", "
", "
", &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_OBS_VAR(&dataVars);
+ zephir_read_property(&dataVars, this_ptr, ZEND_STRL("data"), PH_NOISY_CC);
+ ZEPHIR_INIT_VAR(&_7$$3);
+ ZEPHIR_CONCAT_SSSSSS(&_7$$3, "
", "Backtrace ", "Request ", "Server ", "Included Files ", "Memory ");
+ zephir_concat_self(&html, &_7$$3);
+ if (!(ZEPHIR_IS_EMPTY(&dataVars))) {
+ zephir_concat_self_str(&html, SL("Variables "));
}
-pp299:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'T':
- case 't': goto pp327;
- default: goto pp59;
- }
-pp300:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp301;
- }
-pp301:
+ zephir_concat_self_str(&html, SL(" "));
+ 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", 330);
+ if (Z_TYPE_P(&_8$$3) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_8$$3), _11$$3, _12$$3, _9$$3)
{
- token->opcode = PHQL_T_LIMIT;
- return 0;
- }
-pp302:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'E':
- case 'e': goto pp329;
- default: goto pp86;
- }
-pp303:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'T':
- case 't': goto pp330;
- default: goto pp59;
- }
-pp304:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp305;
+ 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();
}
-pp305:
- {
- token->opcode = PHQL_T_ORDER;
- return 0;
}
-pp306:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp307;
- }
-pp307:
+ 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(&_18$$3, this_ptr, ZEND_STRL("blacklist"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_19$$3);
+ array_init(&_19$$3);
+ ZEPHIR_INIT_VAR(&_20$$3);
+ ZVAL_STRING(&_20$$3, "request");
+ ZEPHIR_CALL_CE_STATIC(&blacklist, phalcon_helper_arr_ce, "get", &_17, 16, &_18$$3, &_20$$3, &_19$$3);
+ zephir_check_call_status();
+ zephir_is_iterable(&_REQUEST, 0, "phalcon/Support/Debug.zep", 350);
+ if (Z_TYPE_P(&_REQUEST) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_REQUEST), _23$$3, _24$$3, _21$$3)
{
- token->opcode = PHQL_T_OUTER;
- return 0;
- }
-pp308:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp309;
+ ZEPHIR_INIT_NVAR(&keyRequest);
+ if (_24$$3 != NULL) {
+ ZVAL_STR_COPY(&keyRequest, _24$$3);
+ } else {
+ ZVAL_LONG(&keyRequest, _23$$3);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _21$$3);
+ ZEPHIR_INIT_NVAR(&_25$$7);
+ zephir_fast_strtolower(&_25$$7, &keyRequest);
+ if (1 != zephir_array_isset(&blacklist, &_25$$7)) {
+ if (Z_TYPE_P(&value) != IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(&_26$$9);
+ ZEPHIR_CONCAT_SVSVS(&_26$$9, "", &keyRequest, " ", &value, " ");
+ zephir_concat_self(&html, &_26$$9);
+ } else {
+ ZEPHIR_CALL_FUNCTION(&_27$$10, "print_r", &_28, 0, &value, &__$true);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_29$$10);
+ ZEPHIR_CONCAT_SVSVS(&_29$$10, "", &keyRequest, " ", &_27$$10, " ");
+ zephir_concat_self(&html, &_29$$10);
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_REQUEST, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_22$$3, &_REQUEST, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_22$$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(&_30$$11);
+ zephir_fast_strtolower(&_30$$11, &keyRequest);
+ if (1 != zephir_array_isset(&blacklist, &_30$$11)) {
+ if (Z_TYPE_P(&value) != IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(&_31$$13);
+ ZEPHIR_CONCAT_SVSVS(&_31$$13, "", &keyRequest, " ", &value, " ");
+ zephir_concat_self(&html, &_31$$13);
+ } else {
+ ZEPHIR_CALL_FUNCTION(&_32$$14, "print_r", &_28, 0, &value, &__$true);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_33$$14);
+ ZEPHIR_CONCAT_SVSVS(&_33$$14, "", &keyRequest, " ", &_32$$14, " ");
+ zephir_concat_self(&html, &_33$$14);
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_REQUEST, "next", NULL, 0);
+ zephir_check_call_status();
}
-pp309:
- {
- token->opcode = PHQL_T_RIGHT;
- return 0;
}
-pp310:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'T':
- case 't': goto pp332;
- default: goto pp59;
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&keyRequest);
+ zephir_concat_self_str(&html, SL("
"));
+ ZEPHIR_INIT_VAR(&_34$$3);
+ ZEPHIR_CONCAT_SSS(&_34$$3, "
", "
", "Key Value ");
+ zephir_concat_self(&html, &_34$$3);
+ zephir_read_property(&_35$$3, this_ptr, ZEND_STRL("blacklist"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_20$$3);
+ array_init(&_20$$3);
+ ZEPHIR_INIT_VAR(&_36$$3);
+ ZVAL_STRING(&_36$$3, "server");
+ ZEPHIR_CALL_CE_STATIC(&blacklist, phalcon_helper_arr_ce, "get", &_17, 16, &_35$$3, &_36$$3, &_20$$3);
+ zephir_check_call_status();
+ zephir_is_iterable(&_SERVER, 0, "phalcon/Support/Debug.zep", 366);
+ if (Z_TYPE_P(&_SERVER) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_SERVER), _39$$3, _40$$3, _37$$3)
+ {
+ ZEPHIR_INIT_NVAR(&keyServer);
+ if (_40$$3 != NULL) {
+ ZVAL_STR_COPY(&keyServer, _40$$3);
+ } else {
+ ZVAL_LONG(&keyServer, _39$$3);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _37$$3);
+ ZEPHIR_INIT_NVAR(&_41$$15);
+ zephir_fast_strtolower(&_41$$15, &keyServer);
+ if (1 != zephir_array_isset(&blacklist, &_41$$15)) {
+ ZEPHIR_CALL_METHOD(&_42$$16, this_ptr, "getvardump", &_43, 0, &value);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_44$$16);
+ ZEPHIR_CONCAT_SVSVS(&_44$$16, "", &keyServer, " ", &_42$$16, " ");
+ zephir_concat_self(&html, &_44$$16);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_SERVER, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_38$$3, &_SERVER, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_38$$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(&_45$$17);
+ zephir_fast_strtolower(&_45$$17, &keyServer);
+ if (1 != zephir_array_isset(&blacklist, &_45$$17)) {
+ ZEPHIR_CALL_METHOD(&_46$$18, this_ptr, "getvardump", &_43, 0, &value);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_47$$18);
+ ZEPHIR_CONCAT_SVSVS(&_47$$18, "", &keyServer, " ", &_46$$18, " ");
+ zephir_concat_self(&html, &_47$$18);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_SERVER, "next", NULL, 0);
+ zephir_check_call_status();
}
-pp311:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'E':
- case 'e': goto pp334;
- default: goto pp59;
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&keyServer);
+ zephir_concat_self_str(&html, SL("
"));
+ ZEPHIR_INIT_VAR(&_48$$3);
+ ZEPHIR_CONCAT_SSS(&_48$$3, "
", "
", "# Path ");
+ zephir_concat_self(&html, &_48$$3);
+ ZEPHIR_CALL_FUNCTION(&_49$$3, "get_included_files", NULL, 0);
+ zephir_check_call_status();
+ zephir_is_iterable(&_49$$3, 0, "phalcon/Support/Debug.zep", 379);
+ if (Z_TYPE_P(&_49$$3) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_49$$3), _52$$3, _53$$3, _50$$3)
+ {
+ ZEPHIR_INIT_NVAR(&keyFile);
+ if (_53$$3 != NULL) {
+ ZVAL_STR_COPY(&keyFile, _53$$3);
+ } else {
+ ZVAL_LONG(&keyFile, _52$$3);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _50$$3);
+ ZEPHIR_INIT_NVAR(&_54$$19);
+ ZEPHIR_CONCAT_SVSVS(&_54$$19, "", &keyFile, " ", &value, " ");
+ zephir_concat_self(&html, &_54$$19);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_49$$3, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_51$$3, &_49$$3, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_51$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&keyFile, &_49$$3, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &_49$$3, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_55$$20);
+ ZEPHIR_CONCAT_SVSVS(&_55$$20, "", &keyFile, " ", &value, " ");
+ zephir_concat_self(&html, &_55$$20);
+ ZEPHIR_CALL_METHOD(NULL, &_49$$3, "next", NULL, 0);
+ zephir_check_call_status();
}
-pp312:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp313;
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&keyFile);
+ zephir_concat_self_str(&html, SL("
"));
+ ZEPHIR_CALL_FUNCTION(&_56$$3, "memory_get_usage", NULL, 0, &__$true);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_57$$3);
+ ZEPHIR_CONCAT_SSSVSS(&_57$$3, "
", "
", "Memory Usage ", &_56$$3, " ", "
");
+ zephir_concat_self(&html, &_57$$3);
+ if (!(ZEPHIR_IS_EMPTY(&dataVars))) {
+ ZEPHIR_INIT_VAR(&_58$$21);
+ ZEPHIR_CONCAT_SSS(&_58$$21, "
", "
", "Key Value ");
+ zephir_concat_self(&html, &_58$$21);
+ zephir_is_iterable(&dataVars, 0, "phalcon/Support/Debug.zep", 401);
+ if (Z_TYPE_P(&dataVars) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&dataVars), _61$$21, _62$$21, _59$$21)
+ {
+ ZEPHIR_INIT_NVAR(&keyVar);
+ if (_62$$21 != NULL) {
+ ZVAL_STR_COPY(&keyVar, _62$$21);
+ } else {
+ ZVAL_LONG(&keyVar, _61$$21);
+ }
+ ZEPHIR_INIT_NVAR(&dataVar);
+ ZVAL_COPY(&dataVar, _59$$21);
+ zephir_array_fetch_long(&_64$$22, &dataVar, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Debug.zep", 398);
+ ZEPHIR_CALL_METHOD(&_63$$22, this_ptr, "getvardump", &_43, 0, &_64$$22);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_65$$22);
+ ZEPHIR_CONCAT_SVSVS(&_65$$22, "", &keyVar, " ", &_63$$22, " ");
+ zephir_concat_self(&html, &_65$$22);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &dataVars, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_60$$21, &dataVars, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_60$$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(&_67$$23, &dataVar, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Debug.zep", 398);
+ ZEPHIR_CALL_METHOD(&_66$$23, this_ptr, "getvardump", &_43, 0, &_67$$23);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_68$$23);
+ ZEPHIR_CONCAT_SVSVS(&_68$$23, "", &keyVar, " ", &_66$$23, " ");
+ zephir_concat_self(&html, &_68$$23);
+ ZEPHIR_CALL_METHOD(NULL, &dataVars, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
-pp313:
- {
- token->opcode = PHQL_T_USING;
- return 0;
+ ZEPHIR_INIT_NVAR(&dataVar);
+ ZEPHIR_INIT_NVAR(&keyVar);
+ zephir_concat_self_str(&html, SL("
"));
}
-pp314:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'S':
- case 's': goto pp336;
- default: goto pp59;
+ zephir_concat_self_str(&html, SL("
"));
+ }
+ ZEPHIR_CALL_METHOD(&_69, this_ptr, "getjssources", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_70);
+ ZEPHIR_CONCAT_VS(&_70, &_69, "
");
+ zephir_concat_self(&html, &_70);
+ RETURN_CCTOR(&html);
+}
+
+static PHP_METHOD(Phalcon_Support_Debug, setBlacklist)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_0 = NULL;
+ zval *blacklist_param = NULL, area, result, subArray, value, _1, _2, *_3, _4, _7, *_8, _9, _5$$3, _6$$4, _10$$5, _11$$6;
+ zval blacklist;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&blacklist);
+ ZVAL_UNDEF(&area);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&subArray);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_11$$6);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(blacklist)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &blacklist_param);
+ zephir_get_arrval(&blacklist, blacklist_param);
+
+
+ ZEPHIR_INIT_VAR(&_1);
+ array_init(&_1);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "request");
+ ZEPHIR_CALL_CE_STATIC(&area, phalcon_helper_arr_ce, "get", &_0, 16, &blacklist, &_2, &_1);
+ 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", 431);
+ if (Z_TYPE_P(&area) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&area), _3)
+ {
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _3);
+ ZEPHIR_INIT_NVAR(&_5$$3);
+ zephir_fast_strtolower(&_5$$3, &value);
+ ZEPHIR_CPY_WRT(&value, &_5$$3);
+ ZEPHIR_INIT_NVAR(&_5$$3);
+ ZVAL_LONG(&_5$$3, 1);
+ zephir_array_update_zval(&subArray, &value, &_5$$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(&_4, &area, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_4)) {
+ break;
}
-pp315:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp316;
+ ZEPHIR_CALL_METHOD(&value, &area, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_6$$4);
+ zephir_fast_strtolower(&_6$$4, &value);
+ ZEPHIR_CPY_WRT(&value, &_6$$4);
+ ZEPHIR_INIT_NVAR(&_6$$4);
+ ZVAL_LONG(&_6$$4, 1);
+ zephir_array_update_zval(&subArray, &value, &_6$$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(&_2);
+ array_init(&_2);
+ ZEPHIR_INIT_VAR(&_7);
+ ZVAL_STRING(&_7, "server");
+ ZEPHIR_CALL_CE_STATIC(&area, phalcon_helper_arr_ce, "get", &_0, 16, &blacklist, &_7, &_2);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&subArray);
+ array_init(&subArray);
+ zephir_is_iterable(&area, 0, "phalcon/Support/Debug.zep", 440);
+ if (Z_TYPE_P(&area) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&area), _8)
+ {
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _8);
+ ZEPHIR_INIT_NVAR(&_10$$5);
+ zephir_fast_strtolower(&_10$$5, &value);
+ ZEPHIR_CPY_WRT(&value, &_10$$5);
+ ZEPHIR_INIT_NVAR(&_10$$5);
+ ZVAL_LONG(&_10$$5, 1);
+ zephir_array_update_zval(&subArray, &value, &_10$$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(&_9, &area, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_9)) {
+ break;
}
-pp316:
- {
- token->opcode = PHQL_T_WHERE;
- return 0;
+ ZEPHIR_CALL_METHOD(&value, &area, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_11$$6);
+ zephir_fast_strtolower(&_11$$6, &value);
+ ZEPHIR_CPY_WRT(&value, &_11$$6);
+ ZEPHIR_INIT_NVAR(&_11$$6);
+ ZVAL_LONG(&_11$$6, 1);
+ zephir_array_update_zval(&subArray, &value, &_11$$6, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &area, "next", NULL, 0);
+ zephir_check_call_status();
}
-pp317:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'T':
- case 't': goto pp338;
- default: goto pp59;
+ }
+ 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_Support_Debug, setShowBackTrace)
+{
+ zval *showBackTrace_param = NULL, __$true, __$false;
+ zend_bool showBackTrace;
+ zval *this_ptr = getThis();
+
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(showBackTrace)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &showBackTrace_param);
+ showBackTrace = zephir_get_boolval(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);
+ }
+ RETURN_THISW();
+}
+
+static PHP_METHOD(Phalcon_Support_Debug, setShowFileFragment)
+{
+ zval *showFileFragment_param = NULL, __$true, __$false;
+ zend_bool showFileFragment;
+ zval *this_ptr = getThis();
+
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(showFileFragment)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &showFileFragment_param);
+ showFileFragment = zephir_get_boolval(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_Support_Debug, setShowFiles)
+{
+ zval *showFiles_param = NULL, __$true, __$false;
+ zend_bool showFiles;
+ zval *this_ptr = getThis();
+
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(showFiles)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &showFiles_param);
+ showFiles = zephir_get_boolval(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_Support_Debug, setUri)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *uri_param = NULL;
+ zval uri;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&uri);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(uri)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_Support_Debug, escapeString)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *value, value_sub, _0$$3, _1$$3, _2$$3, _3$$3, _4$$3;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &value);
+
+
+ if (Z_TYPE_P(value) == IS_STRING) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "\n");
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZVAL_STRING(&_2$$3, "\\n");
+ zephir_fast_str_replace(&_0$$3, &_1$$3, &_2$$3, value);
+ ZVAL_LONG(&_3$$3, 2);
+ ZEPHIR_INIT_VAR(&_4$$3);
+ ZVAL_STRING(&_4$$3, "utf-8");
+ ZEPHIR_RETURN_CALL_FUNCTION("htmlentities", NULL, 0, &_0$$3, &_3$$3, &_4$$3);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ RETVAL_ZVAL(value, 1, 0);
+ RETURN_MM();
+}
+
+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 *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(&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);
+ ZVAL_UNDEF(&_9$$9);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_11$$15);
+ ZVAL_UNDEF(&_12$$15);
+ ZVAL_UNDEF(&_13$$16);
+ ZVAL_UNDEF(&_14$$12);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(argument)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL(n)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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);
+ }
+
+
+ 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);
+ }
+ if (_0) {
+ RETURN_MM_NULL();
+ }
+ if (ZEPHIR_GE_LONG(&numberArguments, 10)) {
+ RETURN_CCTOR(&numberArguments);
+ }
+ ZEPHIR_INIT_VAR(&dump);
+ array_init(&dump);
+ zephir_is_iterable(&argument, 0, "phalcon/Support/Debug.zep", 540);
+ if (Z_TYPE_P(&argument) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&argument), _3, _4, _1)
+ {
+ ZEPHIR_INIT_NVAR(&k);
+ if (_4 != NULL) {
+ ZVAL_STR_COPY(&k, _4);
+ } else {
+ ZVAL_LONG(&k, _3);
}
-pp318:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'N':
- case 'n': goto pp340;
- default: goto pp59;
+ 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);
}
-pp319:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'T':
- case 't': goto pp342;
- default: goto pp59;
+ ZEPHIR_INIT_NVAR(&_10$$5);
+ ZEPHIR_CONCAT_SVSV(&_10$$5, "[", &k, "] => ", &varDump);
+ zephir_array_append(&dump, &_10$$5, PH_SEPARATE, "phalcon/Support/Debug.zep", 537);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &argument, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, &argument, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
}
-pp320:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp321;
+ ZEPHIR_CALL_METHOD(&k, &argument, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&v, &argument, "current", NULL, 0);
+ zephir_check_call_status();
+ 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", 537);
+ ZEPHIR_CALL_METHOD(NULL, &argument, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&v);
+ ZEPHIR_INIT_NVAR(&k);
+ zephir_fast_join_str(return_value, SL(", "), &dump);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Support_Debug, getVarDump)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *variable, variable_sub, className, dumpedObject, _0$$8, _1$$10;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&variable_sub);
+ ZVAL_UNDEF(&className);
+ ZVAL_UNDEF(&dumpedObject);
+ ZVAL_UNDEF(&_0$$8);
+ ZVAL_UNDEF(&_1$$10);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(variable)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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();
+ }
+ 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_Support_Debug, showTraceItem)
+{
+ zend_bool _42$$25;
+ zval _1, _28$$17;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_21 = NULL, *_49 = 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, _17, _2$$3, _3$$3, _4$$3, _5$$3, _12$$3, _13$$3, _6$$4, _7$$4, _8$$5, _9$$6, _10$$6, _11$$6, _14$$10, _15$$11, _16$$11, *_18$$14, _19$$14, _25$$14, _26$$14, _20$$15, _22$$15, _23$$16, _24$$16, _27$$17, _29$$17, _30$$17, _31$$18, _32$$19, _33$$24, _34$$27, _35$$27, _36$$27, _37$$27, _38$$27, _39$$28, _40$$28, _41$$28, _43$$30, _44$$30, _45$$30, _46$$30, _47$$30, _48$$30;
+ zend_long n, ZEPHIR_LAST_CALL_STATUS, i = 0, beforeLine$$19, afterLine$$19;
+ zval *this_ptr = getThis();
+
+ 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(&_17);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_12$$3);
+ ZVAL_UNDEF(&_13$$3);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$6);
+ ZVAL_UNDEF(&_10$$6);
+ ZVAL_UNDEF(&_11$$6);
+ ZVAL_UNDEF(&_14$$10);
+ ZVAL_UNDEF(&_15$$11);
+ ZVAL_UNDEF(&_16$$11);
+ ZVAL_UNDEF(&_19$$14);
+ ZVAL_UNDEF(&_25$$14);
+ ZVAL_UNDEF(&_26$$14);
+ ZVAL_UNDEF(&_20$$15);
+ ZVAL_UNDEF(&_22$$15);
+ ZVAL_UNDEF(&_23$$16);
+ ZVAL_UNDEF(&_24$$16);
+ ZVAL_UNDEF(&_27$$17);
+ ZVAL_UNDEF(&_29$$17);
+ ZVAL_UNDEF(&_30$$17);
+ ZVAL_UNDEF(&_31$$18);
+ ZVAL_UNDEF(&_32$$19);
+ ZVAL_UNDEF(&_33$$24);
+ ZVAL_UNDEF(&_34$$27);
+ ZVAL_UNDEF(&_35$$27);
+ ZVAL_UNDEF(&_36$$27);
+ ZVAL_UNDEF(&_37$$27);
+ ZVAL_UNDEF(&_38$$27);
+ ZVAL_UNDEF(&_39$$28);
+ ZVAL_UNDEF(&_40$$28);
+ ZVAL_UNDEF(&_41$$28);
+ ZVAL_UNDEF(&_43$$30);
+ ZVAL_UNDEF(&_44$$30);
+ ZVAL_UNDEF(&_45$$30);
+ ZVAL_UNDEF(&_46$$30);
+ ZVAL_UNDEF(&_47$$30);
+ ZVAL_UNDEF(&_48$$30);
+ ZVAL_UNDEF(&trace);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_28$$17);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_LONG(n)
+ Z_PARAM_ARRAY(trace)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &n_param, &trace_param);
+ n = zephir_get_intval(n_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&trace, trace_param);
+
+
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_LONG(&_0, n);
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_CONCAT_SVS(&_1, "
#", &_0, " ");
+ ZEPHIR_CPY_WRT(&html, &_1);
+ ZEPHIR_OBS_VAR(&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", 645);
+ zephir_array_fetch_long(&_7$$4, &parts, 1, PH_NOISY | PH_READONLY, "phalcon/Support/Debug.zep", 645);
+ ZEPHIR_INIT_VAR(&prepareUriClass);
+ ZEPHIR_CONCAT_VSV(&prepareUriClass, &_6$$4, "_", &_7$$4);
+ ZEPHIR_INIT_VAR(&classNameWithLink);
+ ZEPHIR_CONCAT_SVSVS(&classNameWithLink, "", &className, " ");
+ } else {
+ ZEPHIR_INIT_VAR(&classReflection);
+ object_init_ex(&classReflection, zephir_get_internal_ce(SL("reflectionclass")));
+ ZEPHIR_CALL_METHOD(NULL, &classReflection, "__construct", NULL, 156, &className);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_8$$5, &classReflection, "isinternal", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_8$$5)) {
+ ZEPHIR_INIT_VAR(&_9$$6);
+ zephir_fast_strtolower(&_9$$6, &className);
+ ZEPHIR_INIT_VAR(&_10$$6);
+ ZVAL_STRING(&_10$$6, "_");
+ ZEPHIR_INIT_VAR(&_11$$6);
+ ZVAL_STRING(&_11$$6, "-");
+ ZEPHIR_INIT_VAR(&prepareInternalClass);
+ zephir_fast_str_replace(&prepareInternalClass, &_10$$6, &_11$$6, &_9$$6);
+ ZEPHIR_INIT_NVAR(&classNameWithLink);
+ ZEPHIR_CONCAT_SVSVS(&classNameWithLink, "", &className, " ");
+ } else {
+ ZEPHIR_CPY_WRT(&classNameWithLink, &className);
}
-pp321:
- {
- token->opcode = PHQL_T_DELETE;
- return 0;
}
-pp322:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'C':
- case 'c': goto pp344;
- default: goto pp59;
- }
-pp323:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp324;
+ ZEPHIR_INIT_VAR(&_12$$3);
+ ZEPHIR_CONCAT_SVS(&_12$$3, "", &classNameWithLink, " ");
+ zephir_concat_self(&html, &_12$$3);
+ zephir_array_fetch_string(&_13$$3, &trace, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Support/Debug.zep", 678);
+ zephir_concat_self(&html, &_13$$3);
+ }
+ ZEPHIR_OBS_VAR(&functionName);
+ zephir_array_fetch_string(&functionName, &trace, SL("function"), PH_NOISY, "phalcon/Support/Debug.zep", 684);
+ if (zephir_array_isset_string(&trace, SL("class"))) {
+ ZEPHIR_CPY_WRT(&functionNameWithLink, &functionName);
+ } else {
+ 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();
+ ZEPHIR_CALL_METHOD(&_14$$10, &functionReflection, "isinternal", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_14$$10)) {
+ ZEPHIR_INIT_VAR(&_15$$11);
+ ZVAL_STRING(&_15$$11, "_");
+ ZEPHIR_INIT_VAR(&_16$$11);
+ ZVAL_STRING(&_16$$11, "-");
+ ZEPHIR_INIT_VAR(&preparedFunctionName);
+ zephir_fast_str_replace(&preparedFunctionName, &_15$$11, &_16$$11, &functionName);
+ ZEPHIR_INIT_NVAR(&functionNameWithLink);
+ ZEPHIR_CONCAT_SVSVS(&functionNameWithLink, "", &functionName, " ");
+ } else {
+ ZEPHIR_CPY_WRT(&functionNameWithLink, &functionName);
}
-pp324:
- {
- token->opcode = PHQL_T_EXISTS;
- return 0;
+ } else {
+ ZEPHIR_CPY_WRT(&functionNameWithLink, &functionName);
}
-pp325:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp326;
- }
-pp326:
+ }
+ ZEPHIR_INIT_VAR(&_17);
+ ZEPHIR_CONCAT_SVS(&_17, "", &functionNameWithLink, " ");
+ zephir_concat_self(&html, &_17);
+ ZEPHIR_OBS_VAR(&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", 736);
+ if (Z_TYPE_P(&traceArgs) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&traceArgs), _18$$14)
{
- token->opcode = PHQL_T_HAVING;
- return 0;
- }
-pp327:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp328;
+ ZEPHIR_INIT_NVAR(&argument);
+ ZVAL_COPY(&argument, _18$$14);
+ ZEPHIR_CALL_METHOD(&_20$$15, this_ptr, "getvardump", &_21, 0, &argument);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_22$$15);
+ ZEPHIR_CONCAT_SVS(&_22$$15, "", &_20$$15, " ");
+ zephir_array_append(&arguments, &_22$$15, PH_SEPARATE, "phalcon/Support/Debug.zep", 730);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &traceArgs, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_19$$14, &traceArgs, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_19$$14)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&argument, &traceArgs, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_23$$16, this_ptr, "getvardump", &_21, 0, &argument);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_24$$16);
+ ZEPHIR_CONCAT_SVS(&_24$$16, "", &_23$$16, " ");
+ zephir_array_append(&arguments, &_24$$16, PH_SEPARATE, "phalcon/Support/Debug.zep", 730);
+ ZEPHIR_CALL_METHOD(NULL, &traceArgs, "next", NULL, 0);
+ zephir_check_call_status();
}
-pp328:
- {
- token->opcode = PHQL_T_INSERT;
- return 0;
}
-pp329:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'T':
- case 't': goto pp345;
- default: goto pp86;
+ ZEPHIR_INIT_NVAR(&argument);
+ ZEPHIR_INIT_VAR(&_25$$14);
+ zephir_fast_join_str(&_25$$14, SL(", "), &arguments);
+ ZEPHIR_INIT_VAR(&_26$$14);
+ ZEPHIR_CONCAT_SVS(&_26$$14, "(", &_25$$14, ")");
+ zephir_concat_self(&html, &_26$$14);
+ }
+ ZEPHIR_OBS_VAR(&filez);
+ if (zephir_array_isset_string_fetch(&filez, &trace, SL("file"), 0)) {
+ ZEPHIR_OBS_VAR(&_27$$17);
+ zephir_array_fetch_string(&_27$$17, &trace, SL("line"), PH_NOISY, "phalcon/Support/Debug.zep", 744);
+ zephir_cast_to_string(&_28$$17, &_27$$17);
+ ZEPHIR_CPY_WRT(&line, &_28$$17);
+ ZEPHIR_INIT_VAR(&_29$$17);
+ ZEPHIR_CONCAT_SVSVS(&_29$$17, "", &filez, " (", &line, ")
");
+ zephir_concat_self(&html, &_29$$17);
+ zephir_read_property(&_30$$17, this_ptr, ZEND_STRL("showFiles"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&showFiles, &_30$$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(&_31$$18, this_ptr, ZEND_STRL("showFileFragment"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&showFileFragment, &_31$$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(&_32$$19);
+ ZEPHIR_CONCAT_SVSVSVS(&_32$$19, "");
+ zephir_concat_self(&html, &_32$$19);
+ } else {
+ ZEPHIR_INIT_NVAR(&firstLine);
+ ZVAL_LONG(&firstLine, 1);
+ ZEPHIR_CPY_WRT(&lastLine, &numberLines);
+ ZEPHIR_INIT_VAR(&_33$$24);
+ ZEPHIR_CONCAT_SVSVS(&_33$$24, "");
+ zephir_concat_self(&html, &_33$$24);
}
-pp330:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp331;
+ 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", 817);
+ if (zephir_is_true(&showFileFragment)) {
+ if (ZEPHIR_IS_LONG(&firstLine, i)) {
+ ZEPHIR_INIT_NVAR(&_34$$27);
+ ZEPHIR_INIT_NVAR(&_35$$27);
+ zephir_fast_trim(&_35$$27, ¤tLine, NULL , ZEPHIR_TRIM_RIGHT);
+ ZEPHIR_INIT_NVAR(&_36$$27);
+ ZVAL_STRING(&_36$$27, "#\\*\\/#");
+ ZEPHIR_INIT_NVAR(&_37$$27);
+ ZEPHIR_INIT_NVAR(&_38$$27);
+ ZVAL_STRING(&_38$$27, "#\\*\\/#");
+ zephir_preg_match(&_37$$27, &_38$$27, &_35$$27, &_34$$27, 0, 0 , 0 );
+ if (zephir_is_true(&_37$$27)) {
+ ZEPHIR_INIT_NVAR(&_39$$28);
+ ZEPHIR_INIT_NVAR(&_40$$28);
+ ZVAL_STRING(&_40$$28, "* /");
+ ZEPHIR_INIT_NVAR(&_41$$28);
+ ZVAL_STRING(&_41$$28, " ");
+ zephir_fast_str_replace(&_39$$28, &_40$$28, &_41$$28, ¤tLine);
+ ZEPHIR_CPY_WRT(¤tLine, &_39$$28);
+ }
+ }
+ }
+ _42$$25 = ZEPHIR_IS_STRING(¤tLine, "\n");
+ if (!(_42$$25)) {
+ _42$$25 = ZEPHIR_IS_STRING(¤tLine, "\r\n");
+ }
+ if (_42$$25) {
+ zephir_concat_self_str(&html, SL(" \n"));
+ } else {
+ ZEPHIR_INIT_NVAR(&_43$$30);
+ ZEPHIR_INIT_NVAR(&_44$$30);
+ ZVAL_STRING(&_44$$30, "\t");
+ ZEPHIR_INIT_NVAR(&_45$$30);
+ ZVAL_STRING(&_45$$30, " ");
+ zephir_fast_str_replace(&_43$$30, &_44$$30, &_45$$30, ¤tLine);
+ ZVAL_LONG(&_46$$30, 2);
+ ZEPHIR_INIT_NVAR(&_47$$30);
+ ZVAL_STRING(&_47$$30, "UTF-8");
+ ZEPHIR_CALL_FUNCTION(&_48$$30, "htmlentities", &_49, 0, &_43$$30, &_46$$30, &_47$$30);
+ zephir_check_call_status();
+ zephir_concat_self(&html, &_48$$30);
+ }
+ i++;
}
-pp331:
+ zephir_concat_self_str(&html, SL(" "));
+ }
+ }
+ zephir_concat_self_str(&html, SL(" "));
+ RETURN_CCTOR(&html);
+}
+
+zend_object *zephir_init_properties_Phalcon_Support_Debug(zend_class_entry *class_type)
+{
+ 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_MM_GROW();
+
+ {
+ 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("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("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);
+ }
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support, Exception, phalcon, support_exception, zend_ce_exception, NULL, 0);
+
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_HelperFactory)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support, HelperFactory, phalcon, support_helperfactory, phalcon_factory_abstractfactory_ce, phalcon_support_helperfactory_method_entry, 0);
+
+ zend_declare_property_string(phalcon_support_helperfactory_ce, SL("exception"), "Phalcon\\Support\\Exception", ZEND_ACC_PROTECTED);
+ return SUCCESS;
+}
+
+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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(services)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&helper);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&arguments);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_ARRAY(arguments)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_get_strval(&name, name_param);
+
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getservice", NULL, 0, &name);
+ zephir_check_call_status();
+ ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(return_value, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Support_HelperFactory, getAdapters)
+{
+ zval *this_ptr = getThis();
+
+
+
+ zephir_create_array(return_value, 1, 0);
+ add_assoc_stringl_ex(return_value, SL("interpolate"), SL("Phalcon\\Support\\Helper\\Str\\Interpolate"));
+ return;
+}
+
+
+
+
+#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);
+
+ 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_Support_Version, getVersion)
+{
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+
+
+ ZEPHIR_MM_GROW();
+
+ zephir_create_array(return_value, 5, 0);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_LONG(&_0, 5);
+ 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, 0);
+ zephir_array_fast_append(return_value, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, 1);
+ zephir_array_fast_append(return_value, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, 6);
+ zephir_array_fast_append(return_value, &_0);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Support_Version, getSpecial)
+{
+ zval suffix;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *special_param = NULL;
+ zend_long special;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&suffix);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(special)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &special_param);
+ special = zephir_get_intval(special_param);
+
+
+ ZEPHIR_INIT_VAR(&suffix);
+ do {
+ if (special == 1) {
+ ZEPHIR_INIT_NVAR(&suffix);
+ ZVAL_STRING(&suffix, "alpha");
+ break;
+ }
+ if (special == 2) {
+ ZEPHIR_INIT_NVAR(&suffix);
+ ZVAL_STRING(&suffix, "beta");
+ break;
+ }
+ if (special == 3) {
+ ZEPHIR_INIT_NVAR(&suffix);
+ ZVAL_STRING(&suffix, "RC");
+ break;
+ }
+ } while(0);
+
+ RETURN_CTOR(&suffix);
+}
+
+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;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+ 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(&result);
+
+
+ ZEPHIR_MM_GROW();
+
+ ZEPHIR_CALL_METHOD(&version, this_ptr, "getversion", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_OBS_VAR(&major);
+ zephir_array_fetch_long(&major, &version, 0, PH_NOISY, "phalcon/Support/Version.zep", 119);
+ ZEPHIR_OBS_VAR(&medium);
+ zephir_array_fetch_long(&medium, &version, 1, PH_NOISY, "phalcon/Support/Version.zep", 120);
+ ZEPHIR_OBS_VAR(&minor);
+ zephir_array_fetch_long(&minor, &version, 2, PH_NOISY, "phalcon/Support/Version.zep", 121);
+ ZEPHIR_OBS_VAR(&special);
+ zephir_array_fetch_long(&special, &version, 3, PH_NOISY, "phalcon/Support/Version.zep", 122);
+ ZEPHIR_OBS_VAR(&specialNumber);
+ zephir_array_fetch_long(&specialNumber, &version, 4, PH_NOISY, "phalcon/Support/Version.zep", 123);
+ 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_CTOR(&result);
+}
+
+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;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+ 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_MM_GROW();
+
+ ZEPHIR_CALL_METHOD(&version, this_ptr, "getversion", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_OBS_VAR(&major);
+ zephir_array_fetch_long(&major, &version, 0, PH_NOISY, "phalcon/Support/Version.zep", 157);
+ ZEPHIR_OBS_VAR(&medium);
+ zephir_array_fetch_long(&medium, &version, 1, PH_NOISY, "phalcon/Support/Version.zep", 158);
+ ZEPHIR_OBS_VAR(&minor);
+ zephir_array_fetch_long(&minor, &version, 2, PH_NOISY, "phalcon/Support/Version.zep", 159);
+ ZEPHIR_OBS_VAR(&special);
+ zephir_array_fetch_long(&special, &version, 3, PH_NOISY, "phalcon/Support/Version.zep", 160);
+ ZEPHIR_OBS_VAR(&specialNumber);
+ zephir_array_fetch_long(&specialNumber, &version, 4, PH_NOISY, "phalcon/Support/Version.zep", 161);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "%02s");
+ ZEPHIR_CALL_FUNCTION(&_1, "sprintf", NULL, 194, &_0, &medium);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "%02s");
+ ZEPHIR_CALL_FUNCTION(&_2, "sprintf", NULL, 194, &_0, &minor);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VVVVV(return_value, &major, &_1, &_2, &special, &specialNumber);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Support_Version, getPart)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *part_param = NULL, version, _0$$3, _1$$4;
+ zend_long part, ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(part)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &part_param);
+ part = zephir_get_intval(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_array_fetch_long(&_0$$3, &version, part, PH_NOISY | PH_READONLY, "phalcon/Support/Version.zep", 189);
+ RETURN_CTOR(&_0$$3);
+ }
+ if (part == 3) {
+ zephir_array_fetch_long(&_1$$4, &version, 3, PH_NOISY | PH_READONLY, "phalcon/Support/Version.zep", 192);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getspecial", NULL, 0, &_1$$4);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ } while(0);
+
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "get", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+
+
+
+#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_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 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 *this_ptr = getThis();
+
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&leftToken);
+ ZVAL_UNDEF(&rightToken);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&context);
+ ZVAL_UNDEF(&replace);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STR(message)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(context)
+ Z_PARAM_STR(leftToken)
+ Z_PARAM_STR(rightToken)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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 {
+ zephir_get_arrval(&context, context_param);
+ }
+ if (!leftToken_param) {
+ ZEPHIR_INIT_VAR(&leftToken);
+ ZVAL_STRING(&leftToken, "%");
+ } else {
+ zephir_get_strval(&leftToken, leftToken_param);
+ }
+ if (!rightToken_param) {
+ ZEPHIR_INIT_VAR(&rightToken);
+ ZVAL_STRING(&rightToken, "%");
+ } else {
+ zephir_get_strval(&rightToken, rightToken_param);
+ }
+
+
+ if (!(ZEPHIR_IS_EMPTY(&context))) {
+ ZEPHIR_INIT_VAR(&replace);
+ array_init(&replace);
+ zephir_is_iterable(&context, 0, "phalcon/Support/Helper/Str/Interpolate.zep", 39);
+ if (Z_TYPE_P(&context) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&context), _2$$3, _3$$3, _0$$3)
{
- token->opcode = PHQL_T_OFFSET;
- return 0;
- }
-pp332:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp333;
+ 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();
}
-pp333:
- {
- token->opcode = PHQL_T_SELECT;
- return 0;
}
-pp334:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp335;
+ 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);
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Debug_Dump)
+{
+ 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);
+ phalcon_support_debug_dump_ce->create_object = zephir_init_properties_Phalcon_Support_Debug_Dump;
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Debug_Dump, getDetailed)
+{
+ zval *this_ptr = getThis();
+
+
+
+ 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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(detailed)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &detailed_param);
+ detailed = zephir_get_boolval(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);
+ }
+ RETURN_THISW();
+}
+
+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;
+ zval styles;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&styles);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 2)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(styles)
+ Z_PARAM_BOOL(detailed)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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 {
+ detailed = zephir_get_boolval(detailed_param);
+ }
+
+
+ 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_MM_GROW();
+
+ 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();
+}
+
+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();
+
+ ZVAL_UNDEF(&variable_sub);
+ ZVAL_UNDEF(&name);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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();
+}
+
+static PHP_METHOD(Phalcon_Support_Debug_Dump, setStyles)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *styles_param = NULL, defaultStyles, _0;
+ zval styles;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&styles);
+ ZVAL_UNDEF(&defaultStyles);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(styles)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_Support_Debug_Dump, toJson)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_0 = NULL;
+ zval *variable, variable_sub, _1;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&variable_sub);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(variable)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &variable);
+
+
+ ZVAL_LONG(&_1, ((128 | 64) | 256));
+ ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_helper_json_ce, "encode", &_0, 14, variable, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Support_Debug_Dump, variable)
+{
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ 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);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_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();
+
+ 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_MM_GROW();
+
+ ZEPHIR_INIT_VAR(&output);
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_get_args(&_0);
+ zephir_is_iterable(&_0, 0, "phalcon/Support/Debug/Dump.zep", 181);
+ 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);
}
-pp335:
- {
- token->opcode = PHQL_T_UPDATE;
- return 0;
- }
-pp336:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp337;
+ 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;
}
-pp337:
- {
- token->opcode = PHQL_T_VALUES;
- return 0;
+ 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();
}
-pp338:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp339;
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&key);
+ RETURN_CTOR(&output);
+}
+
+static PHP_METHOD(Phalcon_Support_Debug_Dump, getStyle)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *type_param = NULL, style, _0;
+ zval type;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&style);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(type)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_read_property(&_0, this_ptr, ZEND_STRL("styles"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&style, &_0, &type, 1))) {
+ RETURN_MM_STRING("color:gray");
+ }
+ RETURN_CTOR(&style);
+}
+
+static PHP_METHOD(Phalcon_Support_Debug_Dump, output)
+{
+ 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 *_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_UNDEF(&variable_sub);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&value);
+ 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(&_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);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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 (!tab_param) {
+ tab = 1;
+ } else {
+ tab = zephir_get_intval(tab_param);
+ }
+
+
+ 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);
+ }
+ 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", 231);
+ 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();
+ 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, "");
+ }
+ _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();
+ 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();
}
-pp339:
- {
- token->opcode = PHQL_T_AGAINST;
- return 0;
}
-pp340:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp341;
- }
-pp341:
- {
- token->opcode = PHQL_T_BETWEEN;
- return 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();
+ 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();
+ 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);
}
-pp342:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp343;
- }
-pp343:
- {
- token->opcode = PHQL_T_CONVERT;
- return 0;
+ 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"));
}
-pp344:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'T':
- case 't': goto pp346;
- default: goto pp59;
- }
-pp345:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'W':
- case 'w': goto pp348;
- default: goto pp86;
+ if (zephir_instance_of_ev(variable, phalcon_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, 438, variable);
+ zephir_check_call_status();
+ zephir_is_iterable(&_46$$12, 0, "phalcon/Support/Debug/Dump.zep", 263);
+ 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();
+ }
}
-pp346:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto pp58;
- default: goto pp347;
+ 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, 156, variable);
+ zephir_check_call_status();
+ ZVAL_LONG(&_67$$15, ((1 | 2) | 4));
+ ZEPHIR_CALL_METHOD(&props$$15, &reflect$$15, "getproperties", NULL, 160, &_67$$15);
+ zephir_check_call_status();
+ zephir_is_iterable(&props$$15, 0, "phalcon/Support/Debug/Dump.zep", 289);
+ 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();
+ 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;
+ }
+ 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();
+ }
}
-pp347:
- {
- token->opcode = PHQL_T_DISTINCT;
- return 0;
+ ZEPHIR_INIT_NVAR(&property$$15);
}
-pp348:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'E':
- case 'e': goto pp349;
- default: goto pp86;
- }
-pp349:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'E':
- case 'e': goto pp350;
- default: goto pp86;
- }
-pp350:
- ppch = *++PPCURSOR;
- switch (ppch) {
- case 'N':
- case 'n': goto pp351;
- default: goto pp86;
+ 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", 307);
+ 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 {
+ 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();
+ }
}
-pp351:
- ++PPCURSOR;
- {
- token->opcode = PHQL_T_BETWEEN_NOT;
- return 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();
+ }
+ 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();
+ }
+ ZEPHIR_CALL_FUNCTION(&_147, "is_float", NULL, 213, 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_Support_Debug_Dump(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_MM_GROW();
+
+ {
+ 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("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("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);
+ }
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Debug_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Debug, Exception, phalcon, support_debug_exception, phalcon_exception_ce, NULL, 0);
+
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Storage_AdapterFactory)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage, AdapterFactory, phalcon, storage_adapterfactory, phalcon_factory_abstractfactory_ce, phalcon_storage_adapterfactory_method_entry, 0);
+
+ zend_declare_property_string(phalcon_storage_adapterfactory_ce, SL("exception"), "Phalcon\\Storage\\Exception", ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_storage_adapterfactory_ce, SL("serializerFactory"), ZEND_ACC_PRIVATE);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Storage_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();
+
+ ZVAL_UNDEF(&factory_sub);
+ ZVAL_UNDEF(&services);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_Storage_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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_OBS_VAR(&_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_Storage_AdapterFactory, getAdapters)
+{
+ zval *this_ptr = getThis();
+
+
+
+ zephir_create_array(return_value, 5, 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"));
+ return;
+}
- }
- return status;
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage, Exception, phalcon, storage_exception, phalcon_exception_ce, NULL, 0);
+
+ return SUCCESS;
}
+
#ifdef HAVE_CONFIG_H
#endif
@@ -170974,92 +160193,202 @@ static int phql_get_token(phql_scanner_state *s, phql_scanner_token *token) {
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Query_Status)
+ZEPHIR_INIT_CLASS(Phalcon_Storage_SerializerFactory)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Mvc\\Model\\Query, Status, phalcon, mvc_model_query_status, phalcon_mvc_model_query_status_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage, SerializerFactory, phalcon, storage_serializerfactory, phalcon_factory_abstractfactory_ce, phalcon_storage_serializerfactory_method_entry, 0);
- zend_declare_property_null(phalcon_mvc_model_query_status_ce, SL("model"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_model_query_status_ce, SL("success"), ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_mvc_model_query_status_ce, 1, phalcon_mvc_model_query_statusinterface_ce);
+ zend_declare_property_string(phalcon_storage_serializerfactory_ce, SL("exception"), "Phalcon\\Storage\\Exception", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_Model_Query_Status, __construct)
+static PHP_METHOD(Phalcon_Storage_SerializerFactory, __construct)
{
- zval *success_param = NULL, *model = NULL, model_sub, __$true, __$false, __$null;
- zend_bool success;
+ 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(&model_sub);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&services);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_BOOL(success)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_OBJECT_OF_CLASS_OR_NULL(model, phalcon_mvc_modelinterface_ce)
+ Z_PARAM_ARRAY(services)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(1, 1, &success_param, &model);
- success = zephir_get_boolval(success_param);
- if (!model) {
- model = &model_sub;
- model = &__$null;
+ ZEPHIR_MM_GROW();
+ 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);
}
- if (success) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("success"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("success"), &__$false);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("model"), model);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Query_Status, getMessages)
+static PHP_METHOD(Phalcon_Storage_SerializerFactory, newInstance)
{
- zval model, _0;
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(&model);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&definition);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("model"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&model, &_0);
- if (Z_TYPE_P(&model) != IS_OBJECT) {
- array_init(return_value);
- RETURN_MM();
+ 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_RETURN_CALL_METHOD(&model, "getmessages", NULL, 0);
+ 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_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Query_Status, getModel)
+static PHP_METHOD(Phalcon_Storage_SerializerFactory, getAdapters)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "model");
+ zephir_create_array(return_value, 6, 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("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"));
+ return;
}
-static PHP_METHOD(Phalcon_Mvc_Model_Query_Status, success)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_AbstractSerializer)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Storage\\Serializer, AbstractSerializer, phalcon, storage_serializer_abstractserializer, phalcon_storage_serializer_abstractserializer_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+
+ zend_declare_property_null(phalcon_storage_serializer_abstractserializer_ce, SL("data"), 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)
{
+ zval *data = NULL, data_sub, __$null;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_NULL(&__$null);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(data)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(0, 1, &data);
+ if (!data) {
+ data = &data_sub;
+ data = &__$null;
+ }
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
+}
- RETURN_MEMBER(getThis(), "success");
+static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, isSerializable)
+{
+ zend_bool _0, _1;
+ zval *data, data_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&data_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(data)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &data);
+
+
+ _0 = ZEPHIR_IS_EMPTY(data);
+ if (!(_0)) {
+ _0 = ((Z_TYPE_P(data) == IS_TRUE || Z_TYPE_P(data) == IS_FALSE) == 1);
+ }
+ _1 = _0;
+ if (!(_1)) {
+ _1 = zephir_is_numeric(data);
+ }
+ RETURN_BOOL(!(_1));
+}
+
+static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, getData)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "data");
+}
+
+static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, setData)
+{
+ zval *data, data_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&data_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(data)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &data);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
}
@@ -171072,16 +160401,69 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Status, success)
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Query_StatusInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Base64)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Mvc\\Model\\Query, StatusInterface, phalcon, mvc_model_query_statusinterface, phalcon_mvc_model_query_statusinterface_method_entry);
+ 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;
}
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Query_StatusInterface, getMessages);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Query_StatusInterface, getModel);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Query_StatusInterface, 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_MM_GROW();
+
+ ZEPHIR_OBS_VAR(&_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", 25);
+ return;
+ }
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 191, &_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, data_sub, _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(data)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &data);
+
+
+ if (Z_TYPE_P(data) != IS_STRING) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the unserializer must of type string", "phalcon/Storage/Serializer/Base64.zep", 39);
+ return;
+ }
+ ZEPHIR_CALL_FUNCTION(&_0, "base64_decode", NULL, 188, data);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_0);
+ ZEPHIR_MM_RESTORE();
+}
+
@@ -171092,564 +160474,412 @@ ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Query_StatusInterface, success);
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Resultset_Complex)
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Igbinary)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\Model\\Resultset, Complex, phalcon, mvc_model_resultset_complex, phalcon_mvc_model_resultset_ce, phalcon_mvc_model_resultset_complex_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Igbinary, phalcon, storage_serializer_igbinary, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_igbinary_method_entry, 0);
- zend_declare_property_null(phalcon_mvc_model_resultset_complex_ce, SL("columnTypes"), ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_mvc_model_resultset_complex_ce, SL("disableHydration"), 0, ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_mvc_model_resultset_complex_ce, 1, phalcon_mvc_model_resultsetinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __construct)
+static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, serialize)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *columnTypes, columnTypes_sub, *result = NULL, result_sub, *cache = NULL, cache_sub, __$null;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&columnTypes_sub);
- ZVAL_UNDEF(&result_sub);
- ZVAL_UNDEF(&cache_sub);
+ ZVAL_UNDEF(&_0);
+
+
+ ZEPHIR_MM_GROW();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_FUNCTION("igbinary_serialize", NULL, 0, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, unserialize)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *data, data_sub, __$false, __$null, version, _0, _1, _2, _7, _3$$3, _4$$3, _5$$4, _6$$4;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_BOOL(&__$false, 0);
ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6$$4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_ZVAL(columnTypes)
- Z_PARAM_OPTIONAL
- Z_PARAM_OBJECT_OF_CLASS_OR_NULL(result, phalcon_db_resultinterface_ce)
- Z_PARAM_OBJECT_OF_CLASS_OR_NULL(cache, zephir_get_internal_ce(SL("psr\\simplecache\\cacheinterface")))
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(data)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 2, &columnTypes, &result, &cache);
- if (!result) {
- result = &result_sub;
- result = &__$null;
- }
- if (!cache) {
- cache = &cache_sub;
- cache = &__$null;
- }
+ zephir_fetch_params(1, 1, 0, &data);
- zephir_update_property_zval(this_ptr, ZEND_STRL("columnTypes"), columnTypes);
- ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_resultset_complex_ce, getThis(), "__construct", &_0, 0, result, cache);
+ ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 86);
+ zephir_check_call_status();
+ ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "8.0");
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, ">=");
+ ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 87, &version, &_0, &_1);
+ zephir_check_call_status();
+ if (zephir_is_true(&_2)) {
+ ZEPHIR_INIT_VAR(&_3$$3);
+ ZEPHIR_INIT_NVAR(&_3$$3);
+ zephir_create_closure_ex(&_3$$3, NULL, phalcon_10__closure_ce, SL("__invoke"));
+ ZVAL_LONG(&_4$$3, 2);
+ ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_3$$3, &_4$$3);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_VAR(&_5$$4);
+ ZEPHIR_INIT_NVAR(&_5$$4);
+ zephir_create_closure_ex(&_5$$4, NULL, phalcon_11__closure_ce, SL("__invoke"));
+ ZVAL_LONG(&_6$$4, 2);
+ ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_5$$4, &_6$$4);
+ zephir_check_call_status();
+ }
+ ZEPHIR_CALL_FUNCTION(&_7, "igbinary_unserialize", NULL, 0, data);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_7);
+ ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 90);
zephir_check_call_status();
+ if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &__$null);
+ }
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Json)
{
- zend_class_entry *_14$$16, *_29$$36;
- zend_string *_5;
- zend_ulong _4;
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Json, phalcon, storage_serializer_json, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_json_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Storage_Serializer_Json, serialize)
+{
+ zval _4$$3;
+ zend_bool _1;
+ zval _0, _2, _5, _6, _8, _3$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_15 = NULL, *_18 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS, dirtyState = 0;
- zval __$true, __$false, row, hydrateMode, eager, alias, activeRow, type, column, columnValue, value, attribute, source, attributes, columnMap, rowModel, keepSnapshots, sqlAlias, modelName, _0, _1, *_2, _3, *_6$$11, _7$$11, _8$$12, _9$$13, _10$$16, _12$$16, _13$$16, _11$$17, _16$$19, _17$$19, _19$$25, _20$$25, *_21$$31, _22$$31, _23$$32, _24$$33, _25$$36, _27$$36, _28$$36, _26$$37, _30$$39, _31$$39, _32$$45, _33$$45;
+ zephir_fcall_cache_entry *_7 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&row);
- ZVAL_UNDEF(&hydrateMode);
- ZVAL_UNDEF(&eager);
- ZVAL_UNDEF(&alias);
- ZVAL_UNDEF(&activeRow);
- ZVAL_UNDEF(&type);
- ZVAL_UNDEF(&column);
- ZVAL_UNDEF(&columnValue);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&attribute);
- ZVAL_UNDEF(&source);
- ZVAL_UNDEF(&attributes);
- ZVAL_UNDEF(&columnMap);
- ZVAL_UNDEF(&rowModel);
- ZVAL_UNDEF(&keepSnapshots);
- ZVAL_UNDEF(&sqlAlias);
- ZVAL_UNDEF(&modelName);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_7$$11);
- ZVAL_UNDEF(&_8$$12);
- ZVAL_UNDEF(&_9$$13);
- ZVAL_UNDEF(&_10$$16);
- ZVAL_UNDEF(&_12$$16);
- ZVAL_UNDEF(&_13$$16);
- ZVAL_UNDEF(&_11$$17);
- ZVAL_UNDEF(&_16$$19);
- ZVAL_UNDEF(&_17$$19);
- ZVAL_UNDEF(&_19$$25);
- ZVAL_UNDEF(&_20$$25);
- ZVAL_UNDEF(&_22$$31);
- ZVAL_UNDEF(&_23$$32);
- ZVAL_UNDEF(&_24$$33);
- ZVAL_UNDEF(&_25$$36);
- ZVAL_UNDEF(&_27$$36);
- ZVAL_UNDEF(&_28$$36);
- ZVAL_UNDEF(&_26$$37);
- ZVAL_UNDEF(&_30$$39);
- ZVAL_UNDEF(&_31$$39);
- ZVAL_UNDEF(&_32$$45);
- ZVAL_UNDEF(&_33$$45);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
ZEPHIR_MM_GROW();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("activeRow"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&activeRow, &_0);
- if (Z_TYPE_P(&activeRow) != IS_NULL) {
- RETURN_CCTOR(&activeRow);
+ ZEPHIR_OBS_VAR(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC);
+ _1 = Z_TYPE_P(&_0) == IS_OBJECT;
+ if (_1) {
+ ZEPHIR_OBS_VAR(&_2);
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC);
+ _1 = !(zephir_is_instance_of(&_2, SL("JsonSerializable")));
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("row"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&row, &_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("disableHydration"), PH_NOISY_CC | PH_READONLY);
- if (zephir_is_true(&_0)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeRow"), &row);
- RETURN_CCTOR(&row);
+ 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, 40, &_4$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_3$$3, "phalcon/Storage/Serializer/Json.zep", 28);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- if (Z_TYPE_P(&row) != IS_ARRAY) {
- if (0) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeRow"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeRow"), &__$false);
- }
- RETURN_MM_BOOL(0);
+ 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(&_5))) {
+ RETURN_MM_MEMBER(getThis(), "data");
}
- zephir_read_property(&_1, this_ptr, ZEND_STRL("hydrateMode"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&hydrateMode, &_1);
- do {
- if (ZEPHIR_IS_LONG(&hydrateMode, 0)) {
- ZEPHIR_INIT_NVAR(&activeRow);
- object_init_ex(&activeRow, phalcon_mvc_model_row_ce);
- if (zephir_has_constructor(&activeRow)) {
- ZEPHIR_CALL_METHOD(NULL, &activeRow, "__construct", NULL, 0);
- zephir_check_call_status();
- }
+ zephir_read_property(&_8, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_helper_json_ce, "encode", &_7, 14, &_8);
+ zephir_check_call_status();
+ RETURN_MM();
+}
- break;
- }
- if (ZEPHIR_IS_LONG(&hydrateMode, 1)) {
- ZEPHIR_INIT_NVAR(&activeRow);
- array_init(&activeRow);
- break;
- }
- ZEPHIR_INIT_NVAR(&activeRow);
- object_init(&activeRow);
- break;
- } while(0);
+static PHP_METHOD(Phalcon_Storage_Serializer_Json, unserialize)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_1 = NULL;
+ zval *data, data_sub, _0;
+ zval *this_ptr = getThis();
- dirtyState = 0;
- zephir_read_property(&_1, this_ptr, ZEND_STRL("columnTypes"), PH_NOISY_CC | PH_READONLY);
- zephir_is_iterable(&_1, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 267);
- if (Z_TYPE_P(&_1) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_1), _4, _5, _2)
- {
- ZEPHIR_INIT_NVAR(&alias);
- if (_5 != NULL) {
- ZVAL_STR_COPY(&alias, _5);
- } else {
- ZVAL_LONG(&alias, _4);
- }
- ZEPHIR_INIT_NVAR(&column);
- ZVAL_COPY(&column, _2);
- if (UNEXPECTED(Z_TYPE_P(&column) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Column type is corrupt", "phalcon/Mvc/Model/Resultset/Complex.zep", 139);
- return;
- }
- ZEPHIR_OBS_NVAR(&type);
- zephir_array_fetch_string(&type, &column, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 142);
- if (ZEPHIR_IS_STRING(&type, "object")) {
- ZEPHIR_OBS_NVAR(&source);
- zephir_array_fetch_string(&source, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 148);
- ZEPHIR_OBS_NVAR(&attributes);
- zephir_array_fetch_string(&attributes, &column, SL("attributes"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 149);
- ZEPHIR_OBS_NVAR(&columnMap);
- zephir_array_fetch_string(&columnMap, &column, SL("columnMap"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 150);
- ZEPHIR_INIT_NVAR(&rowModel);
- array_init(&rowModel);
- zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 168);
- if (Z_TYPE_P(&attributes) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _6$$11)
- {
- ZEPHIR_INIT_NVAR(&attribute);
- ZVAL_COPY(&attribute, _6$$11);
- ZEPHIR_OBS_NVAR(&columnValue);
- ZEPHIR_INIT_NVAR(&_8$$12);
- ZEPHIR_CONCAT_SVSV(&_8$$12, "_", &source, "_", &attribute);
- zephir_array_fetch(&columnValue, &row, &_8$$12, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 161);
- zephir_array_update_zval(&rowModel, &attribute, &columnValue, PH_COPY | PH_SEPARATE);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &attributes, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_7$$11, &attributes, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_7$$11)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&attribute, &attributes, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_OBS_NVAR(&columnValue);
- ZEPHIR_INIT_NVAR(&_9$$13);
- ZEPHIR_CONCAT_SVSV(&_9$$13, "_", &source, "_", &attribute);
- zephir_array_fetch(&columnValue, &row, &_9$$13, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 161);
- zephir_array_update_zval(&rowModel, &attribute, &columnValue, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&attribute);
- do {
- if (ZEPHIR_IS_LONG(&hydrateMode, 0)) {
- ZEPHIR_OBS_NVAR(&keepSnapshots);
- if (!(zephir_array_isset_string_fetch(&keepSnapshots, &column, SL("keepSnapshots"), 0))) {
- ZEPHIR_INIT_NVAR(&keepSnapshots);
- ZVAL_BOOL(&keepSnapshots, 0);
- }
- if (ZEPHIR_GLOBAL(orm).late_state_binding) {
- ZEPHIR_OBS_NVAR(&_10$$16);
- zephir_array_fetch_string(&_10$$16, &column, SL("instance"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 178);
- if (zephir_instance_of_ev(&_10$$16, phalcon_mvc_model_ce)) {
- zephir_array_fetch_string(&_11$$17, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 179);
- ZEPHIR_INIT_NVAR(&modelName);
- zephir_get_class(&modelName, &_11$$17, 0);
- } else {
- ZEPHIR_INIT_NVAR(&modelName);
- ZVAL_STRING(&modelName, "Phalcon\\Mvc\\Model");
- }
- zephir_array_fetch_string(&_12$$16, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 185);
- ZVAL_LONG(&_13$$16, dirtyState);
- _14$$16 = zephir_fetch_class(&modelName);
- ZEPHIR_CALL_CE_STATIC(&value, _14$$16, "cloneresultmap", NULL, 0, &_12$$16, &rowModel, &columnMap, &_13$$16, &keepSnapshots);
- zephir_check_call_status();
- } else {
- zephir_array_fetch_string(&_16$$19, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 199);
- ZVAL_LONG(&_17$$19, dirtyState);
- ZEPHIR_CALL_CE_STATIC(&value, phalcon_mvc_model_ce, "cloneresultmap", &_15, 0, &_16$$19, &rowModel, &columnMap, &_17$$19, &keepSnapshots);
- zephir_check_call_status();
- }
- break;
- }
- ZEPHIR_CALL_CE_STATIC(&value, phalcon_mvc_model_ce, "cloneresultmaphydrate", &_18, 0, &rowModel, &columnMap, &hydrateMode);
- zephir_check_call_status();
- break;
- } while(0);
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(data)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
- ZEPHIR_OBS_NVAR(&attribute);
- zephir_array_fetch_string(&attribute, &column, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 223);
- } else {
- ZEPHIR_OBS_NVAR(&sqlAlias);
- if (zephir_array_isset_string_fetch(&sqlAlias, &column, SL("sqlAlias"), 0)) {
- ZEPHIR_OBS_NVAR(&value);
- zephir_array_fetch(&value, &row, &sqlAlias, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 231);
- } else {
- ZEPHIR_OBS_NVAR(&value);
- zephir_array_isset_fetch(&value, &row, &alias, 0);
- }
- if (zephir_array_isset_string(&column, SL("balias"))) {
- ZEPHIR_CPY_WRT(&attribute, &alias);
- } else {
- ZEPHIR_INIT_NVAR(&_19$$25);
- ZVAL_STRING(&_19$$25, "_");
- ZEPHIR_INIT_NVAR(&_20$$25);
- ZVAL_STRING(&_20$$25, "");
- ZEPHIR_INIT_NVAR(&attribute);
- zephir_fast_str_replace(&attribute, &_19$$25, &_20$$25, &alias);
- }
- }
- if (!(zephir_array_isset_string_fetch(&eager, &column, SL("eager"), 1))) {
- do {
- if (ZEPHIR_IS_LONG(&hydrateMode, 1)) {
- zephir_array_update_zval(&activeRow, &attribute, &value, PH_COPY | PH_SEPARATE);
- break;
- }
- zephir_update_property_zval_zval(&activeRow, &attribute, &value);
- break;
- } while(0);
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_1, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_3, &_1, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_3)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&alias, &_1, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&column, &_1, "current", NULL, 0);
- zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&column) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Column type is corrupt", "phalcon/Mvc/Model/Resultset/Complex.zep", 139);
- return;
- }
- ZEPHIR_OBS_NVAR(&type);
- zephir_array_fetch_string(&type, &column, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 142);
- if (ZEPHIR_IS_STRING(&type, "object")) {
- ZEPHIR_OBS_NVAR(&source);
- zephir_array_fetch_string(&source, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 148);
- ZEPHIR_OBS_NVAR(&attributes);
- zephir_array_fetch_string(&attributes, &column, SL("attributes"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 149);
- ZEPHIR_OBS_NVAR(&columnMap);
- zephir_array_fetch_string(&columnMap, &column, SL("columnMap"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 150);
- ZEPHIR_INIT_NVAR(&rowModel);
- array_init(&rowModel);
- zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 168);
- if (Z_TYPE_P(&attributes) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _21$$31)
- {
- ZEPHIR_INIT_NVAR(&attribute);
- ZVAL_COPY(&attribute, _21$$31);
- ZEPHIR_OBS_NVAR(&columnValue);
- ZEPHIR_INIT_NVAR(&_23$$32);
- ZEPHIR_CONCAT_SVSV(&_23$$32, "_", &source, "_", &attribute);
- zephir_array_fetch(&columnValue, &row, &_23$$32, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 161);
- zephir_array_update_zval(&rowModel, &attribute, &columnValue, PH_COPY | PH_SEPARATE);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &attributes, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_22$$31, &attributes, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_22$$31)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&attribute, &attributes, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_OBS_NVAR(&columnValue);
- ZEPHIR_INIT_NVAR(&_24$$33);
- ZEPHIR_CONCAT_SVSV(&_24$$33, "_", &source, "_", &attribute);
- zephir_array_fetch(&columnValue, &row, &_24$$33, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 161);
- zephir_array_update_zval(&rowModel, &attribute, &columnValue, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&attribute);
- do {
- if (ZEPHIR_IS_LONG(&hydrateMode, 0)) {
- ZEPHIR_OBS_NVAR(&keepSnapshots);
- if (!(zephir_array_isset_string_fetch(&keepSnapshots, &column, SL("keepSnapshots"), 0))) {
- ZEPHIR_INIT_NVAR(&keepSnapshots);
- ZVAL_BOOL(&keepSnapshots, 0);
- }
- if (ZEPHIR_GLOBAL(orm).late_state_binding) {
- ZEPHIR_OBS_NVAR(&_25$$36);
- zephir_array_fetch_string(&_25$$36, &column, SL("instance"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 178);
- if (zephir_instance_of_ev(&_25$$36, phalcon_mvc_model_ce)) {
- zephir_array_fetch_string(&_26$$37, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 179);
- ZEPHIR_INIT_NVAR(&modelName);
- zephir_get_class(&modelName, &_26$$37, 0);
- } else {
- ZEPHIR_INIT_NVAR(&modelName);
- ZVAL_STRING(&modelName, "Phalcon\\Mvc\\Model");
- }
- zephir_array_fetch_string(&_27$$36, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 185);
- ZVAL_LONG(&_28$$36, dirtyState);
- _29$$36 = zephir_fetch_class(&modelName);
- ZEPHIR_CALL_CE_STATIC(&value, _29$$36, "cloneresultmap", NULL, 0, &_27$$36, &rowModel, &columnMap, &_28$$36, &keepSnapshots);
- zephir_check_call_status();
- } else {
- zephir_array_fetch_string(&_30$$39, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 199);
- ZVAL_LONG(&_31$$39, dirtyState);
- ZEPHIR_CALL_CE_STATIC(&value, phalcon_mvc_model_ce, "cloneresultmap", &_15, 0, &_30$$39, &rowModel, &columnMap, &_31$$39, &keepSnapshots);
- zephir_check_call_status();
- }
- break;
- }
- ZEPHIR_CALL_CE_STATIC(&value, phalcon_mvc_model_ce, "cloneresultmaphydrate", &_18, 0, &rowModel, &columnMap, &hydrateMode);
- zephir_check_call_status();
- break;
- } while(0);
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &data);
- ZEPHIR_OBS_NVAR(&attribute);
- zephir_array_fetch_string(&attribute, &column, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 223);
- } else {
- ZEPHIR_OBS_NVAR(&sqlAlias);
- if (zephir_array_isset_string_fetch(&sqlAlias, &column, SL("sqlAlias"), 0)) {
- ZEPHIR_OBS_NVAR(&value);
- zephir_array_fetch(&value, &row, &sqlAlias, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 231);
- } else {
- ZEPHIR_OBS_NVAR(&value);
- zephir_array_isset_fetch(&value, &row, &alias, 0);
- }
- if (zephir_array_isset_string(&column, SL("balias"))) {
- ZEPHIR_CPY_WRT(&attribute, &alias);
- } else {
- ZEPHIR_INIT_NVAR(&_32$$45);
- ZVAL_STRING(&_32$$45, "_");
- ZEPHIR_INIT_NVAR(&_33$$45);
- ZVAL_STRING(&_33$$45, "");
- ZEPHIR_INIT_NVAR(&attribute);
- zephir_fast_str_replace(&attribute, &_32$$45, &_33$$45, &alias);
- }
- }
- ZEPHIR_OBS_NVAR(&eager);
- if (!(zephir_array_isset_string_fetch(&eager, &column, SL("eager"), 0))) {
- do {
- if (ZEPHIR_IS_LONG(&hydrateMode, 1)) {
- zephir_array_update_zval(&activeRow, &attribute, &value, PH_COPY | PH_SEPARATE);
- break;
- }
- zephir_update_property_zval_zval(&activeRow, &attribute, &value);
- break;
- } while(0);
- }
- ZEPHIR_CALL_METHOD(NULL, &_1, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&column);
- ZEPHIR_INIT_NVAR(&alias);
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeRow"), &activeRow);
- RETURN_CCTOR(&activeRow);
+ ZEPHIR_CALL_CE_STATIC(&_0, phalcon_helper_json_ce, "decode", &_1, 180, data);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_0);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, toArray)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Msgpack)
{
- zval records;
- zval current, _0;
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Msgpack, phalcon, storage_serializer_msgpack, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_msgpack_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, serialize)
+{
+ zval _0, _1, _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_1 = NULL, *_2 = NULL, *_3 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(¤t);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&records);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
ZEPHIR_MM_GROW();
- ZEPHIR_INIT_VAR(&records);
- array_init(&records);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 111);
+ 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();
- while (1) {
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0);
- zephir_check_call_status();
- if (!(zephir_is_true(&_0))) {
- break;
- }
- ZEPHIR_CALL_METHOD(¤t, this_ptr, "current", &_2, 489);
- zephir_check_call_status();
- zephir_array_append(&records, ¤t, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Complex.zep", 287);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "next", &_3, 0);
- zephir_check_call_status();
+ if (!(zephir_is_true(&_0))) {
+ RETURN_MM_MEMBER(getThis(), "data");
}
- RETURN_CTOR(&records);
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_FUNCTION("msgpack_pack", NULL, 0, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, serialize)
+static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, unserialize)
{
- zval _7, _6$$4;
- zval records, cache, columnTypes, hydrateMode, container, serializer, _0, _2, _3, _4$$4, _5$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_1 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *data, data_sub, __$false, __$null, version, _0, _1, _2, _7, _3$$3, _4$$3, _5$$4, _6$$4;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&records);
- ZVAL_UNDEF(&cache);
- ZVAL_UNDEF(&columnTypes);
- ZVAL_UNDEF(&hydrateMode);
- ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&serializer);
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&version);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4$$4);
- ZVAL_UNDEF(&_5$$4);
ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$4);
ZVAL_UNDEF(&_6$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(data)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &data);
- ZEPHIR_CALL_METHOD(&records, this_ptr, "toarray", NULL, 0);
- zephir_check_call_status();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("cache"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&cache, &_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("columnTypes"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&columnTypes, &_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("hydrateMode"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&hydrateMode, &_0);
- ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_ce, "getdefault", &_1, 0);
+
+ ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 86);
zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Complex.zep", 316);
- return;
- }
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "serializer");
- ZEPHIR_CALL_METHOD(&_2, &container, "has", NULL, 0, &_3);
+ ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "8.0");
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, ">=");
+ ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 87, &version, &_0, &_1);
zephir_check_call_status();
if (zephir_is_true(&_2)) {
- ZEPHIR_INIT_VAR(&_5$$4);
- ZVAL_STRING(&_5$$4, "serializer");
- ZEPHIR_CALL_METHOD(&_4$$4, &container, "getshared", NULL, 0, &_5$$4);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&serializer, &_4$$4);
- ZEPHIR_INIT_VAR(&_6$$4);
- zephir_create_array(&_6$$4, 4, 0);
- zephir_array_update_string(&_6$$4, SL("cache"), &cache, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_6$$4, SL("rows"), &records, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_6$$4, SL("columnTypes"), &columnTypes, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_6$$4, SL("hydrateMode"), &hydrateMode, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &serializer, "setdata", NULL, 0, &_6$$4);
+ ZEPHIR_INIT_VAR(&_3$$3);
+ ZEPHIR_INIT_NVAR(&_3$$3);
+ zephir_create_closure_ex(&_3$$3, NULL, phalcon_12__closure_ce, SL("__invoke"));
+ ZVAL_LONG(&_4$$3, 2);
+ ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_3$$3, &_4$$3);
zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(&serializer, "serialize", NULL, 0);
+ } else {
+ ZEPHIR_INIT_VAR(&_5$$4);
+ ZEPHIR_INIT_NVAR(&_5$$4);
+ zephir_create_closure_ex(&_5$$4, NULL, phalcon_13__closure_ce, SL("__invoke"));
+ ZVAL_LONG(&_6$$4, 2);
+ ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_5$$4, &_6$$4);
zephir_check_call_status();
- RETURN_MM();
}
- ZEPHIR_INIT_VAR(&_7);
- zephir_create_array(&_7, 4, 0);
- zephir_array_update_string(&_7, SL("cache"), &cache, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_7, SL("rows"), &records, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_7, SL("columnTypes"), &columnTypes, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_7, SL("hydrateMode"), &hydrateMode, PH_COPY | PH_SEPARATE);
- ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 13, &_7);
+ ZEPHIR_CALL_FUNCTION(&_7, "msgpack_unpack", NULL, 0, data);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_7);
+ ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 90);
+ zephir_check_call_status();
+ if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &__$null);
+ }
+ ZEPHIR_MM_RESTORE();
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_None)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, None, phalcon, storage_serializer_none, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_none_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Storage_Serializer_None, serialize)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "data");
+}
+
+static PHP_METHOD(Phalcon_Storage_Serializer_None, unserialize)
+{
+ zval *data, data_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&data_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(data)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &data);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Php)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Php, phalcon, storage_serializer_php, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_php_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Storage_Serializer_Php, serialize)
+{
+ 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);
+
+
+ ZEPHIR_MM_GROW();
+
+ 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(&_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, 13, &_2);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, unserialize)
+static PHP_METHOD(Phalcon_Storage_Serializer_Php, unserialize)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *data, data_sub, __$true, __$false, resultset, container, serializer, _1, _2, _5, _6, _7, _8, _9, _10, _3$$4, _4$$4;
+ zval *data, data_sub, __$false, __$null, version, _0, _1$$4, _2$$4, _3$$4, _8$$4, _4$$6, _5$$6, _6$$7, _7$$7;
zval *this_ptr = getThis();
ZVAL_UNDEF(&data_sub);
- ZVAL_BOOL(&__$true, 1);
ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&resultset);
- ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&serializer);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_9);
- ZVAL_UNDEF(&_10);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$4);
ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_8$$4);
+ ZVAL_UNDEF(&_4$$6);
+ ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&_7$$7);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
@@ -171662,51 +160892,48 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, unserialize)
zephir_fetch_params(1, 1, 0, &data);
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("disableHydration"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("disableHydration"), &__$false);
- }
- ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_ce, "getdefault", &_0, 0);
- zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Complex.zep", 361);
- return;
- }
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "serializer");
- ZEPHIR_CALL_METHOD(&_1, &container, "has", NULL, 0, &_2);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, data);
zephir_check_call_status();
- if (zephir_is_true(&_1)) {
- ZEPHIR_INIT_VAR(&_4$$4);
- ZVAL_STRING(&_4$$4, "serializer");
- ZEPHIR_CALL_METHOD(&_3$$4, &container, "getshared", NULL, 0, &_4$$4);
+ if (!(zephir_is_true(&_0))) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
+ } else {
+ if (Z_TYPE_P(data) != IS_STRING) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the unserializer must of type string", "phalcon/Storage/Serializer/Php.zep", 43);
+ return;
+ }
+ ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 86);
zephir_check_call_status();
- ZEPHIR_CPY_WRT(&serializer, &_3$$4);
- ZEPHIR_CALL_METHOD(NULL, &serializer, "unserialize", NULL, 0, data);
+ 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, 87, &version, &_1$$4, &_2$$4);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&resultset, &serializer, "getdata", NULL, 0);
+ if (zephir_is_true(&_3$$4)) {
+ ZEPHIR_INIT_VAR(&_4$$6);
+ ZEPHIR_INIT_NVAR(&_4$$6);
+ zephir_create_closure_ex(&_4$$6, NULL, phalcon_14__closure_ce, SL("__invoke"));
+ ZVAL_LONG(&_5$$6, 8);
+ ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_4$$6, &_5$$6);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_VAR(&_6$$7);
+ ZEPHIR_INIT_NVAR(&_6$$7);
+ zephir_create_closure_ex(&_6$$7, NULL, phalcon_15__closure_ce, SL("__invoke"));
+ ZVAL_LONG(&_7$$7, 8);
+ ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_6$$7, &_7$$7);
+ zephir_check_call_status();
+ }
+ ZEPHIR_CALL_FUNCTION(&_8$$4, "unserialize", NULL, 15, data);
zephir_check_call_status();
- } else {
- ZEPHIR_CALL_FUNCTION(&resultset, "unserialize", NULL, 15, data);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_8$$4);
+ ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 90);
zephir_check_call_status();
+ if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &__$null);
+ }
}
- if (UNEXPECTED(Z_TYPE_P(&resultset) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/Mvc/Model/Resultset/Complex.zep", 374);
- return;
- }
- zephir_array_fetch_string(&_5, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 377);
- zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_5);
- zephir_array_fetch_string(&_6, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 378);
- ZEPHIR_INIT_ZVAL_NREF(_7);
- ZVAL_LONG(&_7, zephir_fast_count_int(&_6));
- zephir_update_property_zval(this_ptr, ZEND_STRL("count"), &_7);
- zephir_array_fetch_string(&_8, &resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 379);
- zephir_update_property_zval(this_ptr, ZEND_STRL("cache"), &_8);
- zephir_array_fetch_string(&_9, &resultset, SL("columnTypes"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 380);
- zephir_update_property_zval(this_ptr, ZEND_STRL("columnTypes"), &_9);
- zephir_array_fetch_string(&_10, &resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 381);
- zephir_update_property_zval(this_ptr, ZEND_STRL("hydrateMode"), &_10);
ZEPHIR_MM_RESTORE();
}
@@ -171720,604 +160947,457 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, unserialize)
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Resultset_Simple)
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_SerializerInterface)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\Model\\Resultset, Simple, phalcon, mvc_model_resultset_simple, phalcon_mvc_model_resultset_ce, phalcon_mvc_model_resultset_simple_method_entry, 0);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Storage\\Serializer, SerializerInterface, phalcon, storage_serializer_serializerinterface, phalcon_storage_serializer_serializerinterface_method_entry);
- zend_declare_property_null(phalcon_mvc_model_resultset_simple_ce, SL("columnMap"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_model_resultset_simple_ce, SL("model"), ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_mvc_model_resultset_simple_ce, SL("keepSnapshots"), 0, ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_storage_serializer_serializerinterface_ce, 1, zend_ce_serializable);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __construct)
+ZEPHIR_DOC_METHOD(Phalcon_Storage_Serializer_SerializerInterface, getData);
+ZEPHIR_DOC_METHOD(Phalcon_Storage_Serializer_SerializerInterface, setData);
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_AbstractAdapter)
+{
+ 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_string(phalcon_storage_adapter_abstractadapter_ce, SL("prefix"), "", 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);
+ zend_class_implements(phalcon_storage_adapter_abstractadapter_ce, 1, phalcon_storage_adapter_adapterinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getDefaultSerializer)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "defaultSerializer");
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, setDefaultSerializer)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zend_bool keepSnapshots;
- zval *columnMap, columnMap_sub, *model, model_sub, *result, result_sub, *cache = NULL, cache_sub, *keepSnapshots_param = NULL, __$true, __$false, __$null;
+ zval *defaultSerializer_param = NULL;
+ zval defaultSerializer;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&columnMap_sub);
- ZVAL_UNDEF(&model_sub);
- ZVAL_UNDEF(&result_sub);
- ZVAL_UNDEF(&cache_sub);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&defaultSerializer);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(3, 5)
- Z_PARAM_ZVAL(columnMap)
- Z_PARAM_ZVAL(model)
- Z_PARAM_ZVAL(result)
- Z_PARAM_OPTIONAL
- Z_PARAM_OBJECT_OF_CLASS_OR_NULL(cache, zephir_get_internal_ce(SL("psr\\simplecache\\cacheinterface")))
- Z_PARAM_BOOL(keepSnapshots)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(defaultSerializer)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 3, 2, &columnMap, &model, &result, &cache, &keepSnapshots_param);
- if (!cache) {
- cache = &cache_sub;
- cache = &__$null;
- }
- if (!keepSnapshots_param) {
- keepSnapshots = 0;
- } else {
- keepSnapshots = zephir_get_boolval(keepSnapshots_param);
- }
+ zephir_fetch_params(1, 1, 0, &defaultSerializer_param);
+ zephir_get_strval(&defaultSerializer, defaultSerializer_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("model"), model);
- zephir_update_property_zval(this_ptr, ZEND_STRL("columnMap"), columnMap);
- if (keepSnapshots) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("keepSnapshots"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("keepSnapshots"), &__$false);
- }
- ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_resultset_simple_ce, getThis(), "__construct", &_0, 0, result, cache);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &defaultSerializer);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, current)
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getPrefix)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "prefix");
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, __construct)
{
- zend_class_entry *_6$$6;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_7 = NULL, *_11 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval __$true, __$false, row, hydrateMode, columnMap, activeRow, modelName, _0, _1$$6, _3$$6, _4$$6, _5$$6, _2$$7, _8$$9, _9$$9, _10$$9;
+ zephir_fcall_cache_entry *_1 = NULL;
+ zval options;
+ zval *factory, factory_sub, *options_param = NULL, _0, _2, _3, _4, _5, _6$$3;
zval *this_ptr = getThis();
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&row);
- ZVAL_UNDEF(&hydrateMode);
- ZVAL_UNDEF(&columnMap);
- ZVAL_UNDEF(&activeRow);
- ZVAL_UNDEF(&modelName);
+ ZVAL_UNDEF(&factory_sub);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$6);
- ZVAL_UNDEF(&_3$$6);
- ZVAL_UNDEF(&_4$$6);
- ZVAL_UNDEF(&_5$$6);
- ZVAL_UNDEF(&_2$$7);
- ZVAL_UNDEF(&_8$$9);
- ZVAL_UNDEF(&_9$$9);
- ZVAL_UNDEF(&_10$$9);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&options);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ 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();
+#endif
ZEPHIR_MM_GROW();
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("activeRow"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&activeRow, &_0);
- if (Z_TYPE_P(&activeRow) != IS_NULL) {
- RETURN_CCTOR(&activeRow);
+ 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_read_property(&_0, this_ptr, ZEND_STRL("row"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&row, &_0);
- if (Z_TYPE_P(&row) != IS_ARRAY) {
- if (0) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeRow"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeRow"), &__$false);
- }
- RETURN_MM_NULL();
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("serializerFactory"), factory);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "defaultSerializer");
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "Php");
+ ZEPHIR_CALL_CE_STATIC(&_0, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &_0);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "lifetime");
+ ZVAL_LONG(&_5, 3600);
+ ZEPHIR_CALL_CE_STATIC(&_4, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_5);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("lifetime"), &_4);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "prefix");
+ if (zephir_array_key_exists(&options, &_2)) {
+ zephir_array_fetch_string(&_6$$3, &options, SL("prefix"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/AbstractAdapter.zep", 81);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_6$$3);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("hydrateMode"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&hydrateMode, &_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("columnMap"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&columnMap, &_0);
- do {
- if (ZEPHIR_IS_LONG(&hydrateMode, 0)) {
- if (ZEPHIR_GLOBAL(orm).late_state_binding) {
- ZEPHIR_OBS_VAR(&_1$$6);
- zephir_read_property(&_1$$6, this_ptr, ZEND_STRL("model"), PH_NOISY_CC);
- if (zephir_instance_of_ev(&_1$$6, phalcon_mvc_model_ce)) {
- zephir_read_property(&_2$$7, this_ptr, ZEND_STRL("model"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&modelName);
- zephir_get_class(&modelName, &_2$$7, 0);
- } else {
- ZEPHIR_INIT_NVAR(&modelName);
- ZVAL_STRING(&modelName, "Phalcon\\Mvc\\Model");
- }
- zephir_read_property(&_3$$6, this_ptr, ZEND_STRL("model"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_4$$6, this_ptr, ZEND_STRL("keepSnapshots"), PH_NOISY_CC | PH_READONLY);
- ZVAL_LONG(&_5$$6, 0);
- _6$$6 = zephir_fetch_class(&modelName);
- ZEPHIR_CALL_CE_STATIC(&activeRow, _6$$6, "cloneresultmap", NULL, 0, &_3$$6, &row, &columnMap, &_5$$6, &_4$$6);
- zephir_check_call_status();
- } else {
- zephir_read_property(&_8$$9, this_ptr, ZEND_STRL("model"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_9$$9, this_ptr, ZEND_STRL("keepSnapshots"), PH_NOISY_CC | PH_READONLY);
- ZVAL_LONG(&_10$$9, 0);
- ZEPHIR_CALL_CE_STATIC(&activeRow, phalcon_mvc_model_ce, "cloneresultmap", &_7, 0, &_8$$9, &row, &columnMap, &_10$$9, &_9$$9);
- zephir_check_call_status();
- }
- break;
- }
- ZEPHIR_CALL_CE_STATIC(&activeRow, phalcon_mvc_model_ce, "cloneresultmaphydrate", &_11, 0, &row, &columnMap, &hydrateMode);
- zephir_check_call_status();
- break;
- } while(0);
+ ZEPHIR_MM_RESTORE();
+}
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeRow"), &activeRow);
- RETURN_CCTOR(&activeRow);
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, clear)
+{
}
-static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray)
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, decrement)
{
- zend_string *_9$$8, *_22$$17;
- zend_ulong _8$$8, _21$$17;
- zval renamedRecords, renamed;
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, delete)
+{
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, get)
+{
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getAdapter)
+{
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getKeys)
+{
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, has)
+{
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, increment)
+{
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, set)
+{
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getFilteredKeys)
+{
+ zval results;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_12 = NULL;
+ zephir_fcall_cache_entry *_5 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *renameColumns_param = NULL, __$null, result, records, record, renamedKey, key, value, columnMap, _2, _0$$3, _3$$5, *_4$$7, _5$$7, *_6$$8, _7$$8, _10$$10, _11$$10, _13$$12, _14$$12, _15$$14, _16$$14, _17$$16, _18$$16, *_19$$17, _20$$17, _23$$19, _24$$19, _25$$21, _26$$21, _27$$23, _28$$23, _29$$25, _30$$25;
- zend_bool renameColumns, _1;
+ zval prefix;
+ zval *keys = NULL, keys_sub, *prefix_param = NULL, key, pattern, _0, _1, *_2, _3, _4$$3, _6$$5;
zval *this_ptr = getThis();
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&records);
- ZVAL_UNDEF(&record);
- ZVAL_UNDEF(&renamedKey);
+ ZVAL_UNDEF(&keys_sub);
ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&columnMap);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_3$$5);
- ZVAL_UNDEF(&_5$$7);
- ZVAL_UNDEF(&_7$$8);
- ZVAL_UNDEF(&_10$$10);
- ZVAL_UNDEF(&_11$$10);
- ZVAL_UNDEF(&_13$$12);
- ZVAL_UNDEF(&_14$$12);
- ZVAL_UNDEF(&_15$$14);
- ZVAL_UNDEF(&_16$$14);
- ZVAL_UNDEF(&_17$$16);
- ZVAL_UNDEF(&_18$$16);
- ZVAL_UNDEF(&_20$$17);
- ZVAL_UNDEF(&_23$$19);
- ZVAL_UNDEF(&_24$$19);
- ZVAL_UNDEF(&_25$$21);
- ZVAL_UNDEF(&_26$$21);
- ZVAL_UNDEF(&_27$$23);
- ZVAL_UNDEF(&_28$$23);
- ZVAL_UNDEF(&_29$$25);
- ZVAL_UNDEF(&_30$$25);
- ZVAL_UNDEF(&renamedRecords);
- ZVAL_UNDEF(&renamed);
+ ZVAL_UNDEF(&pattern);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&prefix);
+ ZVAL_UNDEF(&results);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(renameColumns)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ZVAL(keys)
+ Z_PARAM_STR(prefix)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &renameColumns_param);
- if (!renameColumns_param) {
- renameColumns = 1;
+ 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 {
- renameColumns = zephir_get_boolval(renameColumns_param);
+ ZEPHIR_INIT_VAR(&prefix);
}
- ZEPHIR_OBS_VAR(&records);
- zephir_read_property(&records, this_ptr, ZEND_STRL("rows"), PH_NOISY_CC);
- if (Z_TYPE_P(&records) != IS_ARRAY) {
- zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("result"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&result, &_0$$3);
- zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("row"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0$$3) != IS_NULL) {
- ZEPHIR_CALL_METHOD(NULL, &result, "execute", NULL, 0);
+ 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", 162);
+ if (Z_TYPE_P(keys) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _2)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ ZVAL_COPY(&key, _2);
+ ZEPHIR_CALL_CE_STATIC(&_4$$3, phalcon_helper_str_ce, "startswith", &_5, 17, &key, &pattern);
zephir_check_call_status();
- }
- ZEPHIR_CALL_METHOD(&records, &result, "fetchall", NULL, 0);
+ if (zephir_is_true(&_4$$3)) {
+ zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/AbstractAdapter.zep", 158);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, keys, "rewind", NULL, 0);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("row"), &__$null);
- zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &records);
- }
- _1 = renameColumns;
- if (_1) {
- ZEPHIR_OBS_VAR(&_2);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("model"), PH_NOISY_CC);
- _1 = !(zephir_instance_of_ev(&_2, phalcon_mvc_model_row_ce));
- }
- if (_1) {
- zephir_read_property(&_3$$5, this_ptr, ZEND_STRL("columnMap"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&columnMap, &_3$$5);
- if (Z_TYPE_P(&columnMap) != IS_ARRAY) {
- RETURN_CCTOR(&records);
- }
- ZEPHIR_INIT_VAR(&renamedRecords);
- array_init(&renamedRecords);
- if (Z_TYPE_P(&records) == IS_ARRAY) {
- zephir_is_iterable(&records, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 241);
- if (Z_TYPE_P(&records) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&records), _4$$7)
- {
- ZEPHIR_INIT_NVAR(&record);
- ZVAL_COPY(&record, _4$$7);
- ZEPHIR_INIT_NVAR(&renamed);
- array_init(&renamed);
- zephir_is_iterable(&record, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 239);
- if (Z_TYPE_P(&record) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&record), _8$$8, _9$$8, _6$$8)
- {
- ZEPHIR_INIT_NVAR(&key);
- if (_9$$8 != NULL) {
- ZVAL_STR_COPY(&key, _9$$8);
- } else {
- ZVAL_LONG(&key, _8$$8);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _6$$8);
- ZEPHIR_OBS_NVAR(&renamedKey);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&renamedKey, &columnMap, &key, 0)))) {
- ZEPHIR_INIT_NVAR(&_10$$10);
- object_init_ex(&_10$$10, phalcon_mvc_model_exception_ce);
- ZEPHIR_INIT_NVAR(&_11$$10);
- ZEPHIR_CONCAT_SVS(&_11$$10, "Column '", &key, "' is not part of the column map");
- ZEPHIR_CALL_METHOD(NULL, &_10$$10, "__construct", &_12, 8, &_11$$10);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_10$$10, "phalcon/Mvc/Model/Resultset/Simple.zep", 222);
- ZEPHIR_MM_RESTORE();
- return;
- }
- if (Z_TYPE_P(&renamedKey) == IS_ARRAY) {
- ZEPHIR_OBS_NVAR(&renamedKey);
- if (UNEXPECTED(!(zephir_array_isset_long_fetch(&renamedKey, &renamedKey, 0, 0)))) {
- ZEPHIR_INIT_NVAR(&_13$$12);
- object_init_ex(&_13$$12, phalcon_mvc_model_exception_ce);
- ZEPHIR_INIT_NVAR(&_14$$12);
- ZEPHIR_CONCAT_SVS(&_14$$12, "Column '", &key, "' is not part of the column map");
- ZEPHIR_CALL_METHOD(NULL, &_13$$12, "__construct", &_12, 8, &_14$$12);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_13$$12, "phalcon/Mvc/Model/Resultset/Simple.zep", 229);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- zephir_array_update_zval(&renamed, &renamedKey, &value, PH_COPY | PH_SEPARATE);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &record, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_7$$8, &record, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_7$$8)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&key, &record, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &record, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_OBS_NVAR(&renamedKey);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&renamedKey, &columnMap, &key, 0)))) {
- ZEPHIR_INIT_NVAR(&_15$$14);
- object_init_ex(&_15$$14, phalcon_mvc_model_exception_ce);
- ZEPHIR_INIT_NVAR(&_16$$14);
- ZEPHIR_CONCAT_SVS(&_16$$14, "Column '", &key, "' is not part of the column map");
- ZEPHIR_CALL_METHOD(NULL, &_15$$14, "__construct", &_12, 8, &_16$$14);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_15$$14, "phalcon/Mvc/Model/Resultset/Simple.zep", 222);
- ZEPHIR_MM_RESTORE();
- return;
- }
- if (Z_TYPE_P(&renamedKey) == IS_ARRAY) {
- ZEPHIR_OBS_NVAR(&renamedKey);
- if (UNEXPECTED(!(zephir_array_isset_long_fetch(&renamedKey, &renamedKey, 0, 0)))) {
- ZEPHIR_INIT_NVAR(&_17$$16);
- object_init_ex(&_17$$16, phalcon_mvc_model_exception_ce);
- ZEPHIR_INIT_NVAR(&_18$$16);
- ZEPHIR_CONCAT_SVS(&_18$$16, "Column '", &key, "' is not part of the column map");
- ZEPHIR_CALL_METHOD(NULL, &_17$$16, "__construct", &_12, 8, &_18$$16);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_17$$16, "phalcon/Mvc/Model/Resultset/Simple.zep", 229);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- zephir_array_update_zval(&renamed, &renamedKey, &value, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &record, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- zephir_array_append(&renamedRecords, &renamed, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Simple.zep", 239);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &records, "rewind", NULL, 0);
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3, keys, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&key, keys, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_CE_STATIC(&_6$$5, phalcon_helper_str_ce, "startswith", &_5, 17, &key, &pattern);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_5$$7, &records, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_5$$7)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&record, &records, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&renamed);
- array_init(&renamed);
- zephir_is_iterable(&record, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 239);
- if (Z_TYPE_P(&record) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&record), _21$$17, _22$$17, _19$$17)
- {
- ZEPHIR_INIT_NVAR(&key);
- if (_22$$17 != NULL) {
- ZVAL_STR_COPY(&key, _22$$17);
- } else {
- ZVAL_LONG(&key, _21$$17);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _19$$17);
- ZEPHIR_OBS_NVAR(&renamedKey);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&renamedKey, &columnMap, &key, 0)))) {
- ZEPHIR_INIT_NVAR(&_23$$19);
- object_init_ex(&_23$$19, phalcon_mvc_model_exception_ce);
- ZEPHIR_INIT_NVAR(&_24$$19);
- ZEPHIR_CONCAT_SVS(&_24$$19, "Column '", &key, "' is not part of the column map");
- ZEPHIR_CALL_METHOD(NULL, &_23$$19, "__construct", &_12, 8, &_24$$19);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_23$$19, "phalcon/Mvc/Model/Resultset/Simple.zep", 222);
- ZEPHIR_MM_RESTORE();
- return;
- }
- if (Z_TYPE_P(&renamedKey) == IS_ARRAY) {
- ZEPHIR_OBS_NVAR(&renamedKey);
- if (UNEXPECTED(!(zephir_array_isset_long_fetch(&renamedKey, &renamedKey, 0, 0)))) {
- ZEPHIR_INIT_NVAR(&_25$$21);
- object_init_ex(&_25$$21, phalcon_mvc_model_exception_ce);
- ZEPHIR_INIT_NVAR(&_26$$21);
- ZEPHIR_CONCAT_SVS(&_26$$21, "Column '", &key, "' is not part of the column map");
- ZEPHIR_CALL_METHOD(NULL, &_25$$21, "__construct", &_12, 8, &_26$$21);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_25$$21, "phalcon/Mvc/Model/Resultset/Simple.zep", 229);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- zephir_array_update_zval(&renamed, &renamedKey, &value, PH_COPY | PH_SEPARATE);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &record, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_20$$17, &record, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_20$$17)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&key, &record, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &record, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_OBS_NVAR(&renamedKey);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&renamedKey, &columnMap, &key, 0)))) {
- ZEPHIR_INIT_NVAR(&_27$$23);
- object_init_ex(&_27$$23, phalcon_mvc_model_exception_ce);
- ZEPHIR_INIT_NVAR(&_28$$23);
- ZEPHIR_CONCAT_SVS(&_28$$23, "Column '", &key, "' is not part of the column map");
- ZEPHIR_CALL_METHOD(NULL, &_27$$23, "__construct", &_12, 8, &_28$$23);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_27$$23, "phalcon/Mvc/Model/Resultset/Simple.zep", 222);
- ZEPHIR_MM_RESTORE();
- return;
- }
- if (Z_TYPE_P(&renamedKey) == IS_ARRAY) {
- ZEPHIR_OBS_NVAR(&renamedKey);
- if (UNEXPECTED(!(zephir_array_isset_long_fetch(&renamedKey, &renamedKey, 0, 0)))) {
- ZEPHIR_INIT_NVAR(&_29$$25);
- object_init_ex(&_29$$25, phalcon_mvc_model_exception_ce);
- ZEPHIR_INIT_NVAR(&_30$$25);
- ZEPHIR_CONCAT_SVS(&_30$$25, "Column '", &key, "' is not part of the column map");
- ZEPHIR_CALL_METHOD(NULL, &_29$$25, "__construct", &_12, 8, &_30$$25);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_29$$25, "phalcon/Mvc/Model/Resultset/Simple.zep", 229);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- zephir_array_update_zval(&renamed, &renamedKey, &value, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &record, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- zephir_array_append(&renamedRecords, &renamed, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Simple.zep", 239);
- ZEPHIR_CALL_METHOD(NULL, &records, "next", NULL, 0);
- zephir_check_call_status();
+ if (zephir_is_true(&_6$$5)) {
+ zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/AbstractAdapter.zep", 158);
}
- }
- ZEPHIR_INIT_NVAR(&record);
+ ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0);
+ zephir_check_call_status();
}
- RETURN_CTOR(&renamedRecords);
}
- RETURN_CCTOR(&records);
+ ZEPHIR_INIT_NVAR(&key);
+ RETURN_CTOR(&results);
}
-static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, serialize)
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getPrefixedKey)
{
- zval data;
- zval container, serializer, _1, _2, _3, _4, _5$$4, _6$$4;
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
+ zval *key = NULL, key_sub, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&serializer);
+ ZVAL_UNDEF(&key_sub);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5$$4);
- ZVAL_UNDEF(&_6$$4);
- ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(key)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &key);
+ ZEPHIR_SEPARATE_PARAM(key);
- ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_ce, "getdefault", &_0, 0);
- zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Simple.zep", 262);
- return;
- }
- ZEPHIR_INIT_VAR(&data);
- zephir_create_array(&data, 6, 0);
- ZEPHIR_OBS_VAR(&_1);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("model"), PH_NOISY_CC);
- zephir_array_update_string(&data, SL("model"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_OBS_NVAR(&_1);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("cache"), PH_NOISY_CC);
- zephir_array_update_string(&data, SL("cache"), &_1, PH_COPY | PH_SEPARATE);
- ZVAL_BOOL(&_3, 0);
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "toarray", NULL, 0, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&data, SL("rows"), &_2, PH_COPY | PH_SEPARATE);
- ZEPHIR_OBS_NVAR(&_1);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("columnMap"), PH_NOISY_CC);
- zephir_array_update_string(&data, SL("columnMap"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_OBS_NVAR(&_1);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("hydrateMode"), PH_NOISY_CC);
- zephir_array_update_string(&data, SL("hydrateMode"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_OBS_NVAR(&_1);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("keepSnapshots"), PH_NOISY_CC);
- zephir_array_update_string(&data, SL("keepSnapshots"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_VAR(&_4);
- ZVAL_STRING(&_4, "serializer");
- ZEPHIR_CALL_METHOD(&_2, &container, "has", NULL, 0, &_4);
- zephir_check_call_status();
- if (zephir_is_true(&_2)) {
- ZEPHIR_INIT_VAR(&_6$$4);
- ZVAL_STRING(&_6$$4, "serializer");
- ZEPHIR_CALL_METHOD(&_5$$4, &container, "getshared", NULL, 0, &_6$$4);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&serializer, &_5$$4);
- ZEPHIR_CALL_METHOD(NULL, &serializer, "setdata", NULL, 0, &data);
+
+ 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();
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getSerializedData)
+{
+ 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_UNDEF(&content_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(content)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &content);
+ ZEPHIR_SEPARATE_PARAM(content);
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC | PH_READONLY);
+ if (!ZEPHIR_IS_STRING_IDENTICAL(&_0, "")) {
+ 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_RETURN_CALL_METHOD(&serializer, "serialize", NULL, 0);
+ 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();
- RETURN_MM();
}
- ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 13, &data);
- zephir_check_call_status();
+ RETVAL_ZVAL(content, 1, 0);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, unserialize)
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getTtl)
{
+ zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *data, data_sub, resultset, keepSnapshots, container, serializer, _1, _2, _5, _6, _7, _8, _9, _10, _11, _3$$4, _4$$4;
+ zval *ttl, ttl_sub, dateTime, _1$$4, _2$$4;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data_sub);
- ZVAL_UNDEF(&resultset);
- ZVAL_UNDEF(&keepSnapshots);
- ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&serializer);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_9);
- ZVAL_UNDEF(&_10);
- ZVAL_UNDEF(&_11);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&ttl_sub);
+ ZVAL_UNDEF(&dateTime);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
+ Z_PARAM_ZVAL(ttl)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &data);
+ zephir_fetch_params(1, 1, 0, &ttl);
- ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_ce, "getdefault", &_0, 0);
- zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Simple.zep", 300);
- return;
+ if (Z_TYPE_P(ttl) == IS_NULL) {
+ RETURN_MM_MEMBER(getThis(), "lifetime");
}
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "serializer");
- ZEPHIR_CALL_METHOD(&_1, &container, "has", NULL, 0, &_2);
- zephir_check_call_status();
- if (zephir_is_true(&_1)) {
- ZEPHIR_INIT_VAR(&_4$$4);
- ZVAL_STRING(&_4$$4, "serializer");
- ZEPHIR_CALL_METHOD(&_3$$4, &container, "getshared", NULL, 0, &_4$$4);
+ _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_CPY_WRT(&serializer, &_3$$4);
- ZEPHIR_CALL_METHOD(NULL, &serializer, "unserialize", NULL, 0, data);
+ ZEPHIR_CALL_METHOD(&_2$$4, &dateTime, "add", NULL, 0, ttl);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&resultset, &serializer, "getdata", NULL, 0);
+ ZEPHIR_RETURN_CALL_METHOD(&_2$$4, "gettimestamp", NULL, 0);
zephir_check_call_status();
- } else {
- ZEPHIR_CALL_FUNCTION(&resultset, "unserialize", NULL, 15, data);
+ RETURN_MM();
+ }
+ RETURN_MM_LONG(zephir_get_intval(ttl));
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getUnserializedData)
+{
+ 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_UNDEF(&content_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(content)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &content);
+ ZEPHIR_SEPARATE_PARAM(content);
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC | PH_READONLY);
+ if (!ZEPHIR_IS_STRING_IDENTICAL(&_0, "")) {
+ 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(content, &_2$$3, "getdata", NULL, 0);
zephir_check_call_status();
}
- if (UNEXPECTED(Z_TYPE_P(&resultset) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/Mvc/Model/Resultset/Simple.zep", 313);
- return;
+ RETVAL_ZVAL(content, 1, 0);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, initSerializer)
+{
+ zend_bool _1;
+ zval _0, _2, _3$$3, _4$$3, _5$$3;
+ zval className;
+ 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);
+ ZVAL_UNDEF(&_5$$3);
+
+
+ ZEPHIR_MM_GROW();
+
+ ZEPHIR_OBS_VAR(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC);
+ _1 = Z_TYPE_P(&_0) == IS_OBJECT;
+ if (_1) {
+ ZEPHIR_OBS_VAR(&_2);
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC);
+ _1 = zephir_instance_of_ev(&_2, phalcon_storage_serializer_serializerinterface_ce);
}
- zephir_array_fetch_string(&_5, &resultset, SL("model"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 316);
- zephir_update_property_zval(this_ptr, ZEND_STRL("model"), &_5);
- zephir_array_fetch_string(&_6, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 317);
- zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_6);
- zephir_array_fetch_string(&_7, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 318);
- ZEPHIR_INIT_ZVAL_NREF(_8);
- ZVAL_LONG(&_8, zephir_fast_count_int(&_7));
- zephir_update_property_zval(this_ptr, ZEND_STRL("count"), &_8);
- zephir_array_fetch_string(&_9, &resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 319);
- zephir_update_property_zval(this_ptr, ZEND_STRL("cache"), &_9);
- zephir_array_fetch_string(&_10, &resultset, SL("columnMap"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 320);
- zephir_update_property_zval(this_ptr, ZEND_STRL("columnMap"), &_10);
- zephir_array_fetch_string(&_11, &resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 321);
- zephir_update_property_zval(this_ptr, ZEND_STRL("hydrateMode"), &_11);
- if (zephir_array_isset_string_fetch(&keepSnapshots, &resultset, SL("keepSnapshots"), 1)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("keepSnapshots"), &keepSnapshots);
+ if (!(_1)) {
+ zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&className);
+ zephir_fast_strtolower(&className, &_3$$3);
+ zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("serializerFactory"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_5$$3, &_4$$3, "newinstance", NULL, 0, &className);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("serializer"), &_5$$3);
}
ZEPHIR_MM_RESTORE();
}
@@ -172332,818 +161412,1119 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, unserialize)
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Transaction_Exception)
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_AdapterInterface)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\Model\\Transaction, Exception, phalcon, mvc_model_transaction_exception, phalcon_mvc_model_exception_ce, NULL, 0);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Storage\\Adapter, AdapterInterface, phalcon, storage_adapter_adapterinterface, phalcon_storage_adapter_adapterinterface_method_entry);
+
+ 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);
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Apcu)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Adapter, Apcu, phalcon, storage_adapter_apcu, phalcon_storage_adapter_abstractadapter_ce, phalcon_storage_adapter_apcu_method_entry, 0);
+
+ zend_declare_property_null(phalcon_storage_adapter_apcu_ce, SL("options"), ZEND_ACC_PROTECTED);
+ phalcon_storage_adapter_apcu_ce->create_object = zephir_init_properties_Phalcon_Storage_Adapter_Apcu;
return SUCCESS;
}
+static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_1 = NULL;
+ zval options;
+ zval *factory, factory_sub, *options_param = NULL, _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&factory_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&options);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ 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();
+#endif
+ ZEPHIR_MM_GROW();
+ 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);
+ }
-#ifdef HAVE_CONFIG_H
-#endif
+ ZEPHIR_INIT_VAR(&_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "ph-apcu-");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_apcu_ce, getThis(), "__construct", &_1, 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_Apcu, clear)
+{
+ 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_UNDEF(&item);
+ ZVAL_UNDEF(&pattern);
+ ZVAL_UNDEF(&apc);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Transaction_Failed)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\Model\\Transaction, Failed, phalcon, mvc_model_transaction_failed, phalcon_mvc_model_transaction_exception_ce, phalcon_mvc_model_transaction_failed_method_entry, 0);
+ ZEPHIR_MM_GROW();
- zend_declare_property_null(phalcon_mvc_model_transaction_failed_ce, SL("record"), ZEND_ACC_PROTECTED);
- return SUCCESS;
+ 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_INIT_NVAR(&apc);
+ object_init_ex(&apc, zephir_get_internal_ce(SL("apcuiterator")));
+ ZEPHIR_CALL_METHOD(NULL, &apc, "__construct", NULL, 0, &pattern);
+ 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(&_2$$4, &item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Apcu.zep", 69);
+ ZEPHIR_CALL_FUNCTION(&_3$$4, "apcu_delete", &_4, 119, &_2$$4);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_3$$4))) {
+ result = 0;
+ }
+ }
+ zend_iterator_dtor(_1);
+ RETURN_MM_BOOL(result);
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Failed, __construct)
+static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, decrement)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *message_param = NULL, *record = NULL, record_sub, __$null;
- zval message;
+ zend_long value, ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, *value_param = NULL, _0, _1;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&message);
- ZVAL_UNDEF(&record_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(message)
+ Z_PARAM_STR(key)
Z_PARAM_OPTIONAL
- Z_PARAM_OBJECT_OF_CLASS_OR_NULL(record, phalcon_mvc_modelinterface_ce)
+ Z_PARAM_LONG(value)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &message_param, &record);
- 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"));
+ 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(message_param) == IS_STRING)) {
- zephir_get_strval(&message, message_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&message);
+ ZEPHIR_INIT_VAR(&key);
}
- if (!record) {
- record = &record_sub;
- record = &__$null;
+ if (!value_param) {
+ value = 1;
+ } else {
+ value = zephir_get_intval(value_param);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("record"), record);
- ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_transaction_failed_ce, getThis(), "__construct", NULL, 0, &message);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZVAL_LONG(&_1, value);
+ ZEPHIR_RETURN_CALL_FUNCTION("apcu_dec", NULL, 120, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Failed, getRecord)
+static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, delete)
{
+ 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_UNDEF(&key);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+ ZEPHIR_MM_GROW();
+ 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);
+ }
- RETURN_MEMBER(getThis(), "record");
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_FUNCTION("apcu_delete", NULL, 119, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Failed, getRecordMessages)
+static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, get)
{
- zval record, _0;
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, _1;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&record);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&content);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
ZEPHIR_MM_GROW();
+ 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_read_property(&_0, this_ptr, ZEND_STRL("record"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&record, &_0);
- if (Z_TYPE_P(&record) != IS_NULL) {
- ZEPHIR_RETURN_CALL_METHOD(&record, "getmessages", NULL, 0);
- zephir_check_call_status();
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE(&_0)) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
RETURN_MM();
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getmessage", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedkey", NULL, 0, &key);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&content, "apcu_fetch", NULL, 121, &_1);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &content);
zephir_check_call_status();
RETURN_MM();
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Transaction_Manager)
+static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, getAdapter)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Mvc\\Model\\Transaction, Manager, phalcon, mvc_model_transaction_manager, phalcon_mvc_model_transaction_manager_method_entry, 0);
+ zval *this_ptr = getThis();
- zend_declare_property_null(phalcon_mvc_model_transaction_manager_ce, SL("container"), ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_mvc_model_transaction_manager_ce, SL("initialized"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_long(phalcon_mvc_model_transaction_manager_ce, SL("number"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_mvc_model_transaction_manager_ce, SL("rollbackPendent"), 1, ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_mvc_model_transaction_manager_ce, SL("service"), "db", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_model_transaction_manager_ce, SL("transactions"), ZEND_ACC_PROTECTED);
- phalcon_mvc_model_transaction_manager_ce->create_object = zephir_init_properties_Phalcon_Mvc_Model_Transaction_Manager;
- zend_class_implements(phalcon_mvc_model_transaction_manager_ce, 1, phalcon_mvc_model_transaction_managerinterface_ce);
- zend_class_implements(phalcon_mvc_model_transaction_manager_ce, 1, phalcon_di_injectionawareinterface_ce);
- return SUCCESS;
+
+ RETURN_MEMBER(getThis(), "adapter");
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, __construct)
+static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, getKeys)
{
+ zend_object_iterator *_1;
+ zval results;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL, *_3 = NULL;
- zval *container = NULL, container_sub, __$null, _1$$4, _2$$4, _4$$4;
+ zval *prefix_param = NULL, item, pattern, apc, _0, _2$$4;
+ zval prefix;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&container_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&prefix);
+ ZVAL_UNDEF(&item);
+ ZVAL_UNDEF(&pattern);
+ ZVAL_UNDEF(&apc);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&results);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_OBJECT_OF_CLASS_OR_NULL(container, phalcon_di_diinterface_ce)
+ Z_PARAM_STR(prefix)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &container);
- if (!container) {
- container = &container_sub;
- ZEPHIR_CPY_WRT(container, &__$null);
+ zephir_fetch_params(1, 0, 1, &prefix_param);
+ if (!prefix_param) {
+ ZEPHIR_INIT_VAR(&prefix);
+ ZVAL_STRING(&prefix, "");
} else {
- ZEPHIR_SEPARATE_PARAM(container);
+ 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);
+ }
}
- if (!(zephir_is_true(container))) {
- ZEPHIR_CALL_CE_STATIC(container, phalcon_di_ce, "getdefault", &_0, 0);
- zephir_check_call_status();
+ 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_INIT_NVAR(&apc);
+ object_init_ex(&apc, zephir_get_internal_ce(SL("apcuiterator")));
+ ZEPHIR_CALL_METHOD(NULL, &apc, "__construct", NULL, 0, &pattern);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&results);
+ array_init(&results);
+ if (Z_TYPE_P(&apc) != IS_OBJECT) {
+ RETURN_CTOR(&results);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
- ZEPHIR_INIT_VAR(&_1$$4);
- object_init_ex(&_1$$4, phalcon_mvc_model_transaction_exception_ce);
- ZEPHIR_INIT_VAR(&_4$$4);
- ZVAL_STRING(&_4$$4, "the services related to the ORM");
- ZEPHIR_CALL_CE_STATIC(&_2$$4, phalcon_mvc_model_transaction_exception_ce, "containerservicenotfound", &_3, 0, &_4$$4);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 8, &_2$$4);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$4, "phalcon/Mvc/Model/Transaction/Manager.zep", 116);
- ZEPHIR_MM_RESTORE();
- return;
+ _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", 152);
+ zephir_array_append(&results, &_2$$4, PH_SEPARATE, "phalcon/Storage/Adapter/Apcu.zep", 152);
}
- ZEPHIR_MM_RESTORE();
+ zend_iterator_dtor(_1);
+ RETURN_CTOR(&results);
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, collectTransactions)
+static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, has)
{
- zval transactions, _0, _1, *_2, _3, _4;
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_UNDEF(&transactions);
+ ZVAL_UNDEF(&key);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("transactions"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&transactions, &_0);
- ZEPHIR_INIT_VAR(&_1);
- zephir_is_iterable(&transactions, 0, "phalcon/Mvc/Model/Transaction/Manager.zep", 133);
- if (Z_TYPE_P(&transactions) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&transactions), _2)
- {
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_COPY(&_1, _2);
- RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("number")));
- } ZEND_HASH_FOREACH_END();
+ 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_CALL_METHOD(NULL, &transactions, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_3, &transactions, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_3)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&_1, &transactions, "current", NULL, 0);
- zephir_check_call_status();
- RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("number")));
- ZEPHIR_CALL_METHOD(NULL, &transactions, "next", NULL, 0);
- zephir_check_call_status();
- }
+ ZEPHIR_INIT_VAR(&key);
}
- ZEPHIR_INIT_NVAR(&_1);
- ZEPHIR_INIT_VAR(&_4);
- array_init(&_4);
- zephir_update_property_zval(this_ptr, ZEND_STRL("transactions"), &_4);
- ZEPHIR_MM_RESTORE();
+
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_FUNCTION("apcu_exists", NULL, 122, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, commit)
+static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, increment)
{
- zval transactions, transaction, connection, _0, *_1, _2, _3$$3, _4$$5;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_long value, ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, *value_param = NULL, _0, _1;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&transactions);
- ZVAL_UNDEF(&transaction);
- ZVAL_UNDEF(&connection);
+ ZVAL_UNDEF(&key);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(key)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(value)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("transactions"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&transactions, &_0);
- zephir_is_iterable(&transactions, 0, "phalcon/Mvc/Model/Transaction/Manager.zep", 152);
- if (Z_TYPE_P(&transactions) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&transactions), _1)
- {
- ZEPHIR_INIT_NVAR(&transaction);
- ZVAL_COPY(&transaction, _1);
- ZEPHIR_CALL_METHOD(&connection, &transaction, "getconnection", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_3$$3, &connection, "isundertransaction", NULL, 0);
- zephir_check_call_status();
- if (zephir_is_true(&_3$$3)) {
- ZEPHIR_CALL_METHOD(NULL, &connection, "commit", NULL, 0);
- zephir_check_call_status();
- }
- } ZEND_HASH_FOREACH_END();
+ 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_CALL_METHOD(NULL, &transactions, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2, &transactions, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_2)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&transaction, &transactions, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&connection, &transaction, "getconnection", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_4$$5, &connection, "isundertransaction", NULL, 0);
- zephir_check_call_status();
- if (zephir_is_true(&_4$$5)) {
- ZEPHIR_CALL_METHOD(NULL, &connection, "commit", NULL, 0);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_METHOD(NULL, &transactions, "next", NULL, 0);
- zephir_check_call_status();
- }
+ ZEPHIR_INIT_VAR(&key);
}
- ZEPHIR_INIT_NVAR(&transaction);
- ZEPHIR_MM_RESTORE();
+ if (!value_param) {
+ value = 1;
+ } else {
+ value = zephir_get_intval(value_param);
+ }
+
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
+ zephir_check_call_status();
+ ZVAL_LONG(&_1, value);
+ ZEPHIR_RETURN_CALL_FUNCTION("apcu_inc", NULL, 123, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, get)
+static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, set)
{
- zval _2$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *autoBegin_param = NULL, __$true, __$false, _0, _4, _1$$3, _3$$4;
- zend_bool autoBegin;
+ zval *key_param = NULL, *value, value_sub, *ttl = NULL, ttl_sub, __$null, _0, _1, _2;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&ttl_sub);
+ ZVAL_NULL(&__$null);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(key)
+ Z_PARAM_ZVAL(value)
Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(autoBegin)
+ Z_PARAM_ZVAL_OR_NULL(ttl)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &autoBegin_param);
- if (!autoBegin_param) {
- autoBegin = 1;
+ 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 {
- autoBegin = zephir_get_boolval(autoBegin_param);
+ ZEPHIR_INIT_VAR(&key);
+ }
+ if (!ttl) {
+ ttl = &ttl_sub;
+ ttl = &__$null;
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("initialized"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_is_true(&_0))) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("rollbackPendent"), PH_NOISY_CC | PH_READONLY);
- if (zephir_is_true(&_1$$3)) {
- ZEPHIR_INIT_VAR(&_2$$4);
- zephir_create_array(&_2$$4, 2, 0);
- zephir_array_fast_append(&_2$$4, this_ptr);
- ZEPHIR_INIT_VAR(&_3$$4);
- ZVAL_STRING(&_3$$4, "rollbackPendent");
- zephir_array_fast_append(&_2$$4, &_3$$4);
- ZEPHIR_CALL_FUNCTION(NULL, "register_shutdown_function", NULL, 492, &_2$$4);
- zephir_check_call_status();
- }
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("initialized"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("initialized"), &__$false);
- }
- }
- if (autoBegin) {
- ZVAL_BOOL(&_4, 1);
- } else {
- ZVAL_BOOL(&_4, 0);
- }
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getorcreatetransaction", NULL, 0, &_4);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "getserializeddata", NULL, 0, value);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_2, this_ptr, "getttl", NULL, 0, ttl);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_FUNCTION("apcu_store", NULL, 124, &_0, &_1, &_2);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getDbService)
+zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Apcu(zend_class_entry *class_type)
{
- zval *this_ptr = getThis();
+ zval _0, _1$$3;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+
+
+ ZEPHIR_MM_GROW();
+
+ {
+ 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);
+ }
+}
- RETURN_MEMBER(getThis(), "service");
-}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getDI)
-{
- zval *this_ptr = getThis();
+#ifdef HAVE_CONFIG_H
+#endif
- RETURN_MEMBER(getThis(), "container");
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Libmemcached)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Adapter, Libmemcached, phalcon, storage_adapter_libmemcached, phalcon_storage_adapter_abstractadapter_ce, phalcon_storage_adapter_libmemcached_method_entry, 0);
+
+ zend_declare_property_null(phalcon_storage_adapter_libmemcached_ce, SL("options"), ZEND_ACC_PROTECTED);
+ phalcon_storage_adapter_libmemcached_ce->create_object = zephir_init_properties_Phalcon_Storage_Adapter_Libmemcached;
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getOrCreateTransaction)
+static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zephir_fcall_cache_entry *_3 = NULL;
- zval *autoBegin_param = NULL, container, transaction, transactions, _0, _10, _11, _1$$3, _2$$3, _4$$3, _5$$4, *_6$$4, _7$$4, _8$$6, _9$$8;
- zend_bool autoBegin;
+ zval options, _0$$3, _1$$3;
+ zval *factory, factory_sub, *options_param = NULL, _2;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&transaction);
- ZVAL_UNDEF(&transactions);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_10);
- ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&factory_sub);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&_0$$3);
ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_5$$4);
- ZVAL_UNDEF(&_7$$4);
- ZVAL_UNDEF(&_8$$6);
- ZVAL_UNDEF(&_9$$8);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_serializerfactory_ce)
Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(autoBegin)
+ Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &autoBegin_param);
- if (!autoBegin_param) {
- autoBegin = 1;
+ zephir_fetch_params(1, 1, 1, &factory, &options_param);
+ if (!options_param) {
+ ZEPHIR_INIT_VAR(&options);
+ array_init(&options);
} else {
- autoBegin = zephir_get_boolval(autoBegin_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&container, &_0);
- if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) {
+ if (!(zephir_array_isset_string(&options, SL("servers")))) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ zephir_create_array(&_0$$3, 1, 0);
ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_mvc_model_transaction_exception_ce);
- ZEPHIR_INIT_VAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "the services related to the ORM");
- ZEPHIR_CALL_CE_STATIC(&_2$$3, phalcon_mvc_model_transaction_exception_ce, "containerservicenotfound", &_3, 0, &_4$$3);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 8, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Mvc/Model/Transaction/Manager.zep", 214);
- ZEPHIR_MM_RESTORE();
- return;
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("number"), PH_NOISY_CC | PH_READONLY);
- if (zephir_is_true(&_0)) {
- zephir_read_property(&_5$$4, this_ptr, ZEND_STRL("transactions"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&transactions, &_5$$4);
- zephir_is_iterable(&transactions, 0, "phalcon/Mvc/Model/Transaction/Manager.zep", 227);
- if (Z_TYPE_P(&transactions) == IS_ARRAY) {
- ZEND_HASH_REVERSE_FOREACH_VAL(Z_ARRVAL_P(&transactions), _6$$4)
- {
- ZEPHIR_INIT_NVAR(&transaction);
- ZVAL_COPY(&transaction, _6$$4);
- if (Z_TYPE_P(&transaction) == IS_OBJECT) {
- ZVAL_BOOL(&_8$$6, 0);
- ZEPHIR_CALL_METHOD(NULL, &transaction, "setisnewtransaction", NULL, 0, &_8$$6);
- zephir_check_call_status();
- RETURN_CCTOR(&transaction);
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &transactions, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_7$$4, &transactions, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_7$$4)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&transaction, &transactions, "current", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&transaction) == IS_OBJECT) {
- ZVAL_BOOL(&_9$$8, 0);
- ZEPHIR_CALL_METHOD(NULL, &transaction, "setisnewtransaction", NULL, 0, &_9$$8);
- zephir_check_call_status();
- RETURN_CCTOR(&transaction);
- }
- ZEPHIR_CALL_METHOD(NULL, &transactions, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&transaction);
- }
- ZEPHIR_INIT_NVAR(&transaction);
- object_init_ex(&transaction, phalcon_mvc_model_transaction_ce);
- zephir_read_property(&_10, this_ptr, ZEND_STRL("service"), PH_NOISY_CC | PH_READONLY);
- if (autoBegin) {
- ZVAL_BOOL(&_11, 1);
- } else {
- ZVAL_BOOL(&_11, 0);
+ zephir_create_array(&_1$$3, 3, 0);
+ add_assoc_stringl_ex(&_1$$3, SL("host"), SL("127.0.0.1"));
+ add_assoc_long_ex(&_1$$3, SL("port"), 11211);
+ add_assoc_long_ex(&_1$$3, SL("weight"), 1);
+ zephir_array_update_long(&_0$$3, 0, &_1$$3, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY);
+ zephir_array_update_string(&options, SL("servers"), &_0$$3, PH_COPY | PH_SEPARATE);
}
- ZEPHIR_CALL_METHOD(NULL, &transaction, "__construct", NULL, 493, &container, &_11, &_10);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &transaction, "settransactionmanager", NULL, 494, this_ptr);
+ ZEPHIR_INIT_VAR(&_2);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "ph-memc-");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_2);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_libmemcached_ce, getThis(), "__construct", &_3, 0, factory, &options);
zephir_check_call_status();
- zephir_update_property_array_append(this_ptr, SL("transactions"), &transaction);
- RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("number")));
- RETURN_CCTOR(&transaction);
-}
-
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getRollbackPendent)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "rollbackPendent");
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, has)
+static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, 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_MM_GROW();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("number"), PH_NOISY_CC | PH_READONLY);
- RETURN_BOOL(ZEPHIR_GT_LONG(&_0, 0));
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "flush", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, notifyCommit)
+static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, decrement)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *transaction, transaction_sub;
+ zend_long value, ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, *value_param = NULL, _0, _1;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&transaction_sub);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(transaction, phalcon_mvc_model_transactioninterface_ce)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(key)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(value)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &transaction);
+ 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 {
+ value = zephir_get_intval(value_param);
+ }
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "collecttransaction", NULL, 0, transaction);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZVAL_LONG(&_1, value);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "decrement", NULL, 0, &key, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, notifyRollback)
+static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, delete)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *transaction, transaction_sub;
+ zval *key_param = NULL, _0, _1;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&transaction_sub);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(transaction, phalcon_mvc_model_transactioninterface_ce)
+ Z_PARAM_STR(key)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &transaction);
+ 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(NULL, this_ptr, "collecttransaction", NULL, 0, transaction);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZVAL_LONG(&_1, 0);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "delete", NULL, 0, &key, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, rollback)
+static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, get)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_4 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *collect_param = NULL, transactions, transaction, connection, _0, *_1, _2, _3$$3, _5$$6;
- zend_bool collect;
+ zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1, _2;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&transactions);
- ZVAL_UNDEF(&transaction);
- ZVAL_UNDEF(&connection);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_5$$6);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(key)
Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(collect)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &collect_param);
- if (!collect_param) {
- collect = 1;
+ 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 {
- collect = zephir_get_boolval(collect_param);
+ ZEPHIR_INIT_VAR(&key);
+ }
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("transactions"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&transactions, &_0);
- zephir_is_iterable(&transactions, 0, "phalcon/Mvc/Model/Transaction/Manager.zep", 298);
- if (Z_TYPE_P(&transactions) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&transactions), _1)
- {
- ZEPHIR_INIT_NVAR(&transaction);
- ZVAL_COPY(&transaction, _1);
- ZEPHIR_CALL_METHOD(&connection, &transaction, "getconnection", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE(&_0)) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
+ }
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "getadapter", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_2, &_1, "get", NULL, 0, &key);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, getAdapter)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval __$true, client, connection, failover, options, persistentId, sasl, saslPass, saslUser, servers, serverList, _0, _1$$3, _3$$3, _4$$3, _5$$3, _6$$4, _7$$4, _8$$4, _9$$4, _10$$4, _11$$4;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_2 = NULL;
+ zval *this_ptr = getThis();
+
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&client);
+ ZVAL_UNDEF(&connection);
+ ZVAL_UNDEF(&failover);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&persistentId);
+ ZVAL_UNDEF(&sasl);
+ ZVAL_UNDEF(&saslPass);
+ ZVAL_UNDEF(&saslUser);
+ ZVAL_UNDEF(&servers);
+ ZVAL_UNDEF(&serverList);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$4);
+ ZVAL_UNDEF(&_9$$4);
+ ZVAL_UNDEF(&_10$$4);
+ ZVAL_UNDEF(&_11$$4);
+
+
+ ZEPHIR_MM_GROW();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) == IS_NULL) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&options, &_1$$3);
+ ZEPHIR_INIT_VAR(&_3$$3);
+ ZVAL_STRING(&_3$$3, "persistentId");
+ ZEPHIR_INIT_VAR(&_4$$3);
+ ZVAL_STRING(&_4$$3, "ph-mcid-");
+ ZEPHIR_CALL_CE_STATIC(&persistentId, phalcon_helper_arr_ce, "get", &_2, 16, &options, &_3$$3, &_4$$3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_3$$3);
+ array_init(&_3$$3);
+ ZEPHIR_INIT_NVAR(&_4$$3);
+ ZVAL_STRING(&_4$$3, "saslAuthData");
+ ZEPHIR_CALL_CE_STATIC(&sasl, phalcon_helper_arr_ce, "get", &_2, 16, &options, &_4$$3, &_3$$3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&connection);
+ object_init_ex(&connection, zephir_get_internal_ce(SL("memcached")));
+ ZEPHIR_CALL_METHOD(NULL, &connection, "__construct", NULL, 0, &persistentId);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&serverList, &connection, "getserverlist", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_5$$3, -1002);
+ ZEPHIR_CALL_METHOD(NULL, &connection, "setoption", NULL, 0, &_5$$3, &_1$$3);
+ zephir_check_call_status();
+ if (zephir_fast_count_int(&serverList) < 1) {
+ ZEPHIR_INIT_VAR(&_6$$4);
+ array_init(&_6$$4);
+ ZEPHIR_INIT_VAR(&_7$$4);
+ ZVAL_STRING(&_7$$4, "servers");
+ ZEPHIR_CALL_CE_STATIC(&servers, phalcon_helper_arr_ce, "get", &_2, 16, &options, &_7$$4, &_6$$4);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_3$$3, &connection, "isundertransaction", NULL, 0);
+ ZEPHIR_INIT_NVAR(&_7$$4);
+ array_init(&_7$$4);
+ ZEPHIR_INIT_VAR(&_8$$4);
+ ZVAL_STRING(&_8$$4, "client");
+ ZEPHIR_CALL_CE_STATIC(&client, phalcon_helper_arr_ce, "get", &_2, 16, &options, &_8$$4, &_7$$4);
zephir_check_call_status();
- if (zephir_is_true(&_3$$3)) {
- ZEPHIR_CALL_METHOD(NULL, &connection, "rollback", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &connection, "close", NULL, 0);
- zephir_check_call_status();
- }
- if (collect) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "collecttransaction", &_4, 0, &transaction);
- zephir_check_call_status();
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &transactions, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2, &transactions, "valid", NULL, 0);
+ ZEPHIR_INIT_NVAR(&_8$$4);
+ ZVAL_STRING(&_8$$4, "user");
+ ZEPHIR_INIT_VAR(&_9$$4);
+ ZVAL_STRING(&_9$$4, "");
+ ZEPHIR_CALL_CE_STATIC(&saslUser, phalcon_helper_arr_ce, "get", &_2, 16, &sasl, &_8$$4, &_9$$4);
zephir_check_call_status();
- if (!zend_is_true(&_2)) {
- break;
+ ZEPHIR_INIT_NVAR(&_8$$4);
+ ZVAL_STRING(&_8$$4, "pass");
+ ZEPHIR_INIT_NVAR(&_9$$4);
+ ZVAL_STRING(&_9$$4, "");
+ ZEPHIR_CALL_CE_STATIC(&saslPass, phalcon_helper_arr_ce, "get", &_2, 16, &sasl, &_8$$4, &_9$$4);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&failover);
+ zephir_create_array(&failover, 5, 0);
+ add_index_long(&failover, 14, 10);
+ add_index_long(&failover, 9, 1);
+ add_index_long(&failover, 21, 2);
+ zephir_array_update_long(&failover, 35, &__$true, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY);
+ add_index_long(&failover, 15, 1);
+ ZEPHIR_INIT_NVAR(&_8$$4);
+ zephir_fast_array_merge(&_8$$4, &failover, &client);
+ ZEPHIR_CPY_WRT(&client, &_8$$4);
+ ZEPHIR_CALL_METHOD(&_10$$4, &connection, "setoptions", NULL, 0, &client);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_10$$4))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Cannot set Memcached client options", "phalcon/Storage/Adapter/Libmemcached.zep", 150);
+ return;
}
- ZEPHIR_CALL_METHOD(&transaction, &transactions, "current", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_11$$4, &connection, "addservers", NULL, 0, &servers);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&connection, &transaction, "getconnection", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_5$$6, &connection, "isundertransaction", NULL, 0);
+ if (!(zephir_is_true(&_11$$4))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Cannot connect to the Memcached server(s)", "phalcon/Storage/Adapter/Libmemcached.zep", 154);
+ return;
+ }
+ if (!(ZEPHIR_IS_EMPTY(&saslUser))) {
+ ZEPHIR_CALL_METHOD(NULL, &connection, "setsaslauthdata", NULL, 0, &saslUser, &saslPass);
zephir_check_call_status();
- if (zephir_is_true(&_5$$6)) {
- ZEPHIR_CALL_METHOD(NULL, &connection, "rollback", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &connection, "close", NULL, 0);
- zephir_check_call_status();
- }
- if (collect) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "collecttransaction", &_4, 0, &transaction);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_METHOD(NULL, &transactions, "next", NULL, 0);
- zephir_check_call_status();
+ }
}
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setserializer", NULL, 125, &connection);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), &connection);
}
- ZEPHIR_INIT_NVAR(&transaction);
- ZEPHIR_MM_RESTORE();
+ RETURN_MM_MEMBER(getThis(), "adapter");
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, rollbackPendent)
+static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, getKeys)
{
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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(prefix)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ 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(NULL, this_ptr, "rollback", NULL, 0);
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_CALL_METHOD(&_1, &_0, "getallkeys", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfilteredkeys", NULL, 0, &_1, &prefix);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, setDbService)
+static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, has)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *service_param = NULL;
- zval service;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, connection, result, _0;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&service);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&connection);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(service)
+ Z_PARAM_STR(key)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &service_param);
- if (UNEXPECTED(Z_TYPE_P(service_param) != IS_STRING && Z_TYPE_P(service_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'service' must be of the type string"));
+ 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(service_param) == IS_STRING)) {
- zephir_get_strval(&service, service_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&service);
+ ZEPHIR_INIT_VAR(&key);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("service"), &service);
- RETURN_THIS();
+ ZEPHIR_CALL_METHOD(&connection, this_ptr, "getadapter", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&result, &connection, "get", NULL, 0, &key);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_0, &connection, "getresultcode", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(!ZEPHIR_IS_LONG_IDENTICAL(&_0, 16));
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, setDI)
+static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, increment)
{
- zval *container, container_sub;
+ 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 *this_ptr = getThis();
- ZVAL_UNDEF(&container_sub);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(key)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(value)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(1, 0, &container);
+ ZEPHIR_MM_GROW();
+ 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 {
+ value = zephir_get_intval(value_param);
+ }
- zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
+ zephir_check_call_status();
+ ZVAL_LONG(&_1, value);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "increment", NULL, 0, &key, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, setRollbackPendent)
+static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, set)
{
- zval *rollbackPendent_param = NULL, __$true, __$false;
- zend_bool rollbackPendent;
+ 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, _2;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&ttl_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_BOOL(rollbackPendent)
+ 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();
#endif
- zephir_fetch_params_without_memory_grow(1, 0, &rollbackPendent_param);
- rollbackPendent = zephir_get_boolval(rollbackPendent_param);
-
-
- if (rollbackPendent) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("rollbackPendent"), &__$true);
+ ZEPHIR_MM_GROW();
+ 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_update_property_zval(this_ptr, ZEND_STRL("rollbackPendent"), &__$false);
+ ZEPHIR_INIT_VAR(&key);
}
- RETURN_THISW();
+ if (!ttl) {
+ ttl = &ttl_sub;
+ ttl = &__$null;
+ }
+
+
+ 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(&_2, this_ptr, "getttl", NULL, 0, ttl);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "set", NULL, 0, &key, &_1, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, collectTransaction)
+static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setSerializer)
{
- zval newTransactions;
+ zval map;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *transaction, transaction_sub, managedTransaction, _0, *_1, _2;
+ zval *connection, connection_sub, serializer, _0, _1$$3, _2$$3, _3$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&transaction_sub);
- ZVAL_UNDEF(&managedTransaction);
+ ZVAL_UNDEF(&connection_sub);
+ ZVAL_UNDEF(&serializer);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&newTransactions);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&map);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(transaction, phalcon_mvc_model_transactioninterface_ce)
+ Z_PARAM_OBJECT_OF_CLASS(connection, zephir_get_internal_ce(SL("memcached")))
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &transaction);
+ zephir_fetch_params(1, 1, 0, &connection);
- ZEPHIR_INIT_VAR(&newTransactions);
- array_init(&newTransactions);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("transactions"), PH_NOISY_CC | PH_READONLY);
- zephir_is_iterable(&_0, 0, "phalcon/Mvc/Model/Transaction/Manager.zep", 363);
- if (Z_TYPE_P(&_0) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1)
- {
- ZEPHIR_INIT_NVAR(&managedTransaction);
- ZVAL_COPY(&managedTransaction, _1);
- if (!ZEPHIR_IS_EQUAL(&managedTransaction, transaction)) {
- zephir_array_append(&newTransactions, transaction, PH_SEPARATE, "phalcon/Mvc/Model/Transaction/Manager.zep", 357);
- } else {
- RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("number")));
- }
- } ZEND_HASH_FOREACH_END();
+ ZEPHIR_INIT_VAR(&map);
+ zephir_create_array(&map, 3, 0);
+ add_assoc_long_ex(&map, SL("php"), 1);
+ add_assoc_long_ex(&map, SL("json"), 3);
+ add_assoc_long_ex(&map, SL("igbinary"), 2);
+ 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", 255);
+ ZVAL_LONG(&_3$$3, -1003);
+ ZEPHIR_CALL_METHOD(NULL, connection, "setoption", NULL, 0, &_3$$3, &_2$$3);
+ zephir_check_call_status();
} else {
- ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "initserializer", 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(&managedTransaction, &_0, "current", NULL, 0);
- zephir_check_call_status();
- if (!ZEPHIR_IS_EQUAL(&managedTransaction, transaction)) {
- zephir_array_append(&newTransactions, transaction, PH_SEPARATE, "phalcon/Mvc/Model/Transaction/Manager.zep", 357);
- } else {
- RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("number")));
- }
- ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0);
- zephir_check_call_status();
- }
}
- ZEPHIR_INIT_NVAR(&managedTransaction);
- zephir_update_property_zval(this_ptr, ZEND_STRL("transactions"), &newTransactions);
ZEPHIR_MM_RESTORE();
}
-zend_object *zephir_init_properties_Phalcon_Mvc_Model_Transaction_Manager(zend_class_entry *class_type)
+zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Libmemcached(zend_class_entry *class_type)
{
zval _0, _1$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
@@ -173156,11 +162537,11 @@ zend_object *zephir_init_properties_Phalcon_Mvc_Model_Transaction_Manager(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("transactions"), PH_NOISY_CC | PH_READONLY);
+ 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("transactions"), &_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("options"), &_1$$3);
}
ZEPHIR_MM_RESTORE();
return Z_OBJ_P(this_ptr);
@@ -173177,1173 +162558,1181 @@ zend_object *zephir_init_properties_Phalcon_Mvc_Model_Transaction_Manager(zend_c
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Transaction_ManagerInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Memory)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Mvc\\Model\\Transaction, ManagerInterface, phalcon, mvc_model_transaction_managerinterface, phalcon_mvc_model_transaction_managerinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Adapter, Memory, phalcon, storage_adapter_memory, phalcon_storage_adapter_abstractadapter_ce, phalcon_storage_adapter_memory_method_entry, 0);
+
+ zend_declare_property_null(phalcon_storage_adapter_memory_ce, SL("data"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_storage_adapter_memory_ce, SL("options"), ZEND_ACC_PROTECTED);
+ phalcon_storage_adapter_memory_ce->create_object = zephir_init_properties_Phalcon_Storage_Adapter_Memory;
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Transaction_ManagerInterface, collectTransactions);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Transaction_ManagerInterface, commit);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Transaction_ManagerInterface, get);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Transaction_ManagerInterface, getDbService);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Transaction_ManagerInterface, getRollbackPendent);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Transaction_ManagerInterface, has);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Transaction_ManagerInterface, notifyCommit);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Transaction_ManagerInterface, notifyRollback);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Transaction_ManagerInterface, rollback);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Transaction_ManagerInterface, rollbackPendent);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Transaction_ManagerInterface, setDbService);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_Transaction_ManagerInterface, setRollbackPendent);
-
-
+static PHP_METHOD(Phalcon_Storage_Adapter_Memory, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_1 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval options;
+ zval *factory, factory_sub, *options_param = NULL, _0;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&factory_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&options);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ 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();
#endif
+ ZEPHIR_MM_GROW();
+ 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(&_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "ph-memo-");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
+ ZEPHIR_INIT_NVAR(&_0);
+ object_init_ex(&_0, phalcon_collection_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 22);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_0);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_memory_ce, getThis(), "__construct", &_1, 0, factory, &options);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "initserializer", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
+}
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router_Annotations)
+static PHP_METHOD(Phalcon_Storage_Adapter_Memory, clear)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\Router, Annotations, phalcon, mvc_router_annotations, phalcon_mvc_router_ce, phalcon_mvc_router_annotations_method_entry, 0);
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
- zend_declare_property_string(phalcon_mvc_router_annotations_ce, SL("actionSuffix"), "Action", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_annotations_ce, SL("actionPreformatCallback"), ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_mvc_router_annotations_ce, SL("controllerSuffix"), "Controller", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_annotations_ce, SL("handlers"), ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_mvc_router_annotations_ce, SL("routePrefix"), "", ZEND_ACC_PROTECTED);
- phalcon_mvc_router_annotations_ce->create_object = zephir_init_properties_Phalcon_Mvc_Router_Annotations;
+ ZVAL_UNDEF(&_0);
- return SUCCESS;
+
+ ZEPHIR_MM_GROW();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "clear", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(1);
}
-static PHP_METHOD(Phalcon_Mvc_Router_Annotations, addModuleResource)
+static PHP_METHOD(Phalcon_Storage_Adapter_Memory, decrement)
{
- zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *module_param = NULL, *handler_param = NULL, *prefix_param = NULL;
- zval module, handler, prefix;
+ zend_long value, ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, *value_param = NULL, current, newValue, prefixedKey, result, _0, _1$$3, _2$$3;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&module);
- ZVAL_UNDEF(&handler);
- ZVAL_UNDEF(&prefix);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(¤t);
+ ZVAL_UNDEF(&newValue);
+ ZVAL_UNDEF(&prefixedKey);
+ ZVAL_UNDEF(&result);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(module)
- Z_PARAM_STR(handler)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(key)
Z_PARAM_OPTIONAL
- Z_PARAM_STR_OR_NULL(prefix)
+ Z_PARAM_LONG(value)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 1, &module_param, &handler_param, &prefix_param);
- if (UNEXPECTED(Z_TYPE_P(module_param) != IS_STRING && Z_TYPE_P(module_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'module' must be of the type string"));
+ 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(module_param) == IS_STRING)) {
- zephir_get_strval(&module, module_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&module);
- }
- if (UNEXPECTED(Z_TYPE_P(handler_param) != IS_STRING && Z_TYPE_P(handler_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'handler' must be of the type string"));
- RETURN_MM_NULL();
+ ZEPHIR_INIT_VAR(&key);
}
- if (EXPECTED(Z_TYPE_P(handler_param) == IS_STRING)) {
- zephir_get_strval(&handler, handler_param);
+ if (!value_param) {
+ value = 1;
} else {
- ZEPHIR_INIT_VAR(&handler);
+ value = zephir_get_intval(value_param);
}
- if (!prefix_param) {
- ZEPHIR_INIT_VAR(&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"));
+
+
+ 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_CALL_METHOD(&result, &_0, "has", NULL, 0, &prefixedKey);
+ zephir_check_call_status();
+ if (zephir_is_true(&result)) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(¤t, &_1$$3, "get", NULL, 0, &prefixedKey);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&newValue);
+ ZVAL_LONG(&newValue, (zephir_get_intval(¤t) - value));
+ ZEPHIR_CPY_WRT(&result, &newValue);
+ zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_2$$3, "set", NULL, 0, &prefixedKey, &newValue);
+ zephir_check_call_status();
+ }
+ RETURN_CCTOR(&result);
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_Memory, delete)
+{
+ 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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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(prefix_param) == IS_STRING)) {
- zephir_get_strval(&prefix, prefix_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&prefix);
- }
+ ZEPHIR_INIT_VAR(&key);
}
- ZEPHIR_INIT_VAR(&_0);
- zephir_create_array(&_0, 3, 0);
- zephir_array_fast_append(&_0, &prefix);
- zephir_array_fast_append(&_0, &handler);
- zephir_array_fast_append(&_0, &module);
- zephir_update_property_array_append(this_ptr, SL("handlers"), &_0);
- RETURN_THIS();
+ 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_CALL_METHOD(&exists, &_0, "has", NULL, 0, &prefixedKey);
+ zephir_check_call_status();
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_1, "remove", NULL, 0, &prefixedKey);
+ zephir_check_call_status();
+ RETURN_CCTOR(&exists);
}
-static PHP_METHOD(Phalcon_Mvc_Router_Annotations, addResource)
+static PHP_METHOD(Phalcon_Storage_Adapter_Memory, get)
{
- zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *handler_param = NULL, *prefix_param = NULL;
- zval handler, prefix;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, content, prefixedKey, _0, _1;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&handler);
- ZVAL_UNDEF(&prefix);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&prefixedKey);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(handler)
+ Z_PARAM_STR(key)
Z_PARAM_OPTIONAL
- Z_PARAM_STR_OR_NULL(prefix)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &handler_param, &prefix_param);
- if (UNEXPECTED(Z_TYPE_P(handler_param) != IS_STRING && Z_TYPE_P(handler_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'handler' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(handler_param) == IS_STRING)) {
- zephir_get_strval(&handler, handler_param);
- } else {
- ZEPHIR_INIT_VAR(&handler);
- }
- if (!prefix_param) {
- ZEPHIR_INIT_VAR(&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"));
+ 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(prefix_param) == IS_STRING)) {
- zephir_get_strval(&prefix, prefix_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&prefix);
+ ZEPHIR_INIT_VAR(&key);
}
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
}
- ZEPHIR_INIT_VAR(&_0);
- zephir_create_array(&_0, 2, 0);
- zephir_array_fast_append(&_0, &prefix);
- zephir_array_fast_append(&_0, &handler);
- zephir_update_property_array_append(this_ptr, SL("handlers"), &_0);
- RETURN_THIS();
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE(&_0)) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
+ }
+ ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key);
+ zephir_check_call_status();
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&content, &_1, "get", NULL, 0, &prefixedKey);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &content);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Annotations, getResources)
+static PHP_METHOD(Phalcon_Storage_Adapter_Memory, getAdapter)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "handlers");
+ RETURN_MEMBER(getThis(), "adapter");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle)
+static PHP_METHOD(Phalcon_Storage_Adapter_Memory, getKeys)
{
- zend_string *_24$$18, *_45$$41;
- zend_ulong _23$$18, _44$$41;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_3 = NULL, *_8 = NULL, *_10 = NULL, *_17 = NULL, *_20 = NULL, *_28 = NULL, *_39 = NULL, *_52 = NULL;
- zval *uri_param = NULL, __$null, annotationsService, handlers, controllerSuffix, scope, prefix, route, compiledPattern, container, handler, controllerName, lowerControllerName, namespaceName, moduleName, handlerAnnotations, classAnnotations, annotations, annotation, methodAnnotations, method, collection, _0, _5, *_6, _7, _1$$3, _2$$3, _4$$3, _9$$6, _11$$6, _12$$6, _13$$7, _14$$7, _15$$4, _16$$12, *_18$$15, _19$$15, *_21$$18, _22$$18, _25$$19, *_26$$19, _27$$19, _29$$23, *_30$$23, _31$$23, _32$$29, _33$$29, _34$$29, _35$$30, _36$$30, _37$$27, _38$$35, *_40$$38, _41$$38, *_42$$41, _43$$41, _46$$42, *_47$$42, _48$$42, _49$$46, *_50$$46, _51$$46;
- zval uri, sufixed;
+ zval *prefix_param = NULL, _0, _1;
+ zval prefix;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&uri);
- ZVAL_UNDEF(&sufixed);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&annotationsService);
- ZVAL_UNDEF(&handlers);
- ZVAL_UNDEF(&controllerSuffix);
- ZVAL_UNDEF(&scope);
ZVAL_UNDEF(&prefix);
- ZVAL_UNDEF(&route);
- ZVAL_UNDEF(&compiledPattern);
- ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&handler);
- ZVAL_UNDEF(&controllerName);
- ZVAL_UNDEF(&lowerControllerName);
- ZVAL_UNDEF(&namespaceName);
- ZVAL_UNDEF(&moduleName);
- ZVAL_UNDEF(&handlerAnnotations);
- ZVAL_UNDEF(&classAnnotations);
- ZVAL_UNDEF(&annotations);
- ZVAL_UNDEF(&annotation);
- ZVAL_UNDEF(&methodAnnotations);
- ZVAL_UNDEF(&method);
- ZVAL_UNDEF(&collection);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_9$$6);
- ZVAL_UNDEF(&_11$$6);
- ZVAL_UNDEF(&_12$$6);
- ZVAL_UNDEF(&_13$$7);
- ZVAL_UNDEF(&_14$$7);
- ZVAL_UNDEF(&_15$$4);
- ZVAL_UNDEF(&_16$$12);
- ZVAL_UNDEF(&_19$$15);
- ZVAL_UNDEF(&_22$$18);
- ZVAL_UNDEF(&_25$$19);
- ZVAL_UNDEF(&_27$$19);
- ZVAL_UNDEF(&_29$$23);
- ZVAL_UNDEF(&_31$$23);
- ZVAL_UNDEF(&_32$$29);
- ZVAL_UNDEF(&_33$$29);
- ZVAL_UNDEF(&_34$$29);
- ZVAL_UNDEF(&_35$$30);
- ZVAL_UNDEF(&_36$$30);
- ZVAL_UNDEF(&_37$$27);
- ZVAL_UNDEF(&_38$$35);
- ZVAL_UNDEF(&_41$$38);
- ZVAL_UNDEF(&_43$$41);
- ZVAL_UNDEF(&_46$$42);
- ZVAL_UNDEF(&_48$$42);
- ZVAL_UNDEF(&_49$$46);
- ZVAL_UNDEF(&_51$$46);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(uri)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(prefix)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ 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(uri_param) == IS_STRING)) {
- zephir_get_strval(&uri, uri_param);
+ if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) {
+ zephir_get_strval(&prefix, prefix_param);
} else {
- ZEPHIR_INIT_VAR(&uri);
+ ZEPHIR_INIT_VAR(&prefix);
+ }
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&container, &_0);
- if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_mvc_router_exception_ce);
- ZEPHIR_INIT_VAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "the 'annotations' service");
- ZEPHIR_CALL_CE_STATIC(&_2$$3, phalcon_mvc_router_exception_ce, "containerservicenotfound", &_3, 0, &_4$$3);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 8, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Mvc/Router/Annotations.zep", 114);
- ZEPHIR_MM_RESTORE();
- return;
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("handlers"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&handlers, &_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("controllerSuffix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&controllerSuffix, &_0);
- ZEPHIR_INIT_VAR(&_5);
- ZVAL_STRING(&_5, "annotations");
- ZEPHIR_CALL_METHOD(&annotationsService, &container, "getshared", NULL, 0, &_5);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "getkeys", NULL, 0);
zephir_check_call_status();
- zephir_is_iterable(&handlers, 0, "phalcon/Mvc/Router/Annotations.zep", 249);
- if (Z_TYPE_P(&handlers) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&handlers), _6)
- {
- ZEPHIR_INIT_NVAR(&scope);
- ZVAL_COPY(&scope, _6);
- if (Z_TYPE_P(&scope) != IS_ARRAY) {
- continue;
- }
- ZEPHIR_OBS_NVAR(&prefix);
- zephir_array_fetch_long(&prefix, &scope, 0, PH_NOISY, "phalcon/Mvc/Router/Annotations.zep", 129);
- if (!(ZEPHIR_IS_EMPTY(&prefix))) {
- ZEPHIR_INIT_NVAR(&route);
- object_init_ex(&route, phalcon_mvc_router_route_ce);
- ZEPHIR_CALL_METHOD(NULL, &route, "__construct", &_8, 117, &prefix);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_9$$6, &route, "getcompiledpattern", &_10, 495);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_11$$6);
- ZVAL_STRING(&_11$$6, "$#");
- ZEPHIR_INIT_NVAR(&_12$$6);
- ZVAL_STRING(&_12$$6, "#");
- ZEPHIR_INIT_NVAR(&compiledPattern);
- zephir_fast_str_replace(&compiledPattern, &_11$$6, &_12$$6, &_9$$6);
- if (zephir_memnstr_str(&compiledPattern, SL("^"), "phalcon/Mvc/Router/Annotations.zep", 146)) {
- ZEPHIR_INIT_NVAR(&_13$$7);
- ZEPHIR_INIT_NVAR(&_14$$7);
- zephir_preg_match(&_14$$7, &compiledPattern, &uri, &_13$$7, 0, 0 , 0 );
- if (!(zephir_is_true(&_14$$7))) {
- continue;
- }
- } else if (!(zephir_start_with(&uri, &prefix, NULL))) {
- continue;
- }
- }
- ZEPHIR_OBS_NVAR(&handler);
- zephir_array_fetch_long(&handler, &scope, 1, PH_NOISY, "phalcon/Mvc/Router/Annotations.zep", 161);
- if (zephir_memnstr_str(&handler, SL("\\"), "phalcon/Mvc/Router/Annotations.zep", 163)) {
- ZEPHIR_INIT_NVAR(&controllerName);
- zephir_get_class_ns(&controllerName, &handler, 0);
- ZEPHIR_INIT_NVAR(&namespaceName);
- zephir_get_ns_class(&namespaceName, &handler, 0);
- } else {
- ZEPHIR_CPY_WRT(&controllerName, &handler);
- ZEPHIR_OBS_NVAR(&namespaceName);
- zephir_fetch_property(&namespaceName, this_ptr, SL("defaultNamespace"), PH_SILENT_CC);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("routePrefix"), &__$null);
- ZEPHIR_OBS_NVAR(&moduleName);
- zephir_array_isset_long_fetch(&moduleName, &scope, 2, 0);
- ZEPHIR_INIT_NVAR(&_15$$4);
- ZEPHIR_CONCAT_VV(&_15$$4, &controllerName, &controllerSuffix);
- zephir_get_strval(&sufixed, &_15$$4);
- if (Z_TYPE_P(&namespaceName) != IS_NULL) {
- ZEPHIR_INIT_NVAR(&_16$$12);
- ZEPHIR_CONCAT_VSV(&_16$$12, &namespaceName, "\\", &sufixed);
- zephir_get_strval(&sufixed, &_16$$12);
- }
- ZEPHIR_CALL_METHOD(&handlerAnnotations, &annotationsService, "get", &_17, 0, &sufixed);
- zephir_check_call_status();
- if (Z_TYPE_P(&handlerAnnotations) != IS_OBJECT) {
- continue;
- }
- ZEPHIR_CALL_METHOD(&classAnnotations, &handlerAnnotations, "getclassannotations", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&classAnnotations) == IS_OBJECT) {
- ZEPHIR_CALL_METHOD(&annotations, &classAnnotations, "getannotations", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&annotations) == IS_ARRAY) {
- zephir_is_iterable(&annotations, 0, "phalcon/Mvc/Router/Annotations.zep", 217);
- if (Z_TYPE_P(&annotations) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&annotations), _18$$15)
- {
- ZEPHIR_INIT_NVAR(&annotation);
- ZVAL_COPY(&annotation, _18$$15);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "processcontrollerannotation", &_20, 0, &controllerName, &annotation);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &annotations, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_19$$15, &annotations, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_19$$15)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&annotation, &annotations, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "processcontrollerannotation", &_20, 0, &controllerName, &annotation);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &annotations, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&annotation);
- }
- }
- ZEPHIR_CALL_METHOD(&methodAnnotations, &handlerAnnotations, "getmethodsannotations", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&lowerControllerName);
- zephir_uncamelize(&lowerControllerName, &controllerName, NULL );
- zephir_is_iterable(&methodAnnotations, 0, "phalcon/Mvc/Router/Annotations.zep", 243);
- if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methodAnnotations), _23$$18, _24$$18, _21$$18)
- {
- ZEPHIR_INIT_NVAR(&method);
- if (_24$$18 != NULL) {
- ZVAL_STR_COPY(&method, _24$$18);
- } else {
- ZVAL_LONG(&method, _23$$18);
- }
- ZEPHIR_INIT_NVAR(&collection);
- ZVAL_COPY(&collection, _21$$18);
- if (Z_TYPE_P(&collection) != IS_OBJECT) {
- continue;
- }
- ZEPHIR_CALL_METHOD(&_25$$19, &collection, "getannotations", NULL, 0);
- zephir_check_call_status();
- zephir_is_iterable(&_25$$19, 0, "phalcon/Mvc/Router/Annotations.zep", 242);
- if (Z_TYPE_P(&_25$$19) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_25$$19), _26$$19)
- {
- ZEPHIR_INIT_NVAR(&annotation);
- ZVAL_COPY(&annotation, _26$$19);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "processactionannotation", &_28, 0, &moduleName, &namespaceName, &lowerControllerName, &method, &annotation);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_25$$19, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_27$$19, &_25$$19, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_27$$19)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&annotation, &_25$$19, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "processactionannotation", &_28, 0, &moduleName, &namespaceName, &lowerControllerName, &method, &annotation);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_25$$19, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&annotation);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &methodAnnotations, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_22$$18, &methodAnnotations, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_22$$18)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&method, &methodAnnotations, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&collection, &methodAnnotations, "current", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&collection) != IS_OBJECT) {
- continue;
- }
- ZEPHIR_CALL_METHOD(&_29$$23, &collection, "getannotations", NULL, 0);
- zephir_check_call_status();
- zephir_is_iterable(&_29$$23, 0, "phalcon/Mvc/Router/Annotations.zep", 242);
- if (Z_TYPE_P(&_29$$23) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_29$$23), _30$$23)
- {
- ZEPHIR_INIT_NVAR(&annotation);
- ZVAL_COPY(&annotation, _30$$23);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "processactionannotation", &_28, 0, &moduleName, &namespaceName, &lowerControllerName, &method, &annotation);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_29$$23, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_31$$23, &_29$$23, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_31$$23)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&annotation, &_29$$23, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "processactionannotation", &_28, 0, &moduleName, &namespaceName, &lowerControllerName, &method, &annotation);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_29$$23, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&annotation);
- ZEPHIR_CALL_METHOD(NULL, &methodAnnotations, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&collection);
- ZEPHIR_INIT_NVAR(&method);
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &handlers, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_7, &handlers, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_7)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&scope, &handlers, "current", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&scope) != IS_ARRAY) {
- continue;
- }
- ZEPHIR_OBS_NVAR(&prefix);
- zephir_array_fetch_long(&prefix, &scope, 0, PH_NOISY, "phalcon/Mvc/Router/Annotations.zep", 129);
- if (!(ZEPHIR_IS_EMPTY(&prefix))) {
- ZEPHIR_INIT_NVAR(&route);
- object_init_ex(&route, phalcon_mvc_router_route_ce);
- ZEPHIR_CALL_METHOD(NULL, &route, "__construct", &_8, 117, &prefix);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_32$$29, &route, "getcompiledpattern", &_10, 495);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_33$$29);
- ZVAL_STRING(&_33$$29, "$#");
- ZEPHIR_INIT_NVAR(&_34$$29);
- ZVAL_STRING(&_34$$29, "#");
- ZEPHIR_INIT_NVAR(&compiledPattern);
- zephir_fast_str_replace(&compiledPattern, &_33$$29, &_34$$29, &_32$$29);
- if (zephir_memnstr_str(&compiledPattern, SL("^"), "phalcon/Mvc/Router/Annotations.zep", 146)) {
- ZEPHIR_INIT_NVAR(&_35$$30);
- ZEPHIR_INIT_NVAR(&_36$$30);
- zephir_preg_match(&_36$$30, &compiledPattern, &uri, &_35$$30, 0, 0 , 0 );
- if (!(zephir_is_true(&_36$$30))) {
- continue;
- }
- } else if (!(zephir_start_with(&uri, &prefix, NULL))) {
- continue;
- }
- }
- ZEPHIR_OBS_NVAR(&handler);
- zephir_array_fetch_long(&handler, &scope, 1, PH_NOISY, "phalcon/Mvc/Router/Annotations.zep", 161);
- if (zephir_memnstr_str(&handler, SL("\\"), "phalcon/Mvc/Router/Annotations.zep", 163)) {
- ZEPHIR_INIT_NVAR(&controllerName);
- zephir_get_class_ns(&controllerName, &handler, 0);
- ZEPHIR_INIT_NVAR(&namespaceName);
- zephir_get_ns_class(&namespaceName, &handler, 0);
- } else {
- ZEPHIR_CPY_WRT(&controllerName, &handler);
- ZEPHIR_OBS_NVAR(&namespaceName);
- zephir_fetch_property(&namespaceName, this_ptr, SL("defaultNamespace"), PH_SILENT_CC);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("routePrefix"), &__$null);
- ZEPHIR_OBS_NVAR(&moduleName);
- zephir_array_isset_long_fetch(&moduleName, &scope, 2, 0);
- ZEPHIR_INIT_NVAR(&_37$$27);
- ZEPHIR_CONCAT_VV(&_37$$27, &controllerName, &controllerSuffix);
- zephir_get_strval(&sufixed, &_37$$27);
- if (Z_TYPE_P(&namespaceName) != IS_NULL) {
- ZEPHIR_INIT_NVAR(&_38$$35);
- ZEPHIR_CONCAT_VSV(&_38$$35, &namespaceName, "\\", &sufixed);
- zephir_get_strval(&sufixed, &_38$$35);
- }
- ZEPHIR_CALL_METHOD(&handlerAnnotations, &annotationsService, "get", &_39, 0, &sufixed);
- zephir_check_call_status();
- if (Z_TYPE_P(&handlerAnnotations) != IS_OBJECT) {
- continue;
- }
- ZEPHIR_CALL_METHOD(&classAnnotations, &handlerAnnotations, "getclassannotations", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&classAnnotations) == IS_OBJECT) {
- ZEPHIR_CALL_METHOD(&annotations, &classAnnotations, "getannotations", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&annotations) == IS_ARRAY) {
- zephir_is_iterable(&annotations, 0, "phalcon/Mvc/Router/Annotations.zep", 217);
- if (Z_TYPE_P(&annotations) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&annotations), _40$$38)
- {
- ZEPHIR_INIT_NVAR(&annotation);
- ZVAL_COPY(&annotation, _40$$38);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "processcontrollerannotation", &_20, 0, &controllerName, &annotation);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &annotations, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_41$$38, &annotations, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_41$$38)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&annotation, &annotations, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "processcontrollerannotation", &_20, 0, &controllerName, &annotation);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &annotations, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&annotation);
- }
- }
- ZEPHIR_CALL_METHOD(&methodAnnotations, &handlerAnnotations, "getmethodsannotations", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&lowerControllerName);
- zephir_uncamelize(&lowerControllerName, &controllerName, NULL );
- zephir_is_iterable(&methodAnnotations, 0, "phalcon/Mvc/Router/Annotations.zep", 243);
- if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methodAnnotations), _44$$41, _45$$41, _42$$41)
- {
- ZEPHIR_INIT_NVAR(&method);
- if (_45$$41 != NULL) {
- ZVAL_STR_COPY(&method, _45$$41);
- } else {
- ZVAL_LONG(&method, _44$$41);
- }
- ZEPHIR_INIT_NVAR(&collection);
- ZVAL_COPY(&collection, _42$$41);
- if (Z_TYPE_P(&collection) != IS_OBJECT) {
- continue;
- }
- ZEPHIR_CALL_METHOD(&_46$$42, &collection, "getannotations", NULL, 0);
- zephir_check_call_status();
- zephir_is_iterable(&_46$$42, 0, "phalcon/Mvc/Router/Annotations.zep", 242);
- if (Z_TYPE_P(&_46$$42) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_46$$42), _47$$42)
- {
- ZEPHIR_INIT_NVAR(&annotation);
- ZVAL_COPY(&annotation, _47$$42);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "processactionannotation", &_28, 0, &moduleName, &namespaceName, &lowerControllerName, &method, &annotation);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_46$$42, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_48$$42, &_46$$42, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_48$$42)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&annotation, &_46$$42, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "processactionannotation", &_28, 0, &moduleName, &namespaceName, &lowerControllerName, &method, &annotation);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_46$$42, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&annotation);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &methodAnnotations, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_43$$41, &methodAnnotations, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_43$$41)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&method, &methodAnnotations, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&collection, &methodAnnotations, "current", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&collection) != IS_OBJECT) {
- continue;
- }
- ZEPHIR_CALL_METHOD(&_49$$46, &collection, "getannotations", NULL, 0);
- zephir_check_call_status();
- zephir_is_iterable(&_49$$46, 0, "phalcon/Mvc/Router/Annotations.zep", 242);
- if (Z_TYPE_P(&_49$$46) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_49$$46), _50$$46)
- {
- ZEPHIR_INIT_NVAR(&annotation);
- ZVAL_COPY(&annotation, _50$$46);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "processactionannotation", &_28, 0, &moduleName, &namespaceName, &lowerControllerName, &method, &annotation);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_49$$46, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_51$$46, &_49$$46, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_51$$46)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&annotation, &_49$$46, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "processactionannotation", &_28, 0, &moduleName, &namespaceName, &lowerControllerName, &method, &annotation);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_49$$46, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&annotation);
- ZEPHIR_CALL_METHOD(NULL, &methodAnnotations, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&collection);
- ZEPHIR_INIT_NVAR(&method);
- }
- ZEPHIR_CALL_METHOD(NULL, &handlers, "next", NULL, 0);
- zephir_check_call_status();
- }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfilteredkeys", NULL, 0, &_1, &prefix);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_Memory, has)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, prefixedKey, _0;
+ zval key;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&prefixedKey);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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();
}
- ZEPHIR_INIT_NVAR(&scope);
- ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_router_annotations_ce, getThis(), "handle", &_52, 0, &uri);
+ 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_MM_RESTORE();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "has", NULL, 0, &prefixedKey);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Annotations, processActionAnnotation)
+static PHP_METHOD(Phalcon_Storage_Adapter_Memory, increment)
{
- zend_string *_12$$18, *_18$$21;
- zend_ulong _11$$18, _17$$21;
- zend_bool isRoute = 0, _8, _21;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_13 = NULL, *_14 = NULL, *_19 = NULL, *_20 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *module_param = NULL, *namespaceName_param = NULL, *controller_param = NULL, *action_param = NULL, *annotation, annotation_sub, name, proxyActionName, actionName, routePrefix, paths, value, uri, route, methods, converts, param, convert, converterParam, routeName, beforeMatch, _0, _1, _2, _5, _6, _3$$6, _4$$6, _7$$16, *_9$$18, _10$$18, *_15$$21, _16$$21;
- zval module, namespaceName, controller, action;
+ zend_long value, ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, *value_param = NULL, current, newValue, prefixedKey, result, _0, _1$$3, _2$$3;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&module);
- ZVAL_UNDEF(&namespaceName);
- ZVAL_UNDEF(&controller);
- ZVAL_UNDEF(&action);
- ZVAL_UNDEF(&annotation_sub);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&proxyActionName);
- ZVAL_UNDEF(&actionName);
- ZVAL_UNDEF(&routePrefix);
- ZVAL_UNDEF(&paths);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&uri);
- ZVAL_UNDEF(&route);
- ZVAL_UNDEF(&methods);
- ZVAL_UNDEF(&converts);
- ZVAL_UNDEF(¶m);
- ZVAL_UNDEF(&convert);
- ZVAL_UNDEF(&converterParam);
- ZVAL_UNDEF(&routeName);
- ZVAL_UNDEF(&beforeMatch);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(¤t);
+ ZVAL_UNDEF(&newValue);
+ ZVAL_UNDEF(&prefixedKey);
+ ZVAL_UNDEF(&result);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_3$$6);
- ZVAL_UNDEF(&_4$$6);
- ZVAL_UNDEF(&_7$$16);
- ZVAL_UNDEF(&_10$$18);
- ZVAL_UNDEF(&_16$$21);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(5, 5)
- Z_PARAM_STR(module)
- Z_PARAM_STR(namespaceName)
- Z_PARAM_STR(controller)
- Z_PARAM_STR(action)
- Z_PARAM_OBJECT_OF_CLASS(annotation, phalcon_annotations_annotation_ce)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(key)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(value)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 5, 0, &module_param, &namespaceName_param, &controller_param, &action_param, &annotation);
- if (UNEXPECTED(Z_TYPE_P(module_param) != IS_STRING && Z_TYPE_P(module_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'module' must be of the type string"));
+ 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(module_param) == IS_STRING)) {
- zephir_get_strval(&module, module_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&module);
+ ZEPHIR_INIT_VAR(&key);
}
- if (UNEXPECTED(Z_TYPE_P(namespaceName_param) != IS_STRING && Z_TYPE_P(namespaceName_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'namespaceName' must be of the type string"));
+ if (!value_param) {
+ value = 1;
+ } else {
+ value = zephir_get_intval(value_param);
+ }
+
+
+ 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_CALL_METHOD(&result, &_0, "has", NULL, 0, &prefixedKey);
+ zephir_check_call_status();
+ if (zephir_is_true(&result)) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(¤t, &_1$$3, "get", NULL, 0, &prefixedKey);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&newValue);
+ ZVAL_LONG(&newValue, (zephir_get_intval(¤t) + value));
+ ZEPHIR_CPY_WRT(&result, &newValue);
+ zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_2$$3, "set", NULL, 0, &prefixedKey, &newValue);
+ zephir_check_call_status();
+ }
+ RETURN_CCTOR(&result);
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_Memory, set)
+{
+ 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, lifetime, prefixedKey, _0;
+ zval key;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&ttl_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&lifetime);
+ ZVAL_UNDEF(&prefixedKey);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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(namespaceName_param) == IS_STRING)) {
- zephir_get_strval(&namespaceName, namespaceName_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&namespaceName);
+ ZEPHIR_INIT_VAR(&key);
}
- if (UNEXPECTED(Z_TYPE_P(controller_param) != IS_STRING && Z_TYPE_P(controller_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controller' must be of the type string"));
- RETURN_MM_NULL();
+ if (!ttl) {
+ ttl = &ttl_sub;
+ ttl = &__$null;
}
- if (EXPECTED(Z_TYPE_P(controller_param) == IS_STRING)) {
- zephir_get_strval(&controller, controller_param);
+
+
+ ZEPHIR_CALL_METHOD(&content, this_ptr, "getserializeddata", NULL, 0, value);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&lifetime, this_ptr, "getttl", NULL, 0, ttl);
+ zephir_check_call_status();
+ 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_CALL_METHOD(NULL, &_0, "set", NULL, 0, &prefixedKey, &content);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(1);
+}
+
+zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Memory(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_MM_GROW();
+
+ {
+ 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);
+ }
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Redis)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Adapter, Redis, phalcon, storage_adapter_redis, phalcon_storage_adapter_abstractadapter_ce, phalcon_storage_adapter_redis_method_entry, 0);
+
+ zend_declare_property_null(phalcon_storage_adapter_redis_ce, SL("options"), ZEND_ACC_PROTECTED);
+ phalcon_storage_adapter_redis_ce->create_object = zephir_init_properties_Phalcon_Storage_Adapter_Redis;
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_Redis, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_1 = NULL, *_14 = NULL;
+ zval options;
+ zval *factory, factory_sub, *options_param = NULL, _0, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&factory_sub);
+ 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(&options);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &factory, &options_param);
+ if (!options_param) {
+ ZEPHIR_INIT_VAR(&options);
+ array_init(&options);
} else {
- ZEPHIR_INIT_VAR(&controller);
+ ZEPHIR_OBS_COPY_OR_DUP(&options, options_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_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "host");
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "127.0.0.1");
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_STRING(&_4, "string");
+ ZEPHIR_CALL_CE_STATIC(&_0, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3, &_4);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("host"), &_0, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "port");
+ ZVAL_LONG(&_6, 6379);
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "int");
+ ZEPHIR_CALL_CE_STATIC(&_5, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_6, &_3);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("port"), &_5, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "index");
+ ZVAL_LONG(&_6, 0);
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "int");
+ ZEPHIR_CALL_CE_STATIC(&_7, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_6, &_3);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("index"), &_7, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "persistent");
+ ZVAL_BOOL(&_6, 0);
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "bool");
+ ZEPHIR_CALL_CE_STATIC(&_8, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_6, &_3);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("persistent"), &_8, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "auth");
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "");
+ ZEPHIR_INIT_NVAR(&_4);
+ ZVAL_STRING(&_4, "string");
+ ZEPHIR_CALL_CE_STATIC(&_9, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3, &_4);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("auth"), &_9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "socket");
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "");
+ ZEPHIR_INIT_NVAR(&_4);
+ ZVAL_STRING(&_4, "string");
+ ZEPHIR_CALL_CE_STATIC(&_10, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3, &_4);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("socket"), &_10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "connectionTimeout");
+ ZVAL_LONG(&_6, 0);
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "int");
+ ZEPHIR_CALL_CE_STATIC(&_11, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_6, &_3);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("connectionTimeout"), &_11, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "retryInterval");
+ ZVAL_NULL(&_6);
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "int");
+ ZEPHIR_CALL_CE_STATIC(&_12, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_6, &_3);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("retryInterval"), &_12, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "readTimeout");
+ ZVAL_LONG(&_6, 0);
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "int");
+ ZEPHIR_CALL_CE_STATIC(&_13, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_6, &_3);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("readTimeout"), &_13, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "ph-reds-");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_2);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_redis_ce, getThis(), "__construct", &_14, 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_MM_GROW();
+
+ 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();
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_Redis, decrement)
+{
+ 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 *this_ptr = getThis();
+
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(key)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(value)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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(action_param) == IS_STRING)) {
- zephir_get_strval(&action, action_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&action);
+ ZEPHIR_INIT_VAR(&key);
+ }
+ if (!value_param) {
+ value = 1;
+ } else {
+ value = zephir_get_intval(value_param);
}
- isRoute = 0;
- ZEPHIR_INIT_VAR(&methods);
- ZVAL_NULL(&methods);
- ZEPHIR_CALL_METHOD(&name, annotation, "getname", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
zephir_check_call_status();
- do {
- if (ZEPHIR_IS_STRING(&name, "Route")) {
- isRoute = 1;
- break;
- }
- if (ZEPHIR_IS_STRING(&name, "Get") || ZEPHIR_IS_STRING(&name, "Post") || ZEPHIR_IS_STRING(&name, "Put") || ZEPHIR_IS_STRING(&name, "Patch") || ZEPHIR_IS_STRING(&name, "Delete") || ZEPHIR_IS_STRING(&name, "Options")) {
- isRoute = 1;
- ZEPHIR_INIT_NVAR(&methods);
- zephir_fast_strtoupper(&methods, &name);
- break;
- }
- } while(0);
+ ZVAL_LONG(&_1, value);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "decrby", NULL, 0, &key, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
- if (!(isRoute)) {
+static PHP_METHOD(Phalcon_Storage_Adapter_Redis, delete)
+{
+ 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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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();
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("actionSuffix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "");
- ZEPHIR_INIT_VAR(&proxyActionName);
- zephir_fast_str_replace(&proxyActionName, &_0, &_1, &action);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("routePrefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&routePrefix, &_2);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("actionPreformatCallback"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_2) != IS_NULL) {
- zephir_read_property(&_3$$6, this_ptr, ZEND_STRL("actionPreformatCallback"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_FUNCTION(&_4$$6, "call_user_func", NULL, 255, &_3$$6, &proxyActionName);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&proxyActionName, &_4$$6);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
+ } else {
+ ZEPHIR_INIT_VAR(&key);
}
- ZEPHIR_INIT_VAR(&actionName);
- zephir_fast_strtolower(&actionName, &proxyActionName);
- ZEPHIR_INIT_VAR(&_5);
- ZVAL_STRING(&_5, "paths");
- ZEPHIR_CALL_METHOD(&paths, annotation, "getnamedargument", NULL, 0, &_5);
+
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
zephir_check_call_status();
- if (Z_TYPE_P(&paths) != IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&paths);
- array_init(&paths);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "del", NULL, 0, &key);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(zephir_get_boolval(&_1));
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_Redis, get)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1, _2;
+ zval key;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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 (!(ZEPHIR_IS_EMPTY(&module))) {
- zephir_array_update_string(&paths, SL("module"), &module, PH_COPY | PH_SEPARATE);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
+ } else {
+ ZEPHIR_INIT_VAR(&key);
}
- if (!(ZEPHIR_IS_EMPTY(&namespaceName))) {
- zephir_array_update_string(&paths, SL("namespace"), &namespaceName, PH_COPY | PH_SEPARATE);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
}
- zephir_array_update_string(&paths, SL("controller"), &controller, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&paths, SL("action"), &actionName, PH_COPY | PH_SEPARATE);
- ZVAL_LONG(&_6, 0);
- ZEPHIR_CALL_METHOD(&value, annotation, "getargument", NULL, 0, &_6);
+
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
zephir_check_call_status();
- if (Z_TYPE_P(&value) != IS_NULL) {
- if (!ZEPHIR_IS_STRING(&value, "/")) {
- ZEPHIR_INIT_VAR(&uri);
- ZEPHIR_CONCAT_VV(&uri, &routePrefix, &value);
- } else {
- if (Z_TYPE_P(&routePrefix) != IS_NULL) {
- ZEPHIR_CPY_WRT(&uri, &routePrefix);
- } else {
- ZEPHIR_CPY_WRT(&uri, &value);
- }
- }
- } else {
- ZEPHIR_INIT_NVAR(&uri);
- ZEPHIR_CONCAT_VV(&uri, &routePrefix, &actionName);
+ if (ZEPHIR_IS_FALSE(&_0)) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
}
- ZEPHIR_CALL_METHOD(&route, this_ptr, "add", NULL, 0, &uri, &paths);
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "getadapter", NULL, 0);
zephir_check_call_status();
- if (Z_TYPE_P(&methods) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_7$$16);
- ZVAL_STRING(&_7$$16, "methods");
- ZEPHIR_CALL_METHOD(&methods, annotation, "getnamedargument", NULL, 0, &_7$$16);
- zephir_check_call_status();
- }
- _8 = Z_TYPE_P(&methods) == IS_ARRAY;
- if (!(_8)) {
- _8 = Z_TYPE_P(&methods) == IS_STRING;
- }
- if (_8) {
- ZEPHIR_CALL_METHOD(NULL, &route, "via", NULL, 0, &methods);
- zephir_check_call_status();
- }
- ZEPHIR_INIT_NVAR(&_5);
- ZVAL_STRING(&_5, "converts");
- ZEPHIR_CALL_METHOD(&converts, annotation, "getnamedargument", NULL, 0, &_5);
+ ZEPHIR_CALL_METHOD(&_2, &_1, "get", NULL, 0, &key);
zephir_check_call_status();
- if (Z_TYPE_P(&converts) == IS_ARRAY) {
- zephir_is_iterable(&converts, 0, "phalcon/Mvc/Router/Annotations.zep", 372);
- if (Z_TYPE_P(&converts) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&converts), _11$$18, _12$$18, _9$$18)
- {
- ZEPHIR_INIT_NVAR(¶m);
- if (_12$$18 != NULL) {
- ZVAL_STR_COPY(¶m, _12$$18);
- } else {
- ZVAL_LONG(¶m, _11$$18);
- }
- ZEPHIR_INIT_NVAR(&convert);
- ZVAL_COPY(&convert, _9$$18);
- ZEPHIR_CALL_METHOD(NULL, &route, "convert", &_13, 0, ¶m, &convert);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_Redis, getAdapter)
+{
+ zend_bool _4$$3, _6$$3;
+ zval auth, connection, connectionTimeout, host, index, options, port, readTimeout, reserved, result, retryInterval, persistent, persistentid, _0, _1$$3, _5$$3, _7$$3, _8$$3, _2$$6, _3$$6;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&auth);
+ ZVAL_UNDEF(&connection);
+ ZVAL_UNDEF(&connectionTimeout);
+ ZVAL_UNDEF(&host);
+ ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&port);
+ ZVAL_UNDEF(&readTimeout);
+ ZVAL_UNDEF(&reserved);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&retryInterval);
+ ZVAL_UNDEF(&persistent);
+ ZVAL_UNDEF(&persistentid);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_2$$6);
+ ZVAL_UNDEF(&_3$$6);
+
+
+ ZEPHIR_MM_GROW();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) == IS_NULL) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&options, &_1$$3);
+ 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_OBS_VAR(&auth);
+ zephir_array_fetch_string(&auth, &options, SL("auth"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 140);
+ ZEPHIR_OBS_VAR(&index);
+ zephir_array_fetch_string(&index, &options, SL("index"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 141);
+ ZEPHIR_OBS_VAR(&persistent);
+ zephir_array_fetch_string(&persistent, &options, SL("persistent"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 142);
+ ZEPHIR_OBS_VAR(&host);
+ zephir_array_fetch_string(&host, &options, SL("host"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 143);
+ ZEPHIR_OBS_VAR(&port);
+ zephir_array_fetch_string(&port, &options, SL("port"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 144);
+ ZEPHIR_OBS_VAR(&connectionTimeout);
+ zephir_array_fetch_string(&connectionTimeout, &options, SL("connectionTimeout"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 145);
+ ZEPHIR_OBS_VAR(&retryInterval);
+ zephir_array_fetch_string(&retryInterval, &options, SL("retryInterval"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 146);
+ ZEPHIR_OBS_VAR(&readTimeout);
+ zephir_array_fetch_string(&readTimeout, &options, SL("readTimeout"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 147);
+ ZEPHIR_INIT_VAR(&reserved);
+ ZVAL_NULL(&reserved);
+ if (!(zephir_is_true(&persistent))) {
+ ZEPHIR_CALL_METHOD(&result, &connection, "connect", NULL, 0, &host, &port, &connectionTimeout, &reserved, &retryInterval, &readTimeout);
+ zephir_check_call_status();
} else {
- ZEPHIR_CALL_METHOD(NULL, &converts, "rewind", NULL, 0);
+ ZEPHIR_INIT_VAR(&persistentid);
+ ZEPHIR_CONCAT_SV(&persistentid, "persistentid_", &index);
+ ZEPHIR_CALL_METHOD(&result, &connection, "pconnect", NULL, 0, &host, &port, &connectionTimeout, &persistentid, &retryInterval, &readTimeout);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_10$$18, &converts, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_10$$18)) {
- break;
- }
- ZEPHIR_CALL_METHOD(¶m, &converts, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&convert, &converts, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &route, "convert", &_14, 0, ¶m, &convert);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &converts, "next", NULL, 0);
- zephir_check_call_status();
- }
}
- ZEPHIR_INIT_NVAR(&convert);
- ZEPHIR_INIT_NVAR(¶m);
- }
- ZEPHIR_INIT_NVAR(&_5);
- ZVAL_STRING(&_5, "converters");
- ZEPHIR_CALL_METHOD(&converts, annotation, "getnamedargument", NULL, 0, &_5);
- zephir_check_call_status();
- if (Z_TYPE_P(&converts) == IS_ARRAY) {
- zephir_is_iterable(&converts, 0, "phalcon/Mvc/Router/Annotations.zep", 383);
- if (Z_TYPE_P(&converts) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&converts), _17$$21, _18$$21, _15$$21)
- {
- ZEPHIR_INIT_NVAR(&converterParam);
- if (_18$$21 != NULL) {
- ZVAL_STR_COPY(&converterParam, _18$$21);
- } else {
- ZVAL_LONG(&converterParam, _17$$21);
- }
- ZEPHIR_INIT_NVAR(&convert);
- ZVAL_COPY(&convert, _15$$21);
- ZEPHIR_CALL_METHOD(NULL, &route, "convert", &_19, 0, &converterParam, &convert);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &converts, "rewind", NULL, 0);
+ if (!(zephir_is_true(&result))) {
+ ZEPHIR_INIT_VAR(&_2$$6);
+ object_init_ex(&_2$$6, phalcon_storage_exception_ce);
+ ZEPHIR_INIT_VAR(&_3$$6);
+ ZEPHIR_CONCAT_SVSVS(&_3$$6, "Could not connect to the Redisd server [", &host, ":", &port, "]");
+ ZEPHIR_CALL_METHOD(NULL, &_2$$6, "__construct", NULL, 8, &_3$$6);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_16$$21, &converts, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_16$$21)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&converterParam, &converts, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&convert, &converts, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &route, "convert", &_20, 0, &converterParam, &convert);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &converts, "next", NULL, 0);
- zephir_check_call_status();
- }
+ zephir_throw_exception_debug(&_2$$6, "phalcon/Storage/Adapter/Redis.zep", 175);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- ZEPHIR_INIT_NVAR(&convert);
- ZEPHIR_INIT_NVAR(&converterParam);
- }
- ZEPHIR_INIT_NVAR(&_5);
- ZVAL_STRING(&_5, "beforeMatch");
- ZEPHIR_CALL_METHOD(&beforeMatch, annotation, "getnamedargument", NULL, 0, &_5);
- zephir_check_call_status();
- _21 = Z_TYPE_P(&beforeMatch) == IS_ARRAY;
- if (!(_21)) {
- _21 = Z_TYPE_P(&beforeMatch) == IS_STRING;
- }
- if (_21) {
- ZEPHIR_CALL_METHOD(NULL, &route, "beforematch", NULL, 0, &beforeMatch);
+ _4$$3 = !(ZEPHIR_IS_EMPTY(&auth));
+ if (_4$$3) {
+ ZEPHIR_CALL_METHOD(&_5$$3, &connection, "auth", NULL, 0, &auth);
+ zephir_check_call_status();
+ _4$$3 = !zephir_is_true(&_5$$3);
+ }
+ if (_4$$3) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Failed to authenticate with the Redis server", "phalcon/Storage/Adapter/Redis.zep", 179);
+ return;
+ }
+ _6$$3 = ZEPHIR_GT_LONG(&index, 0);
+ if (_6$$3) {
+ ZEPHIR_CALL_METHOD(&_7$$3, &connection, "select", NULL, 0, &index);
+ zephir_check_call_status();
+ _6$$3 = !zephir_is_true(&_7$$3);
+ }
+ if (_6$$3) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Redis server selected database failed", "phalcon/Storage/Adapter/Redis.zep", 183);
+ return;
+ }
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_8$$3, 2);
+ ZEPHIR_CALL_METHOD(NULL, &connection, "setoption", NULL, 0, &_8$$3, &_1$$3);
zephir_check_call_status();
- }
- ZEPHIR_INIT_NVAR(&_5);
- ZVAL_STRING(&_5, "name");
- ZEPHIR_CALL_METHOD(&routeName, annotation, "getnamedargument", NULL, 0, &_5);
- zephir_check_call_status();
- if (Z_TYPE_P(&routeName) == IS_STRING) {
- ZEPHIR_CALL_METHOD(NULL, &route, "setname", NULL, 0, &routeName);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setserializer", NULL, 126, &connection);
zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), &connection);
}
- ZEPHIR_MM_RESTORE();
+ RETURN_MM_MEMBER(getThis(), "adapter");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Annotations, processControllerAnnotation)
+static PHP_METHOD(Phalcon_Storage_Adapter_Redis, getKeys)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *handler_param = NULL, *annotation, annotation_sub, _0, _1$$3, _2$$3;
- zval handler;
+ zval *prefix_param = NULL, _0, _1, _2;
+ zval prefix;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&handler);
- ZVAL_UNDEF(&annotation_sub);
+ ZVAL_UNDEF(&prefix);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(handler)
- Z_PARAM_OBJECT_OF_CLASS(annotation, phalcon_annotations_annotation_ce)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(prefix)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &handler_param, &annotation);
- if (UNEXPECTED(Z_TYPE_P(handler_param) != IS_STRING && Z_TYPE_P(handler_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'handler' must be of the type string"));
+ 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(handler_param) == IS_STRING)) {
- zephir_get_strval(&handler, handler_param);
+ if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) {
+ zephir_get_strval(&prefix, prefix_param);
} else {
- ZEPHIR_INIT_VAR(&handler);
+ ZEPHIR_INIT_VAR(&prefix);
+ }
}
- ZEPHIR_CALL_METHOD(&_0, annotation, "getname", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
zephir_check_call_status();
- if (ZEPHIR_IS_STRING(&_0, "RoutePrefix")) {
- ZVAL_LONG(&_2$$3, 0);
- ZEPHIR_CALL_METHOD(&_1$$3, annotation, "getargument", NULL, 0, &_2$$3);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("routePrefix"), &_1$$3);
- }
- ZEPHIR_MM_RESTORE();
+ 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();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Annotations, setActionSuffix)
+static PHP_METHOD(Phalcon_Storage_Adapter_Redis, has)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *actionSuffix_param = NULL;
- zval actionSuffix;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, _0, _1;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&actionSuffix);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(actionSuffix)
+ Z_PARAM_STR(key)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &actionSuffix_param);
- if (UNEXPECTED(Z_TYPE_P(actionSuffix_param) != IS_STRING && Z_TYPE_P(actionSuffix_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'actionSuffix' must be of the type string"));
+ 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(actionSuffix_param) == IS_STRING)) {
- zephir_get_strval(&actionSuffix, actionSuffix_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&actionSuffix);
+ ZEPHIR_INIT_VAR(&key);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("actionSuffix"), &actionSuffix);
- ZEPHIR_MM_RESTORE();
+ 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));
}
-static PHP_METHOD(Phalcon_Mvc_Router_Annotations, setActionPreformatCallback)
+static PHP_METHOD(Phalcon_Storage_Adapter_Redis, increment)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *callback = NULL, callback_sub, __$null, _0$$4;
+ zend_long value, ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, *value_param = NULL, _0, _1;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&callback_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0$$4);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(key)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(callback)
+ Z_PARAM_LONG(value)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &callback);
- if (!callback) {
- callback = &callback_sub;
- callback = &__$null;
+ 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(zephir_is_callable(callback))) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("actionPreformatCallback"), callback);
- } else if (Z_TYPE_P(callback) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_0$$4);
- ZEPHIR_INIT_NVAR(&_0$$4);
- zephir_create_closure_ex(&_0$$4, NULL, phalcon_9__closure_ce, SL("__invoke"));
- zephir_update_property_zval(this_ptr, ZEND_STRL("actionPreformatCallback"), &_0$$4);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "The 'callback' parameter must be either a callable or NULL.", "phalcon/Mvc/Router/Annotations.zep", 455);
- return;
+ ZEPHIR_INIT_VAR(&key);
}
- ZEPHIR_MM_RESTORE();
+ if (!value_param) {
+ value = 1;
+ } else {
+ value = zephir_get_intval(value_param);
+ }
+
+
+ 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();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Annotations, getActionPreformatCallback)
+static PHP_METHOD(Phalcon_Storage_Adapter_Redis, set)
{
+ 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, _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);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
- RETURN_MEMBER(getThis(), "actionPreformatCallback");
+ ZEPHIR_MM_GROW();
+ 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;
+ }
+
+
+ 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(&_2, this_ptr, "getttl", NULL, 0, ttl);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "set", NULL, 0, &key, &_1, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Annotations, setControllerSuffix)
+static PHP_METHOD(Phalcon_Storage_Adapter_Redis, setSerializer)
{
+ zval map;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *controllerSuffix_param = NULL;
- zval controllerSuffix;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *connection, connection_sub, serializer, _0, _1, _4, _7, _2$$3, _3$$3, _5$$4, _6$$4, _8$$5, _9$$5, _10$$5;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&controllerSuffix);
+ ZVAL_UNDEF(&connection_sub);
+ ZVAL_UNDEF(&serializer);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_7);
+ 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(&_10$$5);
+ ZVAL_UNDEF(&map);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(controllerSuffix)
+ Z_PARAM_OBJECT_OF_CLASS(connection, zephir_get_internal_ce(SL("redis")))
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &controllerSuffix_param);
- if (UNEXPECTED(Z_TYPE_P(controllerSuffix_param) != IS_STRING && Z_TYPE_P(controllerSuffix_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerSuffix' must be of the type string"));
- RETURN_MM_NULL();
+ zephir_fetch_params(1, 1, 0, &connection);
+
+
+ ZEPHIR_INIT_VAR(&map);
+ zephir_create_array(&map, 2, 0);
+ add_assoc_long_ex(&map, SL("none"), 0);
+ add_assoc_long_ex(&map, SL("php"), 1);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "\\Redis::SERIALIZER_IGBINARY");
+ ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 127, &_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, 128, &_2$$3);
+ zephir_check_call_status();
+ zephir_array_update_string(&map, SL("igbinary"), &_3$$3, PH_COPY | PH_SEPARATE);
}
- if (EXPECTED(Z_TYPE_P(controllerSuffix_param) == IS_STRING)) {
- zephir_get_strval(&controllerSuffix, controllerSuffix_param);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "\\Redis::SERIALIZER_MSGPACK");
+ ZEPHIR_CALL_FUNCTION(&_4, "defined", NULL, 127, &_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, 128, &_5$$4);
+ zephir_check_call_status();
+ zephir_array_update_string(&map, SL("msgpack"), &_6$$4, PH_COPY | PH_SEPARATE);
+ }
+ zephir_read_property(&_7, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&serializer);
+ zephir_fast_strtolower(&serializer, &_7);
+ if (zephir_array_isset(&map, &serializer)) {
+ ZEPHIR_INIT_VAR(&_8$$5);
+ ZEPHIR_INIT_NVAR(&_8$$5);
+ ZVAL_STRING(&_8$$5, "");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &_8$$5);
+ zephir_array_fetch(&_9$$5, &map, &serializer, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 288);
+ ZVAL_LONG(&_10$$5, 1);
+ ZEPHIR_CALL_METHOD(NULL, connection, "setoption", NULL, 0, &_10$$5, &_9$$5);
+ zephir_check_call_status();
} else {
- ZEPHIR_INIT_VAR(&controllerSuffix);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "initserializer", NULL, 0);
+ zephir_check_call_status();
}
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("controllerSuffix"), &controllerSuffix);
ZEPHIR_MM_RESTORE();
}
-zend_object *zephir_init_properties_Phalcon_Mvc_Router_Annotations(zend_class_entry *class_type)
+zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Redis(zend_class_entry *class_type)
{
- zval _0, _2, _4, _6, _8, _10, _12, _1$$3, _3$$4, _5$$5, _7$$6, _9$$7, _11$$8, _13$$9;
+ zval _0, _1$$3;
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(&_12);
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(&_13$$9);
ZEPHIR_MM_GROW();
@@ -174351,47 +163740,11 @@ zend_object *zephir_init_properties_Phalcon_Mvc_Router_Annotations(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("routes"), PH_NOISY_CC | PH_READONLY);
+ 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("routes"), &_1$$3);
- }
- zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("params"), 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("params"), &_3$$4);
- }
- zephir_read_property_ex(&_4, this_ptr, ZEND_STRL("matches"), 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("matches"), &_5$$5);
- }
- zephir_read_property_ex(&_6, this_ptr, ZEND_STRL("keyRouteIds"), 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("keyRouteIds"), &_7$$6);
- }
- zephir_read_property_ex(&_8, this_ptr, ZEND_STRL("keyRouteNames"), 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("keyRouteNames"), &_9$$7);
- }
- zephir_read_property_ex(&_10, this_ptr, ZEND_STRL("defaultParams"), 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("defaultParams"), &_11$$8);
- }
- zephir_read_property_ex(&_12, this_ptr, ZEND_STRL("handlers"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_12) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_13$$9);
- array_init(&_13$$9);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("handlers"), &_13$$9);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("options"), &_1$$3);
}
ZEPHIR_MM_RESTORE();
return Z_OBJ_P(this_ptr);
@@ -174408,2933 +163761,2794 @@ zend_object *zephir_init_properties_Phalcon_Mvc_Router_Annotations(zend_class_en
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router_Exception)
+ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Stream)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\Router, Exception, phalcon, mvc_router_exception, phalcon_exception_ce, NULL, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Adapter, Stream, phalcon, storage_adapter_stream, phalcon_storage_adapter_abstractadapter_ce, phalcon_storage_adapter_stream_method_entry, 0);
+
+ zend_declare_property_string(phalcon_storage_adapter_stream_ce, SL("storageDir"), "", ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_storage_adapter_stream_ce, SL("options"), ZEND_ACC_PROTECTED);
+ phalcon_storage_adapter_stream_ce->create_object = zephir_init_properties_Phalcon_Storage_Adapter_Stream;
return SUCCESS;
}
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_0 = NULL, *_4 = NULL, *_5 = NULL;
+ zval options;
+ zval *factory, factory_sub, *options_param = NULL, storageDir, _1, _2, _3;
+ zval *this_ptr = getThis();
-
-
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&factory_sub);
+ ZVAL_UNDEF(&storageDir);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&options);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ 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();
#endif
+ ZEPHIR_MM_GROW();
+ 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, "storageDir");
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "");
+ ZEPHIR_CALL_CE_STATIC(&storageDir, phalcon_helper_arr_ce, "get", &_0, 16, &options, &_1, &_2);
+ 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", 57);
+ return;
+ }
+ ZEPHIR_CALL_CE_STATIC(&_3, phalcon_helper_str_ce, "dirseparator", &_4, 129, &storageDir);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("storageDir"), &_3);
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "ph-strm");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_1);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_stream_ce, getThis(), "__construct", &_5, 0, factory, &options);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "initserializer", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
+}
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router_Group)
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, clear)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Mvc\\Router, Group, phalcon, mvc_router_group, phalcon_mvc_router_group_method_entry, 0);
+ zend_bool result = 0, _5$$3, _10$$5;
+ zval directory, iterator, file, _1, *_2, _3, _4$$3, _6$$3, _7$$3, _9$$5, _11$$5, _12$$5;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_0 = NULL, *_8 = NULL;
+ zval *this_ptr = getThis();
- zend_declare_property_null(phalcon_mvc_router_group_ce, SL("beforeMatch"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_group_ce, SL("hostname"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_group_ce, SL("paths"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_group_ce, SL("prefix"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_group_ce, SL("routes"), ZEND_ACC_PROTECTED);
- phalcon_mvc_router_group_ce->create_object = zephir_init_properties_Phalcon_Mvc_Router_Group;
+ ZVAL_UNDEF(&directory);
+ ZVAL_UNDEF(&iterator);
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_11$$5);
+ ZVAL_UNDEF(&_12$$5);
- zend_class_implements(phalcon_mvc_router_group_ce, 1, phalcon_mvc_router_groupinterface_ce);
- return SUCCESS;
+
+ ZEPHIR_MM_GROW();
+
+ result = 1;
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("storageDir"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_CE_STATIC(&directory, phalcon_helper_str_ce, "dirseparator", &_0, 129, &_1);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&iterator, this_ptr, "getiterator", NULL, 130, &directory);
+ zephir_check_call_status();
+ zephir_is_iterable(&iterator, 0, "phalcon/Storage/Adapter/Stream.zep", 90);
+ if (Z_TYPE_P(&iterator) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&iterator), _2)
+ {
+ ZEPHIR_INIT_NVAR(&file);
+ ZVAL_COPY(&file, _2);
+ ZEPHIR_CALL_METHOD(&_4$$3, &file, "isfile", NULL, 0);
+ zephir_check_call_status();
+ _5$$3 = zephir_is_true(&_4$$3);
+ if (_5$$3) {
+ ZEPHIR_CALL_METHOD(&_6$$3, &file, "getpathname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&_7$$3, "unlink", &_8, 131, &_6$$3);
+ zephir_check_call_status();
+ _5$$3 = !zephir_is_true(&_7$$3);
+ }
+ if (_5$$3) {
+ result = 0;
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &iterator, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3, &iterator, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&file, &iterator, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_9$$5, &file, "isfile", NULL, 0);
+ zephir_check_call_status();
+ _10$$5 = zephir_is_true(&_9$$5);
+ if (_10$$5) {
+ ZEPHIR_CALL_METHOD(&_11$$5, &file, "getpathname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&_12$$5, "unlink", &_8, 131, &_11$$5);
+ zephir_check_call_status();
+ _10$$5 = !zephir_is_true(&_12$$5);
+ }
+ if (_10$$5) {
+ result = 0;
+ }
+ ZEPHIR_CALL_METHOD(NULL, &iterator, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&file);
+ RETURN_MM_BOOL(result);
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, __construct)
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, decrement)
{
- zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *paths = NULL, paths_sub, __$null;
+ zend_long value, ZEPHIR_LAST_CALL_STATUS, _1;
+ zval *key_param = NULL, *value_param = NULL, data, _0;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&paths_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(key)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
+ Z_PARAM_LONG(value)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &paths);
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
+ 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();
}
-
-
- _0 = Z_TYPE_P(paths) == IS_ARRAY;
- if (!(_0)) {
- _0 = Z_TYPE_P(paths) == IS_STRING;
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
+ } else {
+ ZEPHIR_INIT_VAR(&key);
}
- if (_0) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("paths"), paths);
+ if (!value_param) {
+ value = 1;
+ } else {
+ value = zephir_get_intval(value_param);
}
- if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("initialize")) == SUCCESS)) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0, paths);
- zephir_check_call_status();
+
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_0))) {
+ RETURN_MM_BOOL(0);
}
- ZEPHIR_MM_RESTORE();
+ 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_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, &key, &data);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, add)
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, delete)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *pattern_param = NULL, *paths = NULL, paths_sub, *httpMethods = NULL, httpMethods_sub, __$null;
- zval pattern;
+ zval *key_param = NULL, filepath, _0;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&paths_sub);
- ZVAL_UNDEF(&httpMethods_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&filepath);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(pattern)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
- Z_PARAM_ZVAL_OR_NULL(httpMethods)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(key)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &httpMethods);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
+ 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(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&pattern);
- }
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
- }
- if (!httpMethods) {
- httpMethods = &httpMethods_sub;
- httpMethods = &__$null;
+ ZEPHIR_INIT_VAR(&key);
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addroute", NULL, 0, &pattern, paths, httpMethods);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_0))) {
+ RETURN_MM_BOOL(0);
+ }
+ ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 132, &key);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_FUNCTION("unlink", NULL, 131, &filepath);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, addConnect)
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, get)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_2 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0;
- zval pattern;
+ zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, content, filepath, payload, _0, _1, _3, _4;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&paths_sub);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&defaultValue_sub);
ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&filepath);
+ ZVAL_UNDEF(&payload);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(pattern)
+ Z_PARAM_STR(key)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &pattern_param, &paths);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
+ 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(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&pattern);
+ ZEPHIR_INIT_VAR(&key);
}
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "CONNECT");
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addroute", NULL, 0, &pattern, paths, &_0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE(&_0)) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
+ }
+ ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 132, &key);
+ zephir_check_call_status();
+ if (!((zephir_file_exists(&filepath) == SUCCESS))) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
+ }
+ ZEPHIR_CALL_METHOD(&payload, this_ptr, "getpayload", NULL, 133, &filepath);
+ zephir_check_call_status();
+ if (UNEXPECTED(ZEPHIR_IS_EMPTY(&payload))) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
+ }
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "isexpired", NULL, 134, &payload);
+ zephir_check_call_status();
+ if (zephir_is_true(&_1)) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
+ }
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "content");
+ ZVAL_NULL(&_4);
+ ZEPHIR_CALL_CE_STATIC(&content, phalcon_helper_arr_ce, "get", &_2, 16, &payload, &_3, &_4);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &content);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, addDelete)
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getAdapter)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "adapter");
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getKeys)
{
+ zval files;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0;
- zval pattern;
+ zval *prefix_param = NULL, directory, file, iterator, *_0, _1, _2$$4, _3$$5, _4$$5, _5$$5, _6$$6, _7$$7, _8$$7, _9$$7;
+ zval prefix;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&paths_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&prefix);
+ ZVAL_UNDEF(&directory);
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&iterator);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_6$$6);
+ ZVAL_UNDEF(&_7$$7);
+ ZVAL_UNDEF(&_8$$7);
+ ZVAL_UNDEF(&_9$$7);
+ ZVAL_UNDEF(&files);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(pattern)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
+ Z_PARAM_STR(prefix)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &pattern_param, &paths);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
+ 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(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
+ if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) {
+ zephir_get_strval(&prefix, prefix_param);
} else {
- ZEPHIR_INIT_VAR(&pattern);
+ ZEPHIR_INIT_VAR(&prefix);
}
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "DELETE");
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addroute", NULL, 0, &pattern, paths, &_0);
+ ZEPHIR_INIT_VAR(&files);
+ array_init(&files);
+ ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdir", NULL, 135);
+ zephir_check_call_status();
+ if (!((zephir_file_exists(&directory) == SUCCESS))) {
+ array_init(return_value);
+ RETURN_MM();
+ }
+ ZEPHIR_CALL_METHOD(&iterator, this_ptr, "getiterator", NULL, 130, &directory);
+ zephir_check_call_status();
+ zephir_is_iterable(&iterator, 0, "phalcon/Storage/Adapter/Stream.zep", 206);
+ if (Z_TYPE_P(&iterator) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&iterator), _0)
+ {
+ ZEPHIR_INIT_NVAR(&file);
+ ZVAL_COPY(&file, _0);
+ ZEPHIR_CALL_METHOD(&_2$$4, &file, "isfile", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_2$$4)) {
+ zephir_read_property(&_3$$5, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_4$$5, &file, "getfilename", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_5$$5);
+ ZEPHIR_CONCAT_VV(&_5$$5, &_3$$5, &_4$$5);
+ zephir_array_append(&files, &_5$$5, PH_SEPARATE, "phalcon/Storage/Adapter/Stream.zep", 202);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &iterator, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &iterator, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&file, &iterator, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_6$$6, &file, "isfile", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_6$$6)) {
+ zephir_read_property(&_7$$7, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_8$$7, &file, "getfilename", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_9$$7);
+ ZEPHIR_CONCAT_VV(&_9$$7, &_7$$7, &_8$$7);
+ zephir_array_append(&files, &_9$$7, PH_SEPARATE, "phalcon/Storage/Adapter/Stream.zep", 202);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &iterator, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&file);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfilteredkeys", NULL, 0, &files, &prefix);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, addGet)
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, has)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0;
- zval pattern;
+ zval *key_param = NULL, payload, filepath, _0;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&paths_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&payload);
+ ZVAL_UNDEF(&filepath);
ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(pattern)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(key)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &pattern_param, &paths);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
+ 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(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&pattern);
- }
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
+ ZEPHIR_INIT_VAR(&key);
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "GET");
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addroute", NULL, 0, &pattern, paths, &_0);
+ ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 132, &key);
zephir_check_call_status();
- RETURN_MM();
+ if (!((zephir_file_exists(&filepath) == SUCCESS))) {
+ RETURN_MM_BOOL(0);
+ }
+ ZEPHIR_CALL_METHOD(&payload, this_ptr, "getpayload", NULL, 133, &filepath);
+ zephir_check_call_status();
+ if (UNEXPECTED(ZEPHIR_IS_EMPTY(&payload))) {
+ RETURN_MM_BOOL(0);
+ }
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "isexpired", NULL, 134, &payload);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(!zephir_is_true(&_0));
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, addHead)
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, increment)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0;
- zval pattern;
+ zend_long value, ZEPHIR_LAST_CALL_STATUS, _1;
+ zval *key_param = NULL, *value_param = NULL, data, _0;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&paths_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&data);
ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(pattern)
+ Z_PARAM_STR(key)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
+ Z_PARAM_LONG(value)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &pattern_param, &paths);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
+ 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(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&pattern);
+ ZEPHIR_INIT_VAR(&key);
}
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
+ if (!value_param) {
+ value = 1;
+ } else {
+ value = zephir_get_intval(value_param);
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "HEAD");
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addroute", NULL, 0, &pattern, paths, &_0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_0))) {
+ RETURN_MM_BOOL(0);
+ }
+ 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_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, &key, &data);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, addOptions)
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, set)
{
+ zval payload;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0;
- zval pattern;
+ zval *key_param = NULL, *value, value_sub, *ttl = NULL, ttl_sub, __$true, __$null, directory, _0, _1, _2, _4, _5, _6, _3$$3;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&paths_sub);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&ttl_sub);
+ ZVAL_BOOL(&__$true, 1);
ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&directory);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&payload);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(pattern)
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(key)
+ Z_PARAM_ZVAL(value)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
+ Z_PARAM_ZVAL_OR_NULL(ttl)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &pattern_param, &paths);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
+ 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(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&pattern);
+ ZEPHIR_INIT_VAR(&key);
}
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
+ if (!ttl) {
+ ttl = &ttl_sub;
+ ttl = &__$null;
}
+ ZEPHIR_INIT_VAR(&payload);
+ zephir_create_array(&payload, 3, 0);
ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "OPTIONS");
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addroute", NULL, 0, &pattern, paths, &_0);
+ zephir_time(&_0);
+ zephir_array_update_string(&payload, SL("created"), &_0, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "getttl", NULL, 0, ttl);
zephir_check_call_status();
- RETURN_MM();
+ zephir_array_update_string(&payload, SL("ttl"), &_1, PH_COPY | PH_SEPARATE);
+ 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_CALL_FUNCTION(&_1, "serialize", NULL, 13, &payload);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&payload, &_1);
+ ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdir", NULL, 135, &key);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&_2, "is_dir", NULL, 136, &directory);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_2))) {
+ ZVAL_LONG(&_3$$3, 0777);
+ ZEPHIR_CALL_FUNCTION(NULL, "mkdir", NULL, 137, &directory, &_3$$3, &__$true);
+ zephir_check_call_status();
+ }
+ ZEPHIR_INIT_VAR(&_4);
+ ZEPHIR_CONCAT_VV(&_4, &directory, &key);
+ ZVAL_LONG(&_5, 2);
+ ZEPHIR_CALL_FUNCTION(&_6, "file_put_contents", NULL, 138, &_4, &payload, &_5);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_6));
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, addPatch)
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDir)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0;
- zval pattern;
+ zephir_fcall_cache_entry *_0 = NULL, *_4 = NULL;
+ zval *key_param = NULL, dirFromFile, dirPrefix, _1, _2, _3, _5, _6, _7, _8;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&paths_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&dirFromFile);
+ ZVAL_UNDEF(&dirPrefix);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_8);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(pattern)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
+ Z_PARAM_STR(key)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &pattern_param, &paths);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
+ 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"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&pattern);
+ ZEPHIR_INIT_VAR(&key);
}
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "PATCH");
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addroute", NULL, 0, &pattern, paths, &_0);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("storageDir"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_3);
+ ZEPHIR_CONCAT_VV(&_3, &_1, &_2);
+ ZEPHIR_CALL_CE_STATIC(&dirPrefix, phalcon_helper_str_ce, "dirseparator", &_0, 129, &_3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_5);
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_7);
+ ZVAL_STRING(&_7, "");
+ zephir_fast_str_replace(&_5, &_6, &_7, &key);
+ ZEPHIR_CALL_CE_STATIC(&dirFromFile, phalcon_helper_str_ce, "dirfromfile", &_4, 139, &_5);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_8);
+ ZEPHIR_CONCAT_VV(&_8, &dirPrefix, &dirFromFile);
+ ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_helper_str_ce, "dirseparator", &_0, 129, &_8);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, addPost)
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getFilepath)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0;
- zval pattern;
+ zval *key_param = NULL, _0, _1, _2, _3, _4;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&paths_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&key);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(pattern)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(key)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &pattern_param, &paths);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
+ 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(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
+ if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
+ zephir_get_strval(&key, key_param);
} else {
- ZEPHIR_INIT_VAR(&pattern);
- }
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
+ ZEPHIR_INIT_VAR(&key);
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "POST");
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addroute", NULL, 0, &pattern, paths, &_0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdir", NULL, 135, &key);
+ zephir_check_call_status();
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "");
+ ZVAL_LONG(&_3, 1);
+ ZEPHIR_MAKE_REF(&_3);
+ ZEPHIR_CALL_FUNCTION(&_4, "str_replace", NULL, 140, &_1, &_2, &key, &_3);
+ ZEPHIR_UNREF(&_3);
zephir_check_call_status();
+ ZEPHIR_CONCAT_VV(return_value, &_0, &_4);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, addPurge)
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getIterator)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0;
- zval pattern;
+ zval *dir_param = NULL, _0, _1;
+ zval dir;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&paths_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&dir);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(pattern)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(dir)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &pattern_param, &paths);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
+ 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"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
+ if (EXPECTED(Z_TYPE_P(dir_param) == IS_STRING)) {
+ zephir_get_strval(&dir, dir_param);
} else {
- ZEPHIR_INIT_VAR(&pattern);
- }
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
+ ZEPHIR_INIT_VAR(&dir);
}
+ object_init_ex(return_value, spl_ce_RecursiveIteratorIterator);
ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "PURGE");
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addroute", NULL, 0, &pattern, paths, &_0);
+ object_init_ex(&_0, spl_ce_RecursiveDirectoryIterator);
+ ZVAL_LONG(&_1, 4096);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 141, &dir, &_1);
+ zephir_check_call_status();
+ ZVAL_LONG(&_1, 2);
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 142, &_0, &_1);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, addPut)
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getPayload)
{
+ zend_bool _10;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0;
- zval pattern;
+ zval *filepath_param = NULL, __$false, payload, pointer, version, _0, _1, _2, _3, _4, _9, _5$$5, _6$$5, _7$$6, _8$$6;
+ zval filepath;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&paths_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&filepath);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&payload);
+ ZVAL_UNDEF(&pointer);
+ ZVAL_UNDEF(&version);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_8$$6);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(pattern)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(filepath)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &pattern_param, &paths);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
- RETURN_MM_NULL();
+ zephir_fetch_params(1, 1, 0, &filepath_param);
+ zephir_get_strval(&filepath, filepath_param);
+
+
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "r");
+ ZEPHIR_CALL_FUNCTION(&pointer, "fopen", NULL, 89, &filepath, &_0);
+ zephir_check_call_status();
+ ZVAL_LONG(&_1, 1);
+ ZEPHIR_CALL_FUNCTION(&_2, "flock", NULL, 143, &pointer, &_1);
+ zephir_check_call_status();
+ if (zephir_is_true(&_2)) {
+ ZEPHIR_INIT_VAR(&payload);
+ zephir_file_get_contents(&payload, &filepath);
}
- if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
+ zephir_fclose(&pointer);
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&payload)) {
+ array_init(return_value);
+ RETURN_MM();
+ }
+ ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 86);
+ 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, 87, &version, &_0, &_3);
+ zephir_check_call_status();
+ if (zephir_is_true(&_4)) {
+ ZEPHIR_INIT_VAR(&_5$$5);
+ ZEPHIR_INIT_NVAR(&_5$$5);
+ zephir_create_closure_ex(&_5$$5, NULL, phalcon_2__closure_ce, SL("__invoke"));
+ ZVAL_LONG(&_6$$5, 8);
+ ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_5$$5, &_6$$5);
+ zephir_check_call_status();
} else {
- ZEPHIR_INIT_VAR(&pattern);
+ ZEPHIR_INIT_VAR(&_7$$6);
+ ZEPHIR_INIT_NVAR(&_7$$6);
+ zephir_create_closure_ex(&_7$$6, NULL, phalcon_3__closure_ce, SL("__invoke"));
+ ZVAL_LONG(&_8$$6, 8);
+ ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_7$$6, &_8$$6);
+ zephir_check_call_status();
}
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
+ ZEPHIR_CALL_FUNCTION(&_9, "unserialize", NULL, 15, &payload);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&payload, &_9);
+ ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 90);
+ zephir_check_call_status();
+ _10 = ZEPHIR_GLOBAL(warning).enable;
+ if (!(_10)) {
+ _10 = Z_TYPE_P(&payload) != IS_ARRAY;
+ }
+ if (UNEXPECTED(_10)) {
+ array_init(return_value);
+ RETURN_MM();
+ }
+ RETURN_CCTOR(&payload);
+}
+
+static PHP_METHOD(Phalcon_Storage_Adapter_Stream, isExpired)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_0 = NULL;
+ zval *payload_param = NULL, created, ttl, _1, _2, _3, _4;
+ zval payload;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&payload);
+ ZVAL_UNDEF(&created);
+ ZVAL_UNDEF(&ttl);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(payload)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &payload_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&payload, payload_param);
+
+
+ ZEPHIR_INIT_VAR(&_1);
+ zephir_time(&_1);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "created");
+ ZEPHIR_CALL_CE_STATIC(&created, phalcon_helper_arr_ce, "get", &_0, 16, &payload, &_2, &_1);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "ttl");
+ ZVAL_LONG(&_3, 3600);
+ ZEPHIR_CALL_CE_STATIC(&ttl, phalcon_helper_arr_ce, "get", &_0, 16, &payload, &_2, &_3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_4);
+ zephir_add_function(&_4, &created, &ttl);
+ ZEPHIR_INIT_NVAR(&_2);
+ zephir_time(&_2);
+ RETURN_MM_BOOL(ZEPHIR_LT(&_4, &_2));
+}
+
+zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Stream(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_MM_GROW();
+
+ {
+ 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);
}
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Assets_Asset)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Assets, Asset, phalcon, assets_asset, phalcon_assets_asset_method_entry, 0);
+
+ zend_declare_property_null(phalcon_assets_asset_ce, SL("attributes"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_assets_asset_ce, SL("autoVersion"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_asset_ce, SL("filter"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_asset_ce, SL("local"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_asset_ce, SL("path"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_asset_ce, SL("sourcePath"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_asset_ce, SL("targetPath"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_asset_ce, SL("targetUri"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_asset_ce, SL("type"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_asset_ce, SL("version"), ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_assets_asset_ce, 1, phalcon_assets_assetinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Assets_Asset, getAttributes)
+{
+ zval *this_ptr = getThis();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "PUT");
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addroute", NULL, 0, &pattern, paths, &_0);
- zephir_check_call_status();
- RETURN_MM();
+
+ RETURN_MEMBER(getThis(), "attributes");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, addTrace)
+static PHP_METHOD(Phalcon_Assets_Asset, setAutoVersion)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0;
- zval pattern;
+ zval *autoVersion_param = NULL, __$true, __$false;
+ zend_bool autoVersion;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&paths_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(pattern)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(autoVersion)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &pattern_param, &paths);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
- } else {
- ZEPHIR_INIT_VAR(&pattern);
- }
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
- }
+ zephir_fetch_params_without_memory_grow(1, 0, &autoVersion_param);
+ autoVersion = zephir_get_boolval(autoVersion_param);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "TRACE");
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addroute", NULL, 0, &pattern, paths, &_0);
- zephir_check_call_status();
- RETURN_MM();
+ if (autoVersion) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("autoVersion"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("autoVersion"), &__$false);
+ }
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, beforeMatch)
+static PHP_METHOD(Phalcon_Assets_Asset, getFilter)
{
- zval *beforeMatch, beforeMatch_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&beforeMatch_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(beforeMatch)
- ZEND_PARSE_PARAMETERS_END();
-#endif
- zephir_fetch_params_without_memory_grow(1, 0, &beforeMatch);
+ RETURN_MEMBER(getThis(), "filter");
+}
+
+static PHP_METHOD(Phalcon_Assets_Asset, getLocal)
+{
+ zval *this_ptr = getThis();
- zephir_update_property_zval(this_ptr, ZEND_STRL("beforeMatch"), beforeMatch);
- RETURN_THISW();
+
+ RETURN_MEMBER(getThis(), "local");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, clear)
+static PHP_METHOD(Phalcon_Assets_Asset, getPath)
{
- zval _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
-
- ZEPHIR_MM_GROW();
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("routes"), &_0);
- ZEPHIR_MM_RESTORE();
+ RETURN_MEMBER(getThis(), "path");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, getBeforeMatch)
+static PHP_METHOD(Phalcon_Assets_Asset, getSourcePath)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "beforeMatch");
+ RETURN_MEMBER(getThis(), "sourcePath");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, getHostname)
+static PHP_METHOD(Phalcon_Assets_Asset, getTargetPath)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "hostname");
+ RETURN_MEMBER(getThis(), "targetPath");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, getPaths)
+static PHP_METHOD(Phalcon_Assets_Asset, getTargetUri)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "paths");
+ RETURN_MEMBER(getThis(), "targetUri");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, getPrefix)
+static PHP_METHOD(Phalcon_Assets_Asset, getType)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "prefix");
+ RETURN_MEMBER(getThis(), "type");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, getRoutes)
+static PHP_METHOD(Phalcon_Assets_Asset, getVersion)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "routes");
+ RETURN_MEMBER(getThis(), "version");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, setHostname)
+static PHP_METHOD(Phalcon_Assets_Asset, setVersion)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *hostname_param = NULL;
- zval hostname;
+ zval *version_param = NULL;
+ zval version;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&hostname);
+ ZVAL_UNDEF(&version);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(hostname)
+ Z_PARAM_STR(version)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &hostname_param);
- zephir_get_strval(&hostname, hostname_param);
+ zephir_fetch_params(1, 1, 0, &version_param);
+ zephir_get_strval(&version, version_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("hostname"), &hostname);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("version"), &version);
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, setPaths)
+static PHP_METHOD(Phalcon_Assets_Asset, __construct)
{
- zval *paths, paths_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval attributes;
+ zend_bool local, filter, autoVersion;
+ zval *type_param = NULL, *path_param = NULL, *local_param = NULL, *filter_param = NULL, *attributes_param = NULL, *version_param = NULL, *autoVersion_param = NULL, __$true, __$false;
+ zval type, path, version;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&paths_sub);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&path);
+ ZVAL_UNDEF(&version);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&attributes);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(paths)
+ ZEND_PARSE_PARAMETERS_START(2, 7)
+ Z_PARAM_STR(type)
+ Z_PARAM_STR(path)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(local)
+ Z_PARAM_BOOL(filter)
+ Z_PARAM_ARRAY(attributes)
+ Z_PARAM_STR_OR_NULL(version)
+ Z_PARAM_BOOL(autoVersion)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(1, 0, &paths);
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 5, &type_param, &path_param, &local_param, &filter_param, &attributes_param, &version_param, &autoVersion_param);
+ zephir_get_strval(&type, type_param);
+ zephir_get_strval(&path, path_param);
+ if (!local_param) {
+ local = 1;
+ } else {
+ local = zephir_get_boolval(local_param);
+ }
+ if (!filter_param) {
+ filter = 1;
+ } else {
+ filter = zephir_get_boolval(filter_param);
+ }
+ if (!attributes_param) {
+ ZEPHIR_INIT_VAR(&attributes);
+ array_init(&attributes);
+ } else {
+ zephir_get_arrval(&attributes, attributes_param);
+ }
+ if (!version_param) {
+ ZEPHIR_INIT_VAR(&version);
+ } else {
+ zephir_get_strval(&version, version_param);
+ }
+ if (!autoVersion_param) {
+ autoVersion = 0;
+ } else {
+ autoVersion = zephir_get_boolval(autoVersion_param);
+ }
- zephir_update_property_zval(this_ptr, ZEND_STRL("paths"), paths);
- RETURN_THISW();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &type);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("path"), &path);
+ if (local) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("local"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("local"), &__$false);
+ }
+ if (filter) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filter"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filter"), &__$false);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &attributes);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("version"), &version);
+ if (autoVersion) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("autoVersion"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("autoVersion"), &__$false);
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, setPrefix)
+static PHP_METHOD(Phalcon_Assets_Asset, getAssetKey)
{
+ zval key, _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *prefix_param = NULL;
- zval prefix;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&prefix);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(prefix)
- ZEND_PARSE_PARAMETERS_END();
-#endif
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &prefix_param);
- zephir_get_strval(&prefix, prefix_param);
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &prefix);
- RETURN_THIS();
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "gettype", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "getpath", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_CONCAT_VSV(&key, &_0, ":", &_1);
+ zephir_md5(return_value, &key);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Group, addRoute)
+static PHP_METHOD(Phalcon_Assets_Asset, getContent)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *pattern_param = NULL, *paths = NULL, paths_sub, *httpMethods = NULL, httpMethods_sub, __$null, mergedPaths, route, defaultPaths, processedPaths, _1, _2;
- zval pattern;
+ zval *basePath_param = NULL, sourcePath, completePath, content, _0, _1$$5, _2$$5, _3$$6, _4$$6;
+ zval basePath;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&paths_sub);
- ZVAL_UNDEF(&httpMethods_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&mergedPaths);
- ZVAL_UNDEF(&route);
- ZVAL_UNDEF(&defaultPaths);
- ZVAL_UNDEF(&processedPaths);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&basePath);
+ ZVAL_UNDEF(&sourcePath);
+ ZVAL_UNDEF(&completePath);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$5);
+ ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&_3$$6);
+ ZVAL_UNDEF(&_4$$6);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(pattern)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
- Z_PARAM_ZVAL_OR_NULL(httpMethods)
+ Z_PARAM_STR_OR_NULL(basePath)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &httpMethods);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
+ zephir_fetch_params(1, 0, 1, &basePath_param);
+ if (!basePath_param) {
+ ZEPHIR_INIT_VAR(&basePath);
} else {
- ZEPHIR_INIT_VAR(&pattern);
- }
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
- }
- if (!httpMethods) {
- httpMethods = &httpMethods_sub;
- httpMethods = &__$null;
+ zephir_get_strval(&basePath, basePath_param);
}
- ZEPHIR_OBS_VAR(&defaultPaths);
- zephir_read_property(&defaultPaths, this_ptr, ZEND_STRL("paths"), PH_NOISY_CC);
- if (Z_TYPE_P(&defaultPaths) == IS_ARRAY) {
- if (Z_TYPE_P(paths) == IS_STRING) {
- ZEPHIR_CALL_CE_STATIC(&processedPaths, phalcon_mvc_router_route_ce, "getroutepaths", &_0, 0, paths);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("sourcePath"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&sourcePath, &_0);
+ if (ZEPHIR_IS_EMPTY(&sourcePath)) {
+ ZEPHIR_OBS_NVAR(&sourcePath);
+ zephir_read_property(&sourcePath, this_ptr, ZEND_STRL("path"), PH_NOISY_CC);
+ }
+ ZEPHIR_INIT_VAR(&completePath);
+ ZEPHIR_CONCAT_VV(&completePath, &basePath, &sourcePath);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("local"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_is_true(&_0)) {
+ if (UNEXPECTED(!((zephir_file_exists(&completePath) == SUCCESS)))) {
+ ZEPHIR_INIT_VAR(&_1$$5);
+ object_init_ex(&_1$$5, phalcon_assets_exception_ce);
+ ZEPHIR_INIT_VAR(&_2$$5);
+ ZEPHIR_CONCAT_SVS(&_2$$5, "Asset's content for '", &completePath, "' cannot be read");
+ ZEPHIR_CALL_METHOD(NULL, &_1$$5, "__construct", NULL, 8, &_2$$5);
zephir_check_call_status();
- } else {
- ZEPHIR_CPY_WRT(&processedPaths, paths);
- }
- if (Z_TYPE_P(&processedPaths) == IS_ARRAY) {
- ZEPHIR_INIT_VAR(&mergedPaths);
- zephir_fast_array_merge(&mergedPaths, &defaultPaths, &processedPaths);
- } else {
- ZEPHIR_CPY_WRT(&mergedPaths, &defaultPaths);
+ zephir_throw_exception_debug(&_1$$5, "phalcon/Assets/Asset.zep", 135);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- } else {
- ZEPHIR_CPY_WRT(&mergedPaths, paths);
}
- ZEPHIR_INIT_VAR(&route);
- object_init_ex(&route, phalcon_mvc_router_route_ce);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_2);
- ZEPHIR_CONCAT_VV(&_2, &_1, &pattern);
- ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 117, &_2, &mergedPaths, httpMethods);
- zephir_check_call_status();
- zephir_update_property_array_append(this_ptr, SL("routes"), &route);
- ZEPHIR_CALL_METHOD(NULL, &route, "setgroup", NULL, 496, this_ptr);
- zephir_check_call_status();
- RETURN_CCTOR(&route);
-}
-
-zend_object *zephir_init_properties_Phalcon_Mvc_Router_Group(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_MM_GROW();
-
- {
- 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("routes"), 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("routes"), &_1$$3);
- }
+ ZEPHIR_INIT_VAR(&content);
+ zephir_file_get_contents(&content, &completePath);
+ if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&content))) {
+ ZEPHIR_INIT_VAR(&_3$$6);
+ object_init_ex(&_3$$6, phalcon_assets_exception_ce);
+ ZEPHIR_INIT_VAR(&_4$$6);
+ ZEPHIR_CONCAT_SVS(&_4$$6, "Asset's content for '", &completePath, "' cannot be read");
+ ZEPHIR_CALL_METHOD(NULL, &_3$$6, "__construct", NULL, 8, &_4$$6);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_3$$6, "phalcon/Assets/Asset.zep", 148);
ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
+ return;
}
+ RETURN_CCTOR(&content);
}
+static PHP_METHOD(Phalcon_Assets_Asset, getRealSourcePath)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *basePath_param = NULL, sourcePath, _0, _1$$4;
+ zval basePath;
+ zval *this_ptr = getThis();
-
-
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&basePath);
+ ZVAL_UNDEF(&sourcePath);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(basePath)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &basePath_param);
+ if (!basePath_param) {
+ ZEPHIR_INIT_VAR(&basePath);
+ } else {
+ zephir_get_strval(&basePath, basePath_param);
+ }
-
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router_GroupInterface)
-{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Mvc\\Router, GroupInterface, phalcon, mvc_router_groupinterface, phalcon_mvc_router_groupinterface_method_entry);
-
- return SUCCESS;
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("sourcePath"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&sourcePath, &_0);
+ if (ZEPHIR_IS_EMPTY(&sourcePath)) {
+ ZEPHIR_OBS_NVAR(&sourcePath);
+ zephir_read_property(&sourcePath, this_ptr, ZEND_STRL("path"), PH_NOISY_CC);
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("local"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_is_true(&_0)) {
+ ZEPHIR_INIT_VAR(&_1$$4);
+ ZEPHIR_CONCAT_VV(&_1$$4, &basePath, &sourcePath);
+ ZEPHIR_RETURN_CALL_FUNCTION("realpath", NULL, 94, &_1$$4);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ RETURN_CCTOR(&sourcePath);
}
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, add);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, addConnect);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, addDelete);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, addGet);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, addHead);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, addOptions);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, addPatch);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, addPost);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, addPurge);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, addPut);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, addTrace);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, beforeMatch);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, clear);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, getBeforeMatch);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, getHostname);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, getPaths);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, getPrefix);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, getRoutes);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, setHostname);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, setPaths);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_GroupInterface, setPrefix);
-
-
+static PHP_METHOD(Phalcon_Assets_Asset, getRealTargetPath)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *basePath_param = NULL, targetPath, completePath, _0;
+ zval basePath;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&basePath);
+ ZVAL_UNDEF(&targetPath);
+ ZVAL_UNDEF(&completePath);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(basePath)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &basePath_param);
+ if (!basePath_param) {
+ ZEPHIR_INIT_VAR(&basePath);
+ } else {
+ zephir_get_strval(&basePath, basePath_param);
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("targetPath"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&targetPath, &_0);
+ if (ZEPHIR_IS_EMPTY(&targetPath)) {
+ ZEPHIR_OBS_NVAR(&targetPath);
+ zephir_read_property(&targetPath, this_ptr, ZEND_STRL("path"), PH_NOISY_CC);
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("local"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_is_true(&_0)) {
+ ZEPHIR_INIT_VAR(&completePath);
+ ZEPHIR_CONCAT_VV(&completePath, &basePath, &targetPath);
+ if ((zephir_file_exists(&completePath) == SUCCESS)) {
+ ZEPHIR_RETURN_CALL_FUNCTION("realpath", NULL, 94, &completePath);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ RETURN_CCTOR(&completePath);
+ }
+ RETURN_CCTOR(&targetPath);
+}
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router_Route)
+static PHP_METHOD(Phalcon_Assets_Asset, getRealTargetUri)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Mvc\\Router, Route, phalcon, mvc_router_route, phalcon_mvc_router_route_method_entry, 0);
+ zend_bool _1;
+ zval modificationTime, targetUri, version, _0, _2, _3$$4, _4$$4, _5$$5;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
- zend_declare_property_null(phalcon_mvc_router_route_ce, SL("beforeMatch"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_route_ce, SL("compiledPattern"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_route_ce, SL("converters"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_route_ce, SL("group"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_route_ce, SL("hostname"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_route_ce, SL("id"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_route_ce, SL("methods"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_route_ce, SL("match"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_route_ce, SL("name"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_route_ce, SL("paths"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_router_route_ce, SL("pattern"), ZEND_ACC_PROTECTED);
- zend_declare_property_long(phalcon_mvc_router_route_ce, SL("uniqueId"), 0, ZEND_ACC_PROTECTED|ZEND_ACC_STATIC);
- phalcon_mvc_router_route_ce->create_object = zephir_init_properties_Phalcon_Mvc_Router_Route;
+ ZVAL_UNDEF(&modificationTime);
+ ZVAL_UNDEF(&targetUri);
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$5);
- zend_class_implements(phalcon_mvc_router_route_ce, 1, phalcon_mvc_router_routeinterface_ce);
- return SUCCESS;
+
+ ZEPHIR_MM_GROW();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("targetUri"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&targetUri, &_0);
+ if (ZEPHIR_IS_EMPTY(&targetUri)) {
+ ZEPHIR_OBS_NVAR(&targetUri);
+ zephir_read_property(&targetUri, this_ptr, ZEND_STRL("path"), PH_NOISY_CC);
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("version"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&version, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("autoVersion"), PH_NOISY_CC | PH_READONLY);
+ _1 = zephir_is_true(&_0);
+ if (_1) {
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("local"), PH_NOISY_CC | PH_READONLY);
+ _1 = zephir_is_true(&_2);
+ }
+ if (_1) {
+ ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "getrealsourcepath", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&modificationTime);
+ zephir_filemtime(&modificationTime, &_3$$4);
+ ZEPHIR_INIT_VAR(&_4$$4);
+ if (zephir_is_true(&version)) {
+ ZEPHIR_INIT_NVAR(&_4$$4);
+ ZEPHIR_CONCAT_VSV(&_4$$4, &version, ".", &modificationTime);
+ } else {
+ ZEPHIR_CPY_WRT(&_4$$4, &modificationTime);
+ }
+ ZEPHIR_CPY_WRT(&version, &_4$$4);
+ }
+ if (zephir_is_true(&version)) {
+ ZEPHIR_INIT_VAR(&_5$$5);
+ ZEPHIR_CONCAT_VSV(&_5$$5, &targetUri, "?ver=", &version);
+ ZEPHIR_CPY_WRT(&targetUri, &_5$$5);
+ }
+ RETURN_CCTOR(&targetUri);
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, getId)
+static PHP_METHOD(Phalcon_Assets_Asset, isAutoVersion)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "id");
+ RETURN_MEMBER(getThis(), "autoVersion");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, __construct)
+static PHP_METHOD(Phalcon_Assets_Asset, setAttributes)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *pattern_param = NULL, *paths = NULL, paths_sub, *httpMethods = NULL, httpMethods_sub, __$null, routeId, uniqueId, _0;
- zval pattern;
+ zval *attributes_param = NULL;
+ zval attributes;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&paths_sub);
- ZVAL_UNDEF(&httpMethods_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&routeId);
- ZVAL_UNDEF(&uniqueId);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&attributes);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(pattern)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
- Z_PARAM_ZVAL_OR_NULL(httpMethods)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(attributes)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &httpMethods);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
- } else {
- ZEPHIR_INIT_VAR(&pattern);
- }
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
- }
- if (!httpMethods) {
- httpMethods = &httpMethods_sub;
- httpMethods = &__$null;
- }
+ zephir_fetch_params(1, 1, 0, &attributes_param);
+ zephir_get_arrval(&attributes, attributes_param);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "reconfigure", NULL, 0, &pattern, paths);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "via", NULL, 0, httpMethods);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(&_0);
- zephir_read_static_property_ce(&_0, phalcon_mvc_router_route_ce, SL("uniqueId"), PH_NOISY_CC);
- ZEPHIR_CPY_WRT(&uniqueId, &_0);
- ZEPHIR_CPY_WRT(&routeId, &uniqueId);
- zephir_update_property_zval(this_ptr, ZEND_STRL("id"), &routeId);
- ZEPHIR_INIT_ZVAL_NREF(_0);
- ZVAL_LONG(&_0, (zephir_get_numberval(&uniqueId) + 1));
- zephir_update_static_property_ce(phalcon_mvc_router_route_ce, ZEND_STRL("uniqueId"), &_0);
- ZEPHIR_MM_RESTORE();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &attributes);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, beforeMatch)
+static PHP_METHOD(Phalcon_Assets_Asset, setFilter)
{
- zval *callback, callback_sub;
+ zval *filter_param = NULL, __$true, __$false;
+ zend_bool filter;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&callback_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(callback)
+ Z_PARAM_BOOL(filter)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(1, 0, &callback);
+ zephir_fetch_params_without_memory_grow(1, 0, &filter_param);
+ filter = zephir_get_boolval(filter_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("beforeMatch"), callback);
+ if (filter) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filter"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filter"), &__$false);
+ }
RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, compilePattern)
+static PHP_METHOD(Phalcon_Assets_Asset, setLocal)
{
- zend_bool _14;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *pattern_param = NULL, _0$$4, _1$$4, _2$$5, _3$$5, _4$$6, _5$$6, _6$$7, _7$$7, _8$$8, _9$$8, _10$$8, _11$$9, _12$$9, _13$$9;
- zval pattern, idPattern;
+ zval *local_param = NULL, __$true, __$false;
+ zend_bool local;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&idPattern);
- ZVAL_UNDEF(&_0$$4);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$5);
- ZVAL_UNDEF(&_3$$5);
- ZVAL_UNDEF(&_4$$6);
- ZVAL_UNDEF(&_5$$6);
- ZVAL_UNDEF(&_6$$7);
- ZVAL_UNDEF(&_7$$7);
- ZVAL_UNDEF(&_8$$8);
- ZVAL_UNDEF(&_9$$8);
- ZVAL_UNDEF(&_10$$8);
- ZVAL_UNDEF(&_11$$9);
- ZVAL_UNDEF(&_12$$9);
- ZVAL_UNDEF(&_13$$9);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(pattern)
+ Z_PARAM_BOOL(local)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &pattern_param);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
- } else {
- ZEPHIR_INIT_VAR(&pattern);
- }
+ zephir_fetch_params_without_memory_grow(1, 0, &local_param);
+ local = zephir_get_boolval(local_param);
- if (zephir_memnstr_str(&pattern, SL(":"), "phalcon/Mvc/Router/Route.zep", 141)) {
- ZEPHIR_INIT_VAR(&idPattern);
- ZVAL_STRING(&idPattern, "/([\\w0-9\\_\\-]+)");
- if (zephir_memnstr_str(&pattern, SL("/:module"), "phalcon/Mvc/Router/Route.zep", 146)) {
- ZEPHIR_INIT_VAR(&_0$$4);
- ZEPHIR_INIT_VAR(&_1$$4);
- ZVAL_STRING(&_1$$4, "/:module");
- zephir_fast_str_replace(&_0$$4, &_1$$4, &idPattern, &pattern);
- zephir_get_strval(&pattern, &_0$$4);
- }
- if (zephir_memnstr_str(&pattern, SL("/:controller"), "phalcon/Mvc/Router/Route.zep", 151)) {
- ZEPHIR_INIT_VAR(&_2$$5);
- ZEPHIR_INIT_VAR(&_3$$5);
- ZVAL_STRING(&_3$$5, "/:controller");
- zephir_fast_str_replace(&_2$$5, &_3$$5, &idPattern, &pattern);
- zephir_get_strval(&pattern, &_2$$5);
- }
- if (zephir_memnstr_str(&pattern, SL("/:namespace"), "phalcon/Mvc/Router/Route.zep", 156)) {
- ZEPHIR_INIT_VAR(&_4$$6);
- ZEPHIR_INIT_VAR(&_5$$6);
- ZVAL_STRING(&_5$$6, "/:namespace");
- zephir_fast_str_replace(&_4$$6, &_5$$6, &idPattern, &pattern);
- zephir_get_strval(&pattern, &_4$$6);
- }
- if (zephir_memnstr_str(&pattern, SL("/:action"), "phalcon/Mvc/Router/Route.zep", 161)) {
- ZEPHIR_INIT_VAR(&_6$$7);
- ZEPHIR_INIT_VAR(&_7$$7);
- ZVAL_STRING(&_7$$7, "/:action");
- zephir_fast_str_replace(&_6$$7, &_7$$7, &idPattern, &pattern);
- zephir_get_strval(&pattern, &_6$$7);
- }
- if (zephir_memnstr_str(&pattern, SL("/:params"), "phalcon/Mvc/Router/Route.zep", 166)) {
- ZEPHIR_INIT_VAR(&_8$$8);
- ZEPHIR_INIT_VAR(&_9$$8);
- ZVAL_STRING(&_9$$8, "/:params");
- ZEPHIR_INIT_VAR(&_10$$8);
- ZVAL_STRING(&_10$$8, "(/.*)*");
- zephir_fast_str_replace(&_8$$8, &_9$$8, &_10$$8, &pattern);
- zephir_get_strval(&pattern, &_8$$8);
- }
- if (zephir_memnstr_str(&pattern, SL("/:int"), "phalcon/Mvc/Router/Route.zep", 171)) {
- ZEPHIR_INIT_VAR(&_11$$9);
- ZEPHIR_INIT_VAR(&_12$$9);
- ZVAL_STRING(&_12$$9, "/:int");
- ZEPHIR_INIT_VAR(&_13$$9);
- ZVAL_STRING(&_13$$9, "/([0-9]+)");
- zephir_fast_str_replace(&_11$$9, &_12$$9, &_13$$9, &pattern);
- zephir_get_strval(&pattern, &_11$$9);
- }
- }
- _14 = zephir_memnstr_str(&pattern, SL("("), "phalcon/Mvc/Router/Route.zep", 182);
- if (!(_14)) {
- _14 = zephir_memnstr_str(&pattern, SL("["), "phalcon/Mvc/Router/Route.zep", 182);
- }
- if (_14) {
- ZEPHIR_CONCAT_SVS(return_value, "#^", &pattern, "$#u");
- RETURN_MM();
+ if (local) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("local"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("local"), &__$false);
}
- RETURN_CTOR(&pattern);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, convert)
+static PHP_METHOD(Phalcon_Assets_Asset, setSourcePath)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, *converter, converter_sub;
- zval name;
+ zval *sourcePath_param = NULL;
+ zval sourcePath;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&converter_sub);
+ ZVAL_UNDEF(&sourcePath);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(name)
- Z_PARAM_ZVAL(converter)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(sourcePath)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &name_param, &converter);
- 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_fetch_params(1, 1, 0, &sourcePath_param);
+ zephir_get_strval(&sourcePath, sourcePath_param);
- zephir_update_property_array(this_ptr, SL("converters"), &name, converter);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("sourcePath"), &sourcePath);
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, extractNamedParams)
+static PHP_METHOD(Phalcon_Assets_Asset, setTargetPath)
{
- long _0, _5$$10, _26$$18;
- zend_long cursor = 0, cursorVar = 0, marker = 0, bracketCount, parenthesesCount, foundPattern, intermediate, numberMatches;
- zend_bool notValid = 0, _6$$11, _7$$11, _8$$11, _9$$11, _10$$11, _11$$11, _12$$11, _13$$11, _14$$11, _15$$11, _16$$11, _17$$11, _25$$17, _29$$34, _30$$35, _31$$35, _32$$35;
- char ch = 0, prevCh;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *pattern_param = NULL, tmp, matches, _1$$10, _2$$10, _3$$10, _18$$15, _19$$15, _20$$15, _22$$15, _23$$15;
- zval pattern, route, item, variable, regexp, _4$$10, _21$$15, _24$$15, _27$$25, _28$$28;
+ zval *targetPath_param = NULL;
+ zval targetPath;
zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&route);
- ZVAL_UNDEF(&item);
- ZVAL_UNDEF(&variable);
- ZVAL_UNDEF(®exp);
- ZVAL_UNDEF(&_4$$10);
- ZVAL_UNDEF(&_21$$15);
- ZVAL_UNDEF(&_24$$15);
- ZVAL_UNDEF(&_27$$25);
- ZVAL_UNDEF(&_28$$28);
- ZVAL_UNDEF(&tmp);
- ZVAL_UNDEF(&matches);
- ZVAL_UNDEF(&_1$$10);
- ZVAL_UNDEF(&_2$$10);
- ZVAL_UNDEF(&_3$$10);
- ZVAL_UNDEF(&_18$$15);
- ZVAL_UNDEF(&_19$$15);
- ZVAL_UNDEF(&_20$$15);
- ZVAL_UNDEF(&_22$$15);
- ZVAL_UNDEF(&_23$$15);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(pattern)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &pattern_param);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
- } else {
- ZEPHIR_INIT_VAR(&pattern);
- }
-
-
- prevCh = '\0';
- bracketCount = 0;
- parenthesesCount = 0;
- foundPattern = 0;
- intermediate = 0;
- numberMatches = 0;
- if (zephir_fast_strlen_ev(&pattern) == 0) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_INIT_VAR(&matches);
- array_init(&matches);
- ZEPHIR_INIT_VAR(&route);
- for (_0 = 0; _0 < Z_STRLEN_P(&pattern); _0++) {
- cursor = _0;
- ch = ZEPHIR_STRING_OFFSET(&pattern, _0);
- if (parenthesesCount == 0) {
- if (ch == '{') {
- if (bracketCount == 0) {
- marker = (cursor + 1);
- intermediate = 0;
- notValid = 0;
- }
- bracketCount++;
- } else if (ch == '}') {
- bracketCount--;
- if (intermediate > 0) {
- if (bracketCount == 0) {
- numberMatches++;
- ZEPHIR_INIT_NVAR(&variable);
- ZEPHIR_INIT_NVAR(®exp);
- ZVAL_LONG(&_1$$10, marker);
- ZVAL_LONG(&_2$$10, (cursor - marker));
- ZEPHIR_INIT_NVAR(&_3$$10);
- zephir_substr(&_3$$10, &pattern, zephir_get_intval(&_1$$10), zephir_get_intval(&_2$$10), 0);
- zephir_cast_to_string(&_4$$10, &_3$$10);
- ZEPHIR_CPY_WRT(&item, &_4$$10);
- for (_5$$10 = 0; _5$$10 < Z_STRLEN_P(&item); _5$$10++) {
- cursorVar = _5$$10;
- ch = ZEPHIR_STRING_OFFSET(&item, _5$$10);
- if (ch == '\0') {
- break;
- }
- _6$$11 = cursorVar == 0;
- if (_6$$11) {
- _7$$11 = ch >= 'a';
- if (_7$$11) {
- _7$$11 = ch <= 'z';
- }
- _8$$11 = _7$$11;
- if (!(_8$$11)) {
- _9$$11 = ch >= 'A';
- if (_9$$11) {
- _9$$11 = ch <= 'Z';
- }
- _8$$11 = _9$$11;
- }
- _6$$11 = !(_8$$11);
- }
- if (_6$$11) {
- notValid = 1;
- break;
- }
- _10$$11 = ch >= 'a';
- if (_10$$11) {
- _10$$11 = ch <= 'z';
- }
- _11$$11 = _10$$11;
- if (!(_11$$11)) {
- _12$$11 = ch >= 'A';
- if (_12$$11) {
- _12$$11 = ch <= 'Z';
- }
- _11$$11 = _12$$11;
- }
- _13$$11 = _11$$11;
- if (!(_13$$11)) {
- _14$$11 = ch >= '0';
- if (_14$$11) {
- _14$$11 = ch <= '9';
- }
- _13$$11 = _14$$11;
- }
- _15$$11 = _13$$11;
- if (!(_15$$11)) {
- _15$$11 = ch == '-';
- }
- _16$$11 = _15$$11;
- if (!(_16$$11)) {
- _16$$11 = ch == '_';
- }
- _17$$11 = _16$$11;
- if (!(_17$$11)) {
- _17$$11 = ch == ':';
- }
- if (_17$$11) {
- if (ch == ':') {
- ZVAL_LONG(&_18$$15, 0);
- ZVAL_LONG(&_19$$15, cursorVar);
- ZEPHIR_INIT_NVAR(&_20$$15);
- zephir_substr(&_20$$15, &item, 0 , zephir_get_intval(&_19$$15), 0);
- zephir_cast_to_string(&_21$$15, &_20$$15);
- ZEPHIR_CPY_WRT(&variable, &_21$$15);
- ZVAL_LONG(&_22$$15, (cursorVar + 1));
- ZEPHIR_INIT_NVAR(&_23$$15);
- zephir_substr(&_23$$15, &item, zephir_get_intval(&_22$$15), 0, ZEPHIR_SUBSTR_NO_LENGTH);
- zephir_cast_to_string(&_24$$15, &_23$$15);
- ZEPHIR_CPY_WRT(®exp, &_24$$15);
- break;
- }
- } else {
- notValid = 1;
- break;
- }
- }
- if (!(notValid)) {
- ZEPHIR_INIT_NVAR(&tmp);
- ZVAL_LONG(&tmp, numberMatches);
- _25$$17 = zephir_is_true(&variable);
- if (_25$$17) {
- _25$$17 = zephir_is_true(®exp);
- }
- if (_25$$17) {
- foundPattern = 0;
- for (_26$$18 = 0; _26$$18 < Z_STRLEN_P(®exp); _26$$18++) {
- ch = ZEPHIR_STRING_OFFSET(®exp, _26$$18);
- if (ch == '\0') {
- break;
- }
- if (!(foundPattern)) {
- if (ch == '(') {
- foundPattern = 1;
- }
- } else {
- if (ch == ')') {
- foundPattern = 2;
- break;
- }
- }
- }
- if (foundPattern != 2) {
- ZEPHIR_INIT_NVAR(&_27$$25);
- ZEPHIR_CONCAT_SVS(&_27$$25, "(", ®exp, ")");
- zephir_concat_self(&route, &_27$$25);
- } else {
- zephir_concat_self(&route, ®exp);
- }
- zephir_array_update_zval(&matches, &variable, &tmp, PH_COPY | PH_SEPARATE);
- } else {
- zephir_concat_self_str(&route, "([^/]*)", sizeof("([^/]*)") - 1);
- zephir_array_update_zval(&matches, &item, &tmp, PH_COPY | PH_SEPARATE);
- }
- } else {
- ZEPHIR_INIT_NVAR(&_28$$28);
- ZEPHIR_CONCAT_SVS(&_28$$28, "{", &item, "}");
- zephir_concat_self(&route, &_28$$28);
- }
- continue;
- }
- }
- }
- }
- if (bracketCount == 0) {
- if (ch == '(') {
- parenthesesCount++;
- } else if (ch == ')') {
- parenthesesCount--;
- if (parenthesesCount == 0) {
- numberMatches++;
- }
- }
- }
- if (bracketCount > 0) {
- intermediate++;
- } else {
- _29$$34 = parenthesesCount == 0;
- if (_29$$34) {
- _29$$34 = prevCh != '\\';
- }
- if (_29$$34) {
- _30$$35 = ch == '.';
- if (!(_30$$35)) {
- _30$$35 = ch == '+';
- }
- _31$$35 = _30$$35;
- if (!(_31$$35)) {
- _31$$35 = ch == '|';
- }
- _32$$35 = _31$$35;
- if (!(_32$$35)) {
- _32$$35 = ch == '#';
- }
- if (_32$$35) {
- zephir_concat_self_str(&route, "\\", sizeof("\\") - 1);
- }
- }
- zephir_concat_self_char(&route, ch);
- prevCh = ch;
- }
- }
- zephir_create_array(return_value, 2, 0);
- zephir_array_fast_append(return_value, &route);
- zephir_array_fast_append(return_value, &matches);
- RETURN_MM();
+
+ ZVAL_UNDEF(&targetPath);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(targetPath)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &targetPath_param);
+ zephir_get_strval(&targetPath, targetPath_param);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("targetPath"), &targetPath);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, getBeforeMatch)
+static PHP_METHOD(Phalcon_Assets_Asset, setTargetUri)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *targetUri_param = NULL;
+ zval targetUri;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&targetUri);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(targetUri)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
- RETURN_MEMBER(getThis(), "beforeMatch");
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &targetUri_param);
+ zephir_get_strval(&targetUri, targetUri_param);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("targetUri"), &targetUri);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, getCompiledPattern)
+static PHP_METHOD(Phalcon_Assets_Asset, setType)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *type_param = NULL;
+ zval type;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&type);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(type)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &type_param);
+ zephir_get_strval(&type, type_param);
- RETURN_MEMBER(getThis(), "compiledPattern");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &type);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, getConverters)
+static PHP_METHOD(Phalcon_Assets_Asset, setPath)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *path_param = NULL;
+ zval path;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&path);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(path)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &path_param);
+ zephir_get_strval(&path, path_param);
- RETURN_MEMBER(getThis(), "converters");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("path"), &path);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, getGroup)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Assets_AssetInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Assets, AssetInterface, phalcon, assets_assetinterface, phalcon_assets_assetinterface_method_entry);
+
+ return SUCCESS;
+}
+
+ZEPHIR_DOC_METHOD(Phalcon_Assets_AssetInterface, getAssetKey);
+ZEPHIR_DOC_METHOD(Phalcon_Assets_AssetInterface, getAttributes);
+ZEPHIR_DOC_METHOD(Phalcon_Assets_AssetInterface, getFilter);
+ZEPHIR_DOC_METHOD(Phalcon_Assets_AssetInterface, getType);
+ZEPHIR_DOC_METHOD(Phalcon_Assets_AssetInterface, setAttributes);
+ZEPHIR_DOC_METHOD(Phalcon_Assets_AssetInterface, setFilter);
+ZEPHIR_DOC_METHOD(Phalcon_Assets_AssetInterface, setType);
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Assets_Collection)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Assets, Collection, phalcon, assets_collection, phalcon_assets_collection_method_entry, 0);
+
+ zend_declare_property_null(phalcon_assets_collection_ce, SL("assets"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_collection_ce, SL("attributes"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_assets_collection_ce, SL("autoVersion"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_collection_ce, SL("codes"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_collection_ce, SL("filters"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_collection_ce, SL("includedAssets"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_assets_collection_ce, SL("join"), 1, ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_assets_collection_ce, SL("local"), 1, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_collection_ce, SL("prefix"), ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_assets_collection_ce, SL("position"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_collection_ce, SL("sourcePath"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_assets_collection_ce, SL("targetLocal"), 1, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_collection_ce, SL("targetPath"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_collection_ce, SL("targetUri"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_collection_ce, SL("version"), ZEND_ACC_PROTECTED);
+ phalcon_assets_collection_ce->create_object = zephir_init_properties_Phalcon_Assets_Collection;
+
+ zend_class_implements(phalcon_assets_collection_ce, 1, zend_ce_countable);
+ zend_class_implements(phalcon_assets_collection_ce, 1, zend_ce_iterator);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Assets_Collection, getAssets)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "group");
+ RETURN_MEMBER(getThis(), "assets");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, getHttpMethods)
+static PHP_METHOD(Phalcon_Assets_Collection, getAttributes)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "methods");
+ RETURN_MEMBER(getThis(), "attributes");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, getHostname)
+static PHP_METHOD(Phalcon_Assets_Collection, setAutoVersion)
{
+ zval *autoVersion_param = NULL, __$true, __$false;
+ zend_bool autoVersion;
zval *this_ptr = getThis();
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(autoVersion)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
- RETURN_MEMBER(getThis(), "hostname");
+ zephir_fetch_params_without_memory_grow(1, 0, &autoVersion_param);
+ autoVersion = zephir_get_boolval(autoVersion_param);
+
+
+ if (autoVersion) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("autoVersion"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("autoVersion"), &__$false);
+ }
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, getMatch)
+static PHP_METHOD(Phalcon_Assets_Collection, getCodes)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "match");
+ RETURN_MEMBER(getThis(), "codes");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, getName)
+static PHP_METHOD(Phalcon_Assets_Collection, getFilters)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "name");
+ RETURN_MEMBER(getThis(), "filters");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, getPaths)
+static PHP_METHOD(Phalcon_Assets_Collection, getJoin)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "paths");
+ RETURN_MEMBER(getThis(), "join");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, getPattern)
+static PHP_METHOD(Phalcon_Assets_Collection, getLocal)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "pattern");
+ RETURN_MEMBER(getThis(), "local");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, getReversedPaths)
+static PHP_METHOD(Phalcon_Assets_Collection, getPrefix)
{
- zval _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
- ZEPHIR_MM_GROW();
+ RETURN_MEMBER(getThis(), "prefix");
+}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("paths"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_FUNCTION("array_flip", NULL, 174, &_0);
- zephir_check_call_status();
- RETURN_MM();
+static PHP_METHOD(Phalcon_Assets_Collection, getPosition)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "position");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, getRouteId)
+static PHP_METHOD(Phalcon_Assets_Collection, getSourcePath)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "id");
+ RETURN_MEMBER(getThis(), "sourcePath");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, getRoutePaths)
+static PHP_METHOD(Phalcon_Assets_Collection, getTargetLocal)
{
- zend_long _0$$4;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *paths = NULL, paths_sub, __$null, moduleName, controllerName, actionName, parts, routePaths, realClassName, namespaceName, _1$$9;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&paths_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&moduleName);
- ZVAL_UNDEF(&controllerName);
- ZVAL_UNDEF(&actionName);
- ZVAL_UNDEF(&parts);
- ZVAL_UNDEF(&routePaths);
- ZVAL_UNDEF(&realClassName);
- ZVAL_UNDEF(&namespaceName);
- ZVAL_UNDEF(&_1$$9);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
- ZEND_PARSE_PARAMETERS_END();
-#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &paths);
- if (!paths) {
- paths = &paths_sub;
- ZEPHIR_CPY_WRT(paths, &__$null);
- } else {
- ZEPHIR_SEPARATE_PARAM(paths);
- }
+ RETURN_MEMBER(getThis(), "targetLocal");
+}
+static PHP_METHOD(Phalcon_Assets_Collection, getTargetPath)
+{
+ zval *this_ptr = getThis();
- if (Z_TYPE_P(paths) == IS_NULL) {
- ZEPHIR_INIT_NVAR(paths);
- array_init(paths);
- }
- if (Z_TYPE_P(paths) == IS_STRING) {
- ZEPHIR_INIT_VAR(&moduleName);
- ZVAL_NULL(&moduleName);
- ZEPHIR_INIT_VAR(&controllerName);
- ZVAL_NULL(&controllerName);
- ZEPHIR_INIT_VAR(&actionName);
- ZVAL_NULL(&actionName);
- ZEPHIR_INIT_VAR(&parts);
- zephir_fast_explode_str(&parts, SL("::"), paths, LONG_MAX);
- do {
- _0$$4 = zephir_fast_count_int(&parts);
- if (_0$$4 == 3) {
- ZEPHIR_OBS_NVAR(&moduleName);
- zephir_array_fetch_long(&moduleName, &parts, 0, PH_NOISY, "phalcon/Mvc/Router/Route.zep", 459);
- ZEPHIR_OBS_NVAR(&controllerName);
- zephir_array_fetch_long(&controllerName, &parts, 1, PH_NOISY, "phalcon/Mvc/Router/Route.zep", 460);
- ZEPHIR_OBS_NVAR(&actionName);
- zephir_array_fetch_long(&actionName, &parts, 2, PH_NOISY, "phalcon/Mvc/Router/Route.zep", 461);
- break;
- }
- if (_0$$4 == 2) {
- ZEPHIR_OBS_NVAR(&controllerName);
- zephir_array_fetch_long(&controllerName, &parts, 0, PH_NOISY, "phalcon/Mvc/Router/Route.zep", 465);
- ZEPHIR_OBS_NVAR(&actionName);
- zephir_array_fetch_long(&actionName, &parts, 1, PH_NOISY, "phalcon/Mvc/Router/Route.zep", 466);
- break;
- }
- if (_0$$4 == 1) {
- ZEPHIR_OBS_NVAR(&controllerName);
- zephir_array_fetch_long(&controllerName, &parts, 0, PH_NOISY, "phalcon/Mvc/Router/Route.zep", 470);
- break;
- }
- } while(0);
- ZEPHIR_INIT_VAR(&routePaths);
- array_init(&routePaths);
- if (Z_TYPE_P(&moduleName) != IS_NULL) {
- zephir_array_update_string(&routePaths, SL("module"), &moduleName, PH_COPY | PH_SEPARATE);
- }
- if (Z_TYPE_P(&controllerName) != IS_NULL) {
- if (zephir_memnstr_str(&controllerName, SL("\\"), "phalcon/Mvc/Router/Route.zep", 484)) {
- ZEPHIR_INIT_VAR(&realClassName);
- zephir_get_class_ns(&realClassName, &controllerName, 0);
- ZEPHIR_INIT_VAR(&namespaceName);
- zephir_get_ns_class(&namespaceName, &controllerName, 0);
- if (zephir_is_true(&namespaceName)) {
- zephir_array_update_string(&routePaths, SL("namespace"), &namespaceName, PH_COPY | PH_SEPARATE);
- }
- } else {
- ZEPHIR_CPY_WRT(&realClassName, &controllerName);
- }
- ZEPHIR_INIT_VAR(&_1$$9);
- zephir_uncamelize(&_1$$9, &realClassName, NULL );
- zephir_array_update_string(&routePaths, SL("controller"), &_1$$9, PH_COPY | PH_SEPARATE);
- }
- if (Z_TYPE_P(&actionName) != IS_NULL) {
- zephir_array_update_string(&routePaths, SL("action"), &actionName, PH_COPY | PH_SEPARATE);
- }
- } else {
- ZEPHIR_CPY_WRT(&routePaths, paths);
- }
- if (UNEXPECTED(Z_TYPE_P(&routePaths) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "The route contains invalid paths", "phalcon/Mvc/Router/Route.zep", 512);
- return;
- }
- RETURN_CCTOR(&routePaths);
+
+ RETURN_MEMBER(getThis(), "targetPath");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, match)
+static PHP_METHOD(Phalcon_Assets_Collection, getTargetUri)
{
- zval *callback, callback_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&callback_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(callback)
- ZEND_PARSE_PARAMETERS_END();
-#endif
- zephir_fetch_params_without_memory_grow(1, 0, &callback);
+ RETURN_MEMBER(getThis(), "targetUri");
+}
+
+static PHP_METHOD(Phalcon_Assets_Collection, getVersion)
+{
+ zval *this_ptr = getThis();
- zephir_update_property_zval(this_ptr, ZEND_STRL("match"), callback);
- RETURN_THISW();
+
+ RETURN_MEMBER(getThis(), "version");
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, reConfigure)
+static PHP_METHOD(Phalcon_Assets_Collection, setVersion)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, routePaths, pcrePattern, compiledPattern, extracted, _0$$4, _1$$4;
- zval pattern;
+ zval *version_param = NULL;
+ zval version;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&paths_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&routePaths);
- ZVAL_UNDEF(&pcrePattern);
- ZVAL_UNDEF(&compiledPattern);
- ZVAL_UNDEF(&extracted);
- ZVAL_UNDEF(&_0$$4);
- ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&version);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(pattern)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(paths)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(version)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &pattern_param, &paths);
- if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) {
- zephir_get_strval(&pattern, pattern_param);
- } else {
- ZEPHIR_INIT_VAR(&pattern);
- }
- if (!paths) {
- paths = &paths_sub;
- paths = &__$null;
- }
+ zephir_fetch_params(1, 1, 0, &version_param);
+ zephir_get_strval(&version, version_param);
- ZEPHIR_CALL_SELF(&routePaths, "getroutepaths", NULL, 0, paths);
- zephir_check_call_status();
- if (!(zephir_start_with_str(&pattern, SL("#")))) {
- if (zephir_memnstr_str(&pattern, SL("{"), "phalcon/Mvc/Router/Route.zep", 552)) {
- ZEPHIR_CALL_METHOD(&extracted, this_ptr, "extractnamedparams", NULL, 0, &pattern);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(&pcrePattern);
- zephir_array_fetch_long(&pcrePattern, &extracted, 0, PH_NOISY, "phalcon/Mvc/Router/Route.zep", 557);
- ZEPHIR_INIT_VAR(&_0$$4);
- zephir_array_fetch_long(&_1$$4, &extracted, 1, PH_NOISY | PH_READONLY, "phalcon/Mvc/Router/Route.zep", 558);
- zephir_fast_array_merge(&_0$$4, &routePaths, &_1$$4);
- ZEPHIR_CPY_WRT(&routePaths, &_0$$4);
- } else {
- ZEPHIR_CPY_WRT(&pcrePattern, &pattern);
- }
- ZEPHIR_CALL_METHOD(&compiledPattern, this_ptr, "compilepattern", NULL, 0, &pcrePattern);
- zephir_check_call_status();
- } else {
- ZEPHIR_CPY_WRT(&compiledPattern, &pattern);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("pattern"), &pattern);
- zephir_update_property_zval(this_ptr, ZEND_STRL("compiledPattern"), &compiledPattern);
- zephir_update_property_zval(this_ptr, ZEND_STRL("paths"), &routePaths);
- ZEPHIR_MM_RESTORE();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("version"), &version);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, reset)
+static PHP_METHOD(Phalcon_Assets_Collection, __construct)
{
zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zval *this_ptr = getThis();
ZVAL_UNDEF(&_0);
+ ZEPHIR_MM_GROW();
- ZEPHIR_INIT_ZVAL_NREF(_0);
- ZVAL_LONG(&_0, 0);
- zephir_update_static_property_ce(phalcon_mvc_router_route_ce, ZEND_STRL("uniqueId"), &_0);
+ ZEPHIR_INIT_VAR(&_0);
+ array_init(&_0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("includedAssets"), &_0);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, setGroup)
+static PHP_METHOD(Phalcon_Assets_Collection, add)
{
- zval *group, group_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *asset, asset_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&group_sub);
+ ZVAL_UNDEF(&asset_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(group, phalcon_mvc_router_groupinterface_ce)
+ Z_PARAM_OBJECT_OF_CLASS(asset, phalcon_assets_assetinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(1, 0, &group);
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &asset);
- zephir_update_property_zval(this_ptr, ZEND_STRL("group"), group);
- RETURN_THISW();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addasset", NULL, 162, asset);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, setHttpMethods)
+static PHP_METHOD(Phalcon_Assets_Collection, addCss)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *httpMethods, httpMethods_sub;
+ zend_bool filter, autoVersion;
+ zval *path_param = NULL, *local = NULL, local_sub, *filter_param = NULL, *attributes = NULL, attributes_sub, *version_param = NULL, *autoVersion_param = NULL, __$null, collectionLocal, collectionAttributes, _0, _1, _2;
+ zval path, version;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&httpMethods_sub);
+ ZVAL_UNDEF(&path);
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&local_sub);
+ ZVAL_UNDEF(&attributes_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&collectionLocal);
+ ZVAL_UNDEF(&collectionAttributes);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(httpMethods)
+ ZEND_PARSE_PARAMETERS_START(1, 6)
+ Z_PARAM_STR(path)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(local)
+ Z_PARAM_BOOL(filter)
+ Z_PARAM_ZVAL_OR_NULL(attributes)
+ Z_PARAM_STR_OR_NULL(version)
+ Z_PARAM_BOOL(autoVersion)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &httpMethods);
+ zephir_fetch_params(1, 1, 5, &path_param, &local, &filter_param, &attributes, &version_param, &autoVersion_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(path_param) == IS_STRING)) {
+ zephir_get_strval(&path, path_param);
+ } else {
+ ZEPHIR_INIT_VAR(&path);
+ }
+ if (!local) {
+ local = &local_sub;
+ local = &__$null;
+ }
+ if (!filter_param) {
+ filter = 1;
+ } else {
+ filter = zephir_get_boolval(filter_param);
+ }
+ if (!attributes) {
+ attributes = &attributes_sub;
+ attributes = &__$null;
+ }
+ if (!version_param) {
+ ZEPHIR_INIT_VAR(&version);
+ } else {
+ zephir_get_strval(&version, version_param);
+ }
+ if (!autoVersion_param) {
+ autoVersion = 0;
+ } else {
+ autoVersion = zephir_get_boolval(autoVersion_param);
+ }
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "via", NULL, 0, httpMethods);
+ if (((Z_TYPE_P(local) == IS_TRUE || Z_TYPE_P(local) == IS_FALSE) == 1)) {
+ ZEPHIR_CPY_WRT(&collectionLocal, local);
+ } else {
+ ZEPHIR_OBS_NVAR(&collectionLocal);
+ zephir_read_property(&collectionLocal, this_ptr, ZEND_STRL("local"), PH_NOISY_CC);
+ }
+ if (Z_TYPE_P(attributes) == IS_ARRAY) {
+ ZEPHIR_CPY_WRT(&collectionAttributes, attributes);
+ } else {
+ ZEPHIR_OBS_NVAR(&collectionAttributes);
+ zephir_read_property(&collectionAttributes, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC);
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, phalcon_assets_asset_css_ce);
+ if (filter) {
+ ZVAL_BOOL(&_1, 1);
+ } else {
+ ZVAL_BOOL(&_1, 0);
+ }
+ if (autoVersion) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 163, &path, &collectionLocal, &_1, &collectionAttributes, &version, &_2);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "add", NULL, 0, &_0);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, setHostname)
+static PHP_METHOD(Phalcon_Assets_Collection, addFilter)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *hostname_param = NULL;
- zval hostname;
+ zval *filter, filter_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&hostname);
+ ZVAL_UNDEF(&filter_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(hostname)
+ Z_PARAM_OBJECT_OF_CLASS(filter, phalcon_assets_filterinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &hostname_param);
- if (UNEXPECTED(Z_TYPE_P(hostname_param) != IS_STRING && Z_TYPE_P(hostname_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'hostname' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(hostname_param) == IS_STRING)) {
- zephir_get_strval(&hostname, hostname_param);
- } else {
- ZEPHIR_INIT_VAR(&hostname);
- }
+ zephir_fetch_params_without_memory_grow(1, 0, &filter);
- zephir_update_property_zval(this_ptr, ZEND_STRL("hostname"), &hostname);
- RETURN_THIS();
+ zephir_update_property_array_append(this_ptr, SL("filters"), filter);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, setName)
+static PHP_METHOD(Phalcon_Assets_Collection, addInline)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL;
- zval name;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *code, code_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&code_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ Z_PARAM_OBJECT_OF_CLASS(code, phalcon_assets_inline_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &name_param);
- zephir_get_strval(&name, name_param);
+ zephir_fetch_params(1, 1, 0, &code);
- zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addasset", NULL, 162, code);
+ zephir_check_call_status();
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_Router_Route, via)
+static PHP_METHOD(Phalcon_Assets_Collection, addInlineCss)
{
- zval *httpMethods, httpMethods_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool filter;
+ zval *content_param = NULL, *filter_param = NULL, *attributes = NULL, attributes_sub, __$null, collectionAttributes, _0, _1;
+ zval content;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&httpMethods_sub);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&attributes_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&collectionAttributes);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(httpMethods)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(content)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(filter)
+ Z_PARAM_ZVAL_OR_NULL(attributes)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(1, 0, &httpMethods);
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &content_param, &filter_param, &attributes);
+ zephir_get_strval(&content, content_param);
+ if (!filter_param) {
+ filter = 1;
+ } else {
+ filter = zephir_get_boolval(filter_param);
+ }
+ if (!attributes) {
+ attributes = &attributes_sub;
+ attributes = &__$null;
+ }
- zephir_update_property_zval(this_ptr, ZEND_STRL("methods"), httpMethods);
- RETURN_THISW();
+ if (Z_TYPE_P(attributes) == IS_ARRAY) {
+ ZEPHIR_CPY_WRT(&collectionAttributes, attributes);
+ } else {
+ ZEPHIR_OBS_NVAR(&collectionAttributes);
+ zephir_read_property(&collectionAttributes, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC);
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, phalcon_assets_inline_css_ce);
+ if (filter) {
+ ZVAL_BOOL(&_1, 1);
+ } else {
+ ZVAL_BOOL(&_1, 0);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 164, &content, &_1, &collectionAttributes);
+ zephir_check_call_status();
+ zephir_update_property_array_append(this_ptr, SL("codes"), &_0);
+ RETURN_THIS();
}
-zend_object *zephir_init_properties_Phalcon_Mvc_Router_Route(zend_class_entry *class_type)
+static PHP_METHOD(Phalcon_Assets_Collection, addInlineJs)
{
- 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(&_1$$3);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_5$$5);
-
-
- ZEPHIR_MM_GROW();
-
- {
- 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("paths"), 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("paths"), &_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_read_property_ex(&_4, this_ptr, ZEND_STRL("converters"), 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("converters"), &_5$$5);
- }
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
- }
-}
-
-
-
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool filter;
+ zval *content_param = NULL, *filter_param = NULL, *attributes = NULL, attributes_sub, __$null, collectionAttributes, _0, _1;
+ zval content;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&attributes_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&collectionAttributes);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(content)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(filter)
+ Z_PARAM_ZVAL_OR_NULL(attributes)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &content_param, &filter_param, &attributes);
+ zephir_get_strval(&content, content_param);
+ if (!filter_param) {
+ filter = 1;
+ } else {
+ filter = zephir_get_boolval(filter_param);
+ }
+ if (!attributes) {
+ attributes = &attributes_sub;
+ attributes = &__$null;
+ }
-
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router_RouteInterface)
-{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Mvc\\Router, RouteInterface, phalcon, mvc_router_routeinterface, phalcon_mvc_router_routeinterface_method_entry);
-
- return SUCCESS;
+ if (Z_TYPE_P(attributes) == IS_ARRAY) {
+ ZEPHIR_CPY_WRT(&collectionAttributes, attributes);
+ } else {
+ ZEPHIR_OBS_NVAR(&collectionAttributes);
+ zephir_read_property(&collectionAttributes, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC);
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, phalcon_assets_inline_js_ce);
+ if (filter) {
+ ZVAL_BOOL(&_1, 1);
+ } else {
+ ZVAL_BOOL(&_1, 0);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 165, &content, &_1, &collectionAttributes);
+ zephir_check_call_status();
+ zephir_update_property_array_append(this_ptr, SL("codes"), &_0);
+ RETURN_THIS();
}
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, compilePattern);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, convert);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, getCompiledPattern);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, getHostname);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, getHttpMethods);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, getName);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, getPaths);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, getPattern);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, getReversedPaths);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, getRouteId);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, setHostname);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, setHttpMethods);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, setName);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, reConfigure);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, reset);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_Router_RouteInterface, via);
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Exception)
+static PHP_METHOD(Phalcon_Assets_Collection, addJs)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\View, Exception, phalcon, mvc_view_exception, phalcon_exception_ce, NULL, 0);
-
- return SUCCESS;
-}
-
-
-
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool filter, autoVersion;
+ zval *path_param = NULL, *local = NULL, local_sub, *filter_param = NULL, *attributes = NULL, attributes_sub, *version_param = NULL, *autoVersion_param = NULL, __$null, collectionLocal, collectionAttributes, _0, _1, _2;
+ zval path, version;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&path);
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&local_sub);
+ ZVAL_UNDEF(&attributes_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&collectionLocal);
+ ZVAL_UNDEF(&collectionAttributes);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 6)
+ Z_PARAM_STR(path)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(local)
+ Z_PARAM_BOOL(filter)
+ Z_PARAM_ZVAL_OR_NULL(attributes)
+ Z_PARAM_STR_OR_NULL(version)
+ Z_PARAM_BOOL(autoVersion)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 5, &path_param, &local, &filter_param, &attributes, &version_param, &autoVersion_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(path_param) == IS_STRING)) {
+ zephir_get_strval(&path, path_param);
+ } else {
+ ZEPHIR_INIT_VAR(&path);
+ }
+ if (!local) {
+ local = &local_sub;
+ local = &__$null;
+ }
+ if (!filter_param) {
+ filter = 1;
+ } else {
+ filter = zephir_get_boolval(filter_param);
+ }
+ if (!attributes) {
+ attributes = &attributes_sub;
+ attributes = &__$null;
+ }
+ if (!version_param) {
+ ZEPHIR_INIT_VAR(&version);
+ } else {
+ zephir_get_strval(&version, version_param);
+ }
+ if (!autoVersion_param) {
+ autoVersion = 0;
+ } else {
+ autoVersion = zephir_get_boolval(autoVersion_param);
+ }
-
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Simple)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\View, Simple, phalcon, mvc_view_simple, phalcon_di_injectable_ce, phalcon_mvc_view_simple_method_entry, 0);
-
- zend_declare_property_null(phalcon_mvc_view_simple_ce, SL("activeRenderPath"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_simple_ce, SL("content"), ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_mvc_view_simple_ce, SL("engines"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_simple_ce, SL("eventsManager"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_simple_ce, SL("options"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_simple_ce, SL("registeredEngines"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_simple_ce, SL("viewsDir"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_simple_ce, SL("viewParams"), ZEND_ACC_PROTECTED);
- phalcon_mvc_view_simple_ce->create_object = zephir_init_properties_Phalcon_Mvc_View_Simple;
-
- zend_class_implements(phalcon_mvc_view_simple_ce, 1, phalcon_mvc_viewbaseinterface_ce);
- zend_class_implements(phalcon_mvc_view_simple_ce, 1, phalcon_events_eventsawareinterface_ce);
- return SUCCESS;
+ if (((Z_TYPE_P(local) == IS_TRUE || Z_TYPE_P(local) == IS_FALSE) == 1)) {
+ ZEPHIR_CPY_WRT(&collectionLocal, local);
+ } else {
+ ZEPHIR_OBS_NVAR(&collectionLocal);
+ zephir_read_property(&collectionLocal, this_ptr, ZEND_STRL("local"), PH_NOISY_CC);
+ }
+ if (Z_TYPE_P(attributes) == IS_ARRAY) {
+ ZEPHIR_CPY_WRT(&collectionAttributes, attributes);
+ } else {
+ ZEPHIR_OBS_NVAR(&collectionAttributes);
+ zephir_read_property(&collectionAttributes, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC);
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, phalcon_assets_asset_js_ce);
+ if (filter) {
+ ZVAL_BOOL(&_1, 1);
+ } else {
+ ZVAL_BOOL(&_1, 0);
+ }
+ if (autoVersion) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 166, &path, &collectionLocal, &_1, &collectionAttributes, &version, &_2);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "add", NULL, 0, &_0);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, getRegisteredEngines)
+static PHP_METHOD(Phalcon_Assets_Collection, count)
{
+ zval _0;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&_0);
+
- RETURN_MEMBER(getThis(), "registeredEngines");
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("assets"), PH_NOISY_CC | PH_READONLY);
+ RETURN_LONG(zephir_fast_count_int(&_0));
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, __construct)
+static PHP_METHOD(Phalcon_Assets_Collection, current)
{
+ zval _0, _1, _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *options_param = NULL;
- zval options;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
-#endif
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- 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("options"), &options);
- ZEPHIR_MM_RESTORE();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("assets"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_OBS_VAR(&_2);
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("position"), PH_NOISY_CC);
+ zephir_array_fetch(&_1, &_0, &_2, PH_NOISY | PH_READONLY, "phalcon/Assets/Collection.zep", 261);
+ RETURN_CTOR(&_1);
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, __get)
+static PHP_METHOD(Phalcon_Assets_Collection, getRealTargetPath)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key_param = NULL, value, _0;
- zval key;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *basePath_param = NULL, targetPath, completePath, _0;
+ zval basePath;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&basePath);
+ ZVAL_UNDEF(&targetPath);
+ ZVAL_UNDEF(&completePath);
ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(basePath)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, &basePath_param);
+ if (UNEXPECTED(Z_TYPE_P(basePath_param) != IS_STRING && Z_TYPE_P(basePath_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'basePath' 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(basePath_param) == IS_STRING)) {
+ zephir_get_strval(&basePath, basePath_param);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_VAR(&basePath);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("viewParams"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&value, &_0, &key, 1))) {
- RETURN_MM_NULL();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("targetPath"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&targetPath, &_0);
+ ZEPHIR_INIT_VAR(&completePath);
+ ZEPHIR_CONCAT_VV(&completePath, &basePath, &targetPath);
+ if ((zephir_file_exists(&completePath) == SUCCESS)) {
+ ZEPHIR_RETURN_CALL_FUNCTION("realpath", NULL, 94, &completePath);
+ zephir_check_call_status();
+ RETURN_MM();
}
- RETURN_CTOR(&value);
+ RETURN_CCTOR(&completePath);
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, __set)
+static PHP_METHOD(Phalcon_Assets_Collection, has)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key_param = NULL, *value, value_sub;
- zval key;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *asset, asset_sub, key, assets;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&asset_sub);
ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&assets);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(asset, phalcon_assets_assetinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_update_property_array(this_ptr, SL("viewParams"), &key, value);
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Mvc_View_Simple, getActiveRenderPath)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "activeRenderPath");
-}
-
-static PHP_METHOD(Phalcon_Mvc_View_Simple, getContent)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "content");
-}
-
-static PHP_METHOD(Phalcon_Mvc_View_Simple, getEventsManager)
-{
- zval *this_ptr = getThis();
-
+ zephir_fetch_params(1, 1, 0, &asset);
- RETURN_MEMBER(getThis(), "eventsManager");
+ ZEPHIR_CALL_METHOD(&key, asset, "getassetkey", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_OBS_VAR(&assets);
+ zephir_read_property(&assets, this_ptr, ZEND_STRL("includedAssets"), PH_NOISY_CC);
+ RETURN_MM_BOOL(zephir_fast_in_array(&key, &assets));
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, getParamsToView)
+static PHP_METHOD(Phalcon_Assets_Collection, isAutoVersion)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "viewParams");
+ RETURN_MEMBER(getThis(), "autoVersion");
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, getVar)
+static PHP_METHOD(Phalcon_Assets_Collection, join)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key_param = NULL, value, _0;
- zval key;
+ zval *join_param = NULL, __$true, __$false;
+ zend_bool join;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_0);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_BOOL(join)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- 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_fetch_params_without_memory_grow(1, 0, &join_param);
+ join = zephir_get_boolval(join_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("viewParams"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&value, &_0, &key, 1))) {
- RETURN_MM_NULL();
+ if (join) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("join"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("join"), &__$false);
}
- RETURN_CTOR(&value);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, getViewsDir)
+static PHP_METHOD(Phalcon_Assets_Collection, key)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "viewsDir");
+ RETURN_MEMBER(getThis(), "position");
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, partial)
+static PHP_METHOD(Phalcon_Assets_Collection, next)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *partialPath_param = NULL, *params = NULL, params_sub, __$null, viewParams, mergedParams, _2, _0$$3, _1$$3;
- zval partialPath;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&partialPath);
- ZVAL_UNDEF(¶ms_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&viewParams);
- ZVAL_UNDEF(&mergedParams);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$3);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(partialPath)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(params)
- ZEND_PARSE_PARAMETERS_END();
-#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &partialPath_param, ¶ms);
- if (UNEXPECTED(Z_TYPE_P(partialPath_param) != IS_STRING && Z_TYPE_P(partialPath_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'partialPath' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(partialPath_param) == IS_STRING)) {
- zephir_get_strval(&partialPath, partialPath_param);
- } else {
- ZEPHIR_INIT_VAR(&partialPath);
- }
- if (!params) {
- params = ¶ms_sub;
- params = &__$null;
- }
+ RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("position")));
+}
+static PHP_METHOD(Phalcon_Assets_Collection, rewind)
+{
+ zval _0;
+ zval *this_ptr = getThis();
- ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 388);
- zephir_check_call_status();
- if (Z_TYPE_P(params) == IS_ARRAY) {
- zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("viewParams"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&viewParams, &_0$$3);
- ZEPHIR_INIT_VAR(&mergedParams);
- zephir_fast_array_merge(&mergedParams, &viewParams, params);
- ZEPHIR_INIT_VAR(&_1$$3);
- ZEPHIR_CREATE_SYMBOL_TABLE();
-
- } else {
- ZEPHIR_CPY_WRT(&mergedParams, params);
- }
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "internalrender", NULL, 0, &partialPath, &mergedParams);
- zephir_check_call_status();
- if (Z_TYPE_P(params) == IS_ARRAY) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("viewParams"), &viewParams);
- }
- ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 497);
- zephir_check_call_status();
- zephir_read_property(&_2, this_ptr, ZEND_STRL("content"), PH_NOISY_CC | PH_READONLY);
- zend_print_zval(&_2, 0);
- ZEPHIR_MM_RESTORE();
+ ZVAL_UNDEF(&_0);
+
+
+
+ ZEPHIR_INIT_ZVAL_NREF(_0);
+ ZVAL_LONG(&_0, 0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("position"), &_0);
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, registerEngines)
+static PHP_METHOD(Phalcon_Assets_Collection, setAttributes)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *engines_param = NULL;
- zval engines;
+ zval *attributes_param = NULL;
+ zval attributes;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&engines);
+ ZVAL_UNDEF(&attributes);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(engines)
+ Z_PARAM_ARRAY(attributes)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &engines_param);
- ZEPHIR_OBS_COPY_OR_DUP(&engines, engines_param);
+ zephir_fetch_params(1, 1, 0, &attributes_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&attributes, attributes_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("registeredEngines"), &engines);
- ZEPHIR_MM_RESTORE();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &attributes);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, render)
+static PHP_METHOD(Phalcon_Assets_Collection, setFilters)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval params;
- zval *path_param = NULL, *params_param = NULL, mergedParams, viewParams, _0, _1;
- zval path;
+ zval *filters_param = NULL;
+ zval filters;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&path);
- ZVAL_UNDEF(&mergedParams);
- ZVAL_UNDEF(&viewParams);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(¶ms);
+ ZVAL_UNDEF(&filters);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(path)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(params)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(filters)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &path_param, ¶ms_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(path_param) == IS_STRING)) {
- zephir_get_strval(&path, path_param);
- } else {
- ZEPHIR_INIT_VAR(&path);
- }
- if (!params_param) {
- ZEPHIR_INIT_VAR(¶ms);
- array_init(¶ms);
- } else {
- zephir_get_arrval(¶ms, params_param);
- }
+ zephir_fetch_params(1, 1, 0, &filters_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&filters, filters_param);
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_CREATE_SYMBOL_TABLE();
-
- ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 388);
- zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("viewParams"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&viewParams, &_1);
- ZEPHIR_INIT_VAR(&mergedParams);
- zephir_fast_array_merge(&mergedParams, &viewParams, ¶ms);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "internalrender", NULL, 0, &path, &mergedParams);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 497);
- zephir_check_call_status();
- RETURN_MM_MEMBER(getThis(), "content");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filters"), &filters);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, setContent)
+static PHP_METHOD(Phalcon_Assets_Collection, setLocal)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *content_param = NULL;
- zval content;
+ zval *local_param = NULL, __$true, __$false;
+ zend_bool local;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&content);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(content)
+ Z_PARAM_BOOL(local)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &content_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);
+ zephir_fetch_params_without_memory_grow(1, 0, &local_param);
+ if (UNEXPECTED(Z_TYPE_P(local_param) != IS_TRUE && Z_TYPE_P(local_param) != IS_FALSE)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'local' must be of the type bool"));
+ RETURN_NULL();
}
+ local = (Z_TYPE_P(local_param) == IS_TRUE);
- zephir_update_property_zval(this_ptr, ZEND_STRL("content"), &content);
- RETURN_THIS();
+ if (local) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("local"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("local"), &__$false);
+ }
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, setEventsManager)
+static PHP_METHOD(Phalcon_Assets_Collection, setPrefix)
{
- zval *eventsManager, eventsManager_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *prefix_param = NULL;
+ zval prefix;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&eventsManager_sub);
+ ZVAL_UNDEF(&prefix);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(eventsManager, phalcon_events_managerinterface_ce)
+ Z_PARAM_STR(prefix)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(1, 0, &eventsManager);
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &prefix_param);
+ 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_update_property_zval(this_ptr, ZEND_STRL("eventsManager"), eventsManager);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &prefix);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, setParamToView)
+static PHP_METHOD(Phalcon_Assets_Collection, setTargetLocal)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub;
- zval key;
+ zval *targetLocal_param = NULL, __$true, __$false;
+ zend_bool targetLocal;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(targetLocal)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- 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_fetch_params_without_memory_grow(1, 0, &targetLocal_param);
+ if (UNEXPECTED(Z_TYPE_P(targetLocal_param) != IS_TRUE && Z_TYPE_P(targetLocal_param) != IS_FALSE)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'targetLocal' must be of the type bool"));
+ RETURN_NULL();
}
+ targetLocal = (Z_TYPE_P(targetLocal_param) == IS_TRUE);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "setvar", NULL, 0, &key, value);
- zephir_check_call_status();
- RETURN_MM();
+ if (targetLocal) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("targetLocal"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("targetLocal"), &__$false);
+ }
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, setVar)
+static PHP_METHOD(Phalcon_Assets_Collection, setTargetPath)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key_param = NULL, *value, value_sub;
- zval key;
+ zval *targetPath_param = NULL;
+ zval targetPath;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&targetPath);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(targetPath)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ zephir_fetch_params(1, 1, 0, &targetPath_param);
+ if (UNEXPECTED(Z_TYPE_P(targetPath_param) != IS_STRING && Z_TYPE_P(targetPath_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'targetPath' 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(targetPath_param) == IS_STRING)) {
+ zephir_get_strval(&targetPath, targetPath_param);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_VAR(&targetPath);
}
- zephir_update_property_array(this_ptr, SL("viewParams"), &key, value);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("targetPath"), &targetPath);
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, setVars)
+static PHP_METHOD(Phalcon_Assets_Collection, setTargetUri)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_bool merge;
- zval *params_param = NULL, *merge_param = NULL, _0$$3, _1$$3;
- zval params;
+ zval *targetUri_param = NULL;
+ zval targetUri;
zval *this_ptr = getThis();
- ZVAL_UNDEF(¶ms);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&targetUri);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ARRAY(params)
- Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(merge)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(targetUri)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, ¶ms_param, &merge_param);
- ZEPHIR_OBS_COPY_OR_DUP(¶ms, params_param);
- if (!merge_param) {
- merge = 1;
+ zephir_fetch_params(1, 1, 0, &targetUri_param);
+ if (UNEXPECTED(Z_TYPE_P(targetUri_param) != IS_STRING && Z_TYPE_P(targetUri_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'targetUri' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(targetUri_param) == IS_STRING)) {
+ zephir_get_strval(&targetUri, targetUri_param);
} else {
- merge = zephir_get_boolval(merge_param);
+ ZEPHIR_INIT_VAR(&targetUri);
}
- if (merge) {
- ZEPHIR_INIT_VAR(&_0$$3);
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("viewParams"), PH_NOISY_CC | PH_READONLY);
- zephir_fast_array_merge(&_0$$3, &_1$$3, ¶ms);
- ZEPHIR_CPY_WRT(¶ms, &_0$$3);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("viewParams"), ¶ms);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("targetUri"), &targetUri);
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, setViewsDir)
+static PHP_METHOD(Phalcon_Assets_Collection, setSourcePath)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_1 = NULL;
- zval *viewsDir_param = NULL, _0;
- zval viewsDir;
+ zval *sourcePath_param = NULL;
+ zval sourcePath;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&viewsDir);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&sourcePath);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(viewsDir)
+ Z_PARAM_STR(sourcePath)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &viewsDir_param);
- if (UNEXPECTED(Z_TYPE_P(viewsDir_param) != IS_STRING && Z_TYPE_P(viewsDir_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewsDir' must be of the type string"));
+ zephir_fetch_params(1, 1, 0, &sourcePath_param);
+ if (UNEXPECTED(Z_TYPE_P(sourcePath_param) != IS_STRING && Z_TYPE_P(sourcePath_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sourcePath' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(viewsDir_param) == IS_STRING)) {
- zephir_get_strval(&viewsDir, viewsDir_param);
+ if (EXPECTED(Z_TYPE_P(sourcePath_param) == IS_STRING)) {
+ zephir_get_strval(&sourcePath, sourcePath_param);
} else {
- ZEPHIR_INIT_VAR(&viewsDir);
+ ZEPHIR_INIT_VAR(&sourcePath);
}
- ZEPHIR_CALL_CE_STATIC(&_0, phalcon_helper_str_ce, "dirseparator", &_1, 129, &viewsDir);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("viewsDir"), &_0);
- ZEPHIR_MM_RESTORE();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("sourcePath"), &sourcePath);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, loadTemplateEngines)
+static PHP_METHOD(Phalcon_Assets_Collection, valid)
{
- zval _15$$11, _20$$17;
- zend_class_entry *_12$$9, *_19$$15;
- zend_string *_10$$5;
- zend_ulong _9$$5;
- zval engines, di, registeredEngines, extension, engineService, engineObject, _0, _1$$3, _2$$4, _3$$6, _4$$6, _6$$6, *_7$$5, _8$$5, _11$$9, _16$$12, _17$$12, _18$$15, _21$$18, _22$$18, _23$$19;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_5 = NULL, *_13 = NULL, *_14 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval _0, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&engines);
- ZVAL_UNDEF(&di);
- ZVAL_UNDEF(®isteredEngines);
- ZVAL_UNDEF(&extension);
- ZVAL_UNDEF(&engineService);
- ZVAL_UNDEF(&engineObject);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$6);
- ZVAL_UNDEF(&_4$$6);
- ZVAL_UNDEF(&_6$$6);
- ZVAL_UNDEF(&_8$$5);
- ZVAL_UNDEF(&_11$$9);
- ZVAL_UNDEF(&_16$$12);
- ZVAL_UNDEF(&_17$$12);
- ZVAL_UNDEF(&_18$$15);
- ZVAL_UNDEF(&_21$$18);
- ZVAL_UNDEF(&_22$$18);
- ZVAL_UNDEF(&_23$$19);
- ZVAL_UNDEF(&_15$$11);
- ZVAL_UNDEF(&_20$$17);
+ ZVAL_UNDEF(&_1);
- ZEPHIR_MM_GROW();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("engines"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&engines, &_0);
- if (ZEPHIR_IS_FALSE_IDENTICAL(&engines)) {
- ZEPHIR_OBS_VAR(&di);
- zephir_read_property(&di, this_ptr, ZEND_STRL("container"), PH_NOISY_CC);
- ZEPHIR_INIT_NVAR(&engines);
- array_init(&engines);
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("registeredEngines"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(®isteredEngines, &_1$$3);
- if (Z_TYPE_P(®isteredEngines) != IS_ARRAY) {
- ZEPHIR_INIT_VAR(&_2$$4);
- object_init_ex(&_2$$4, phalcon_mvc_view_engine_php_ce);
- ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 499, this_ptr, &di);
- zephir_check_call_status();
- zephir_array_update_string(&engines, SL(".phtml"), &_2$$4, PH_COPY | PH_SEPARATE);
- } else {
- if (Z_TYPE_P(&di) != IS_OBJECT) {
- ZEPHIR_INIT_VAR(&_3$$6);
- object_init_ex(&_3$$6, phalcon_mvc_view_exception_ce);
- ZEPHIR_INIT_VAR(&_6$$6);
- ZVAL_STRING(&_6$$6, "the application services");
- ZEPHIR_CALL_CE_STATIC(&_4$$6, phalcon_mvc_view_exception_ce, "containerservicenotfound", &_5, 0, &_6$$6);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_3$$6, "__construct", NULL, 8, &_4$$6);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_3$$6, "phalcon/Mvc/View/Simple.zep", 453);
- ZEPHIR_MM_RESTORE();
- return;
- }
- zephir_is_iterable(®isteredEngines, 0, "phalcon/Mvc/View/Simple.zep", 486);
- if (Z_TYPE_P(®isteredEngines) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(®isteredEngines), _9$$5, _10$$5, _7$$5)
- {
- ZEPHIR_INIT_NVAR(&extension);
- if (_10$$5 != NULL) {
- ZVAL_STR_COPY(&extension, _10$$5);
- } else {
- ZVAL_LONG(&extension, _9$$5);
- }
- ZEPHIR_INIT_NVAR(&engineService);
- ZVAL_COPY(&engineService, _7$$5);
- if (Z_TYPE_P(&engineService) == IS_OBJECT) {
- if (zephir_is_instance_of(&engineService, SL("Closure"))) {
- _12$$9 = zephir_fetch_class_str_ex(SL("Closure"), ZEND_FETCH_CLASS_AUTO);
- ZEPHIR_CALL_CE_STATIC(&_11$$9, _12$$9, "bind", &_13, 0, &engineService, &di);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&engineService, &_11$$9);
- ZEPHIR_CALL_FUNCTION(&engineObject, "call_user_func", &_14, 255, &engineService, this_ptr);
- zephir_check_call_status();
- } else {
- ZEPHIR_CPY_WRT(&engineObject, &engineService);
- }
- } else if (Z_TYPE_P(&engineService) == IS_STRING) {
- ZEPHIR_INIT_NVAR(&_15$$11);
- zephir_create_array(&_15$$11, 1, 0);
- zephir_array_fast_append(&_15$$11, this_ptr);
- ZEPHIR_CALL_METHOD(&engineObject, &di, "getshared", NULL, 0, &engineService, &_15$$11);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&_16$$12);
- object_init_ex(&_16$$12, phalcon_mvc_view_exception_ce);
- ZEPHIR_INIT_NVAR(&_17$$12);
- ZEPHIR_CONCAT_SV(&_17$$12, "Invalid template engine registration for extension: ", &extension);
- ZEPHIR_CALL_METHOD(NULL, &_16$$12, "__construct", NULL, 8, &_17$$12);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_16$$12, "phalcon/Mvc/View/Simple.zep", 481);
- ZEPHIR_MM_RESTORE();
- return;
- }
- zephir_array_update_zval(&engines, &extension, &engineObject, PH_COPY | PH_SEPARATE);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, ®isteredEngines, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_8$$5, ®isteredEngines, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_8$$5)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&extension, ®isteredEngines, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&engineService, ®isteredEngines, "current", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&engineService) == IS_OBJECT) {
- if (zephir_is_instance_of(&engineService, SL("Closure"))) {
- _19$$15 = zephir_fetch_class_str_ex(SL("Closure"), ZEND_FETCH_CLASS_AUTO);
- ZEPHIR_CALL_CE_STATIC(&_18$$15, _19$$15, "bind", &_13, 0, &engineService, &di);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&engineService, &_18$$15);
- ZEPHIR_CALL_FUNCTION(&engineObject, "call_user_func", &_14, 255, &engineService, this_ptr);
- zephir_check_call_status();
- } else {
- ZEPHIR_CPY_WRT(&engineObject, &engineService);
- }
- } else if (Z_TYPE_P(&engineService) == IS_STRING) {
- ZEPHIR_INIT_NVAR(&_20$$17);
- zephir_create_array(&_20$$17, 1, 0);
- zephir_array_fast_append(&_20$$17, this_ptr);
- ZEPHIR_CALL_METHOD(&engineObject, &di, "getshared", NULL, 0, &engineService, &_20$$17);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&_21$$18);
- object_init_ex(&_21$$18, phalcon_mvc_view_exception_ce);
- ZEPHIR_INIT_NVAR(&_22$$18);
- ZEPHIR_CONCAT_SV(&_22$$18, "Invalid template engine registration for extension: ", &extension);
- ZEPHIR_CALL_METHOD(NULL, &_21$$18, "__construct", NULL, 8, &_22$$18);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_21$$18, "phalcon/Mvc/View/Simple.zep", 481);
- ZEPHIR_MM_RESTORE();
- return;
- }
- zephir_array_update_zval(&engines, &extension, &engineObject, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, ®isteredEngines, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&engineService);
- ZEPHIR_INIT_NVAR(&extension);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("engines"), &engines);
- } else {
- zephir_read_property(&_23$$19, this_ptr, ZEND_STRL("engines"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&engines, &_23$$19);
- }
- RETURN_CCTOR(&engines);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("assets"), 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));
}
-static PHP_METHOD(Phalcon_Mvc_View_Simple, internalRender)
+static PHP_METHOD(Phalcon_Assets_Collection, addAsset)
{
- zend_string *_7;
- zend_ulong _6;
- zend_bool notExists = 0, mustClean = 0, _11$$6, _22$$13;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_15 = NULL, *_18 = NULL, *_26 = NULL, *_29 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *path_param = NULL, *params, params_sub, eventsManager, engines, extension, engine, _0, _3, *_4, _5, _1$$4, _2$$4, _8$$6, _9$$6, _10$$6, _16$$6, _12$$7, _13$$10, _14$$10, _17$$12, _19$$13, _20$$13, _21$$13, _27$$13, _23$$14, _24$$17, _25$$17, _28$$19, _30$$20, _32$$21;
- zval path, viewEnginePath, viewsDirPath, _31$$20;
+ zval *asset, asset_sub, _0, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&path);
- ZVAL_UNDEF(&viewEnginePath);
- ZVAL_UNDEF(&viewsDirPath);
- ZVAL_UNDEF(&_31$$20);
- ZVAL_UNDEF(¶ms_sub);
- ZVAL_UNDEF(&eventsManager);
- ZVAL_UNDEF(&engines);
- ZVAL_UNDEF(&extension);
- ZVAL_UNDEF(&engine);
+ ZVAL_UNDEF(&asset_sub);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_8$$6);
- ZVAL_UNDEF(&_9$$6);
- ZVAL_UNDEF(&_10$$6);
- ZVAL_UNDEF(&_16$$6);
- ZVAL_UNDEF(&_12$$7);
- ZVAL_UNDEF(&_13$$10);
- ZVAL_UNDEF(&_14$$10);
- ZVAL_UNDEF(&_17$$12);
- ZVAL_UNDEF(&_19$$13);
- ZVAL_UNDEF(&_20$$13);
- ZVAL_UNDEF(&_21$$13);
- ZVAL_UNDEF(&_27$$13);
- ZVAL_UNDEF(&_23$$14);
- ZVAL_UNDEF(&_24$$17);
- ZVAL_UNDEF(&_25$$17);
- ZVAL_UNDEF(&_28$$19);
- ZVAL_UNDEF(&_30$$20);
- ZVAL_UNDEF(&_32$$21);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(path)
- Z_PARAM_ZVAL(params)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(asset, phalcon_assets_assetinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &path_param, ¶ms);
- 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(path_param) == IS_STRING)) {
- zephir_get_strval(&path, path_param);
- } else {
- ZEPHIR_INIT_VAR(&path);
- }
+ zephir_fetch_params(1, 1, 0, &asset);
- 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_update_property_zval(this_ptr, ZEND_STRL("activeRenderPath"), &path);
- }
- if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
- ZEPHIR_INIT_VAR(&_2$$4);
- ZVAL_STRING(&_2$$4, "view:beforeRender");
- ZEPHIR_CALL_METHOD(&_1$$4, &eventsManager, "fire", NULL, 0, &_2$$4, this_ptr);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_1$$4)) {
- RETURN_MM_NULL();
- }
- }
- notExists = 1;
- mustClean = 1;
- zephir_read_property(&_0, this_ptr, ZEND_STRL("viewsDir"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_3);
- ZEPHIR_CONCAT_VV(&_3, &_0, &path);
- zephir_get_strval(&viewsDirPath, &_3);
- ZEPHIR_CALL_METHOD(&engines, this_ptr, "loadtemplateengines", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, asset);
zephir_check_call_status();
- zephir_is_iterable(&engines, 0, "phalcon/Mvc/View/Simple.zep", 577);
- if (Z_TYPE_P(&engines) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&engines), _6, _7, _4)
- {
- ZEPHIR_INIT_NVAR(&extension);
- if (_7 != NULL) {
- ZVAL_STR_COPY(&extension, _7);
- } else {
- ZVAL_LONG(&extension, _6);
- }
- ZEPHIR_INIT_NVAR(&engine);
- ZVAL_COPY(&engine, _4);
- ZEPHIR_INIT_NVAR(&_8$$6);
- ZEPHIR_CONCAT_VV(&_8$$6, &viewsDirPath, &extension);
- ZVAL_LONG(&_9$$6, -zephir_fast_strlen_ev(&extension));
- ZEPHIR_INIT_NVAR(&_10$$6);
- zephir_substr(&_10$$6, &viewsDirPath, zephir_get_intval(&_9$$6), 0, ZEPHIR_SUBSTR_NO_LENGTH);
- _11$$6 = ZEPHIR_IS_EQUAL(&_10$$6, &extension);
- if (_11$$6) {
- _11$$6 = (zephir_file_exists(&viewsDirPath) == SUCCESS);
- }
- if ((zephir_file_exists(&_8$$6) == SUCCESS)) {
- ZEPHIR_INIT_NVAR(&_12$$7);
- ZEPHIR_CONCAT_VV(&_12$$7, &viewsDirPath, &extension);
- zephir_get_strval(&viewEnginePath, &_12$$7);
- } else if (_11$$6) {
- ZEPHIR_CPY_WRT(&viewEnginePath, &viewsDirPath);
- } else {
- continue;
- }
- if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
- ZEPHIR_INIT_NVAR(&_14$$10);
- ZVAL_STRING(&_14$$10, "view:beforeRenderView");
- ZEPHIR_CALL_METHOD(&_13$$10, &eventsManager, "fire", &_15, 0, &_14$$10, this_ptr, &viewEnginePath);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_13$$10)) {
- continue;
- }
- }
- if (mustClean) {
- ZVAL_BOOL(&_16$$6, 1);
- } else {
- ZVAL_BOOL(&_16$$6, 0);
- }
- ZEPHIR_CALL_METHOD(NULL, &engine, "render", NULL, 0, &viewEnginePath, params, &_16$$6);
- zephir_check_call_status();
- notExists = 0;
- if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
- ZEPHIR_INIT_NVAR(&_17$$12);
- ZVAL_STRING(&_17$$12, "view:afterRenderView");
- ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", &_18, 0, &_17$$12, this_ptr);
- zephir_check_call_status();
- }
- break;
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &engines, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_5, &engines, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_5)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&extension, &engines, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&engine, &engines, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_19$$13);
- ZEPHIR_CONCAT_VV(&_19$$13, &viewsDirPath, &extension);
- ZVAL_LONG(&_20$$13, -zephir_fast_strlen_ev(&extension));
- ZEPHIR_INIT_NVAR(&_21$$13);
- zephir_substr(&_21$$13, &viewsDirPath, zephir_get_intval(&_20$$13), 0, ZEPHIR_SUBSTR_NO_LENGTH);
- _22$$13 = ZEPHIR_IS_EQUAL(&_21$$13, &extension);
- if (_22$$13) {
- _22$$13 = (zephir_file_exists(&viewsDirPath) == SUCCESS);
- }
- if ((zephir_file_exists(&_19$$13) == SUCCESS)) {
- ZEPHIR_INIT_NVAR(&_23$$14);
- ZEPHIR_CONCAT_VV(&_23$$14, &viewsDirPath, &extension);
- zephir_get_strval(&viewEnginePath, &_23$$14);
- } else if (_22$$13) {
- ZEPHIR_CPY_WRT(&viewEnginePath, &viewsDirPath);
- } else {
- continue;
- }
- if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
- ZEPHIR_INIT_NVAR(&_25$$17);
- ZVAL_STRING(&_25$$17, "view:beforeRenderView");
- ZEPHIR_CALL_METHOD(&_24$$17, &eventsManager, "fire", &_26, 0, &_25$$17, this_ptr, &viewEnginePath);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_24$$17)) {
- continue;
- }
- }
- if (mustClean) {
- ZVAL_BOOL(&_27$$13, 1);
- } else {
- ZVAL_BOOL(&_27$$13, 0);
- }
- ZEPHIR_CALL_METHOD(NULL, &engine, "render", NULL, 0, &viewEnginePath, params, &_27$$13);
- zephir_check_call_status();
- notExists = 0;
- if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
- ZEPHIR_INIT_NVAR(&_28$$19);
- ZVAL_STRING(&_28$$19, "view:afterRenderView");
- ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", &_29, 0, &_28$$19, this_ptr);
- zephir_check_call_status();
- }
- break;
- ZEPHIR_CALL_METHOD(NULL, &engines, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&engine);
- ZEPHIR_INIT_NVAR(&extension);
- if (notExists) {
- ZEPHIR_INIT_VAR(&_30$$20);
- object_init_ex(&_30$$20, phalcon_mvc_view_exception_ce);
- ZEPHIR_INIT_VAR(&_31$$20);
- ZEPHIR_CONCAT_SVS(&_31$$20, "View '", &viewsDirPath, "' was not found in the views directory");
- ZEPHIR_CALL_METHOD(NULL, &_30$$20, "__construct", NULL, 8, &_31$$20);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_30$$20, "phalcon/Mvc/View/Simple.zep", 580);
- ZEPHIR_MM_RESTORE();
- return;
+ if (zephir_is_true(&_0)) {
+ RETURN_MM_BOOL(0);
}
- if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
- ZEPHIR_INIT_VAR(&_32$$21);
- ZVAL_STRING(&_32$$21, "view:afterRender");
- ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_32$$21, this_ptr);
- zephir_check_call_status();
+ if (zephir_instance_of_ev(asset, phalcon_assets_asset_ce)) {
+ zephir_update_property_array_append(this_ptr, SL("assets"), asset);
+ } else {
+ zephir_update_property_array_append(this_ptr, SL("codes"), asset);
}
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_CALL_METHOD(&_1, asset, "getassetkey", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_array_append(this_ptr, SL("includedAssets"), &_1);
+ RETURN_MM_BOOL(1);
}
-zend_object *zephir_init_properties_Phalcon_Mvc_View_Simple(zend_class_entry *class_type)
+zend_object *zephir_init_properties_Phalcon_Assets_Collection(zend_class_entry *class_type)
{
- zval _0, _2, _1$$3, _3$$4;
+ 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_MM_GROW();
@@ -177342,17 +166556,29 @@ zend_object *zephir_init_properties_Phalcon_Mvc_View_Simple(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("viewParams"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("filters"), 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("viewParams"), &_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("filters"), &_1$$3);
}
- zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("codes"), 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_update_property_zval_ex(this_ptr, ZEND_STRL("codes"), &_3$$4);
+ }
+ zephir_read_property_ex(&_4, this_ptr, ZEND_STRL("attributes"), 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("attributes"), &_5$$5);
+ }
+ zephir_read_property_ex(&_6, this_ptr, ZEND_STRL("assets"), 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("assets"), &_7$$6);
}
ZEPHIR_MM_RESTORE();
return Z_OBJ_P(this_ptr);
@@ -177369,597 +166595,409 @@ zend_object *zephir_init_properties_Phalcon_Mvc_View_Simple(zend_class_entry *cl
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Engine_AbstractEngine)
+ZEPHIR_INIT_CLASS(Phalcon_Assets_Exception)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\View\\Engine, AbstractEngine, phalcon, mvc_view_engine_abstractengine, phalcon_di_injectable_ce, phalcon_mvc_view_engine_abstractengine_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Assets, Exception, phalcon, assets_exception, phalcon_exception_ce, NULL, 0);
- zend_declare_property_null(phalcon_mvc_view_engine_abstractengine_ce, SL("view"), ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_mvc_view_engine_abstractengine_ce, 1, phalcon_mvc_view_engine_engineinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_AbstractEngine, __construct)
-{
- zval *view, view_sub, *container = NULL, container_sub, __$null;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&view_sub);
- ZVAL_UNDEF(&container_sub);
- ZVAL_NULL(&__$null);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(view, phalcon_mvc_viewbaseinterface_ce)
- Z_PARAM_OPTIONAL
- Z_PARAM_OBJECT_OF_CLASS_OR_NULL(container, phalcon_di_diinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 1, &view, &container);
- if (!container) {
- container = &container_sub;
- container = &__$null;
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("view"), view);
- zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container);
-}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_AbstractEngine, getContent)
-{
- 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_MM_GROW();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("view"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_METHOD(&_0, "getcontent", NULL, 0);
- zephir_check_call_status();
- RETURN_MM();
-}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_AbstractEngine, getView)
+ZEPHIR_INIT_CLASS(Phalcon_Assets_FilterInterface)
{
- zval *this_ptr = getThis();
-
-
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Assets, FilterInterface, phalcon, assets_filterinterface, phalcon_assets_filterinterface_method_entry);
- RETURN_MEMBER(getThis(), "view");
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_AbstractEngine, partial)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *partialPath_param = NULL, *params = NULL, params_sub, __$null, _0;
- zval partialPath;
- zval *this_ptr = getThis();
+ZEPHIR_DOC_METHOD(Phalcon_Assets_FilterInterface, filter);
- ZVAL_UNDEF(&partialPath);
- ZVAL_UNDEF(¶ms_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(partialPath)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(params)
- ZEND_PARSE_PARAMETERS_END();
-#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &partialPath_param, ¶ms);
- if (UNEXPECTED(Z_TYPE_P(partialPath_param) != IS_STRING && Z_TYPE_P(partialPath_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'partialPath' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(partialPath_param) == IS_STRING)) {
- zephir_get_strval(&partialPath, partialPath_param);
- } else {
- ZEPHIR_INIT_VAR(&partialPath);
- }
- if (!params) {
- params = ¶ms_sub;
- params = &__$null;
- }
+#ifdef HAVE_CONFIG_H
+#endif
- zephir_read_property(&_0, this_ptr, ZEND_STRL("view"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_0, "partial", NULL, 0, &partialPath, params);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
+ZEPHIR_INIT_CLASS(Phalcon_Assets_Inline)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Assets, Inline, phalcon, assets_inline, phalcon_assets_inline_method_entry, 0);
-#ifdef HAVE_CONFIG_H
-#endif
+ zend_declare_property_null(phalcon_assets_inline_ce, SL("attributes"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_inline_ce, SL("content"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_inline_ce, SL("filter"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_inline_ce, SL("type"), ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_assets_inline_ce, 1, phalcon_assets_assetinterface_ce);
+ return SUCCESS;
+}
+static PHP_METHOD(Phalcon_Assets_Inline, getAttributes)
+{
+ zval *this_ptr = getThis();
+ RETURN_MEMBER(getThis(), "attributes");
+}
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Engine_EngineInterface)
+static PHP_METHOD(Phalcon_Assets_Inline, getContent)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Mvc\\View\\Engine, EngineInterface, phalcon, mvc_view_engine_engineinterface, phalcon_mvc_view_engine_engineinterface_method_entry);
+ zval *this_ptr = getThis();
- return SUCCESS;
-}
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_View_Engine_EngineInterface, getContent);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_View_Engine_EngineInterface, partial);
-ZEPHIR_DOC_METHOD(Phalcon_Mvc_View_Engine_EngineInterface, render);
+ RETURN_MEMBER(getThis(), "content");
+}
+static PHP_METHOD(Phalcon_Assets_Inline, getFilter)
+{
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
+ RETURN_MEMBER(getThis(), "filter");
+}
+static PHP_METHOD(Phalcon_Assets_Inline, getType)
+{
+ zval *this_ptr = getThis();
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Engine_Php)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\View\\Engine, Php, phalcon, mvc_view_engine_php, phalcon_mvc_view_engine_abstractengine_ce, phalcon_mvc_view_engine_php_method_entry, 0);
- return SUCCESS;
+ RETURN_MEMBER(getThis(), "type");
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Php, render)
+static PHP_METHOD(Phalcon_Assets_Inline, __construct)
{
- zend_string *_3$$4;
- zend_ulong _2$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool mustClean;
- zval *path_param = NULL, *params, params_sub, *mustClean_param = NULL, key, value, *_0$$4, _1$$4, _4$$5, _5$$6, _6$$7, _7$$7;
- zval path;
+ zval attributes;
+ zend_bool filter;
+ zval *type_param = NULL, *content_param = NULL, *filter_param = NULL, *attributes_param = NULL, __$true, __$false;
+ zval type, content;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&path);
- ZVAL_UNDEF(¶ms_sub);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_4$$5);
- ZVAL_UNDEF(&_5$$6);
- ZVAL_UNDEF(&_6$$7);
- ZVAL_UNDEF(&_7$$7);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&content);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&attributes);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(path)
- Z_PARAM_ZVAL(params)
+ ZEND_PARSE_PARAMETERS_START(2, 4)
+ Z_PARAM_STR(type)
+ Z_PARAM_STR(content)
Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(mustClean)
+ Z_PARAM_BOOL(filter)
+ Z_PARAM_ARRAY(attributes)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 1, &path_param, ¶ms, &mustClean_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(path_param) == IS_STRING)) {
- zephir_get_strval(&path, path_param);
- } else {
- ZEPHIR_INIT_VAR(&path);
- }
- if (!mustClean_param) {
- mustClean = 0;
+ zephir_fetch_params(1, 2, 2, &type_param, &content_param, &filter_param, &attributes_param);
+ zephir_get_strval(&type, type_param);
+ zephir_get_strval(&content, content_param);
+ if (!filter_param) {
+ filter = 1;
} else {
- mustClean = zephir_get_boolval(mustClean_param);
- }
-
-
- if (mustClean) {
- ZEPHIR_CALL_FUNCTION(NULL, "ob_clean", NULL, 501);
- zephir_check_call_status();
- }
- if (Z_TYPE_P(params) == IS_ARRAY) {
- zephir_is_iterable(params, 0, "phalcon/Mvc/View/Engine/Php.zep", 36);
- if (Z_TYPE_P(params) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(params), _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_CPY_WRT(&_4$$5, &value);
- if (zephir_set_symbol(&key, &_4$$5) == FAILURE) {
- return;
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, params, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1$$4, params, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1$$4)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&key, params, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, params, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&_5$$6, &value);
- if (zephir_set_symbol(&key, &_5$$6) == FAILURE) {
- return;
- }
- ZEPHIR_CALL_METHOD(NULL, params, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- }
- if (zephir_require_zval(&path) == FAILURE) {
- RETURN_MM_NULL();
+ filter = zephir_get_boolval(filter_param);
}
- if (mustClean) {
- zephir_read_property(&_6$$7, this_ptr, ZEND_STRL("view"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_FUNCTION(&_7$$7, "ob_get_contents", NULL, 500);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_6$$7, "setcontent", NULL, 0, &_7$$7);
- zephir_check_call_status();
+ if (!attributes_param) {
+ ZEPHIR_INIT_VAR(&attributes);
+ array_init(&attributes);
+ } else {
+ zephir_get_arrval(&attributes, attributes_param);
+ }
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &type);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("content"), &content);
+ if (filter) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filter"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filter"), &__$false);
}
+ zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &attributes);
ZEPHIR_MM_RESTORE();
}
+static PHP_METHOD(Phalcon_Assets_Inline, getAssetKey)
+{
+ zval key, _0, _1;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
-#ifdef HAVE_CONFIG_H
-#endif
+ ZEPHIR_MM_GROW();
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "gettype", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcontent", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_CONCAT_VSV(&key, &_0, ":", &_1);
+ zephir_md5(return_value, &key);
+ RETURN_MM();
+}
+static PHP_METHOD(Phalcon_Assets_Inline, setAttributes)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *attributes_param = NULL;
+ zval attributes;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&attributes);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(attributes)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Engine_Volt)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\View\\Engine, Volt, phalcon, mvc_view_engine_volt, phalcon_mvc_view_engine_abstractengine_ce, phalcon_mvc_view_engine_volt_method_entry, 0);
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &attributes_param);
+ zephir_get_arrval(&attributes, attributes_param);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_ce, SL("compiler"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_ce, SL("eventsManager"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_ce, SL("macros"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_ce, SL("options"), ZEND_ACC_PROTECTED);
- phalcon_mvc_view_engine_volt_ce->create_object = zephir_init_properties_Phalcon_Mvc_View_Engine_Volt;
- zend_class_implements(phalcon_mvc_view_engine_volt_ce, 1, phalcon_events_eventsawareinterface_ce);
- return SUCCESS;
+ zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &attributes);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, callMacro)
+static PHP_METHOD(Phalcon_Assets_Inline, setFilter)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval arguments;
- zval *name_param = NULL, *arguments_param = NULL, macro, _0, _1$$3;
- zval name, _2$$3;
+ zval *filter_param = NULL, __$true, __$false;
+ zend_bool filter;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(¯o);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&arguments);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(name)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(arguments)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(filter)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &name_param, &arguments_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 (!arguments_param) {
- ZEPHIR_INIT_VAR(&arguments);
- array_init(&arguments);
- } else {
- zephir_get_arrval(&arguments, arguments_param);
- }
+ zephir_fetch_params_without_memory_grow(1, 0, &filter_param);
+ filter = zephir_get_boolval(filter_param);
- ZEPHIR_OBS_VAR(¯o);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("macros"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(!(zephir_array_isset_fetch(¯o, &_0, &name, 0)))) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_mvc_view_exception_ce);
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_CONCAT_SVS(&_2$$3, "Macro '", &name, "' does not exist");
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 8, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Mvc/View/Engine/Volt.zep", 57);
- ZEPHIR_MM_RESTORE();
- return;
+ if (filter) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filter"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filter"), &__$false);
}
- ZEPHIR_RETURN_CALL_FUNCTION("call_user_func", NULL, 255, ¯o, &arguments);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, convertEncoding)
+static PHP_METHOD(Phalcon_Assets_Inline, setType)
{
- zend_bool _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *text_param = NULL, *from_param = NULL, *to_param = NULL;
- zval text, from, to;
+ zval *type_param = NULL;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&text);
- ZVAL_UNDEF(&from);
- ZVAL_UNDEF(&to);
+ ZVAL_UNDEF(&type);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(3, 3)
- Z_PARAM_STR(text)
- Z_PARAM_STR(from)
- Z_PARAM_STR(to)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(type)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 3, 0, &text_param, &from_param, &to_param);
- zephir_get_strval(&text, text_param);
- if (UNEXPECTED(Z_TYPE_P(from_param) != IS_STRING && Z_TYPE_P(from_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'from' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(from_param) == IS_STRING)) {
- zephir_get_strval(&from, from_param);
- } else {
- ZEPHIR_INIT_VAR(&from);
- }
- if (UNEXPECTED(Z_TYPE_P(to_param) != IS_STRING && Z_TYPE_P(to_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'to' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(to_param) == IS_STRING)) {
- zephir_get_strval(&to, to_param);
- } else {
- ZEPHIR_INIT_VAR(&to);
- }
+ zephir_fetch_params(1, 1, 0, &type_param);
+ zephir_get_strval(&type, type_param);
- _0 = ZEPHIR_IS_STRING_IDENTICAL(&from, "latin1");
- if (!(_0)) {
- _0 = ZEPHIR_IS_STRING_IDENTICAL(&to, "utf8");
- }
- if (_0) {
- ZEPHIR_RETURN_CALL_FUNCTION("utf8_encode", NULL, 502, &text);
- zephir_check_call_status();
- RETURN_MM();
- }
- _1 = ZEPHIR_IS_STRING_IDENTICAL(&to, "latin1");
- if (!(_1)) {
- _1 = ZEPHIR_IS_STRING_IDENTICAL(&from, "utf8");
- }
- if (_1) {
- ZEPHIR_RETURN_CALL_FUNCTION("utf8_decode", NULL, 240, &text);
- zephir_check_call_status();
- RETURN_MM();
- }
- if ((zephir_function_exists_ex(ZEND_STRL("mb_convert_encoding")) == SUCCESS)) {
- ZEPHIR_RETURN_CALL_FUNCTION("mb_convert_encoding", NULL, 228, &text, &from, &to);
- zephir_check_call_status();
- RETURN_MM();
- }
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "'mbstring' is required to perform the charset conversion", "phalcon/Mvc/View/Engine/Volt.zep", 96);
- return;
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &type);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, getCompiler)
-{
- zval compiler, container, options, _0, _1$$3, _2$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&compiler);
- ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZEPHIR_MM_GROW();
+#ifdef HAVE_CONFIG_H
+#endif
- zephir_read_property(&_0, this_ptr, ZEND_STRL("compiler"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&compiler, &_0);
- if (Z_TYPE_P(&compiler) != IS_OBJECT) {
- ZEPHIR_INIT_NVAR(&compiler);
- object_init_ex(&compiler, phalcon_mvc_view_engine_volt_compiler_ce);
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("view"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &compiler, "__construct", NULL, 503, &_1$$3);
- zephir_check_call_status();
- zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&container, &_2$$3);
- if (Z_TYPE_P(&container) == IS_OBJECT) {
- ZEPHIR_CALL_METHOD(NULL, &compiler, "setdi", NULL, 504, &container);
- zephir_check_call_status();
- }
- zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&options, &_2$$3);
- if (Z_TYPE_P(&options) == IS_ARRAY) {
- ZEPHIR_CALL_METHOD(NULL, &compiler, "setoptions", NULL, 505, &options);
- zephir_check_call_status();
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("compiler"), &compiler);
- }
- RETURN_CCTOR(&compiler);
-}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, getEventsManager)
-{
- zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "eventsManager");
+ZEPHIR_INIT_CLASS(Phalcon_Assets_Manager)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Assets, Manager, phalcon, assets_manager, phalcon_di_abstractinjectionaware_ce, phalcon_assets_manager_method_entry, 0);
+
+ zend_declare_property_null(phalcon_assets_manager_ce, SL("collections"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_assets_manager_ce, SL("options"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_assets_manager_ce, SL("implicitOutput"), 1, ZEND_ACC_PROTECTED);
+ phalcon_assets_manager_ce->create_object = zephir_init_properties_Phalcon_Assets_Manager;
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, getOptions)
+static PHP_METHOD(Phalcon_Assets_Manager, __construct)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *options_param = NULL;
+ zval options;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&options);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &options_param);
+ if (!options_param) {
+ ZEPHIR_INIT_VAR(&options);
+ array_init(&options);
+ } else {
+ zephir_get_arrval(&options, options_param);
+ }
- RETURN_MEMBER(getThis(), "options");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, isIncluded)
+static PHP_METHOD(Phalcon_Assets_Manager, addAsset)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *needle, needle_sub, *haystack, haystack_sub, _0$$5, _1$$4;
+ zval *asset, asset_sub, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&needle_sub);
- ZVAL_UNDEF(&haystack_sub);
- ZVAL_UNDEF(&_0$$5);
- ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&asset_sub);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(needle)
- Z_PARAM_ZVAL(haystack)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(asset, phalcon_assets_asset_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &needle, &haystack);
+ zephir_fetch_params(1, 1, 0, &asset);
- if (Z_TYPE_P(haystack) == IS_ARRAY) {
- RETURN_MM_BOOL(zephir_fast_in_array(needle, haystack));
- }
- if (Z_TYPE_P(haystack) == IS_STRING) {
- if ((zephir_function_exists_ex(ZEND_STRL("mb_strpos")) == SUCCESS)) {
- ZEPHIR_CALL_FUNCTION(&_0$$5, "mb_strpos", NULL, 273, haystack, needle);
- zephir_check_call_status();
- RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_0$$5));
- }
- ZEPHIR_INIT_VAR(&_1$$4);
- zephir_fast_strpos(&_1$$4, haystack, needle, 0 );
- RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_1$$4));
- }
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "Invalid haystack", "phalcon/Mvc/View/Engine/Volt.zep", 179);
- return;
+ ZEPHIR_CALL_METHOD(&_0, asset, "gettype", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addassetbytype", NULL, 0, &_0, asset);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, length)
+static PHP_METHOD(Phalcon_Assets_Manager, addAssetByType)
{
- zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *item, item_sub;
+ zval *type_param = NULL, *asset, asset_sub, collection, _0;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&item_sub);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&asset_sub);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(item)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(type)
+ Z_PARAM_OBJECT_OF_CLASS(asset, phalcon_assets_asset_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &item);
-
-
- _0 = Z_TYPE_P(item) == IS_OBJECT;
- if (!(_0)) {
- _0 = Z_TYPE_P(item) == IS_ARRAY;
+ zephir_fetch_params(1, 2, 0, &type_param, &asset);
+ 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 (_0) {
- RETURN_MM_LONG(zephir_fast_count_int(item));
+ if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) {
+ zephir_get_strval(&type, type_param);
+ } else {
+ ZEPHIR_INIT_VAR(&type);
}
- if ((zephir_function_exists_ex(ZEND_STRL("mb_strlen")) == SUCCESS)) {
- ZEPHIR_RETURN_CALL_FUNCTION("mb_strlen", NULL, 281, item);
+
+
+ ZEPHIR_OBS_VAR(&collection);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("collections"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&collection, &_0, &type, 0))) {
+ ZEPHIR_INIT_NVAR(&collection);
+ object_init_ex(&collection, phalcon_assets_collection_ce);
+ ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 167);
zephir_check_call_status();
- RETURN_MM();
+ zephir_update_property_array(this_ptr, SL("collections"), &type, &collection);
}
- RETURN_MM_LONG(zephir_fast_strlen_ev(item));
+ ZEPHIR_CALL_METHOD(NULL, &collection, "add", NULL, 168, asset);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, render)
+static PHP_METHOD(Phalcon_Assets_Manager, addCss)
{
- zend_string *_8$$8;
- zend_ulong _7$$8;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool mustClean;
- zval *path_param = NULL, *params, params_sub, *mustClean_param = NULL, compiler, compiledTemplatePath, eventsManager, key, value, _0, _1$$4, _2$$4, _3$$6, _4$$6, *_5$$8, _6$$8, _9$$9, _10$$10, _11$$11, _12$$11;
- zval path;
+ zval attributes;
+ zend_bool filter, autoVersion;
+ zval *path_param = NULL, *local = NULL, local_sub, *filter_param = NULL, *attributes_param = NULL, *version_param = NULL, *autoVersion_param = NULL, __$true, _0, _1, _2, _3;
+ zval path, version;
zval *this_ptr = getThis();
ZVAL_UNDEF(&path);
- ZVAL_UNDEF(¶ms_sub);
- ZVAL_UNDEF(&compiler);
- ZVAL_UNDEF(&compiledTemplatePath);
- ZVAL_UNDEF(&eventsManager);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&local_sub);
+ ZVAL_BOOL(&__$true, 1);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$6);
- ZVAL_UNDEF(&_4$$6);
- ZVAL_UNDEF(&_6$$8);
- ZVAL_UNDEF(&_9$$9);
- ZVAL_UNDEF(&_10$$10);
- ZVAL_UNDEF(&_11$$11);
- ZVAL_UNDEF(&_12$$11);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&attributes);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
+ ZEND_PARSE_PARAMETERS_START(1, 6)
Z_PARAM_STR(path)
- Z_PARAM_ZVAL(params)
Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(mustClean)
+ Z_PARAM_ZVAL(local)
+ Z_PARAM_BOOL(filter)
+ Z_PARAM_ARRAY(attributes)
+ Z_PARAM_STR_OR_NULL(version)
+ Z_PARAM_BOOL(autoVersion)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 1, &path_param, ¶ms, &mustClean_param);
+ zephir_fetch_params(1, 1, 5, &path_param, &local, &filter_param, &attributes_param, &version_param, &autoVersion_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();
@@ -177969,4850 +167007,3543 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, render)
} else {
ZEPHIR_INIT_VAR(&path);
}
- if (!mustClean_param) {
- mustClean = 0;
+ if (!local) {
+ local = &local_sub;
+ local = &__$true;
+ }
+ if (!filter_param) {
+ filter = 1;
} else {
- mustClean = zephir_get_boolval(mustClean_param);
+ filter = zephir_get_boolval(filter_param);
+ }
+ if (!attributes_param) {
+ ZEPHIR_INIT_VAR(&attributes);
+ array_init(&attributes);
+ } else {
+ zephir_get_arrval(&attributes, attributes_param);
+ }
+ if (!version_param) {
+ ZEPHIR_INIT_VAR(&version);
+ } else {
+ zephir_get_strval(&version, version_param);
+ }
+ if (!autoVersion_param) {
+ autoVersion = 0;
+ } else {
+ autoVersion = zephir_get_boolval(autoVersion_param);
}
- if (mustClean) {
- ZEPHIR_CALL_FUNCTION(NULL, "ob_clean", NULL, 501);
- zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, phalcon_assets_asset_css_ce);
+ if (filter) {
+ ZVAL_BOOL(&_1, 1);
+ } else {
+ ZVAL_BOOL(&_1, 0);
}
- ZEPHIR_CALL_METHOD(&compiler, this_ptr, "getcompiler", NULL, 0);
- zephir_check_call_status();
- 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$$4);
- ZVAL_STRING(&_2$$4, "view:beforeCompile");
- ZEPHIR_CALL_METHOD(&_1$$4, &eventsManager, "fire", NULL, 0, &_2$$4, this_ptr);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_1$$4)) {
- RETURN_MM_NULL();
- }
+ if (autoVersion) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
}
- ZEPHIR_CALL_METHOD(NULL, &compiler, "compile", NULL, 0, &path);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 163, &path, local, &_1, &attributes, &version, &_2);
zephir_check_call_status();
- if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
- ZEPHIR_INIT_VAR(&_4$$6);
- ZVAL_STRING(&_4$$6, "view:afterCompile");
- ZEPHIR_CALL_METHOD(&_3$$6, &eventsManager, "fire", NULL, 0, &_4$$6, this_ptr);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_3$$6)) {
- RETURN_MM_NULL();
- }
- }
- ZEPHIR_CALL_METHOD(&compiledTemplatePath, &compiler, "getcompiledtemplatepath", NULL, 0);
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "css");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addassetbytype", NULL, 0, &_3, &_0);
zephir_check_call_status();
- if (Z_TYPE_P(params) == IS_ARRAY) {
- zephir_is_iterable(params, 0, "phalcon/Mvc/View/Engine/Volt.zep", 248);
- if (Z_TYPE_P(params) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(params), _7$$8, _8$$8, _5$$8)
- {
- ZEPHIR_INIT_NVAR(&key);
- if (_8$$8 != NULL) {
- ZVAL_STR_COPY(&key, _8$$8);
- } else {
- ZVAL_LONG(&key, _7$$8);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _5$$8);
- ZEPHIR_CPY_WRT(&_9$$9, &value);
- if (zephir_set_symbol(&key, &_9$$9) == FAILURE) {
- return;
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, params, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_6$$8, params, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_6$$8)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&key, params, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, params, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&_10$$10, &value);
- if (zephir_set_symbol(&key, &_10$$10) == FAILURE) {
- return;
- }
- ZEPHIR_CALL_METHOD(NULL, params, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- }
- if (zephir_require_zval(&compiledTemplatePath) == FAILURE) {
- RETURN_MM_NULL();
- }
- if (mustClean) {
- zephir_read_property(&_11$$11, this_ptr, ZEND_STRL("view"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_FUNCTION(&_12$$11, "ob_get_contents", NULL, 500);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_11$$11, "setcontent", NULL, 0, &_12$$11);
- zephir_check_call_status();
- }
- ZEPHIR_MM_RESTORE();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, setEventsManager)
+static PHP_METHOD(Phalcon_Assets_Manager, addInlineCode)
{
- zval *eventsManager, eventsManager_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *code, code_sub, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&eventsManager_sub);
+ ZVAL_UNDEF(&code_sub);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(eventsManager, phalcon_events_managerinterface_ce)
+ Z_PARAM_OBJECT_OF_CLASS(code, phalcon_assets_inline_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(1, 0, &eventsManager);
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &code);
- zephir_update_property_zval(this_ptr, ZEND_STRL("eventsManager"), eventsManager);
+ ZEPHIR_CALL_METHOD(&_0, code, "gettype", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addinlinecodebytype", NULL, 0, &_0, code);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, setOptions)
+static PHP_METHOD(Phalcon_Assets_Manager, addInlineCodeByType)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *options_param = NULL;
- zval options;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *type_param = NULL, *code, code_sub, collection, _0;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&code_sub);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(type)
+ Z_PARAM_OBJECT_OF_CLASS(code, phalcon_assets_inline_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &options_param);
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_fetch_params(1, 2, 0, &type_param, &code);
+ 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("options"), &options);
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_OBS_VAR(&collection);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("collections"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&collection, &_0, &type, 0))) {
+ ZEPHIR_INIT_NVAR(&collection);
+ object_init_ex(&collection, phalcon_assets_collection_ce);
+ ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 167);
+ zephir_check_call_status();
+ zephir_update_property_array(this_ptr, SL("collections"), &type, &collection);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &collection, "addinline", NULL, 169, code);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, slice)
+static PHP_METHOD(Phalcon_Assets_Manager, addInlineCss)
{
- zend_bool _1$$5;
- zval slice;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_3 = NULL, *_4 = NULL;
- zend_long start, ZEPHIR_LAST_CALL_STATUS, position = 0;
- zval *value, value_sub, *start_param = NULL, *end = NULL, end_sub, __$null, length, _9, _0$$3, _2$$6, _5$$9, _6$$11, _7$$10, _8$$12;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *content_param = NULL, *filter = NULL, filter_sub, *attributes = NULL, attributes_sub, __$true, __$null, _0, _1;
+ zval content;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&end_sub);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&filter_sub);
+ ZVAL_UNDEF(&attributes_sub);
+ ZVAL_BOOL(&__$true, 1);
ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&length);
- ZVAL_UNDEF(&_9);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_2$$6);
- ZVAL_UNDEF(&_5$$9);
- ZVAL_UNDEF(&_6$$11);
- ZVAL_UNDEF(&_7$$10);
- ZVAL_UNDEF(&_8$$12);
- ZVAL_UNDEF(&slice);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_ZVAL(value)
+ Z_PARAM_STR(content)
Z_PARAM_OPTIONAL
- Z_PARAM_LONG(start)
- Z_PARAM_ZVAL_OR_NULL(end)
+ Z_PARAM_ZVAL(filter)
+ Z_PARAM_ZVAL_OR_NULL(attributes)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 2, &value, &start_param, &end);
- if (!start_param) {
- start = 0;
- } else {
- start = zephir_get_intval(start_param);
+ zephir_fetch_params(1, 1, 2, &content_param, &filter, &attributes);
+ zephir_get_strval(&content, content_param);
+ if (!filter) {
+ filter = &filter_sub;
+ filter = &__$true;
}
- if (!end) {
- end = &end_sub;
- ZEPHIR_CPY_WRT(end, &__$null);
- } else {
- ZEPHIR_SEPARATE_PARAM(end);
+ if (!attributes) {
+ attributes = &attributes_sub;
+ attributes = &__$null;
}
- if (Z_TYPE_P(value) == IS_OBJECT) {
- if (Z_TYPE_P(end) == IS_NULL) {
- ZEPHIR_INIT_NVAR(end);
- ZVAL_LONG(end, (zephir_fast_count_int(value) - 1));
- }
- position = 0;
- ZEPHIR_INIT_VAR(&slice);
- array_init(&slice);
- ZEPHIR_CALL_METHOD(NULL, value, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_0$$3, value, "valid", NULL, 0);
- zephir_check_call_status();
- if (!(zephir_is_true(&_0$$3))) {
- break;
- }
- _1$$5 = position >= start;
- if (_1$$5) {
- _1$$5 = ZEPHIR_GE_LONG(end, position);
- }
- if (_1$$5) {
- ZEPHIR_CALL_METHOD(&_2$$6, value, "current", &_3, 0);
- zephir_check_call_status();
- zephir_array_append(&slice, &_2$$6, PH_SEPARATE, "phalcon/Mvc/View/Engine/Volt.zep", 305);
- }
- ZEPHIR_CALL_METHOD(NULL, value, "next", &_4, 0);
- zephir_check_call_status();
- position++;
- }
- RETURN_CTOR(&slice);
- }
- ZEPHIR_INIT_VAR(&length);
- if (Z_TYPE_P(end) != IS_NULL) {
- ZVAL_LONG(&length, (((zephir_get_numberval(end) - start)) + 1));
- } else {
- ZVAL_NULL(&length);
- }
- if (Z_TYPE_P(value) == IS_ARRAY) {
- ZVAL_LONG(&_5$$9, start);
- ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 260, value, &_5$$9, &length);
- zephir_check_call_status();
- RETURN_MM();
- }
- if ((zephir_function_exists_ex(ZEND_STRL("mb_substr")) == SUCCESS)) {
- if (Z_TYPE_P(&length) != IS_NULL) {
- ZVAL_LONG(&_6$$11, start);
- ZEPHIR_RETURN_CALL_FUNCTION("mb_substr", NULL, 184, value, &_6$$11, &length);
- zephir_check_call_status();
- RETURN_MM();
- }
- ZVAL_LONG(&_7$$10, start);
- ZEPHIR_RETURN_CALL_FUNCTION("mb_substr", NULL, 184, value, &_7$$10);
- zephir_check_call_status();
- RETURN_MM();
- }
- if (Z_TYPE_P(&length) != IS_NULL) {
- ZVAL_LONG(&_8$$12, start);
- zephir_substr(return_value, value, zephir_get_intval(&_8$$12), zephir_get_intval(&length), 0);
- RETURN_MM();
- }
- ZVAL_LONG(&_9, start);
- zephir_substr(return_value, value, zephir_get_intval(&_9), 0, ZEPHIR_SUBSTR_NO_LENGTH);
- RETURN_MM();
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, phalcon_assets_inline_css_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 164, &content, filter, attributes);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "css");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addinlinecodebytype", NULL, 0, &_1, &_0);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, sort)
+static PHP_METHOD(Phalcon_Assets_Manager, addInlineJs)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *value_param = NULL;
- zval value;
+ zval *content_param = NULL, *filter = NULL, filter_sub, *attributes = NULL, attributes_sub, __$true, __$null, _0, _1;
+ zval content;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&filter_sub);
+ ZVAL_UNDEF(&attributes_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(value)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(content)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL(filter)
+ Z_PARAM_ZVAL_OR_NULL(attributes)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &value_param);
- zephir_get_arrval(&value, value_param);
+ zephir_fetch_params(1, 1, 2, &content_param, &filter, &attributes);
+ zephir_get_strval(&content, content_param);
+ if (!filter) {
+ filter = &filter_sub;
+ filter = &__$true;
+ }
+ if (!attributes) {
+ attributes = &attributes_sub;
+ attributes = &__$null;
+ }
- ZEPHIR_MAKE_REF(&value);
- ZEPHIR_CALL_FUNCTION(NULL, "asort", NULL, 506, &value);
- ZEPHIR_UNREF(&value);
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, phalcon_assets_inline_js_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 165, &content, filter, attributes);
zephir_check_call_status();
- RETURN_CTOR(&value);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "js");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addinlinecodebytype", NULL, 0, &_1, &_0);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-zend_object *zephir_init_properties_Phalcon_Mvc_View_Engine_Volt(zend_class_entry *class_type)
+static PHP_METHOD(Phalcon_Assets_Manager, addJs)
{
- 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_MM_GROW();
-
- {
- 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_ex(&_2, this_ptr, ZEND_STRL("macros"), 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("macros"), &_3$$4);
- }
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
- }
-}
-
-
-
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval attributes;
+ zend_bool filter, autoVersion;
+ zval *path_param = NULL, *local = NULL, local_sub, *filter_param = NULL, *attributes_param = NULL, *version_param = NULL, *autoVersion_param = NULL, __$true, _0, _1, _2, _3;
+ zval path, version;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&path);
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&local_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&attributes);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 6)
+ Z_PARAM_STR(path)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL(local)
+ Z_PARAM_BOOL(filter)
+ Z_PARAM_ARRAY(attributes)
+ Z_PARAM_STR_OR_NULL(version)
+ Z_PARAM_BOOL(autoVersion)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 5, &path_param, &local, &filter_param, &attributes_param, &version_param, &autoVersion_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(path_param) == IS_STRING)) {
+ zephir_get_strval(&path, path_param);
+ } else {
+ ZEPHIR_INIT_VAR(&path);
+ }
+ if (!local) {
+ local = &local_sub;
+ local = &__$true;
+ }
+ if (!filter_param) {
+ filter = 1;
+ } else {
+ filter = zephir_get_boolval(filter_param);
+ }
+ if (!attributes_param) {
+ ZEPHIR_INIT_VAR(&attributes);
+ array_init(&attributes);
+ } else {
+ zephir_get_arrval(&attributes, attributes_param);
+ }
+ if (!version_param) {
+ ZEPHIR_INIT_VAR(&version);
+ } else {
+ zephir_get_strval(&version, version_param);
+ }
+ if (!autoVersion_param) {
+ autoVersion = 0;
+ } else {
+ autoVersion = zephir_get_boolval(autoVersion_param);
+ }
-
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Engine_Volt_Compiler)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Mvc\\View\\Engine\\Volt, Compiler, phalcon, mvc_view_engine_volt_compiler, phalcon_mvc_view_engine_volt_compiler_method_entry, 0);
-
- zend_declare_property_bool(phalcon_mvc_view_engine_volt_compiler_ce, SL("autoescape"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_long(phalcon_mvc_view_engine_volt_compiler_ce, SL("blockLevel"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_compiler_ce, SL("blocks"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_compiler_ce, SL("container"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_compiler_ce, SL("compiledTemplatePath"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_compiler_ce, SL("currentBlock"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_compiler_ce, SL("currentPath"), ZEND_ACC_PROTECTED);
- zend_declare_property_long(phalcon_mvc_view_engine_volt_compiler_ce, SL("exprLevel"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_mvc_view_engine_volt_compiler_ce, SL("extended"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_compiler_ce, SL("extensions"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_compiler_ce, SL("extendedBlocks"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_compiler_ce, SL("filters"), ZEND_ACC_PROTECTED);
- zend_declare_property_long(phalcon_mvc_view_engine_volt_compiler_ce, SL("foreachLevel"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_compiler_ce, SL("forElsePointers"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_compiler_ce, SL("functions"), ZEND_ACC_PROTECTED);
- zend_declare_property_long(phalcon_mvc_view_engine_volt_compiler_ce, SL("level"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_compiler_ce, SL("loopPointers"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_compiler_ce, SL("macros"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_compiler_ce, SL("options"), ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_mvc_view_engine_volt_compiler_ce, SL("prefix"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_mvc_view_engine_volt_compiler_ce, SL("view"), ZEND_ACC_PROTECTED);
- phalcon_mvc_view_engine_volt_compiler_ce->create_object = zephir_init_properties_Phalcon_Mvc_View_Engine_Volt_Compiler;
-
- zend_class_implements(phalcon_mvc_view_engine_volt_compiler_ce, 1, phalcon_di_injectionawareinterface_ce);
- return SUCCESS;
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, phalcon_assets_asset_js_ce);
+ if (filter) {
+ ZVAL_BOOL(&_1, 1);
+ } else {
+ ZVAL_BOOL(&_1, 0);
+ }
+ if (autoVersion) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 166, &path, local, &_1, &attributes, &version, &_2);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "js");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addassetbytype", NULL, 0, &_3, &_0);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, __construct)
+static PHP_METHOD(Phalcon_Assets_Manager, collection)
{
- zval *view = NULL, view_sub, __$null;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL, collection, _0;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&view_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_OBJECT_OF_CLASS_OR_NULL(view, phalcon_mvc_viewbaseinterface_ce)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(0, 1, &view);
- if (!view) {
- view = &view_sub;
- view = &__$null;
- }
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_get_strval(&name, name_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("view"), view);
+ ZEPHIR_OBS_VAR(&collection);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("collections"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&collection, &_0, &name, 0))) {
+ ZEPHIR_INIT_NVAR(&collection);
+ object_init_ex(&collection, phalcon_assets_collection_ce);
+ ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 167);
+ zephir_check_call_status();
+ zephir_update_property_array(this_ptr, SL("collections"), &name, &collection);
+ }
+ RETURN_CCTOR(&collection);
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, addExtension)
+static PHP_METHOD(Phalcon_Assets_Manager, collectionAssetsByType)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *extension, extension_sub;
+ zval type;
+ zval *assets_param = NULL, *type_param = NULL, asset, *_0, _1, _2$$3, _3$$5;
+ zval assets, filtered;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&extension_sub);
+ ZVAL_UNDEF(&assets);
+ ZVAL_UNDEF(&filtered);
+ ZVAL_UNDEF(&asset);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&type);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(extension)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ARRAY(assets)
+ Z_PARAM_STR(type)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &extension);
+ zephir_fetch_params(1, 2, 0, &assets_param, &type_param);
+ zephir_get_arrval(&assets, assets_param);
+ zephir_get_strval(&type, type_param);
- if (UNEXPECTED(Z_TYPE_P(extension) != IS_OBJECT)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "The extension is not valid", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 160);
- return;
- }
- if ((zephir_method_exists_ex(extension, ZEND_STRL("initialize")) == SUCCESS)) {
- ZEPHIR_CALL_METHOD(NULL, extension, "initialize", NULL, 0, this_ptr);
+ ZEPHIR_INIT_VAR(&filtered);
+ array_init(&filtered);
+ zephir_is_iterable(&assets, 0, "phalcon/Assets/Manager.zep", 240);
+ if (Z_TYPE_P(&assets) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&assets), _0)
+ {
+ ZEPHIR_INIT_NVAR(&asset);
+ ZVAL_COPY(&asset, _0);
+ ZEPHIR_CALL_METHOD(&_2$$3, &asset, "gettype", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EQUAL(&_2$$3, &type)) {
+ zephir_array_append(&filtered, &asset, PH_SEPARATE, "phalcon/Assets/Manager.zep", 236);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &assets, "rewind", NULL, 0);
zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &assets, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&asset, &assets, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_3$$5, &asset, "gettype", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EQUAL(&_3$$5, &type)) {
+ zephir_array_append(&filtered, &asset, PH_SEPARATE, "phalcon/Assets/Manager.zep", 236);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &assets, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- zephir_update_property_array_append(this_ptr, SL("extensions"), extension);
- RETURN_THIS();
+ ZEPHIR_INIT_NVAR(&asset);
+ RETURN_CTOR(&filtered);
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, addFilter)
+static PHP_METHOD(Phalcon_Assets_Manager, exists)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, *definition, definition_sub;
- zval name;
+ zval *id_param = NULL, _0;
+ zval id;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&definition_sub);
+ ZVAL_UNDEF(&id);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(name)
- Z_PARAM_ZVAL(definition)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(id)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ zephir_fetch_params(1, 1, 0, &id_param);
+ if (UNEXPECTED(Z_TYPE_P(id_param) != IS_STRING && Z_TYPE_P(id_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' 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(id_param) == IS_STRING)) {
+ zephir_get_strval(&id, id_param);
} else {
- ZEPHIR_INIT_VAR(&name);
+ ZEPHIR_INIT_VAR(&id);
}
- zephir_update_property_array(this_ptr, SL("filters"), &name, definition);
- RETURN_THIS();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("collections"), PH_NOISY_CC | PH_READONLY);
+ RETURN_MM_BOOL(zephir_array_isset(&_0, &id));
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, addFunction)
+static PHP_METHOD(Phalcon_Assets_Manager, get)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, *definition, definition_sub;
- zval name;
+ zval *id_param = NULL, collection, _0;
+ zval id;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&definition_sub);
+ ZVAL_UNDEF(&id);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(name)
- Z_PARAM_ZVAL(definition)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(id)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ zephir_fetch_params(1, 1, 0, &id_param);
+ if (UNEXPECTED(Z_TYPE_P(id_param) != IS_STRING && Z_TYPE_P(id_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' 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(id_param) == IS_STRING)) {
+ zephir_get_strval(&id, id_param);
} else {
- ZEPHIR_INIT_VAR(&name);
+ ZEPHIR_INIT_VAR(&id);
}
- zephir_update_property_array(this_ptr, SL("functions"), &name, definition);
- RETURN_THIS();
+ ZEPHIR_OBS_VAR(&collection);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("collections"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&collection, &_0, &id, 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The collection does not exist in the manager", "phalcon/Assets/Manager.zep", 270);
+ return;
+ }
+ RETURN_CCTOR(&collection);
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, attributeReader)
+static PHP_METHOD(Phalcon_Assets_Manager, getCollections)
{
- zend_bool _4$$5, _9$$8;
- zval exprCode;
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "collections");
+}
+
+static PHP_METHOD(Phalcon_Assets_Manager, getCss)
+{
+ zval collection, _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *expr_param = NULL, left, leftType, variable, level, leftCode, right, _0, _10, _1$$4, _2$$4, _3$$5, _5$$5, _6$$5, _7$$6, _8$$7, _11$$11, _12$$12;
- zval expr;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&expr);
- ZVAL_UNDEF(&left);
- ZVAL_UNDEF(&leftType);
- ZVAL_UNDEF(&variable);
- ZVAL_UNDEF(&level);
- ZVAL_UNDEF(&leftCode);
- ZVAL_UNDEF(&right);
+ ZVAL_UNDEF(&collection);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_10);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$5);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&_7$$6);
- ZVAL_UNDEF(&_8$$7);
- ZVAL_UNDEF(&_11$$11);
- ZVAL_UNDEF(&_12$$12);
- ZVAL_UNDEF(&exprCode);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(expr)
- ZEND_PARSE_PARAMETERS_END();
-#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &expr_param);
- ZEPHIR_OBS_COPY_OR_DUP(&expr, expr_param);
-
- ZEPHIR_INIT_VAR(&exprCode);
- ZEPHIR_OBS_VAR(&left);
- zephir_array_fetch_string(&left, &expr, SL("left"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 219);
- zephir_array_fetch_string(&_0, &left, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 221);
- if (ZEPHIR_IS_LONG(&_0, 265)) {
- ZEPHIR_OBS_VAR(&variable);
- zephir_array_fetch_string(&variable, &left, SL("value"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 222);
- if (ZEPHIR_IS_STRING(&variable, "loop")) {
- ZEPHIR_OBS_VAR(&level);
- zephir_read_property(&level, this_ptr, ZEND_STRL("foreachLevel"), PH_NOISY_CC);
- ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "getuniqueprefix", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_2$$4);
- ZEPHIR_CONCAT_SVVS(&_2$$4, "$", &_1$$4, &level, "loop");
- zephir_concat_self(&exprCode, &_2$$4);
- zephir_update_property_array(this_ptr, SL("loopPointers"), &level, &level);
- } else {
- ZEPHIR_OBS_VAR(&_3$$5);
- zephir_read_property(&_3$$5, this_ptr, ZEND_STRL("container"), PH_NOISY_CC);
- _4$$5 = Z_TYPE_P(&_3$$5) == IS_OBJECT;
- if (_4$$5) {
- zephir_read_property(&_5$$5, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_6$$5, &_5$$5, "has", NULL, 0, &variable);
- zephir_check_call_status();
- _4$$5 = zephir_is_true(&_6$$5);
- }
- if (_4$$5) {
- ZEPHIR_INIT_VAR(&_7$$6);
- ZEPHIR_CONCAT_SV(&_7$$6, "$this->", &variable);
- zephir_concat_self(&exprCode, &_7$$6);
- } else {
- ZEPHIR_INIT_VAR(&_8$$7);
- ZEPHIR_CONCAT_SV(&_8$$7, "$", &variable);
- zephir_concat_self(&exprCode, &_8$$7);
- }
- }
- } else {
- ZEPHIR_CALL_METHOD(&leftCode, this_ptr, "expression", NULL, 507, &left);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("collections"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_string_fetch(&collection, &_0, SL("css"), 1))) {
+ object_init_ex(return_value, phalcon_assets_collection_ce);
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 167);
zephir_check_call_status();
- ZEPHIR_OBS_VAR(&leftType);
- zephir_array_fetch_string(&leftType, &left, SL("type"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 243);
- _9$$8 = !ZEPHIR_IS_LONG(&leftType, '.');
- if (_9$$8) {
- _9$$8 = !ZEPHIR_IS_LONG(&leftType, 350);
- }
- if (_9$$8) {
- zephir_concat_self(&exprCode, &leftCode);
- } else {
- zephir_concat_self(&exprCode, &leftCode);
- }
+ RETURN_MM();
}
- zephir_concat_self_str(&exprCode, "->", sizeof("->") - 1);
- ZEPHIR_OBS_VAR(&right);
- zephir_array_fetch_string(&right, &expr, SL("right"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 254);
- zephir_array_fetch_string(&_10, &right, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 256);
- if (ZEPHIR_IS_LONG(&_10, 265)) {
- zephir_array_fetch_string(&_11$$11, &right, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 257);
- zephir_concat_self(&exprCode, &_11$$11);
- } else {
- ZEPHIR_CALL_METHOD(&_12$$12, this_ptr, "expression", NULL, 507, &right);
+ RETURN_CTOR(&collection);
+}
+
+static PHP_METHOD(Phalcon_Assets_Manager, getJs)
+{
+ zval collection, _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&_0);
+
+
+ ZEPHIR_MM_GROW();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("collections"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_string_fetch(&collection, &_0, SL("js"), 1))) {
+ object_init_ex(return_value, phalcon_assets_collection_ce);
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 167);
zephir_check_call_status();
- zephir_concat_self(&exprCode, &_12$$12);
+ RETURN_MM();
}
- RETURN_CTOR(&exprCode);
+ RETURN_CTOR(&collection);
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compile)
+static PHP_METHOD(Phalcon_Assets_Manager, getOptions)
{
- zval _11$$26;
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "options");
+}
+
+static PHP_METHOD(Phalcon_Assets_Manager, output)
+{
+ zend_bool filterNeeded = 0, _18$$23, _22$$24, _32$$44, _34$$45, _48$$63, _50$$64, _60$$84, _62$$85, _68$$93;
+ zval output;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_16 = NULL, *_20 = NULL, *_21 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool extendsMode, _9, _13;
- zval *templatePath_param = NULL, *extendsMode_param = NULL, __$true, __$false, __$null, blocksCode, compilation, compileAlways, compiledExtension, compiledPath, compiledSeparator, compiledTemplatePath, options, prefix, stat, templateSepPath, _0, _1$$4, _2$$4, _3$$10, _4$$10, _5$$13, _6$$13, _7$$17, _8$$17, _10$$22, _12$$26, _14$$29, _15$$31, _16$$32, _17$$35, _18$$35;
- zval templatePath;
+ zval *collection, collection_sub, *callback, callback_sub, *type = NULL, type_sub, asset, assets, attributes, autoVersion, collectionSourcePath, collectionTargetPath, completeSourcePath, completeTargetPath, content, filter, filters, filteredContent, filteredJoinedContent, html, join, local, modificationTime, mustFilter, options, parameters, path, prefixedPath, sourceBasePath, sourcePath, targetBasePath, targetPath, targetUri, typeCss, useImplicitOutput, version, _0, *_7, _8, _1$$3, _2$$10, _3$$10, _4$$9, _5$$11, _6$$11, _9$$15, _10$$15, _11$$17, _12$$17, _13$$19, _14$$19, _15$$20, _17$$23, _19$$23, _23$$25, _24$$25, _25$$26, _26$$27, _27$$28, *_28$$32, _29$$32, _30$$39, _31$$44, _33$$44, _35$$46, _36$$46, _37$$47, _38$$48, _39$$49, _40$$55, _41$$55, _42$$57, _43$$57, _44$$59, _45$$59, _46$$60, _47$$63, _49$$63, _51$$65, _52$$65, _53$$66, _54$$67, _55$$68, *_56$$72, _57$$72, _58$$79, _59$$84, _61$$84, _63$$86, _64$$86, _65$$87, _66$$88, _67$$89, _69$$94, _70$$95, _71$$96, _72$$97;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&templatePath);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&blocksCode);
- ZVAL_UNDEF(&compilation);
- ZVAL_UNDEF(&compileAlways);
- ZVAL_UNDEF(&compiledExtension);
- ZVAL_UNDEF(&compiledPath);
- ZVAL_UNDEF(&compiledSeparator);
- ZVAL_UNDEF(&compiledTemplatePath);
+ ZVAL_UNDEF(&collection_sub);
+ ZVAL_UNDEF(&callback_sub);
+ ZVAL_UNDEF(&type_sub);
+ ZVAL_UNDEF(&asset);
+ ZVAL_UNDEF(&assets);
+ ZVAL_UNDEF(&attributes);
+ ZVAL_UNDEF(&autoVersion);
+ ZVAL_UNDEF(&collectionSourcePath);
+ ZVAL_UNDEF(&collectionTargetPath);
+ ZVAL_UNDEF(&completeSourcePath);
+ ZVAL_UNDEF(&completeTargetPath);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&filter);
+ ZVAL_UNDEF(&filters);
+ ZVAL_UNDEF(&filteredContent);
+ ZVAL_UNDEF(&filteredJoinedContent);
+ ZVAL_UNDEF(&html);
+ ZVAL_UNDEF(&join);
+ ZVAL_UNDEF(&local);
+ ZVAL_UNDEF(&modificationTime);
+ ZVAL_UNDEF(&mustFilter);
ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&prefix);
- ZVAL_UNDEF(&stat);
- ZVAL_UNDEF(&templateSepPath);
+ ZVAL_UNDEF(¶meters);
+ ZVAL_UNDEF(&path);
+ ZVAL_UNDEF(&prefixedPath);
+ ZVAL_UNDEF(&sourceBasePath);
+ ZVAL_UNDEF(&sourcePath);
+ ZVAL_UNDEF(&targetBasePath);
+ ZVAL_UNDEF(&targetPath);
+ ZVAL_UNDEF(&targetUri);
+ ZVAL_UNDEF(&typeCss);
+ ZVAL_UNDEF(&useImplicitOutput);
+ ZVAL_UNDEF(&version);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$10);
ZVAL_UNDEF(&_3$$10);
- ZVAL_UNDEF(&_4$$10);
- ZVAL_UNDEF(&_5$$13);
- ZVAL_UNDEF(&_6$$13);
- ZVAL_UNDEF(&_7$$17);
- ZVAL_UNDEF(&_8$$17);
- ZVAL_UNDEF(&_10$$22);
- ZVAL_UNDEF(&_12$$26);
- ZVAL_UNDEF(&_14$$29);
- ZVAL_UNDEF(&_15$$31);
- ZVAL_UNDEF(&_16$$32);
- ZVAL_UNDEF(&_17$$35);
- ZVAL_UNDEF(&_18$$35);
- ZVAL_UNDEF(&_11$$26);
+ ZVAL_UNDEF(&_4$$9);
+ ZVAL_UNDEF(&_5$$11);
+ ZVAL_UNDEF(&_6$$11);
+ ZVAL_UNDEF(&_9$$15);
+ ZVAL_UNDEF(&_10$$15);
+ ZVAL_UNDEF(&_11$$17);
+ ZVAL_UNDEF(&_12$$17);
+ ZVAL_UNDEF(&_13$$19);
+ ZVAL_UNDEF(&_14$$19);
+ ZVAL_UNDEF(&_15$$20);
+ ZVAL_UNDEF(&_17$$23);
+ ZVAL_UNDEF(&_19$$23);
+ ZVAL_UNDEF(&_23$$25);
+ ZVAL_UNDEF(&_24$$25);
+ ZVAL_UNDEF(&_25$$26);
+ ZVAL_UNDEF(&_26$$27);
+ ZVAL_UNDEF(&_27$$28);
+ ZVAL_UNDEF(&_29$$32);
+ ZVAL_UNDEF(&_30$$39);
+ ZVAL_UNDEF(&_31$$44);
+ ZVAL_UNDEF(&_33$$44);
+ ZVAL_UNDEF(&_35$$46);
+ ZVAL_UNDEF(&_36$$46);
+ ZVAL_UNDEF(&_37$$47);
+ ZVAL_UNDEF(&_38$$48);
+ ZVAL_UNDEF(&_39$$49);
+ ZVAL_UNDEF(&_40$$55);
+ ZVAL_UNDEF(&_41$$55);
+ ZVAL_UNDEF(&_42$$57);
+ ZVAL_UNDEF(&_43$$57);
+ ZVAL_UNDEF(&_44$$59);
+ ZVAL_UNDEF(&_45$$59);
+ ZVAL_UNDEF(&_46$$60);
+ ZVAL_UNDEF(&_47$$63);
+ ZVAL_UNDEF(&_49$$63);
+ ZVAL_UNDEF(&_51$$65);
+ ZVAL_UNDEF(&_52$$65);
+ ZVAL_UNDEF(&_53$$66);
+ ZVAL_UNDEF(&_54$$67);
+ ZVAL_UNDEF(&_55$$68);
+ ZVAL_UNDEF(&_57$$72);
+ ZVAL_UNDEF(&_58$$79);
+ ZVAL_UNDEF(&_59$$84);
+ ZVAL_UNDEF(&_61$$84);
+ ZVAL_UNDEF(&_63$$86);
+ ZVAL_UNDEF(&_64$$86);
+ ZVAL_UNDEF(&_65$$87);
+ ZVAL_UNDEF(&_66$$88);
+ ZVAL_UNDEF(&_67$$89);
+ ZVAL_UNDEF(&_69$$94);
+ ZVAL_UNDEF(&_70$$95);
+ ZVAL_UNDEF(&_71$$96);
+ ZVAL_UNDEF(&_72$$97);
+ ZVAL_UNDEF(&output);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(templatePath)
- Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(extendsMode)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_OBJECT_OF_CLASS(collection, phalcon_assets_collection_ce)
+ Z_PARAM_ZVAL(callback)
+ Z_PARAM_ZVAL(type)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &templatePath_param, &extendsMode_param);
- if (UNEXPECTED(Z_TYPE_P(templatePath_param) != IS_STRING && Z_TYPE_P(templatePath_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'templatePath' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(templatePath_param) == IS_STRING)) {
- zephir_get_strval(&templatePath, templatePath_param);
- } else {
- ZEPHIR_INIT_VAR(&templatePath);
- }
- if (!extendsMode_param) {
- extendsMode = 0;
- } else {
- extendsMode = zephir_get_boolval(extendsMode_param);
- }
+ zephir_fetch_params(1, 3, 0, &collection, &callback, &type);
+ ZEPHIR_SEPARATE_PARAM(type);
- if (0) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("extended"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("extended"), &__$false);
- }
- if (0) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("extendedBlocks"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("extendedBlocks"), &__$false);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("blocks"), &__$null);
- ZEPHIR_INIT_ZVAL_NREF(_0);
- ZVAL_LONG(&_0, 0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("level"), &_0);
- ZEPHIR_INIT_ZVAL_NREF(_0);
- ZVAL_LONG(&_0, 0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("foreachLevel"), &_0);
- ZEPHIR_INIT_ZVAL_NREF(_0);
- ZVAL_LONG(&_0, 0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("blockLevel"), &_0);
- ZEPHIR_INIT_ZVAL_NREF(_0);
- ZVAL_LONG(&_0, 0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("exprLevel"), &_0);
- ZEPHIR_INIT_VAR(&compilation);
- ZVAL_NULL(&compilation);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&options, &_0);
- ZEPHIR_OBS_VAR(&compileAlways);
- if (!(zephir_array_isset_string_fetch(&compileAlways, &options, SL("always"), 0))) {
- ZEPHIR_OBS_NVAR(&compileAlways);
- if (zephir_array_isset_string_fetch(&compileAlways, &options, SL("compileAlways"), 0)) {
- ZEPHIR_INIT_VAR(&_1$$4);
- ZVAL_STRING(&_1$$4, "The 'compileAlways' option is deprecated. Use 'always' instead.");
- ZVAL_LONG(&_2$$4, 16384);
- ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 7, &_1$$4, &_2$$4);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&compileAlways);
- ZVAL_BOOL(&compileAlways, 0);
+ ZEPHIR_INIT_VAR(&sourceBasePath);
+ ZVAL_NULL(&sourceBasePath);
+ ZEPHIR_INIT_VAR(&targetBasePath);
+ ZVAL_NULL(&targetBasePath);
+ ZEPHIR_OBS_VAR(&useImplicitOutput);
+ zephir_read_property(&useImplicitOutput, this_ptr, ZEND_STRL("implicitOutput"), PH_NOISY_CC);
+ ZEPHIR_INIT_VAR(&output);
+ ZEPHIR_CALL_METHOD(&_0, collection, "getassets", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&assets, this_ptr, "collectionassetsbytype", NULL, 0, &_0, type);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&filters, collection, "getfilters", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&typeCss);
+ ZVAL_STRING(&typeCss, "css");
+ if (zephir_fast_count_int(&filters)) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&options, &_1$$3);
+ if (Z_TYPE_P(&options) == IS_ARRAY) {
+ ZEPHIR_OBS_NVAR(&sourceBasePath);
+ zephir_array_isset_string_fetch(&sourceBasePath, &options, SL("sourceBasePath"), 0);
+ ZEPHIR_OBS_NVAR(&targetBasePath);
+ zephir_array_isset_string_fetch(&targetBasePath, &options, SL("targetBasePath"), 0);
}
- }
- if (UNEXPECTED(((Z_TYPE_P(&compileAlways) == IS_TRUE || Z_TYPE_P(&compileAlways) == IS_FALSE) != 1))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "'always' must be a bool value", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 318);
- return;
- }
- ZEPHIR_OBS_VAR(&prefix);
- if (!(zephir_array_isset_string_fetch(&prefix, &options, SL("prefix"), 0))) {
- ZEPHIR_INIT_NVAR(&prefix);
- ZVAL_STRING(&prefix, "");
- }
- if (UNEXPECTED(Z_TYPE_P(&prefix) != IS_STRING)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "'prefix' must be a string", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 329);
- return;
- }
- ZEPHIR_OBS_VAR(&compiledPath);
- if (!(zephir_array_isset_string_fetch(&compiledPath, &options, SL("path"), 0))) {
- ZEPHIR_OBS_NVAR(&compiledPath);
- if (zephir_array_isset_string_fetch(&compiledPath, &options, SL("compiledPath"), 0)) {
- ZEPHIR_INIT_VAR(&_3$$10);
- ZVAL_STRING(&_3$$10, "The 'compiledPath' option is deprecated. Use 'path' instead.");
- ZVAL_LONG(&_4$$10, 16384);
- ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 7, &_3$$10, &_4$$10);
- zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&collectionSourcePath, collection, "getsourcepath", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&collectionSourcePath)) {
+ ZEPHIR_INIT_VAR(&completeSourcePath);
+ ZEPHIR_CONCAT_VV(&completeSourcePath, &sourceBasePath, &collectionSourcePath);
} else {
- ZEPHIR_INIT_NVAR(&compiledPath);
- ZVAL_STRING(&compiledPath, "");
+ ZEPHIR_CPY_WRT(&completeSourcePath, &sourceBasePath);
}
- }
- ZEPHIR_OBS_VAR(&compiledSeparator);
- if (!(zephir_array_isset_string_fetch(&compiledSeparator, &options, SL("separator"), 0))) {
- ZEPHIR_OBS_NVAR(&compiledSeparator);
- if (zephir_array_isset_string_fetch(&compiledSeparator, &options, SL("compiledSeparator"), 0)) {
- ZEPHIR_INIT_VAR(&_5$$13);
- ZVAL_STRING(&_5$$13, "The 'compiledSeparator' option is deprecated. Use 'separator' instead.");
- ZVAL_LONG(&_6$$13, 16384);
- ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 7, &_5$$13, &_6$$13);
- zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&collectionTargetPath, collection, "gettargetpath", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&collectionTargetPath)) {
+ ZEPHIR_INIT_VAR(&completeTargetPath);
+ ZEPHIR_CONCAT_VV(&completeTargetPath, &targetBasePath, &collectionTargetPath);
} else {
- ZEPHIR_INIT_NVAR(&compiledSeparator);
- ZVAL_STRING(&compiledSeparator, "%%");
+ ZEPHIR_CPY_WRT(&completeTargetPath, &targetBasePath);
}
- }
- if (UNEXPECTED(Z_TYPE_P(&compiledSeparator) != IS_STRING)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "'separator' must be a string", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 362);
- return;
- }
- ZEPHIR_OBS_VAR(&compiledExtension);
- if (!(zephir_array_isset_string_fetch(&compiledExtension, &options, SL("extension"), 0))) {
- ZEPHIR_OBS_NVAR(&compiledExtension);
- if (zephir_array_isset_string_fetch(&compiledExtension, &options, SL("compiledExtension"), 0)) {
- ZEPHIR_INIT_VAR(&_7$$17);
- ZVAL_STRING(&_7$$17, "The 'compiledExtension' option is deprecated. Use 'extension' instead.");
- ZVAL_LONG(&_8$$17, 16384);
- ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 7, &_7$$17, &_8$$17);
+ ZEPHIR_INIT_VAR(&filteredJoinedContent);
+ ZVAL_STRING(&filteredJoinedContent, "");
+ ZEPHIR_CALL_METHOD(&join, collection, "getjoin", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&join)) {
+ if (UNEXPECTED(!zephir_is_true(&completeTargetPath))) {
+ ZEPHIR_INIT_VAR(&_2$$10);
+ object_init_ex(&_2$$10, phalcon_assets_exception_ce);
+ ZEPHIR_INIT_VAR(&_3$$10);
+ ZEPHIR_CONCAT_SVS(&_3$$10, "Path '", &completeTargetPath, "' is not a valid target path (1)");
+ ZEPHIR_CALL_METHOD(NULL, &_2$$10, "__construct", NULL, 8, &_3$$10);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_2$$10, "phalcon/Assets/Manager.zep", 433);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_CALL_FUNCTION(&_4$$9, "is_dir", NULL, 136, &completeTargetPath);
zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&compiledExtension);
- ZVAL_STRING(&compiledExtension, ".php");
+ if (UNEXPECTED(zephir_is_true(&_4$$9))) {
+ ZEPHIR_INIT_VAR(&_5$$11);
+ object_init_ex(&_5$$11, phalcon_assets_exception_ce);
+ ZEPHIR_INIT_VAR(&_6$$11);
+ ZEPHIR_CONCAT_SVS(&_6$$11, "Path '", &completeTargetPath, "' is not a valid target path (2), is dir.");
+ ZEPHIR_CALL_METHOD(NULL, &_5$$11, "__construct", NULL, 8, &_6$$11);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_5$$11, "phalcon/Assets/Manager.zep", 439);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
}
}
- if (UNEXPECTED(Z_TYPE_P(&compiledExtension) != IS_STRING)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "'extension' must be a string", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 380);
- return;
- }
- ZEPHIR_OBS_VAR(&stat);
- if (!(zephir_array_isset_string_fetch(&stat, &options, SL("stat"), 0))) {
- ZEPHIR_INIT_NVAR(&stat);
- ZVAL_BOOL(&stat, 1);
- }
- _9 = Z_TYPE_P(&compiledPath) == IS_OBJECT;
- if (_9) {
- _9 = zephir_is_instance_of(&compiledPath, SL("Closure"));
- }
- if (Z_TYPE_P(&compiledPath) == IS_STRING) {
- if (!(ZEPHIR_IS_EMPTY(&compiledPath))) {
- ZEPHIR_CALL_FUNCTION(&_10$$22, "realpath", NULL, 94, &templatePath);
+ zephir_is_iterable(&assets, 0, "phalcon/Assets/Manager.zep", 697);
+ if (Z_TYPE_P(&assets) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&assets), _7)
+ {
+ ZEPHIR_INIT_NVAR(&asset);
+ ZVAL_COPY(&asset, _7);
+ filterNeeded = 0;
+ ZEPHIR_CALL_METHOD(type, &asset, "gettype", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&templateSepPath);
- zephir_prepare_virtual_path(&templateSepPath, &_10$$22, &compiledSeparator);
- } else {
- ZEPHIR_CPY_WRT(&templateSepPath, &templatePath);
- }
- ZEPHIR_INIT_VAR(&compiledTemplatePath);
- if (extendsMode) {
- ZEPHIR_CONCAT_VVVVSVV(&compiledTemplatePath, &compiledPath, &prefix, &templateSepPath, &compiledSeparator, "e", &compiledSeparator, &compiledExtension);
- } else {
- ZEPHIR_CONCAT_VVVV(&compiledTemplatePath, &compiledPath, &prefix, &templateSepPath, &compiledExtension);
- }
- } else if (_9) {
- ZEPHIR_INIT_VAR(&_11$$26);
- zephir_create_array(&_11$$26, 3, 0);
- zephir_array_fast_append(&_11$$26, &templatePath);
- zephir_array_fast_append(&_11$$26, &options);
- ZEPHIR_INIT_VAR(&_12$$26);
- ZVAL_BOOL(&_12$$26, extendsMode);
- zephir_array_fast_append(&_11$$26, &_12$$26);
- ZEPHIR_INIT_NVAR(&compiledTemplatePath);
- ZEPHIR_CALL_USER_FUNC_ARRAY(&compiledTemplatePath, &compiledPath, &_11$$26);
- zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&compiledTemplatePath) != IS_STRING)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "'path' closure didn't return a valid string", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 433);
- return;
- }
- } else {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "'path' must be a string or a closure", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 438);
- return;
- }
- _13 = !((zephir_file_exists(&compiledTemplatePath) == SUCCESS));
- if (!(_13)) {
- _13 = zephir_is_true(&compileAlways);
- }
- if (_13) {
- if (extendsMode) {
- ZVAL_BOOL(&_14$$29, 1);
- } else {
- ZVAL_BOOL(&_14$$29, 0);
- }
- ZEPHIR_CALL_METHOD(&compilation, this_ptr, "compilefile", NULL, 0, &templatePath, &compiledTemplatePath, &_14$$29);
- zephir_check_call_status();
- } else {
- if (ZEPHIR_IS_TRUE_IDENTICAL(&stat)) {
- ZEPHIR_INIT_VAR(&_15$$31);
- if (zephir_compare_mtime(&templatePath, &compiledTemplatePath)) {
- if (extendsMode) {
- ZVAL_BOOL(&_16$$32, 1);
+ ZEPHIR_CALL_METHOD(&local, &asset, "getlocal", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_fast_count_int(&filters)) {
+ if (zephir_is_true(&local)) {
+ ZEPHIR_CALL_METHOD(&sourcePath, &asset, "getrealsourcepath", NULL, 0, &completeSourcePath);
+ zephir_check_call_status();
+ if (UNEXPECTED(!zephir_is_true(&sourcePath))) {
+ ZEPHIR_CALL_METHOD(&sourcePath, &asset, "getpath", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_9$$15);
+ object_init_ex(&_9$$15, phalcon_assets_exception_ce);
+ ZEPHIR_INIT_NVAR(&_10$$15);
+ ZEPHIR_CONCAT_SVS(&_10$$15, "Asset '", &sourcePath, "' does not have a valid source path");
+ ZEPHIR_CALL_METHOD(NULL, &_9$$15, "__construct", NULL, 8, &_10$$15);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_9$$15, "phalcon/Assets/Manager.zep", 477);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
} else {
- ZVAL_BOOL(&_16$$32, 0);
+ ZEPHIR_CALL_METHOD(&sourcePath, &asset, "getpath", NULL, 0);
+ zephir_check_call_status();
+ filterNeeded = 1;
}
- ZEPHIR_CALL_METHOD(&compilation, this_ptr, "compilefile", NULL, 0, &templatePath, &compiledTemplatePath, &_16$$32);
+ ZEPHIR_CALL_METHOD(&targetPath, &asset, "getrealtargetpath", NULL, 0, &completeTargetPath);
zephir_check_call_status();
+ if (UNEXPECTED(!zephir_is_true(&targetPath))) {
+ ZEPHIR_INIT_NVAR(&_11$$17);
+ object_init_ex(&_11$$17, phalcon_assets_exception_ce);
+ ZEPHIR_INIT_NVAR(&_12$$17);
+ ZEPHIR_CONCAT_SVS(&_12$$17, "Asset '", &sourcePath, "' does not have a valid target path");
+ ZEPHIR_CALL_METHOD(NULL, &_11$$17, "__construct", NULL, 8, &_12$$17);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_11$$17, "phalcon/Assets/Manager.zep", 503);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ if (zephir_is_true(&local)) {
+ if (UNEXPECTED(ZEPHIR_IS_EQUAL(&targetPath, &sourcePath))) {
+ ZEPHIR_INIT_NVAR(&_13$$19);
+ object_init_ex(&_13$$19, phalcon_assets_exception_ce);
+ ZEPHIR_INIT_NVAR(&_14$$19);
+ ZEPHIR_CONCAT_SVS(&_14$$19, "Asset '", &targetPath, "' have the same source and target paths");
+ ZEPHIR_CALL_METHOD(NULL, &_13$$19, "__construct", NULL, 8, &_14$$19);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_13$$19, "phalcon/Assets/Manager.zep", 513);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ if ((zephir_file_exists(&targetPath) == SUCCESS)) {
+ ZEPHIR_INIT_NVAR(&_15$$20);
+ if (zephir_compare_mtime(&targetPath, &sourcePath)) {
+ filterNeeded = 1;
+ }
+ } else {
+ filterNeeded = 1;
+ }
+ }
} else {
- if (extendsMode) {
- ZEPHIR_INIT_VAR(&blocksCode);
- zephir_file_get_contents(&blocksCode, &compiledTemplatePath);
- if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&blocksCode))) {
- ZEPHIR_INIT_VAR(&_17$$35);
- object_init_ex(&_17$$35, phalcon_mvc_view_engine_volt_exception_ce);
- ZEPHIR_INIT_VAR(&_18$$35);
- ZEPHIR_CONCAT_SVS(&_18$$35, "Extends compilation file ", &compiledTemplatePath, " could not be opened");
- ZEPHIR_CALL_METHOD(NULL, &_17$$35, "__construct", NULL, 508, &_18$$35);
+ ZEPHIR_CALL_METHOD(&path, &asset, "getrealtargeturi", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "getprefixedpath", &_16, 170, collection, &path);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_17$$23, &asset, "getversion", NULL, 0);
+ zephir_check_call_status();
+ _18$$23 = Z_TYPE_P(&_17$$23) == IS_NULL;
+ if (_18$$23) {
+ ZEPHIR_CALL_METHOD(&_19$$23, &asset, "isautoversion", NULL, 0);
+ zephir_check_call_status();
+ _18$$23 = zephir_is_true(&_19$$23);
+ }
+ if (_18$$23) {
+ ZEPHIR_CALL_METHOD(&version, collection, "getversion", &_20, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&autoVersion, collection, "isautoversion", &_21, 0);
+ zephir_check_call_status();
+ _22$$24 = zephir_is_true(&autoVersion);
+ if (_22$$24) {
+ _22$$24 = zephir_is_true(&local);
+ }
+ if (_22$$24) {
+ ZEPHIR_CALL_METHOD(&_23$$25, &asset, "getrealsourcepath", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&modificationTime);
+ zephir_filemtime(&modificationTime, &_23$$25);
+ ZEPHIR_INIT_NVAR(&_24$$25);
+ if (zephir_is_true(&version)) {
+ ZEPHIR_INIT_NVAR(&_24$$25);
+ ZEPHIR_CONCAT_VSV(&_24$$25, &version, ".", &modificationTime);
+ } else {
+ ZEPHIR_CPY_WRT(&_24$$25, &modificationTime);
+ }
+ ZEPHIR_CPY_WRT(&version, &_24$$25);
+ }
+ if (zephir_is_true(&version)) {
+ ZEPHIR_INIT_NVAR(&_25$$26);
+ ZEPHIR_CONCAT_VSV(&_25$$26, &prefixedPath, "?ver=", &version);
+ ZEPHIR_CPY_WRT(&prefixedPath, &_25$$26);
+ }
+ }
+ ZEPHIR_CALL_METHOD(&attributes, &asset, "getattributes", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(¶meters);
+ if (Z_TYPE_P(&attributes) == IS_ARRAY) {
+ zephir_array_update_long(&attributes, 0, &prefixedPath, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
+ ZEPHIR_INIT_NVAR(&_26$$27);
+ zephir_create_array(&_26$$27, 1, 0);
+ zephir_array_fast_append(&_26$$27, &attributes);
+ ZEPHIR_CPY_WRT(¶meters, &_26$$27);
+ } else {
+ ZEPHIR_INIT_NVAR(&_27$$28);
+ zephir_create_array(&_27$$28, 1, 0);
+ zephir_array_fast_append(&_27$$28, &prefixedPath);
+ ZEPHIR_CPY_WRT(¶meters, &_27$$28);
+ }
+ zephir_array_append(¶meters, &local, PH_SEPARATE, "phalcon/Assets/Manager.zep", 559);
+ ZEPHIR_INIT_NVAR(&html);
+ ZEPHIR_CALL_USER_FUNC_ARRAY(&html, callback, ¶meters);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE(&useImplicitOutput)) {
+ zend_print_zval(&html, 0);
+ } else {
+ zephir_concat_self(&output, &html);
+ }
+ continue;
+ }
+ if (filterNeeded == 1) {
+ ZEPHIR_CALL_METHOD(&content, &asset, "getcontent", NULL, 0, &completeSourcePath);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&mustFilter, &asset, "getfilter", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE(&mustFilter)) {
+ zephir_is_iterable(&filters, 0, "phalcon/Assets/Manager.zep", 612);
+ if (Z_TYPE_P(&filters) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&filters), _28$$32)
+ {
+ ZEPHIR_INIT_NVAR(&filter);
+ ZVAL_COPY(&filter, _28$$32);
+ if (UNEXPECTED(Z_TYPE_P(&filter) != IS_OBJECT)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "Filter is invalid", "phalcon/Assets/Manager.zep", 598);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&filteredContent, &filter, "filter", NULL, 0, &content);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&content, &filteredContent);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &filters, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_29$$32, &filters, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_29$$32)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&filter, &filters, "current", NULL, 0);
+ zephir_check_call_status();
+ if (UNEXPECTED(Z_TYPE_P(&filter) != IS_OBJECT)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "Filter is invalid", "phalcon/Assets/Manager.zep", 598);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&filteredContent, &filter, "filter", NULL, 0, &content);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&content, &filteredContent);
+ ZEPHIR_CALL_METHOD(NULL, &filters, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&filter);
+ if (ZEPHIR_IS_TRUE(&join)) {
+ if (ZEPHIR_IS_EQUAL(type, &typeCss)) {
+ zephir_concat_self(&filteredJoinedContent, &filteredContent);
+ } else {
+ ZEPHIR_INIT_NVAR(&_30$$39);
+ ZEPHIR_CONCAT_VS(&_30$$39, &filteredContent, ";");
+ zephir_concat_self(&filteredJoinedContent, &_30$$39);
+ }
+ }
+ } else {
+ if (ZEPHIR_IS_TRUE(&join)) {
+ zephir_concat_self(&filteredJoinedContent, &content);
+ } else {
+ ZEPHIR_CPY_WRT(&filteredContent, &content);
+ }
+ }
+ if (!(zephir_is_true(&join))) {
+ zephir_file_put_contents(NULL, &targetPath, &filteredContent);
+ }
+ }
+ if (!(zephir_is_true(&join))) {
+ ZEPHIR_CALL_METHOD(&path, &asset, "getrealtargeturi", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "getprefixedpath", &_16, 170, collection, &path);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_31$$44, &asset, "getversion", NULL, 0);
+ zephir_check_call_status();
+ _32$$44 = Z_TYPE_P(&_31$$44) == IS_NULL;
+ if (_32$$44) {
+ ZEPHIR_CALL_METHOD(&_33$$44, &asset, "isautoversion", NULL, 0);
+ zephir_check_call_status();
+ _32$$44 = zephir_is_true(&_33$$44);
+ }
+ if (_32$$44) {
+ ZEPHIR_CALL_METHOD(&version, collection, "getversion", &_20, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&autoVersion, collection, "isautoversion", &_21, 0);
+ zephir_check_call_status();
+ _34$$45 = zephir_is_true(&autoVersion);
+ if (_34$$45) {
+ _34$$45 = zephir_is_true(&local);
+ }
+ if (_34$$45) {
+ ZEPHIR_CALL_METHOD(&_35$$46, &asset, "getrealsourcepath", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&modificationTime);
+ zephir_filemtime(&modificationTime, &_35$$46);
+ ZEPHIR_INIT_NVAR(&_36$$46);
+ if (zephir_is_true(&version)) {
+ ZEPHIR_INIT_NVAR(&_36$$46);
+ ZEPHIR_CONCAT_VSV(&_36$$46, &version, ".", &modificationTime);
+ } else {
+ ZEPHIR_CPY_WRT(&_36$$46, &modificationTime);
+ }
+ ZEPHIR_CPY_WRT(&version, &_36$$46);
+ }
+ if (zephir_is_true(&version)) {
+ ZEPHIR_INIT_NVAR(&_37$$47);
+ ZEPHIR_CONCAT_VSV(&_37$$47, &prefixedPath, "?ver=", &version);
+ ZEPHIR_CPY_WRT(&prefixedPath, &_37$$47);
+ }
+ }
+ ZEPHIR_CALL_METHOD(&attributes, &asset, "getattributes", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&local);
+ ZVAL_BOOL(&local, 1);
+ if (Z_TYPE_P(&attributes) == IS_ARRAY) {
+ zephir_array_update_long(&attributes, 0, &prefixedPath, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
+ ZEPHIR_INIT_NVAR(&_38$$48);
+ zephir_create_array(&_38$$48, 1, 0);
+ zephir_array_fast_append(&_38$$48, &attributes);
+ ZEPHIR_CPY_WRT(¶meters, &_38$$48);
+ } else {
+ ZEPHIR_INIT_NVAR(&_39$$49);
+ zephir_create_array(&_39$$49, 1, 0);
+ zephir_array_fast_append(&_39$$49, &prefixedPath);
+ ZEPHIR_CPY_WRT(¶meters, &_39$$49);
+ }
+ zephir_array_append(¶meters, &local, PH_SEPARATE, "phalcon/Assets/Manager.zep", 679);
+ ZEPHIR_INIT_NVAR(&html);
+ ZEPHIR_CALL_USER_FUNC_ARRAY(&html, callback, ¶meters);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE(&useImplicitOutput)) {
+ zend_print_zval(&html, 0);
+ } else {
+ zephir_concat_self(&output, &html);
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &assets, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_8, &assets, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_8)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&asset, &assets, "current", NULL, 0);
+ zephir_check_call_status();
+ filterNeeded = 0;
+ ZEPHIR_CALL_METHOD(type, &asset, "gettype", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&local, &asset, "getlocal", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_fast_count_int(&filters)) {
+ if (zephir_is_true(&local)) {
+ ZEPHIR_CALL_METHOD(&sourcePath, &asset, "getrealsourcepath", NULL, 0, &completeSourcePath);
+ zephir_check_call_status();
+ if (UNEXPECTED(!zephir_is_true(&sourcePath))) {
+ ZEPHIR_CALL_METHOD(&sourcePath, &asset, "getpath", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_40$$55);
+ object_init_ex(&_40$$55, phalcon_assets_exception_ce);
+ ZEPHIR_INIT_NVAR(&_41$$55);
+ ZEPHIR_CONCAT_SVS(&_41$$55, "Asset '", &sourcePath, "' does not have a valid source path");
+ ZEPHIR_CALL_METHOD(NULL, &_40$$55, "__construct", NULL, 8, &_41$$55);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_40$$55, "phalcon/Assets/Manager.zep", 477);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ } else {
+ ZEPHIR_CALL_METHOD(&sourcePath, &asset, "getpath", NULL, 0);
+ zephir_check_call_status();
+ filterNeeded = 1;
+ }
+ ZEPHIR_CALL_METHOD(&targetPath, &asset, "getrealtargetpath", NULL, 0, &completeTargetPath);
+ zephir_check_call_status();
+ if (UNEXPECTED(!zephir_is_true(&targetPath))) {
+ ZEPHIR_INIT_NVAR(&_42$$57);
+ object_init_ex(&_42$$57, phalcon_assets_exception_ce);
+ ZEPHIR_INIT_NVAR(&_43$$57);
+ ZEPHIR_CONCAT_SVS(&_43$$57, "Asset '", &sourcePath, "' does not have a valid target path");
+ ZEPHIR_CALL_METHOD(NULL, &_42$$57, "__construct", NULL, 8, &_43$$57);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_42$$57, "phalcon/Assets/Manager.zep", 503);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ if (zephir_is_true(&local)) {
+ if (UNEXPECTED(ZEPHIR_IS_EQUAL(&targetPath, &sourcePath))) {
+ ZEPHIR_INIT_NVAR(&_44$$59);
+ object_init_ex(&_44$$59, phalcon_assets_exception_ce);
+ ZEPHIR_INIT_NVAR(&_45$$59);
+ ZEPHIR_CONCAT_SVS(&_45$$59, "Asset '", &targetPath, "' have the same source and target paths");
+ ZEPHIR_CALL_METHOD(NULL, &_44$$59, "__construct", NULL, 8, &_45$$59);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_44$$59, "phalcon/Assets/Manager.zep", 513);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ if ((zephir_file_exists(&targetPath) == SUCCESS)) {
+ ZEPHIR_INIT_NVAR(&_46$$60);
+ if (zephir_compare_mtime(&targetPath, &sourcePath)) {
+ filterNeeded = 1;
+ }
+ } else {
+ filterNeeded = 1;
+ }
+ }
+ } else {
+ ZEPHIR_CALL_METHOD(&path, &asset, "getrealtargeturi", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "getprefixedpath", &_16, 170, collection, &path);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_47$$63, &asset, "getversion", NULL, 0);
+ zephir_check_call_status();
+ _48$$63 = Z_TYPE_P(&_47$$63) == IS_NULL;
+ if (_48$$63) {
+ ZEPHIR_CALL_METHOD(&_49$$63, &asset, "isautoversion", NULL, 0);
+ zephir_check_call_status();
+ _48$$63 = zephir_is_true(&_49$$63);
+ }
+ if (_48$$63) {
+ ZEPHIR_CALL_METHOD(&version, collection, "getversion", &_20, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&autoVersion, collection, "isautoversion", &_21, 0);
+ zephir_check_call_status();
+ _50$$64 = zephir_is_true(&autoVersion);
+ if (_50$$64) {
+ _50$$64 = zephir_is_true(&local);
+ }
+ if (_50$$64) {
+ ZEPHIR_CALL_METHOD(&_51$$65, &asset, "getrealsourcepath", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&modificationTime);
+ zephir_filemtime(&modificationTime, &_51$$65);
+ ZEPHIR_INIT_NVAR(&_52$$65);
+ if (zephir_is_true(&version)) {
+ ZEPHIR_INIT_NVAR(&_52$$65);
+ ZEPHIR_CONCAT_VSV(&_52$$65, &version, ".", &modificationTime);
+ } else {
+ ZEPHIR_CPY_WRT(&_52$$65, &modificationTime);
+ }
+ ZEPHIR_CPY_WRT(&version, &_52$$65);
+ }
+ if (zephir_is_true(&version)) {
+ ZEPHIR_INIT_NVAR(&_53$$66);
+ ZEPHIR_CONCAT_VSV(&_53$$66, &prefixedPath, "?ver=", &version);
+ ZEPHIR_CPY_WRT(&prefixedPath, &_53$$66);
+ }
+ }
+ ZEPHIR_CALL_METHOD(&attributes, &asset, "getattributes", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&attributes) == IS_ARRAY) {
+ zephir_array_update_long(&attributes, 0, &prefixedPath, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
+ ZEPHIR_INIT_NVAR(&_54$$67);
+ zephir_create_array(&_54$$67, 1, 0);
+ zephir_array_fast_append(&_54$$67, &attributes);
+ ZEPHIR_CPY_WRT(¶meters, &_54$$67);
+ } else {
+ ZEPHIR_INIT_NVAR(&_55$$68);
+ zephir_create_array(&_55$$68, 1, 0);
+ zephir_array_fast_append(&_55$$68, &prefixedPath);
+ ZEPHIR_CPY_WRT(¶meters, &_55$$68);
+ }
+ zephir_array_append(¶meters, &local, PH_SEPARATE, "phalcon/Assets/Manager.zep", 559);
+ ZEPHIR_INIT_NVAR(&html);
+ ZEPHIR_CALL_USER_FUNC_ARRAY(&html, callback, ¶meters);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE(&useImplicitOutput)) {
+ zend_print_zval(&html, 0);
+ } else {
+ zephir_concat_self(&output, &html);
+ }
+ continue;
+ }
+ if (filterNeeded == 1) {
+ ZEPHIR_CALL_METHOD(&content, &asset, "getcontent", NULL, 0, &completeSourcePath);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&mustFilter, &asset, "getfilter", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE(&mustFilter)) {
+ zephir_is_iterable(&filters, 0, "phalcon/Assets/Manager.zep", 612);
+ if (Z_TYPE_P(&filters) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&filters), _56$$72)
+ {
+ ZEPHIR_INIT_NVAR(&filter);
+ ZVAL_COPY(&filter, _56$$72);
+ if (UNEXPECTED(Z_TYPE_P(&filter) != IS_OBJECT)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "Filter is invalid", "phalcon/Assets/Manager.zep", 598);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&filteredContent, &filter, "filter", NULL, 0, &content);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&content, &filteredContent);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &filters, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_57$$72, &filters, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_57$$72)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&filter, &filters, "current", NULL, 0);
+ zephir_check_call_status();
+ if (UNEXPECTED(Z_TYPE_P(&filter) != IS_OBJECT)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "Filter is invalid", "phalcon/Assets/Manager.zep", 598);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&filteredContent, &filter, "filter", NULL, 0, &content);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&content, &filteredContent);
+ ZEPHIR_CALL_METHOD(NULL, &filters, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&filter);
+ if (ZEPHIR_IS_TRUE(&join)) {
+ if (ZEPHIR_IS_EQUAL(type, &typeCss)) {
+ zephir_concat_self(&filteredJoinedContent, &filteredContent);
+ } else {
+ ZEPHIR_INIT_NVAR(&_58$$79);
+ ZEPHIR_CONCAT_VS(&_58$$79, &filteredContent, ";");
+ zephir_concat_self(&filteredJoinedContent, &_58$$79);
+ }
+ }
+ } else {
+ if (ZEPHIR_IS_TRUE(&join)) {
+ zephir_concat_self(&filteredJoinedContent, &content);
+ } else {
+ ZEPHIR_CPY_WRT(&filteredContent, &content);
+ }
+ }
+ if (!(zephir_is_true(&join))) {
+ zephir_file_put_contents(NULL, &targetPath, &filteredContent);
+ }
+ }
+ if (!(zephir_is_true(&join))) {
+ ZEPHIR_CALL_METHOD(&path, &asset, "getrealtargeturi", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "getprefixedpath", &_16, 170, collection, &path);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_59$$84, &asset, "getversion", NULL, 0);
+ zephir_check_call_status();
+ _60$$84 = Z_TYPE_P(&_59$$84) == IS_NULL;
+ if (_60$$84) {
+ ZEPHIR_CALL_METHOD(&_61$$84, &asset, "isautoversion", NULL, 0);
zephir_check_call_status();
- zephir_throw_exception_debug(&_17$$35, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 477);
- ZEPHIR_MM_RESTORE();
- return;
+ _60$$84 = zephir_is_true(&_61$$84);
}
- if (zephir_is_true(&blocksCode)) {
- ZEPHIR_CALL_FUNCTION(&compilation, "unserialize", NULL, 15, &blocksCode);
+ if (_60$$84) {
+ ZEPHIR_CALL_METHOD(&version, collection, "getversion", &_20, 0);
zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&autoVersion, collection, "isautoversion", &_21, 0);
+ zephir_check_call_status();
+ _62$$85 = zephir_is_true(&autoVersion);
+ if (_62$$85) {
+ _62$$85 = zephir_is_true(&local);
+ }
+ if (_62$$85) {
+ ZEPHIR_CALL_METHOD(&_63$$86, &asset, "getrealsourcepath", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&modificationTime);
+ zephir_filemtime(&modificationTime, &_63$$86);
+ ZEPHIR_INIT_NVAR(&_64$$86);
+ if (zephir_is_true(&version)) {
+ ZEPHIR_INIT_NVAR(&_64$$86);
+ ZEPHIR_CONCAT_VSV(&_64$$86, &version, ".", &modificationTime);
+ } else {
+ ZEPHIR_CPY_WRT(&_64$$86, &modificationTime);
+ }
+ ZEPHIR_CPY_WRT(&version, &_64$$86);
+ }
+ if (zephir_is_true(&version)) {
+ ZEPHIR_INIT_NVAR(&_65$$87);
+ ZEPHIR_CONCAT_VSV(&_65$$87, &prefixedPath, "?ver=", &version);
+ ZEPHIR_CPY_WRT(&prefixedPath, &_65$$87);
+ }
+ }
+ ZEPHIR_CALL_METHOD(&attributes, &asset, "getattributes", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&local);
+ ZVAL_BOOL(&local, 1);
+ if (Z_TYPE_P(&attributes) == IS_ARRAY) {
+ zephir_array_update_long(&attributes, 0, &prefixedPath, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
+ ZEPHIR_INIT_NVAR(&_66$$88);
+ zephir_create_array(&_66$$88, 1, 0);
+ zephir_array_fast_append(&_66$$88, &attributes);
+ ZEPHIR_CPY_WRT(¶meters, &_66$$88);
} else {
- ZEPHIR_INIT_NVAR(&compilation);
- array_init(&compilation);
+ ZEPHIR_INIT_NVAR(&_67$$89);
+ zephir_create_array(&_67$$89, 1, 0);
+ zephir_array_fast_append(&_67$$89, &prefixedPath);
+ ZEPHIR_CPY_WRT(¶meters, &_67$$89);
+ }
+ zephir_array_append(¶meters, &local, PH_SEPARATE, "phalcon/Assets/Manager.zep", 679);
+ ZEPHIR_INIT_NVAR(&html);
+ ZEPHIR_CALL_USER_FUNC_ARRAY(&html, callback, ¶meters);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE(&useImplicitOutput)) {
+ zend_print_zval(&html, 0);
+ } else {
+ zephir_concat_self(&output, &html);
}
}
+ ZEPHIR_CALL_METHOD(NULL, &assets, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&asset);
+ if (zephir_fast_count_int(&filters)) {
+ if (ZEPHIR_IS_TRUE(&join)) {
+ zephir_file_put_contents(NULL, &completeTargetPath, &filteredJoinedContent);
+ ZEPHIR_CALL_METHOD(&targetUri, collection, "gettargeturi", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "getprefixedpath", &_16, 170, collection, &targetUri);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&version, collection, "getversion", &_20, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&autoVersion, collection, "isautoversion", &_21, 0);
+ zephir_check_call_status();
+ _68$$93 = zephir_is_true(&autoVersion);
+ if (_68$$93) {
+ _68$$93 = zephir_is_true(&local);
+ }
+ if (_68$$93) {
+ ZEPHIR_INIT_NVAR(&modificationTime);
+ zephir_filemtime(&modificationTime, &completeTargetPath);
+ ZEPHIR_INIT_VAR(&_69$$94);
+ if (zephir_is_true(&version)) {
+ ZEPHIR_INIT_NVAR(&_69$$94);
+ ZEPHIR_CONCAT_VSV(&_69$$94, &version, ".", &modificationTime);
+ } else {
+ ZEPHIR_CPY_WRT(&_69$$94, &modificationTime);
+ }
+ ZEPHIR_CPY_WRT(&version, &_69$$94);
+ }
+ if (zephir_is_true(&version)) {
+ ZEPHIR_INIT_VAR(&_70$$95);
+ ZEPHIR_CONCAT_VSV(&_70$$95, &prefixedPath, "?ver=", &version);
+ ZEPHIR_CPY_WRT(&prefixedPath, &_70$$95);
+ }
+ ZEPHIR_CALL_METHOD(&attributes, collection, "getattributes", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&local, collection, "gettargetlocal", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&attributes) == IS_ARRAY) {
+ zephir_array_update_long(&attributes, 0, &prefixedPath, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
+ ZEPHIR_INIT_VAR(&_71$$96);
+ zephir_create_array(&_71$$96, 1, 0);
+ zephir_array_fast_append(&_71$$96, &attributes);
+ ZEPHIR_CPY_WRT(¶meters, &_71$$96);
+ } else {
+ ZEPHIR_INIT_VAR(&_72$$97);
+ zephir_create_array(&_72$$97, 1, 0);
+ zephir_array_fast_append(&_72$$97, &prefixedPath);
+ ZEPHIR_CPY_WRT(¶meters, &_72$$97);
+ }
+ zephir_array_append(¶meters, &local, PH_SEPARATE, "phalcon/Assets/Manager.zep", 741);
+ ZEPHIR_INIT_NVAR(&html);
+ ZEPHIR_CALL_USER_FUNC_ARRAY(&html, callback, ¶meters);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE(&useImplicitOutput)) {
+ zend_print_zval(&html, 0);
+ } else {
+ zephir_concat_self(&output, &html);
}
}
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("compiledTemplatePath"), &compiledTemplatePath);
- RETURN_CCTOR(&compilation);
+ RETURN_CTOR(&output);
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileAutoEscape)
+static PHP_METHOD(Phalcon_Assets_Manager, outputCss)
{
+ zend_bool _2;
+ zval callback;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool extendsMode;
- zval *statement_param = NULL, *extendsMode_param = NULL, autoescape, oldAutoescape, compilation, _0, _1;
- zval statement;
+ zval *collectionName_param = NULL, collection, container, tag, _0, _1, _3, _4$$5, _5$$5;
+ zval collectionName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statement);
- ZVAL_UNDEF(&autoescape);
- ZVAL_UNDEF(&oldAutoescape);
- ZVAL_UNDEF(&compilation);
+ ZVAL_UNDEF(&collectionName);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&container);
+ ZVAL_UNDEF(&tag);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&callback);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ARRAY(statement)
- Z_PARAM_BOOL(extendsMode)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(collectionName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &statement_param, &extendsMode_param);
- ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param);
- extendsMode = zephir_get_boolval(extendsMode_param);
+ zephir_fetch_params(1, 0, 1, &collectionName_param);
+ if (!collectionName_param) {
+ ZEPHIR_INIT_VAR(&collectionName);
+ } else {
+ zephir_get_strval(&collectionName, collectionName_param);
+ }
- ZEPHIR_OBS_VAR(&autoescape);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&autoescape, &statement, SL("enable"), 0)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 514);
- return;
- }
- ZEPHIR_OBS_VAR(&oldAutoescape);
- zephir_read_property(&oldAutoescape, this_ptr, ZEND_STRL("autoescape"), PH_NOISY_CC);
- zephir_update_property_zval(this_ptr, ZEND_STRL("autoescape"), &autoescape);
- zephir_array_fetch_string(&_0, &statement, SL("block_statements"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 524);
- if (extendsMode) {
- ZVAL_BOOL(&_1, 1);
+ if (!(!(ZEPHIR_IS_EMPTY(&collectionName)))) {
+ ZEPHIR_CALL_METHOD(&collection, this_ptr, "getcss", NULL, 0);
+ zephir_check_call_status();
} else {
- ZVAL_BOOL(&_1, 0);
+ ZEPHIR_CALL_METHOD(&collection, this_ptr, "get", NULL, 0, &collectionName);
+ zephir_check_call_status();
}
- ZEPHIR_CALL_METHOD(&compilation, this_ptr, "statementlist", NULL, 509, &_0, &_1);
+ ZEPHIR_INIT_VAR(&callback);
+ zephir_create_array(&callback, 2, 0);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "Phalcon\\Tag");
+ zephir_array_fast_append(&callback, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "stylesheetLink");
+ zephir_array_fast_append(&callback, &_0);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&container, &_1);
+ _2 = Z_TYPE_P(&container) == IS_OBJECT;
+ if (_2) {
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "tag");
+ ZEPHIR_CALL_METHOD(&_3, &container, "has", NULL, 0, &_0);
+ zephir_check_call_status();
+ _2 = zephir_is_true(&_3);
+ }
+ if (_2) {
+ ZEPHIR_INIT_VAR(&_4$$5);
+ ZVAL_STRING(&_4$$5, "tag");
+ ZEPHIR_CALL_METHOD(&tag, &container, "getshared", NULL, 0, &_4$$5);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_5$$5);
+ zephir_create_array(&_5$$5, 2, 0);
+ zephir_array_fast_append(&_5$$5, &tag);
+ ZEPHIR_INIT_NVAR(&_4$$5);
+ ZVAL_STRING(&_4$$5, "stylesheetLink");
+ zephir_array_fast_append(&_5$$5, &_4$$5);
+ ZEPHIR_CPY_WRT(&callback, &_5$$5);
+ }
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "css");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "output", NULL, 0, &collection, &callback, &_0);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("autoescape"), &oldAutoescape);
- RETURN_CCTOR(&compilation);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileCall)
+static PHP_METHOD(Phalcon_Assets_Manager, outputInline)
{
+ zval html, joinedContent, output;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_bool extendsMode;
- zval *statement_param = NULL, *extendsMode_param = NULL;
- zval statement;
+ zephir_fcall_cache_entry *_7 = NULL, *_11 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection, collection_sub, *type, type_sub, attributes, code, codes, content, filter, filters, join, *_0$$3, _1$$3, _27$$3, *_2$$4, _3$$4, _4$$5, _5$$7, _6$$10, _8$$10, _9$$10, _10$$10, _12$$10, *_13$$11, _14$$11, _15$$12, _16$$14, _17$$17, _18$$17, _19$$17, _20$$17, _21$$17, _22$$18, _23$$18, _24$$18, _25$$18, _26$$18;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statement);
+ ZVAL_UNDEF(&collection_sub);
+ ZVAL_UNDEF(&type_sub);
+ ZVAL_UNDEF(&attributes);
+ ZVAL_UNDEF(&code);
+ ZVAL_UNDEF(&codes);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&filter);
+ ZVAL_UNDEF(&filters);
+ ZVAL_UNDEF(&join);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_27$$3);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$7);
+ ZVAL_UNDEF(&_6$$10);
+ ZVAL_UNDEF(&_8$$10);
+ ZVAL_UNDEF(&_9$$10);
+ ZVAL_UNDEF(&_10$$10);
+ ZVAL_UNDEF(&_12$$10);
+ ZVAL_UNDEF(&_14$$11);
+ ZVAL_UNDEF(&_15$$12);
+ ZVAL_UNDEF(&_16$$14);
+ ZVAL_UNDEF(&_17$$17);
+ ZVAL_UNDEF(&_18$$17);
+ ZVAL_UNDEF(&_19$$17);
+ ZVAL_UNDEF(&_20$$17);
+ ZVAL_UNDEF(&_21$$17);
+ ZVAL_UNDEF(&_22$$18);
+ ZVAL_UNDEF(&_23$$18);
+ ZVAL_UNDEF(&_24$$18);
+ ZVAL_UNDEF(&_25$$18);
+ ZVAL_UNDEF(&_26$$18);
+ ZVAL_UNDEF(&html);
+ ZVAL_UNDEF(&joinedContent);
+ ZVAL_UNDEF(&output);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ARRAY(statement)
- Z_PARAM_BOOL(extendsMode)
+ Z_PARAM_OBJECT_OF_CLASS(collection, phalcon_assets_collection_ce)
+ Z_PARAM_ZVAL(type)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &statement_param, &extendsMode_param);
- ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param);
- extendsMode = zephir_get_boolval(extendsMode_param);
+ zephir_fetch_params(1, 2, 0, &collection, &type);
+ ZEPHIR_INIT_VAR(&output);
+ ZEPHIR_INIT_VAR(&html);
+ ZEPHIR_INIT_VAR(&joinedContent);
+ ZEPHIR_CALL_METHOD(&codes, collection, "getcodes", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&filters, collection, "getfilters", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&join, collection, "getjoin", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_fast_count_int(&codes)) {
+ zephir_is_iterable(&codes, 0, "phalcon/Assets/Manager.zep", 833);
+ if (Z_TYPE_P(&codes) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&codes), _0$$3)
+ {
+ ZEPHIR_INIT_NVAR(&code);
+ ZVAL_COPY(&code, _0$$3);
+ ZEPHIR_CALL_METHOD(&attributes, &code, "getattributes", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&content, &code, "getcontent", NULL, 0);
+ zephir_check_call_status();
+ zephir_is_iterable(&filters, 0, "phalcon/Assets/Manager.zep", 824);
+ if (Z_TYPE_P(&filters) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&filters), _2$$4)
+ {
+ ZEPHIR_INIT_NVAR(&filter);
+ ZVAL_COPY(&filter, _2$$4);
+ if (UNEXPECTED(Z_TYPE_P(&filter) != IS_OBJECT)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "Filter is invalid", "phalcon/Assets/Manager.zep", 814);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&_4$$5, &filter, "filter", NULL, 0, &content);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&content, &_4$$5);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &filters, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3$$4, &filters, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3$$4)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&filter, &filters, "current", NULL, 0);
+ zephir_check_call_status();
+ if (UNEXPECTED(Z_TYPE_P(&filter) != IS_OBJECT)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "Filter is invalid", "phalcon/Assets/Manager.zep", 814);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&_5$$7, &filter, "filter", NULL, 0, &content);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&content, &_5$$7);
+ ZEPHIR_CALL_METHOD(NULL, &filters, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&filter);
+ if (zephir_is_true(&join)) {
+ zephir_concat_self(&joinedContent, &content);
+ } else {
+ ZVAL_BOOL(&_8$$10, 0);
+ ZVAL_BOOL(&_9$$10, 1);
+ ZEPHIR_CALL_CE_STATIC(&_6$$10, phalcon_tag_ce, "taghtml", &_7, 0, type, &attributes, &_8$$10, &_9$$10);
+ zephir_check_call_status();
+ ZVAL_BOOL(&_8$$10, 1);
+ ZEPHIR_CALL_CE_STATIC(&_10$$10, phalcon_tag_ce, "taghtmlclose", &_11, 0, type, &_8$$10);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_12$$10);
+ ZEPHIR_CONCAT_VVV(&_12$$10, &_6$$10, &content, &_10$$10);
+ zephir_concat_self(&html, &_12$$10);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &codes, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1$$3, &codes, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&code, &codes, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&attributes, &code, "getattributes", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&content, &code, "getcontent", NULL, 0);
+ zephir_check_call_status();
+ zephir_is_iterable(&filters, 0, "phalcon/Assets/Manager.zep", 824);
+ if (Z_TYPE_P(&filters) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&filters), _13$$11)
+ {
+ ZEPHIR_INIT_NVAR(&filter);
+ ZVAL_COPY(&filter, _13$$11);
+ if (UNEXPECTED(Z_TYPE_P(&filter) != IS_OBJECT)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "Filter is invalid", "phalcon/Assets/Manager.zep", 814);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&_15$$12, &filter, "filter", NULL, 0, &content);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&content, &_15$$12);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &filters, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_14$$11, &filters, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_14$$11)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&filter, &filters, "current", NULL, 0);
+ zephir_check_call_status();
+ if (UNEXPECTED(Z_TYPE_P(&filter) != IS_OBJECT)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "Filter is invalid", "phalcon/Assets/Manager.zep", 814);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&_16$$14, &filter, "filter", NULL, 0, &content);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&content, &_16$$14);
+ ZEPHIR_CALL_METHOD(NULL, &filters, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&filter);
+ if (zephir_is_true(&join)) {
+ zephir_concat_self(&joinedContent, &content);
+ } else {
+ ZVAL_BOOL(&_18$$17, 0);
+ ZVAL_BOOL(&_19$$17, 1);
+ ZEPHIR_CALL_CE_STATIC(&_17$$17, phalcon_tag_ce, "taghtml", &_7, 0, type, &attributes, &_18$$17, &_19$$17);
+ zephir_check_call_status();
+ ZVAL_BOOL(&_18$$17, 1);
+ ZEPHIR_CALL_CE_STATIC(&_20$$17, phalcon_tag_ce, "taghtmlclose", &_11, 0, type, &_18$$17);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_21$$17);
+ ZEPHIR_CONCAT_VVV(&_21$$17, &_17$$17, &content, &_20$$17);
+ zephir_concat_self(&html, &_21$$17);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &codes, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&code);
+ if (zephir_is_true(&join)) {
+ ZVAL_BOOL(&_23$$18, 0);
+ ZVAL_BOOL(&_24$$18, 1);
+ ZEPHIR_CALL_CE_STATIC(&_22$$18, phalcon_tag_ce, "taghtml", &_7, 0, type, &attributes, &_23$$18, &_24$$18);
+ zephir_check_call_status();
+ ZVAL_BOOL(&_23$$18, 1);
+ ZEPHIR_CALL_CE_STATIC(&_25$$18, phalcon_tag_ce, "taghtmlclose", &_11, 0, type, &_23$$18);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_26$$18);
+ ZEPHIR_CONCAT_VVV(&_26$$18, &_22$$18, &joinedContent, &_25$$18);
+ zephir_concat_self(&html, &_26$$18);
+ }
+ zephir_read_property(&_27$$3, this_ptr, ZEND_STRL("implicitOutput"), PH_NOISY_CC | PH_READONLY);
+ if (ZEPHIR_IS_TRUE(&_27$$3)) {
+ zend_print_zval(&html, 0);
+ } else {
+ zephir_concat_self(&output, &html);
+ }
+ }
+ RETURN_CTOR(&output);
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileCase)
+static PHP_METHOD(Phalcon_Assets_Manager, outputInlineCss)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool caseClause;
- zval *statement_param = NULL, *caseClause_param = NULL, expr, _2, _0$$4, _1$$4;
- zval statement;
+ zval *collectionName_param = NULL, collection, _0;
+ zval collectionName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statement);
- ZVAL_UNDEF(&expr);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_0$$4);
- ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&collectionName);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ARRAY(statement)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(caseClause)
+ Z_PARAM_STR_OR_NULL(collectionName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &statement_param, &caseClause_param);
- ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param);
- if (!caseClause_param) {
- caseClause = 1;
+ zephir_fetch_params(1, 0, 1, &collectionName_param);
+ if (!collectionName_param) {
+ ZEPHIR_INIT_VAR(&collectionName);
} else {
- caseClause = zephir_get_boolval(caseClause_param);
+ zephir_get_strval(&collectionName, collectionName_param);
}
- if (UNEXPECTED(caseClause == 0)) {
- RETURN_MM_STRING("");
- }
- ZEPHIR_OBS_VAR(&expr);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0)))) {
- ZEPHIR_INIT_VAR(&_0$$4);
- object_init_ex(&_0$$4, phalcon_mvc_view_engine_volt_exception_ce);
- ZEPHIR_INIT_VAR(&_1$$4);
- ZVAL_STRING(&_1$$4, "Corrupt statement");
- ZEPHIR_CALL_METHOD(NULL, &_0$$4, "__construct", NULL, 508, &_1$$4, &statement);
+ if (!(!(ZEPHIR_IS_EMPTY(&collectionName)))) {
+ ZEPHIR_CALL_METHOD(&collection, this_ptr, "getcss", NULL, 0);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CALL_METHOD(&collection, this_ptr, "get", NULL, 0, &collectionName);
zephir_check_call_status();
- zephir_throw_exception_debug(&_0$$4, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 567);
- ZEPHIR_MM_RESTORE();
- return;
}
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 507, &expr);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "style");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "outputinline", NULL, 0, &collection, &_0);
zephir_check_call_status();
- ZEPHIR_CONCAT_SVS(return_value, "");
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileDo)
+static PHP_METHOD(Phalcon_Assets_Manager, outputInlineJs)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *statement_param = NULL, expr, _0;
- zval statement;
+ zval *collectionName_param = NULL, collection, _0;
+ zval collectionName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statement);
- ZVAL_UNDEF(&expr);
+ ZVAL_UNDEF(&collectionName);
+ ZVAL_UNDEF(&collection);
ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(statement)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(collectionName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &statement_param);
- ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param);
+ zephir_fetch_params(1, 0, 1, &collectionName_param);
+ if (!collectionName_param) {
+ ZEPHIR_INIT_VAR(&collectionName);
+ } else {
+ zephir_get_strval(&collectionName, collectionName_param);
+ }
- ZEPHIR_OBS_VAR(&expr);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 591);
- return;
+ if (!(!(ZEPHIR_IS_EMPTY(&collectionName)))) {
+ ZEPHIR_CALL_METHOD(&collection, this_ptr, "getjs", NULL, 0);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CALL_METHOD(&collection, this_ptr, "get", NULL, 0, &collectionName);
+ zephir_check_call_status();
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "expression", NULL, 507, &expr);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "script");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "outputinline", NULL, 0, &collection, &_0);
zephir_check_call_status();
- ZEPHIR_CONCAT_SVS(return_value, "");
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileEcho)
+static PHP_METHOD(Phalcon_Assets_Manager, outputJs)
{
+ zend_bool _2;
+ zval callback;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *statement_param = NULL, expr, exprCode, name, _2, _5, _0$$3, _1$$3, _3$$4, _4$$5;
- zval statement;
+ zval *collectionName_param = NULL, collection, container, tag, _0, _1, _3, _4$$5, _5$$5;
+ zval collectionName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statement);
- ZVAL_UNDEF(&expr);
- ZVAL_UNDEF(&exprCode);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&collectionName);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&container);
+ ZVAL_UNDEF(&tag);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&callback);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(statement)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(collectionName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &statement_param);
- ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param);
+ zephir_fetch_params(1, 0, 1, &collectionName_param);
+ if (!collectionName_param) {
+ ZEPHIR_INIT_VAR(&collectionName);
+ } else {
+ zephir_get_strval(&collectionName, collectionName_param);
+ }
- ZEPHIR_OBS_VAR(&expr);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0)))) {
- ZEPHIR_INIT_VAR(&_0$$3);
- object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce);
- ZEPHIR_INIT_VAR(&_1$$3);
- ZVAL_STRING(&_1$$3, "Corrupt statement");
- ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 508, &_1$$3, &statement);
+ if (!(!(ZEPHIR_IS_EMPTY(&collectionName)))) {
+ ZEPHIR_CALL_METHOD(&collection, this_ptr, "getjs", NULL, 0);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CALL_METHOD(&collection, this_ptr, "get", NULL, 0, &collectionName);
zephir_check_call_status();
- zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 615);
- ZEPHIR_MM_RESTORE();
- return;
}
- ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 507, &expr);
- zephir_check_call_status();
- zephir_array_fetch_string(&_2, &expr, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 623);
- if (ZEPHIR_IS_LONG(&_2, 350)) {
- zephir_array_fetch_string(&name, &expr, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 624);
- zephir_array_fetch_string(&_3$$4, &name, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 626);
- if (ZEPHIR_IS_LONG(&_3$$4, 265)) {
- zephir_array_fetch_string(&_4$$5, &name, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 631);
- if (ZEPHIR_IS_STRING(&_4$$5, "super")) {
- RETURN_CCTOR(&exprCode);
- }
- }
+ ZEPHIR_INIT_VAR(&callback);
+ zephir_create_array(&callback, 2, 0);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "Phalcon\\Tag");
+ zephir_array_fast_append(&callback, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "javascriptInclude");
+ zephir_array_fast_append(&callback, &_0);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&container, &_1);
+ _2 = Z_TYPE_P(&container) == IS_OBJECT;
+ if (_2) {
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "tag");
+ ZEPHIR_CALL_METHOD(&_3, &container, "has", NULL, 0, &_0);
+ zephir_check_call_status();
+ _2 = zephir_is_true(&_3);
}
- zephir_read_property(&_5, this_ptr, ZEND_STRL("autoescape"), PH_NOISY_CC | PH_READONLY);
- if (zephir_is_true(&_5)) {
- ZEPHIR_CONCAT_SVS(return_value, "= $this->escaper->escapeHtml(", &exprCode, ") ?>");
- RETURN_MM();
+ if (_2) {
+ ZEPHIR_INIT_VAR(&_4$$5);
+ ZVAL_STRING(&_4$$5, "tag");
+ ZEPHIR_CALL_METHOD(&tag, &container, "getshared", NULL, 0, &_4$$5);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_5$$5);
+ zephir_create_array(&_5$$5, 2, 0);
+ zephir_array_fast_append(&_5$$5, &tag);
+ ZEPHIR_INIT_NVAR(&_4$$5);
+ ZVAL_STRING(&_4$$5, "javascriptInclude");
+ zephir_array_fast_append(&_5$$5, &_4$$5);
+ ZEPHIR_CPY_WRT(&callback, &_5$$5);
}
- ZEPHIR_CONCAT_SVS(return_value, "= ", &exprCode, " ?>");
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "js");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "output", NULL, 0, &collection, &callback, &_0);
+ zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileElseIf)
+static PHP_METHOD(Phalcon_Assets_Manager, set)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *statement_param = NULL, expr, _2, _0$$3, _1$$3;
- zval statement;
+ zval *id_param = NULL, *collection, collection_sub;
+ zval id;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statement);
- ZVAL_UNDEF(&expr);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&id);
+ ZVAL_UNDEF(&collection_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(statement)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(id)
+ Z_PARAM_OBJECT_OF_CLASS(collection, phalcon_assets_collection_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &statement_param);
- ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param);
+ zephir_fetch_params(1, 2, 0, &id_param, &collection);
+ if (UNEXPECTED(Z_TYPE_P(id_param) != IS_STRING && Z_TYPE_P(id_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(id_param) == IS_STRING)) {
+ zephir_get_strval(&id, id_param);
+ } else {
+ ZEPHIR_INIT_VAR(&id);
+ }
- ZEPHIR_OBS_VAR(&expr);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0)))) {
- ZEPHIR_INIT_VAR(&_0$$3);
- object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce);
- ZEPHIR_INIT_VAR(&_1$$3);
- ZVAL_STRING(&_1$$3, "Corrupt statement");
- ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 508, &_1$$3, &statement);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 662);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 507, &expr);
- zephir_check_call_status();
- ZEPHIR_CONCAT_SVS(return_value, "");
- RETURN_MM();
+ zephir_update_property_array(this_ptr, SL("collections"), &id, collection);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileFile)
+static PHP_METHOD(Phalcon_Assets_Manager, setOptions)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool extendsMode;
- zval *path_param = NULL, *compiledPath_param = NULL, *extendsMode_param = NULL, viewCode, compilation, finalCompilation, _4, _5, _0$$4, _2$$5;
- zval path, compiledPath, _1$$4, _3$$5;
+ zval *options_param = NULL;
+ zval options;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&path);
- ZVAL_UNDEF(&compiledPath);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_3$$5);
- ZVAL_UNDEF(&viewCode);
- ZVAL_UNDEF(&compilation);
- ZVAL_UNDEF(&finalCompilation);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_0$$4);
- ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&options);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(path)
- Z_PARAM_STR(compiledPath)
- Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(extendsMode)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 1, &path_param, &compiledPath_param, &extendsMode_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(path_param) == IS_STRING)) {
- zephir_get_strval(&path, path_param);
- } else {
- ZEPHIR_INIT_VAR(&path);
- }
- if (UNEXPECTED(Z_TYPE_P(compiledPath_param) != IS_STRING && Z_TYPE_P(compiledPath_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'compiledPath' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(compiledPath_param) == IS_STRING)) {
- zephir_get_strval(&compiledPath, compiledPath_param);
- } else {
- ZEPHIR_INIT_VAR(&compiledPath);
- }
- if (!extendsMode_param) {
- extendsMode = 0;
- } else {
- extendsMode = zephir_get_boolval(extendsMode_param);
- }
+ zephir_fetch_params(1, 1, 0, &options_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- if (UNEXPECTED(ZEPHIR_IS_EQUAL(&path, &compiledPath))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Template path and compilation template path cannot be the same", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 695);
- return;
- }
- if (UNEXPECTED(!((zephir_file_exists(&path) == SUCCESS)))) {
- ZEPHIR_INIT_VAR(&_0$$4);
- object_init_ex(&_0$$4, phalcon_mvc_view_engine_volt_exception_ce);
- ZEPHIR_INIT_VAR(&_1$$4);
- ZEPHIR_CONCAT_SVS(&_1$$4, "Template file ", &path, " does not exist");
- ZEPHIR_CALL_METHOD(NULL, &_0$$4, "__construct", NULL, 508, &_1$$4);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_0$$4, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 702);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_INIT_VAR(&viewCode);
- zephir_file_get_contents(&viewCode, &path);
- if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&viewCode))) {
- ZEPHIR_INIT_VAR(&_2$$5);
- object_init_ex(&_2$$5, phalcon_mvc_view_engine_volt_exception_ce);
- ZEPHIR_INIT_VAR(&_3$$5);
- ZEPHIR_CONCAT_SVS(&_3$$5, "Template file ", &path, " could not be opened");
- ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 508, &_3$$5);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_2$$5, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 714);
- ZEPHIR_MM_RESTORE();
- return;
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("currentPath"), &path);
- if (extendsMode) {
- ZVAL_BOOL(&_4, 1);
- } else {
- ZVAL_BOOL(&_4, 0);
- }
- ZEPHIR_CALL_METHOD(&compilation, this_ptr, "compilesource", NULL, 0, &viewCode, &_4);
- zephir_check_call_status();
- if (Z_TYPE_P(&compilation) == IS_ARRAY) {
- ZEPHIR_CALL_FUNCTION(&finalCompilation, "serialize", NULL, 13, &compilation);
- zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
+ RETURN_THIS();
+}
+
+static PHP_METHOD(Phalcon_Assets_Manager, useImplicitOutput)
+{
+ zval *implicitOutput_param = NULL, __$true, __$false;
+ zend_bool implicitOutput;
+ zval *this_ptr = getThis();
+
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(implicitOutput)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &implicitOutput_param);
+ implicitOutput = zephir_get_boolval(implicitOutput_param);
+
+
+ if (implicitOutput) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("implicitOutput"), &__$true);
} else {
- ZEPHIR_CPY_WRT(&finalCompilation, &compilation);
- }
- ZEPHIR_INIT_VAR(&_5);
- zephir_file_put_contents(&_5, &compiledPath, &finalCompilation);
- if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&_5))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Volt directory can't be written", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 735);
- return;
+ zephir_update_property_zval(this_ptr, ZEND_STRL("implicitOutput"), &__$false);
}
- RETURN_CCTOR(&compilation);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForeach)
+static PHP_METHOD(Phalcon_Assets_Manager, getPrefixedPath)
{
- zval compilation;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool extendsMode;
- zval *statement_param = NULL, *extendsMode_param = NULL, prefix, level, prefixLevel, expr, exprCode, bstatement, type, blockStatements, forElse, code, loopContext, iterator, key, ifExpr, variable, _4, *_0$$4, _1$$4, _2$$7, _3$$10, _5$$11, _6$$11, _7$$11, _8$$11, _9$$11, _10$$11, _11$$11, _12$$11, _13$$11, _14$$13, _15$$14, _16$$15, _17$$15, _18$$17, _19$$17, _20$$17, _21$$17, _22$$17, _23$$17, _24$$18, _25$$22;
- zval statement;
+ zval path;
+ zval *collection, collection_sub, *path_param = NULL, prefix;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statement);
+ ZVAL_UNDEF(&collection_sub);
ZVAL_UNDEF(&prefix);
- ZVAL_UNDEF(&level);
- ZVAL_UNDEF(&prefixLevel);
- ZVAL_UNDEF(&expr);
- ZVAL_UNDEF(&exprCode);
- ZVAL_UNDEF(&bstatement);
- ZVAL_UNDEF(&type);
- ZVAL_UNDEF(&blockStatements);
- ZVAL_UNDEF(&forElse);
- ZVAL_UNDEF(&code);
- ZVAL_UNDEF(&loopContext);
- ZVAL_UNDEF(&iterator);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&ifExpr);
- ZVAL_UNDEF(&variable);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$7);
- ZVAL_UNDEF(&_3$$10);
- ZVAL_UNDEF(&_5$$11);
- ZVAL_UNDEF(&_6$$11);
- ZVAL_UNDEF(&_7$$11);
- ZVAL_UNDEF(&_8$$11);
- ZVAL_UNDEF(&_9$$11);
- ZVAL_UNDEF(&_10$$11);
- ZVAL_UNDEF(&_11$$11);
- ZVAL_UNDEF(&_12$$11);
- ZVAL_UNDEF(&_13$$11);
- ZVAL_UNDEF(&_14$$13);
- ZVAL_UNDEF(&_15$$14);
- ZVAL_UNDEF(&_16$$15);
- ZVAL_UNDEF(&_17$$15);
- ZVAL_UNDEF(&_18$$17);
- ZVAL_UNDEF(&_19$$17);
- ZVAL_UNDEF(&_20$$17);
- ZVAL_UNDEF(&_21$$17);
- ZVAL_UNDEF(&_22$$17);
- ZVAL_UNDEF(&_23$$17);
- ZVAL_UNDEF(&_24$$18);
- ZVAL_UNDEF(&_25$$22);
- ZVAL_UNDEF(&compilation);
+ ZVAL_UNDEF(&path);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ARRAY(statement)
- Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(extendsMode)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_OBJECT_OF_CLASS(collection, phalcon_assets_collection_ce)
+ Z_PARAM_STR(path)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &statement_param, &extendsMode_param);
- ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param);
- if (!extendsMode_param) {
- extendsMode = 0;
- } else {
- extendsMode = zephir_get_boolval(extendsMode_param);
- }
+ zephir_fetch_params(1, 2, 0, &collection, &path_param);
+ zephir_get_strval(&path, path_param);
- if (UNEXPECTED(!(zephir_array_isset_string(&statement, SL("expr"))))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 760);
- return;
- }
- ZEPHIR_INIT_VAR(&compilation);
- ZEPHIR_INIT_VAR(&forElse);
- ZVAL_NULL(&forElse);
- RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("foreachLevel")));
- ZEPHIR_CALL_METHOD(&prefix, this_ptr, "getuniqueprefix", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(&level);
- zephir_read_property(&level, this_ptr, ZEND_STRL("foreachLevel"), PH_NOISY_CC);
- ZEPHIR_INIT_VAR(&prefixLevel);
- ZEPHIR_CONCAT_VV(&prefixLevel, &prefix, &level);
- ZEPHIR_OBS_VAR(&expr);
- zephir_array_fetch_string(&expr, &statement, SL("expr"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 780);
- ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 507, &expr);
+ ZEPHIR_CALL_METHOD(&prefix, collection, "getprefix", NULL, 0);
zephir_check_call_status();
- ZEPHIR_OBS_VAR(&blockStatements);
- zephir_array_fetch_string(&blockStatements, &statement, SL("block_statements"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 787);
- ZEPHIR_INIT_NVAR(&forElse);
- ZVAL_BOOL(&forElse, 0);
- if (Z_TYPE_P(&blockStatements) == IS_ARRAY) {
- zephir_is_iterable(&blockStatements, 0, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 808);
- if (Z_TYPE_P(&blockStatements) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&blockStatements), _0$$4)
- {
- ZEPHIR_INIT_NVAR(&bstatement);
- ZVAL_COPY(&bstatement, _0$$4);
- ZEPHIR_OBS_NVAR(&type);
- if (!(zephir_array_isset_string_fetch(&type, &bstatement, SL("type"), 0))) {
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 321)) {
- ZEPHIR_INIT_NVAR(&_2$$7);
- ZEPHIR_CONCAT_SVS(&_2$$7, "");
- zephir_concat_self(&compilation, &_2$$7);
- ZEPHIR_CPY_WRT(&forElse, &prefixLevel);
- zephir_update_property_array(this_ptr, SL("forElsePointers"), &level, &forElse);
- break;
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &blockStatements, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1$$4, &blockStatements, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1$$4)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&bstatement, &blockStatements, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_OBS_NVAR(&type);
- if (!(zephir_array_isset_string_fetch(&type, &bstatement, SL("type"), 0))) {
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 321)) {
- ZEPHIR_INIT_NVAR(&_3$$10);
- ZEPHIR_CONCAT_SVS(&_3$$10, "");
- zephir_concat_self(&compilation, &_3$$10);
- ZEPHIR_CPY_WRT(&forElse, &prefixLevel);
- zephir_update_property_array(this_ptr, SL("forElsePointers"), &level, &forElse);
- break;
- }
- ZEPHIR_CALL_METHOD(NULL, &blockStatements, "next", NULL, 0);
- zephir_check_call_status();
- }
+ if (!(zephir_is_true(&prefix))) {
+ RETURN_CTOR(&path);
+ }
+ ZEPHIR_CONCAT_VV(return_value, &prefix, &path);
+ RETURN_MM();
+}
+
+zend_object *zephir_init_properties_Phalcon_Assets_Manager(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_MM_GROW();
+
+ {
+ 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_INIT_NVAR(&bstatement);
+ zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("collections"), 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("collections"), &_3$$4);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
+ }
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Assets_Asset_Css)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Assets\\Asset, Css, phalcon, assets_asset_css, phalcon_assets_asset_ce, phalcon_assets_asset_css_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Assets_Asset_Css, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_0 = NULL;
+ zval attributes;
+ zend_bool local, filter, autoVersion;
+ zval *path_param = NULL, *local_param = NULL, *filter_param = NULL, *attributes_param = NULL, *version_param = NULL, *autoVersion_param = NULL, _1, _2, _3, _4;
+ zval path, version;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&path);
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&attributes);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 6)
+ Z_PARAM_STR(path)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(local)
+ Z_PARAM_BOOL(filter)
+ Z_PARAM_ARRAY(attributes)
+ Z_PARAM_STR_OR_NULL(version)
+ Z_PARAM_BOOL(autoVersion)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 5, &path_param, &local_param, &filter_param, &attributes_param, &version_param, &autoVersion_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 (extendsMode) {
- ZVAL_BOOL(&_4, 1);
+ if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) {
+ zephir_get_strval(&path, path_param);
} else {
- ZVAL_BOOL(&_4, 0);
+ ZEPHIR_INIT_VAR(&path);
}
- ZEPHIR_CALL_METHOD(&code, this_ptr, "statementlist", NULL, 509, &blockStatements, &_4);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(&loopContext);
- zephir_read_property(&loopContext, this_ptr, ZEND_STRL("loopPointers"), PH_NOISY_CC);
- if (zephir_array_isset(&loopContext, &level)) {
- ZEPHIR_INIT_VAR(&_5$$11);
- ZEPHIR_CONCAT_SVSVS(&_5$$11, "self = &$", &prefixLevel, "loop; ");
- zephir_concat_self(&compilation, &_8$$11);
- ZEPHIR_INIT_VAR(&_9$$11);
- ZEPHIR_CONCAT_SVSVS(&_9$$11, "$", &prefixLevel, "loop->length = count($", &prefixLevel, "iterator); ");
- zephir_concat_self(&compilation, &_9$$11);
- ZEPHIR_INIT_VAR(&_10$$11);
- ZEPHIR_CONCAT_SVS(&_10$$11, "$", &prefixLevel, "loop->index = 1; ");
- zephir_concat_self(&compilation, &_10$$11);
- ZEPHIR_INIT_VAR(&_11$$11);
- ZEPHIR_CONCAT_SVS(&_11$$11, "$", &prefixLevel, "loop->index0 = 1; ");
- zephir_concat_self(&compilation, &_11$$11);
- ZEPHIR_INIT_VAR(&_12$$11);
- ZEPHIR_CONCAT_SVSVS(&_12$$11, "$", &prefixLevel, "loop->revindex = $", &prefixLevel, "loop->length; ");
- zephir_concat_self(&compilation, &_12$$11);
- ZEPHIR_INIT_VAR(&_13$$11);
- ZEPHIR_CONCAT_SVSVS(&_13$$11, "$", &prefixLevel, "loop->revindex0 = $", &prefixLevel, "loop->length - 1; ?>");
- zephir_concat_self(&compilation, &_13$$11);
- ZEPHIR_INIT_VAR(&iterator);
- ZEPHIR_CONCAT_SVS(&iterator, "$", &prefixLevel, "iterator");
+ if (!local_param) {
+ local = 1;
} else {
- ZEPHIR_CPY_WRT(&iterator, &exprCode);
+ local = zephir_get_boolval(local_param);
}
- ZEPHIR_OBS_VAR(&variable);
- zephir_array_fetch_string(&variable, &statement, SL("variable"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 839);
- ZEPHIR_OBS_VAR(&key);
- if (zephir_array_isset_string_fetch(&key, &statement, SL("key"), 0)) {
- ZEPHIR_INIT_VAR(&_14$$13);
- ZEPHIR_CONCAT_SVSVSVS(&_14$$13, " $", &variable, ") { ");
- zephir_concat_self(&compilation, &_14$$13);
+ if (!filter_param) {
+ filter = 1;
} else {
- ZEPHIR_INIT_VAR(&_15$$14);
- ZEPHIR_CONCAT_SVSVS(&_15$$14, "");
- zephir_concat_self(&compilation, &_17$$15);
+ if (!attributes_param) {
+ ZEPHIR_INIT_VAR(&attributes);
+ array_init(&attributes);
} else {
- zephir_concat_self_str(&compilation, "?>", sizeof("?>") - 1);
+ zephir_get_arrval(&attributes, attributes_param);
}
- if (zephir_array_isset(&loopContext, &level)) {
- ZEPHIR_INIT_VAR(&_18$$17);
- ZEPHIR_CONCAT_SVSVS(&_18$$17, "first = ($", &prefixLevel, "incr == 0); ");
- zephir_concat_self(&compilation, &_18$$17);
- ZEPHIR_INIT_VAR(&_19$$17);
- ZEPHIR_CONCAT_SVSVS(&_19$$17, "$", &prefixLevel, "loop->index = $", &prefixLevel, "incr + 1; ");
- zephir_concat_self(&compilation, &_19$$17);
- ZEPHIR_INIT_VAR(&_20$$17);
- ZEPHIR_CONCAT_SVSVS(&_20$$17, "$", &prefixLevel, "loop->index0 = $", &prefixLevel, "incr; ");
- zephir_concat_self(&compilation, &_20$$17);
- ZEPHIR_INIT_VAR(&_21$$17);
- ZEPHIR_CONCAT_SVSVSVS(&_21$$17, "$", &prefixLevel, "loop->revindex = $", &prefixLevel, "loop->length - $", &prefixLevel, "incr; ");
- zephir_concat_self(&compilation, &_21$$17);
- ZEPHIR_INIT_VAR(&_22$$17);
- ZEPHIR_CONCAT_SVSVSVS(&_22$$17, "$", &prefixLevel, "loop->revindex0 = $", &prefixLevel, "loop->length - ($", &prefixLevel, "incr + 1); ");
- zephir_concat_self(&compilation, &_22$$17);
- ZEPHIR_INIT_VAR(&_23$$17);
- ZEPHIR_CONCAT_SVSVSVS(&_23$$17, "$", &prefixLevel, "loop->last = ($", &prefixLevel, "incr == ($", &prefixLevel, "loop->length - 1)); ?>");
- zephir_concat_self(&compilation, &_23$$17);
+ if (!version_param) {
+ ZEPHIR_INIT_VAR(&version);
+ } else {
+ zephir_get_strval(&version, version_param);
}
- if (Z_TYPE_P(&forElse) == IS_STRING) {
- ZEPHIR_INIT_VAR(&_24$$18);
- ZEPHIR_CONCAT_SVS(&_24$$18, "");
- zephir_concat_self(&compilation, &_24$$18);
+ if (!autoVersion_param) {
+ autoVersion = 0;
+ } else {
+ autoVersion = zephir_get_boolval(autoVersion_param);
}
- zephir_concat_self(&compilation, &code);
- if (zephir_array_isset_string(&statement, SL("if_expr"))) {
- zephir_concat_self_str(&compilation, "", sizeof("") - 1);
+
+
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "css");
+ if (local) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
}
- if (Z_TYPE_P(&forElse) == IS_STRING) {
- zephir_concat_self_str(&compilation, "", sizeof("") - 1);
+ if (filter) {
+ ZVAL_BOOL(&_3, 1);
} else {
- if (zephir_array_isset(&loopContext, &level)) {
- ZEPHIR_INIT_VAR(&_25$$22);
- ZEPHIR_CONCAT_SVS(&_25$$22, "");
- zephir_concat_self(&compilation, &_25$$22);
- } else {
- zephir_concat_self_str(&compilation, "", sizeof("") - 1);
- }
+ ZVAL_BOOL(&_3, 0);
}
- RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("foreachLevel")));
- RETURN_CTOR(&compilation);
+ if (autoVersion) {
+ ZVAL_BOOL(&_4, 1);
+ } else {
+ ZVAL_BOOL(&_4, 0);
+ }
+ ZEPHIR_CALL_PARENT(NULL, phalcon_assets_asset_css_ce, getThis(), "__construct", &_0, 0, &_1, &path, &_2, &_3, &attributes, &version, &_4);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForElse)
-{
- zval level, prefix, _0, _1;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&level);
- ZVAL_UNDEF(&prefix);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+
+
+#ifdef HAVE_CONFIG_H
+#endif
- zephir_read_property(&level, this_ptr, ZEND_STRL("foreachLevel"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("forElsePointers"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&prefix, &_0, &level, 1))) {
- RETURN_STRING("");
- }
- zephir_read_property(&_1, this_ptr, ZEND_STRL("loopPointers"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset(&_1, &level)) {
- ZEPHIR_CONCAT_SVSVS(return_value, "");
- return;
- }
- ZEPHIR_CONCAT_SVS(return_value, "");
- return;
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Assets_Asset_Js)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Assets\\Asset, Js, phalcon, assets_asset_js, phalcon_assets_asset_ce, phalcon_assets_asset_js_method_entry, 0);
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileIf)
+static PHP_METHOD(Phalcon_Assets_Asset_Js, __construct)
{
- zval compilation;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool extendsMode;
- zval *statement_param = NULL, *extendsMode_param = NULL, blockStatements, expr, _2, _3, _4, _5, _6, _0$$3, _1$$3, _7$$4, _8$$4, _9$$4;
- zval statement;
+ zephir_fcall_cache_entry *_0 = NULL;
+ zval attributes;
+ zend_bool local, filter, autoVersion;
+ zval *path_param = NULL, *local_param = NULL, *filter_param = NULL, *attributes_param = NULL, *version_param = NULL, *autoVersion_param = NULL, _1, _2, _3, _4;
+ zval path, version;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statement);
- ZVAL_UNDEF(&blockStatements);
- ZVAL_UNDEF(&expr);
+ ZVAL_UNDEF(&path);
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_7$$4);
- ZVAL_UNDEF(&_8$$4);
- ZVAL_UNDEF(&_9$$4);
- ZVAL_UNDEF(&compilation);
+ ZVAL_UNDEF(&attributes);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ARRAY(statement)
+ ZEND_PARSE_PARAMETERS_START(1, 6)
+ Z_PARAM_STR(path)
Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(extendsMode)
+ Z_PARAM_BOOL(local)
+ Z_PARAM_BOOL(filter)
+ Z_PARAM_ARRAY(attributes)
+ Z_PARAM_STR_OR_NULL(version)
+ Z_PARAM_BOOL(autoVersion)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &statement_param, &extendsMode_param);
- ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param);
- if (!extendsMode_param) {
- extendsMode = 0;
+ zephir_fetch_params(1, 1, 5, &path_param, &local_param, &filter_param, &attributes_param, &version_param, &autoVersion_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(path_param) == IS_STRING)) {
+ zephir_get_strval(&path, path_param);
} else {
- extendsMode = zephir_get_boolval(extendsMode_param);
+ ZEPHIR_INIT_VAR(&path);
+ }
+ if (!local_param) {
+ local = 1;
+ } else {
+ local = zephir_get_boolval(local_param);
+ }
+ if (!filter_param) {
+ filter = 1;
+ } else {
+ filter = zephir_get_boolval(filter_param);
+ }
+ if (!attributes_param) {
+ ZEPHIR_INIT_VAR(&attributes);
+ array_init(&attributes);
+ } else {
+ zephir_get_arrval(&attributes, attributes_param);
+ }
+ if (!version_param) {
+ ZEPHIR_INIT_VAR(&version);
+ } else {
+ zephir_get_strval(&version, version_param);
+ }
+ if (!autoVersion_param) {
+ autoVersion = 0;
+ } else {
+ autoVersion = zephir_get_boolval(autoVersion_param);
}
- ZEPHIR_OBS_VAR(&expr);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0)))) {
- ZEPHIR_INIT_VAR(&_0$$3);
- object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce);
- ZEPHIR_INIT_VAR(&_1$$3);
- ZVAL_STRING(&_1$$3, "Corrupt statement");
- ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 508, &_1$$3, &statement);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 942);
- ZEPHIR_MM_RESTORE();
- return;
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "js");
+ if (local) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
}
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 507, &expr);
- zephir_check_call_status();
- zephir_array_fetch_string(&_4, &statement, SL("true_statements"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 948);
- if (extendsMode) {
- ZVAL_BOOL(&_5, 1);
+ if (filter) {
+ ZVAL_BOOL(&_3, 1);
} else {
- ZVAL_BOOL(&_5, 0);
+ ZVAL_BOOL(&_3, 0);
}
- ZEPHIR_CALL_METHOD(&_3, this_ptr, "statementlist", NULL, 509, &_4, &_5);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_6);
- ZEPHIR_CONCAT_SVSV(&_6, "", &_3);
- zephir_get_strval(&compilation, &_6);
- ZEPHIR_OBS_VAR(&blockStatements);
- if (zephir_array_isset_string_fetch(&blockStatements, &statement, SL("false_statements"), 0)) {
- if (extendsMode) {
- ZVAL_BOOL(&_8$$4, 1);
- } else {
- ZVAL_BOOL(&_8$$4, 0);
- }
- ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "statementlist", NULL, 509, &blockStatements, &_8$$4);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_9$$4);
- ZEPHIR_CONCAT_SV(&_9$$4, "", &_7$$4);
- zephir_concat_self(&compilation, &_9$$4);
+ if (autoVersion) {
+ ZVAL_BOOL(&_4, 1);
+ } else {
+ ZVAL_BOOL(&_4, 0);
}
- zephir_concat_self_str(&compilation, "", sizeof("") - 1);
- RETURN_CTOR(&compilation);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_assets_asset_js_ce, getThis(), "__construct", &_0, 0, &_1, &path, &_2, &_3, &attributes, &version, &_4);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileInclude)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Assets_Filters_Cssmin)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Assets\\Filters, Cssmin, phalcon, assets_filters_cssmin, phalcon_assets_filters_cssmin_method_entry, 0);
+
+ zend_class_implements(phalcon_assets_filters_cssmin_ce, 1, phalcon_assets_filterinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Assets_Filters_Cssmin, filter)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *statement_param = NULL, pathExpr, path, subCompiler, finalPath, compilation, params, _0, _3, _1$$5, _2$$6;
- zval statement;
+ zval *content_param = NULL;
+ zval content;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statement);
- ZVAL_UNDEF(&pathExpr);
- ZVAL_UNDEF(&path);
- ZVAL_UNDEF(&subCompiler);
- ZVAL_UNDEF(&finalPath);
- ZVAL_UNDEF(&compilation);
- ZVAL_UNDEF(¶ms);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_1$$5);
- ZVAL_UNDEF(&_2$$6);
+ ZVAL_UNDEF(&content);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(statement)
+ Z_PARAM_STR(content)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &statement_param);
- ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param);
-
-
- ZEPHIR_OBS_VAR(&pathExpr);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&pathExpr, &statement, SL("path"), 0)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 982);
- return;
- }
- zephir_array_fetch_string(&_0, &pathExpr, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 989);
- if (ZEPHIR_IS_LONG(&_0, 260)) {
- if (!(zephir_array_isset_string(&statement, SL("params")))) {
- ZEPHIR_OBS_VAR(&path);
- zephir_array_fetch_string(&path, &pathExpr, SL("value"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 998);
- ZEPHIR_CALL_METHOD(&finalPath, this_ptr, "getfinalpath", NULL, 0, &path);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&subCompiler);
- if (zephir_clone(&subCompiler, this_ptr) == FAILURE) {
- RETURN_MM();
- }
- ZVAL_BOOL(&_1$$5, 0);
- ZEPHIR_CALL_METHOD(&compilation, &subCompiler, "compile", NULL, 0, &finalPath, &_1$$5);
- zephir_check_call_status();
- if (Z_TYPE_P(&compilation) == IS_NULL) {
- ZEPHIR_CALL_METHOD(&_2$$6, &subCompiler, "getcompiledtemplatepath", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&compilation);
- zephir_file_get_contents(&compilation, &_2$$6);
- }
- RETURN_CCTOR(&compilation);
- }
+ zephir_fetch_params(1, 1, 0, &content_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();
}
- ZEPHIR_CALL_METHOD(&path, this_ptr, "expression", NULL, 507, &pathExpr);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(¶ms);
- if (!(zephir_array_isset_string_fetch(¶ms, &statement, SL("params"), 0))) {
- ZEPHIR_CONCAT_SVS(return_value, "partial(", &path, "); ?>");
- RETURN_MM();
+ if (EXPECTED(Z_TYPE_P(content_param) == IS_STRING)) {
+ zephir_get_strval(&content, content_param);
+ } else {
+ ZEPHIR_INIT_VAR(&content);
}
- ZEPHIR_CALL_METHOD(&_3, this_ptr, "expression", NULL, 507, ¶ms);
- zephir_check_call_status();
- ZEPHIR_CONCAT_SVSVS(return_value, "partial(", &path, ", ", &_3, "); ?>");
- RETURN_MM();
+
+
+ RETURN_CTOR(&content);
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileMacro)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Assets_Filters_Jsmin)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Assets\\Filters, Jsmin, phalcon, assets_filters_jsmin, phalcon_assets_filters_jsmin_method_entry, 0);
+
+ zend_class_implements(phalcon_assets_filters_jsmin_ce, 1, phalcon_assets_filterinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Assets_Filters_Jsmin, filter)
{
- zend_string *_9$$6;
- zend_ulong _8$$6;
- zval code, macroName, _28, _4$$5, _5$$6;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_15 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool extendsMode;
- zval *statement_param = NULL, *extendsMode_param = NULL, name, defaultValue, parameters, position, parameter, variableName, blockStatements, _0, _3, _1$$4, _2$$4, *_6$$6, _7$$6, _10$$7, _11$$7, _12$$7, _13$$7, _14$$8, _16$$8, _17$$9, _18$$10, _19$$10, _20$$10, _21$$10, _22$$11, _23$$11, _24$$12, _25$$13, _26$$13, _27$$13;
- zval statement;
+ zval *content_param = NULL;
+ zval content;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statement);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&defaultValue);
- ZVAL_UNDEF(¶meters);
- ZVAL_UNDEF(&position);
- ZVAL_UNDEF(¶meter);
- ZVAL_UNDEF(&variableName);
- ZVAL_UNDEF(&blockStatements);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_7$$6);
- ZVAL_UNDEF(&_10$$7);
- ZVAL_UNDEF(&_11$$7);
- ZVAL_UNDEF(&_12$$7);
- ZVAL_UNDEF(&_13$$7);
- ZVAL_UNDEF(&_14$$8);
- ZVAL_UNDEF(&_16$$8);
- ZVAL_UNDEF(&_17$$9);
- ZVAL_UNDEF(&_18$$10);
- ZVAL_UNDEF(&_19$$10);
- ZVAL_UNDEF(&_20$$10);
- ZVAL_UNDEF(&_21$$10);
- ZVAL_UNDEF(&_22$$11);
- ZVAL_UNDEF(&_23$$11);
- ZVAL_UNDEF(&_24$$12);
- ZVAL_UNDEF(&_25$$13);
- ZVAL_UNDEF(&_26$$13);
- ZVAL_UNDEF(&_27$$13);
- ZVAL_UNDEF(&code);
- ZVAL_UNDEF(¯oName);
- ZVAL_UNDEF(&_28);
- ZVAL_UNDEF(&_4$$5);
- ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&content);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ARRAY(statement)
- Z_PARAM_BOOL(extendsMode)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(content)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &statement_param, &extendsMode_param);
- ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param);
- extendsMode = zephir_get_boolval(extendsMode_param);
-
-
- ZEPHIR_OBS_VAR(&name);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&name, &statement, SL("name"), 0)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1057);
- return;
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("macros"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(zephir_array_isset(&_0, &name))) {
- ZEPHIR_INIT_VAR(&_1$$4);
- object_init_ex(&_1$$4, phalcon_mvc_view_engine_volt_exception_ce);
- ZEPHIR_INIT_VAR(&_2$$4);
- ZEPHIR_CONCAT_SVS(&_2$$4, "Macro '", &name, "' is already defined");
- ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 508, &_2$$4);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$4, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1064);
- ZEPHIR_MM_RESTORE();
- return;
- }
- zephir_update_property_array(this_ptr, SL("macros"), &name, &name);
- ZEPHIR_INIT_VAR(&_3);
- ZEPHIR_CONCAT_SVS(&_3, "$this->macros['", &name, "']");
- zephir_get_strval(¯oName, &_3);
- ZEPHIR_INIT_VAR(&code);
- ZVAL_STRING(&code, "");
- zephir_concat_self(&code, &_4$$5);
- } else {
- ZEPHIR_INIT_VAR(&_5$$6);
- ZEPHIR_CONCAT_VS(&_5$$6, ¯oName, " = function($__p = null) { ");
- zephir_concat_self(&code, &_5$$6);
- zephir_is_iterable(¶meters, 0, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1103);
- if (Z_TYPE_P(¶meters) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(¶meters), _8$$6, _9$$6, _6$$6)
- {
- ZEPHIR_INIT_NVAR(&position);
- if (_9$$6 != NULL) {
- ZVAL_STR_COPY(&position, _9$$6);
- } else {
- ZVAL_LONG(&position, _8$$6);
- }
- ZEPHIR_INIT_NVAR(¶meter);
- ZVAL_COPY(¶meter, _6$$6);
- ZEPHIR_OBS_NVAR(&variableName);
- zephir_array_fetch_string(&variableName, ¶meter, SL("variable"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1085);
- ZEPHIR_INIT_NVAR(&_10$$7);
- ZEPHIR_CONCAT_SVS(&_10$$7, "if (isset($__p[", &position, "])) { ");
- zephir_concat_self(&code, &_10$$7);
- ZEPHIR_INIT_NVAR(&_11$$7);
- ZEPHIR_CONCAT_SVSVS(&_11$$7, "$", &variableName, " = $__p[", &position, "];");
- zephir_concat_self(&code, &_11$$7);
- zephir_concat_self_str(&code, " } else { ", sizeof(" } else { ") - 1);
- ZEPHIR_INIT_NVAR(&_12$$7);
- ZEPHIR_CONCAT_SVS(&_12$$7, "if (array_key_exists(\"", &variableName, "\", $__p)) { ");
- zephir_concat_self(&code, &_12$$7);
- ZEPHIR_INIT_NVAR(&_13$$7);
- ZEPHIR_CONCAT_SVSVS(&_13$$7, "$", &variableName, " = $__p[\"", &variableName, "\"];");
- zephir_concat_self(&code, &_13$$7);
- zephir_concat_self_str(&code, " } else { ", sizeof(" } else { ") - 1);
- ZEPHIR_OBS_NVAR(&defaultValue);
- if (EXPECTED(zephir_array_isset_string_fetch(&defaultValue, ¶meter, SL("default"), 0))) {
- ZEPHIR_CALL_METHOD(&_14$$8, this_ptr, "expression", &_15, 507, &defaultValue);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_16$$8);
- ZEPHIR_CONCAT_SVSVS(&_16$$8, "$", &variableName, " = ", &_14$$8, ";");
- zephir_concat_self(&code, &_16$$8);
- } else {
- ZEPHIR_INIT_NVAR(&_17$$9);
- ZEPHIR_CONCAT_SVSVS(&_17$$9, " throw new \\Phalcon\\Mvc\\View\\Exception(\"Macro '", &name, "' was called without parameter: ", &variableName, "\"); ");
- zephir_concat_self(&code, &_17$$9);
- }
- zephir_concat_self_str(&code, " } } ", sizeof(" } } ") - 1);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, ¶meters, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_7$$6, ¶meters, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_7$$6)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&position, ¶meters, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(¶meter, ¶meters, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_OBS_NVAR(&variableName);
- zephir_array_fetch_string(&variableName, ¶meter, SL("variable"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1085);
- ZEPHIR_INIT_NVAR(&_18$$10);
- ZEPHIR_CONCAT_SVS(&_18$$10, "if (isset($__p[", &position, "])) { ");
- zephir_concat_self(&code, &_18$$10);
- ZEPHIR_INIT_NVAR(&_19$$10);
- ZEPHIR_CONCAT_SVSVS(&_19$$10, "$", &variableName, " = $__p[", &position, "];");
- zephir_concat_self(&code, &_19$$10);
- zephir_concat_self_str(&code, " } else { ", sizeof(" } else { ") - 1);
- ZEPHIR_INIT_NVAR(&_20$$10);
- ZEPHIR_CONCAT_SVS(&_20$$10, "if (array_key_exists(\"", &variableName, "\", $__p)) { ");
- zephir_concat_self(&code, &_20$$10);
- ZEPHIR_INIT_NVAR(&_21$$10);
- ZEPHIR_CONCAT_SVSVS(&_21$$10, "$", &variableName, " = $__p[\"", &variableName, "\"];");
- zephir_concat_self(&code, &_21$$10);
- zephir_concat_self_str(&code, " } else { ", sizeof(" } else { ") - 1);
- ZEPHIR_OBS_NVAR(&defaultValue);
- if (EXPECTED(zephir_array_isset_string_fetch(&defaultValue, ¶meter, SL("default"), 0))) {
- ZEPHIR_CALL_METHOD(&_22$$11, this_ptr, "expression", &_15, 507, &defaultValue);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_23$$11);
- ZEPHIR_CONCAT_SVSVS(&_23$$11, "$", &variableName, " = ", &_22$$11, ";");
- zephir_concat_self(&code, &_23$$11);
- } else {
- ZEPHIR_INIT_NVAR(&_24$$12);
- ZEPHIR_CONCAT_SVSVS(&_24$$12, " throw new \\Phalcon\\Mvc\\View\\Exception(\"Macro '", &name, "' was called without parameter: ", &variableName, "\"); ");
- zephir_concat_self(&code, &_24$$12);
- }
- zephir_concat_self_str(&code, " } } ", sizeof(" } } ") - 1);
- ZEPHIR_CALL_METHOD(NULL, ¶meters, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(¶meter);
- ZEPHIR_INIT_NVAR(&position);
- zephir_concat_self_str(&code, " ?>", sizeof(" ?>") - 1);
+ zephir_fetch_params(1, 1, 0, &content_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();
}
- ZEPHIR_OBS_VAR(&blockStatements);
- if (zephir_array_isset_string_fetch(&blockStatements, &statement, SL("block_statements"), 0)) {
- if (extendsMode) {
- ZVAL_BOOL(&_26$$13, 1);
- } else {
- ZVAL_BOOL(&_26$$13, 0);
- }
- ZEPHIR_CALL_METHOD(&_25$$13, this_ptr, "statementlist", NULL, 509, &blockStatements, &_26$$13);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_27$$13);
- ZEPHIR_CONCAT_VS(&_27$$13, &_25$$13, "");
- zephir_concat_self(&code, &_28);
- RETURN_CTOR(&code);
+
+
+ RETURN_CTOR(&content);
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileReturn)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Assets_Filters_None)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Assets\\Filters, None, phalcon, assets_filters_none, phalcon_assets_filters_none_method_entry, 0);
+
+ zend_class_implements(phalcon_assets_filters_none_ce, 1, phalcon_assets_filterinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Assets_Filters_None, filter)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *statement_param = NULL, expr, _0;
- zval statement;
+ zval *content_param = NULL;
+ zval content;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statement);
- ZVAL_UNDEF(&expr);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&content);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(statement)
+ Z_PARAM_STR(content)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &statement_param);
- ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param);
+ zephir_fetch_params(1, 1, 0, &content_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);
+ }
- ZEPHIR_OBS_VAR(&expr);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1140);
- return;
- }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "expression", NULL, 507, &expr);
- zephir_check_call_status();
- ZEPHIR_CONCAT_SVS(return_value, "");
- RETURN_MM();
+ RETURN_CTOR(&content);
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSet)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Assets_Inline_Css)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Assets\\Inline, Css, phalcon, assets_inline_css, phalcon_assets_inline_ce, phalcon_assets_inline_css_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Assets_Inline_Css, __construct)
{
- zval compilation;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_3 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *statement_param = NULL, assignments, assignment, exprCode, target, *_0, _1, _2$$4, _4$$4, _5$$4, _6$$5, _7$$6, _8$$7, _9$$8, _10$$9, _11$$10, _12$$10, _13$$10, _14$$11, _15$$12, _16$$13, _17$$14, _18$$15;
- zval statement;
+ zephir_fcall_cache_entry *_1 = NULL;
+ zend_bool filter;
+ zval *content_param = NULL, *filter_param = NULL, *attributes = NULL, attributes_sub, __$null, _0$$3, _2, _3;
+ zval content;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statement);
- ZVAL_UNDEF(&assignments);
- ZVAL_UNDEF(&assignment);
- ZVAL_UNDEF(&exprCode);
- ZVAL_UNDEF(&target);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_4$$4);
- ZVAL_UNDEF(&_5$$4);
- ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&_7$$6);
- ZVAL_UNDEF(&_8$$7);
- ZVAL_UNDEF(&_9$$8);
- ZVAL_UNDEF(&_10$$9);
- ZVAL_UNDEF(&_11$$10);
- ZVAL_UNDEF(&_12$$10);
- ZVAL_UNDEF(&_13$$10);
- ZVAL_UNDEF(&_14$$11);
- ZVAL_UNDEF(&_15$$12);
- ZVAL_UNDEF(&_16$$13);
- ZVAL_UNDEF(&_17$$14);
- ZVAL_UNDEF(&_18$$15);
- ZVAL_UNDEF(&compilation);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&attributes_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(statement)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(content)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(filter)
+ Z_PARAM_ZVAL_OR_NULL(attributes)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &statement_param);
- ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param);
+ zephir_fetch_params(1, 1, 2, &content_param, &filter_param, &attributes);
+ zephir_get_strval(&content, content_param);
+ if (!filter_param) {
+ filter = 1;
+ } else {
+ filter = zephir_get_boolval(filter_param);
+ }
+ if (!attributes) {
+ attributes = &attributes_sub;
+ ZEPHIR_CPY_WRT(attributes, &__$null);
+ } else {
+ ZEPHIR_SEPARATE_PARAM(attributes);
+ }
- ZEPHIR_OBS_VAR(&assignments);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&assignments, &statement, SL("assignments"), 0)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1166);
- return;
+ if (Z_TYPE_P(attributes) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ zephir_create_array(&_0$$3, 1, 0);
+ add_assoc_stringl_ex(&_0$$3, SL("type"), SL("text/css"));
+ ZEPHIR_CPY_WRT(attributes, &_0$$3);
}
- ZEPHIR_INIT_VAR(&compilation);
- ZVAL_STRING(&compilation, "", sizeof(" ?>") - 1);
- RETURN_CTOR(&compilation);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_assets_inline_css_ce, getThis(), "__construct", &_1, 0, &_2, &content, &_3, attributes);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileString)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Assets_Inline_Js)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Assets\\Inline, Js, phalcon, assets_inline_js, phalcon_assets_inline_ce, phalcon_assets_inline_js_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Assets_Inline_Js, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool extendsMode;
- zval *viewCode_param = NULL, *extendsMode_param = NULL, _0, _1;
- zval viewCode;
+ zephir_fcall_cache_entry *_1 = NULL;
+ zend_bool filter;
+ zval *content_param = NULL, *filter_param = NULL, *attributes = NULL, attributes_sub, __$null, _0$$3, _2, _3;
+ zval content;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&viewCode);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&attributes_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(viewCode)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(content)
Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(extendsMode)
+ Z_PARAM_BOOL(filter)
+ Z_PARAM_ZVAL_OR_NULL(attributes)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &viewCode_param, &extendsMode_param);
- if (UNEXPECTED(Z_TYPE_P(viewCode_param) != IS_STRING && Z_TYPE_P(viewCode_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewCode' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(viewCode_param) == IS_STRING)) {
- zephir_get_strval(&viewCode, viewCode_param);
+ zephir_fetch_params(1, 1, 2, &content_param, &filter_param, &attributes);
+ zephir_get_strval(&content, content_param);
+ if (!filter_param) {
+ filter = 1;
} else {
- ZEPHIR_INIT_VAR(&viewCode);
+ filter = zephir_get_boolval(filter_param);
}
- if (!extendsMode_param) {
- extendsMode = 0;
+ if (!attributes) {
+ attributes = &attributes_sub;
+ ZEPHIR_CPY_WRT(attributes, &__$null);
} else {
- extendsMode = zephir_get_boolval(extendsMode_param);
+ ZEPHIR_SEPARATE_PARAM(attributes);
}
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "eval code");
- zephir_update_property_zval(this_ptr, ZEND_STRL("currentPath"), &_0);
- if (extendsMode) {
- ZVAL_BOOL(&_1, 1);
+ if (Z_TYPE_P(attributes) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ zephir_create_array(&_0$$3, 1, 0);
+ add_assoc_stringl_ex(&_0$$3, SL("type"), SL("text/javascript"));
+ ZEPHIR_CPY_WRT(attributes, &_0$$3);
+ }
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "js");
+ if (filter) {
+ ZVAL_BOOL(&_3, 1);
} else {
- ZVAL_BOOL(&_1, 0);
+ ZVAL_BOOL(&_3, 0);
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "compilesource", NULL, 0, &viewCode, &_1);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_assets_inline_js_ce, getThis(), "__construct", &_1, 0, &_2, &content, &_3, attributes);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_MM_RESTORE();
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Application_AbstractApplication)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Application, AbstractApplication, phalcon, application_abstractapplication, phalcon_di_injectable_ce, phalcon_application_abstractapplication_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+
+ zend_declare_property_null(phalcon_application_abstractapplication_ce, SL("container"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_application_abstractapplication_ce, SL("defaultModule"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_application_abstractapplication_ce, SL("eventsManager"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_application_abstractapplication_ce, SL("modules"), ZEND_ACC_PROTECTED);
+ phalcon_application_abstractapplication_ce->create_object = zephir_init_properties_Phalcon_Application_AbstractApplication;
+
+ zend_class_implements(phalcon_application_abstractapplication_ce, 1, phalcon_events_eventsawareinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Application_AbstractApplication, __construct)
+{
+ zval *container = NULL, container_sub, __$null;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&container_sub);
+ ZVAL_NULL(&__$null);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_OBJECT_OF_CLASS_OR_NULL(container, phalcon_di_diinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(0, 1, &container);
+ if (!container) {
+ container = &container_sub;
+ container = &__$null;
+ }
+
+
+ if (Z_TYPE_P(container) == IS_OBJECT) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container);
+ }
+}
+
+static PHP_METHOD(Phalcon_Application_AbstractApplication, getDefaultModule)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "defaultModule");
+}
+
+static PHP_METHOD(Phalcon_Application_AbstractApplication, getEventsManager)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "eventsManager");
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSwitch)
+static PHP_METHOD(Phalcon_Application_AbstractApplication, getModule)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool extendsMode;
- zval *statement_param = NULL, *extendsMode_param = NULL, compilation, caseClauses, expr, lines, _2, _0$$3, _1$$3, _3$$4, _4$$5, _5$$5, _6$$5;
- zval statement;
+ zval *name_param = NULL, module, _0, _1$$3;
+ zval name, _2$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statement);
- ZVAL_UNDEF(&compilation);
- ZVAL_UNDEF(&caseClauses);
- ZVAL_UNDEF(&expr);
- ZVAL_UNDEF(&lines);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&module);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_4$$5);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_6$$5);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ARRAY(statement)
- Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(extendsMode)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &statement_param, &extendsMode_param);
- ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param);
- if (!extendsMode_param) {
- extendsMode = 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 {
- extendsMode = zephir_get_boolval(extendsMode_param);
+ ZEPHIR_INIT_VAR(&name);
}
- ZEPHIR_OBS_VAR(&expr);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0)))) {
- ZEPHIR_INIT_VAR(&_0$$3);
- object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce);
+ ZEPHIR_OBS_VAR(&module);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("modules"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&module, &_0, &name, 0)))) {
ZEPHIR_INIT_VAR(&_1$$3);
- ZVAL_STRING(&_1$$3, "Corrupt statement");
- ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 508, &_1$$3, &statement);
+ object_init_ex(&_1$$3, phalcon_application_exception_ce);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_SVS(&_2$$3, "Module '", &name, "' isn't registered in the application container");
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 8, &_2$$3);
zephir_check_call_status();
- zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1256);
+ zephir_throw_exception_debug(&_1$$3, "phalcon/Application/AbstractApplication.zep", 83);
ZEPHIR_MM_RESTORE();
return;
}
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 507, &expr);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&compilation);
- ZEPHIR_CONCAT_SVS(&compilation, "");
- ZEPHIR_OBS_VAR(&caseClauses);
- if (zephir_array_isset_string_fetch(&caseClauses, &statement, SL("case_clauses"), 0)) {
- if (extendsMode) {
- ZVAL_BOOL(&_3$$4, 1);
- } else {
- ZVAL_BOOL(&_3$$4, 0);
- }
- ZEPHIR_CALL_METHOD(&lines, this_ptr, "statementlist", NULL, 509, &caseClauses, &_3$$4);
- zephir_check_call_status();
- if (zephir_fast_strlen_ev(&lines) != 0) {
- ZEPHIR_INIT_VAR(&_4$$5);
- ZVAL_STRING(&_4$$5, "/(*ANYCRLF)^\\h+|\\h+$|(\\h){2,}/mu");
- ZEPHIR_INIT_VAR(&_5$$5);
- ZVAL_STRING(&_5$$5, "");
- ZEPHIR_CALL_FUNCTION(&_6$$5, "preg_replace", NULL, 50, &_4$$5, &_5$$5, &lines);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&lines, &_6$$5);
- }
- zephir_concat_self(&compilation, &lines);
- }
- zephir_concat_self_str(&compilation, SL(""));
- RETURN_CCTOR(&compilation);
+ RETURN_CCTOR(&module);
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression)
+static PHP_METHOD(Phalcon_Application_AbstractApplication, getModules)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "modules");
+}
+
+static PHP_METHOD(Phalcon_Application_AbstractApplication, registerModules)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_3 = NULL, *_7 = NULL, *_11 = NULL, *_13 = NULL, *_15 = NULL, *_21 = NULL, *_28 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *expr_param = NULL, exprCode, extensions, items, singleExpr, singleExprCode, name, left, leftCode, right, rightCode, type, startCode, endCode, start, end, _0, _2$$4, *_4$$6, _5$$6, _6$$7, _8$$8, _9$$10, _10$$11, _12$$15, _14$$16, _16$$34, _17$$34, _18$$34, _19$$34, _20$$38, _22$$72, _23$$72, _24$$76, _25$$76, _26$$76, _27$$76;
- zval expr, _1$$4;
+ zend_bool merge;
+ zval *modules_param = NULL, *merge_param = NULL, _0$$3, _1$$3;
+ zval modules;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&expr);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&exprCode);
- ZVAL_UNDEF(&extensions);
- ZVAL_UNDEF(&items);
- ZVAL_UNDEF(&singleExpr);
- ZVAL_UNDEF(&singleExprCode);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&left);
- ZVAL_UNDEF(&leftCode);
- ZVAL_UNDEF(&right);
- ZVAL_UNDEF(&rightCode);
- ZVAL_UNDEF(&type);
- ZVAL_UNDEF(&startCode);
- ZVAL_UNDEF(&endCode);
- ZVAL_UNDEF(&start);
- ZVAL_UNDEF(&end);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_5$$6);
- ZVAL_UNDEF(&_6$$7);
- ZVAL_UNDEF(&_8$$8);
- ZVAL_UNDEF(&_9$$10);
- ZVAL_UNDEF(&_10$$11);
- ZVAL_UNDEF(&_12$$15);
- ZVAL_UNDEF(&_14$$16);
- ZVAL_UNDEF(&_16$$34);
- ZVAL_UNDEF(&_17$$34);
- ZVAL_UNDEF(&_18$$34);
- ZVAL_UNDEF(&_19$$34);
- ZVAL_UNDEF(&_20$$38);
- ZVAL_UNDEF(&_22$$72);
- ZVAL_UNDEF(&_23$$72);
- ZVAL_UNDEF(&_24$$76);
- ZVAL_UNDEF(&_25$$76);
- ZVAL_UNDEF(&_26$$76);
- ZVAL_UNDEF(&_27$$76);
+ ZVAL_UNDEF(&modules);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(expr)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(modules)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(merge)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &expr_param);
- ZEPHIR_OBS_COPY_OR_DUP(&expr, expr_param);
-
+ zephir_fetch_params(1, 1, 1, &modules_param, &merge_param);
+ zephir_get_arrval(&modules, modules_param);
+ if (!merge_param) {
+ merge = 0;
+ } else {
+ merge = zephir_get_boolval(merge_param);
+ }
- ZEPHIR_INIT_VAR(&exprCode);
- ZVAL_NULL(&exprCode);
- RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("exprLevel")));
- zephir_read_property(&_0, this_ptr, ZEND_STRL("extensions"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&extensions, &_0);
- while (1) {
- if (Z_TYPE_P(&extensions) == IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&_1$$4);
- zephir_create_array(&_1$$4, 1, 0);
- zephir_array_fast_append(&_1$$4, &expr);
- ZEPHIR_INIT_NVAR(&_2$$4);
- ZVAL_STRING(&_2$$4, "resolveExpression");
- ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "fireextensionevent", &_3, 510, &_2$$4, &_1$$4);
- zephir_check_call_status();
- if (Z_TYPE_P(&exprCode) == IS_STRING) {
- break;
- }
- }
- ZEPHIR_OBS_NVAR(&type);
- if (!(zephir_array_isset_string_fetch(&type, &expr, SL("type"), 0))) {
- ZEPHIR_INIT_NVAR(&items);
- array_init(&items);
- zephir_is_iterable(&expr, 0, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1353);
- if (Z_TYPE_P(&expr) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&expr), _4$$6)
- {
- ZEPHIR_INIT_NVAR(&singleExpr);
- ZVAL_COPY(&singleExpr, _4$$6);
- zephir_array_fetch_string(&_6$$7, &singleExpr, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1344);
- ZEPHIR_CALL_METHOD(&singleExprCode, this_ptr, "expression", &_7, 507, &_6$$7);
- zephir_check_call_status();
- ZEPHIR_OBS_NVAR(&name);
- if (zephir_array_isset_string_fetch(&name, &singleExpr, SL("name"), 0)) {
- ZEPHIR_INIT_NVAR(&_8$$8);
- ZEPHIR_CONCAT_SVSV(&_8$$8, "'", &name, "' => ", &singleExprCode);
- zephir_array_append(&items, &_8$$8, PH_SEPARATE, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1347);
- } else {
- zephir_array_append(&items, &singleExprCode, PH_SEPARATE, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1349);
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &expr, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_5$$6, &expr, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_5$$6)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleExpr, &expr, "current", NULL, 0);
- zephir_check_call_status();
- zephir_array_fetch_string(&_9$$10, &singleExpr, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1344);
- ZEPHIR_CALL_METHOD(&singleExprCode, this_ptr, "expression", &_7, 507, &_9$$10);
- zephir_check_call_status();
- ZEPHIR_OBS_NVAR(&name);
- if (zephir_array_isset_string_fetch(&name, &singleExpr, SL("name"), 0)) {
- ZEPHIR_INIT_NVAR(&_10$$11);
- ZEPHIR_CONCAT_SVSV(&_10$$11, "'", &name, "' => ", &singleExprCode);
- zephir_array_append(&items, &_10$$11, PH_SEPARATE, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1347);
- } else {
- zephir_array_append(&items, &singleExprCode, PH_SEPARATE, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1349);
- }
- ZEPHIR_CALL_METHOD(NULL, &expr, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&singleExpr);
- ZEPHIR_INIT_NVAR(&exprCode);
- zephir_fast_join_str(&exprCode, SL(", "), &items);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, '.')) {
- ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "attributereader", &_11, 0, &expr);
- zephir_check_call_status();
- break;
- }
- ZEPHIR_OBS_NVAR(&left);
- if (zephir_array_isset_string_fetch(&left, &expr, SL("left"), 0)) {
- ZEPHIR_CALL_METHOD(&leftCode, this_ptr, "expression", &_7, 507, &left);
- zephir_check_call_status();
- }
- if (ZEPHIR_IS_LONG(&type, 311)) {
- zephir_array_fetch_string(&_12$$15, &expr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1379);
- ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "resolvetest", &_13, 0, &_12$$15, &leftCode);
- zephir_check_call_status();
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 124)) {
- zephir_array_fetch_string(&_14$$16, &expr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1391);
- ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "resolvefilter", &_15, 511, &_14$$16, &leftCode);
- zephir_check_call_status();
- break;
- }
- ZEPHIR_OBS_NVAR(&right);
- if (zephir_array_isset_string_fetch(&right, &expr, SL("right"), 0)) {
- ZEPHIR_CALL_METHOD(&rightCode, this_ptr, "expression", &_7, 507, &right);
- zephir_check_call_status();
- }
- ZEPHIR_INIT_NVAR(&exprCode);
- ZVAL_NULL(&exprCode);
- do {
- if (ZEPHIR_IS_LONG(&type, '!')) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SV(&exprCode, "!", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, '*')) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " * ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, '+')) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " + ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, '-')) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " - ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, '/')) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " / ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 37)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " % ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, '<')) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " < ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 61)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " > ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 62)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " > ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 126)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " . ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 278)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVSVS(&exprCode, "pow(", &leftCode, ", ", &rightCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 360)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- if (zephir_array_isset_string(&expr, SL("left"))) {
- ZEPHIR_CONCAT_SVS(&exprCode, "[", &leftCode, "]");
- } else {
- ZVAL_STRING(&exprCode, "[]");
- }
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 258)) {
- ZEPHIR_OBS_NVAR(&exprCode);
- zephir_array_fetch_string(&exprCode, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1462);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 259)) {
- ZEPHIR_OBS_NVAR(&exprCode);
- zephir_array_fetch_string(&exprCode, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1466);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 260)) {
- ZEPHIR_INIT_NVAR(&_16$$34);
- zephir_array_fetch_string(&_17$$34, &expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1470);
- ZEPHIR_INIT_NVAR(&_18$$34);
- ZVAL_STRING(&_18$$34, "'");
- ZEPHIR_INIT_NVAR(&_19$$34);
- ZVAL_STRING(&_19$$34, "\\'");
- zephir_fast_str_replace(&_16$$34, &_18$$34, &_19$$34, &_17$$34);
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVS(&exprCode, "'", &_16$$34, "'");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 261)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZVAL_STRING(&exprCode, "null");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 262)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZVAL_STRING(&exprCode, "false");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 263)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZVAL_STRING(&exprCode, "true");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 265)) {
- zephir_array_fetch_string(&_20$$38, &expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1486);
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SV(&exprCode, "$", &_20$$38);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 266)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " && ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 267)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " || ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 270)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " <= ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 271)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " >= ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 272)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " == ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 273)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " != ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 274)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " === ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 275)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " !== ", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 276)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVSVS(&exprCode, "range(", &leftCode, ", ", &rightCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 350)) {
- ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "functioncall", &_21, 0, &expr);
- zephir_check_call_status();
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 356)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVS(&exprCode, "(", &leftCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 361)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_VSVS(&exprCode, &leftCode, "[", &rightCode, "]");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 365)) {
- ZEPHIR_OBS_NVAR(&start);
- if (zephir_array_isset_string_fetch(&start, &expr, SL("start"), 0)) {
- ZEPHIR_CALL_METHOD(&startCode, this_ptr, "expression", &_7, 507, &start);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&startCode);
- ZVAL_STRING(&startCode, "null");
- }
- ZEPHIR_OBS_NVAR(&end);
- if (zephir_array_isset_string_fetch(&end, &expr, SL("end"), 0)) {
- ZEPHIR_CALL_METHOD(&endCode, this_ptr, "expression", &_7, 507, &end);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&endCode);
- ZVAL_STRING(&endCode, "null");
- }
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVSVSVS(&exprCode, "$this->slice(", &leftCode, ", ", &startCode, ", ", &endCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 362)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVS(&exprCode, "!isset(", &leftCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 363)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVS(&exprCode, "isset(", &leftCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 392)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVS(&exprCode, "!empty(", &leftCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 386)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVS(&exprCode, "empty(", &leftCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 393)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVS(&exprCode, "!(((", &leftCode, ") % 2) == 0)");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 387)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVS(&exprCode, "(((", &leftCode, ") % 2) == 0)");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 394)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVS(&exprCode, "!(((", &leftCode, ") % 2) != 0)");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 388)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVS(&exprCode, "(((", &leftCode, ") % 2) != 0)");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 395)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVS(&exprCode, "!is_numeric(", &leftCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 389)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVS(&exprCode, "is_numeric(", &leftCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 396)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVS(&exprCode, "!is_scalar(", &leftCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 390)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVS(&exprCode, "is_scalar(", &leftCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 397)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVSVS(&exprCode, "!(is_array(", &leftCode, ") || (", &leftCode, ") instanceof Traversable)");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 391)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVSVS(&exprCode, "(is_array(", &leftCode, ") || (", &leftCode, ") instanceof Traversable)");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 309)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVSVS(&exprCode, "$this->isIncluded(", &leftCode, ", ", &rightCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 367)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVSVS(&exprCode, "!$this->isIncluded(", &leftCode, ", ", &rightCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 366)) {
- zephir_array_fetch_string(&_23$$72, &expr, SL("ternary"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1625);
- ZEPHIR_CALL_METHOD(&_22$$72, this_ptr, "expression", &_7, 507, &_23$$72);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SVSVSVS(&exprCode, "(", &_22$$72, " ? ", &leftCode, " : ", &rightCode, ")");
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 368)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SV(&exprCode, "-", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 369)) {
- ZEPHIR_INIT_NVAR(&exprCode);
- ZEPHIR_CONCAT_SV(&exprCode, "+", &rightCode);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 364)) {
- ZEPHIR_OBS_NVAR(&exprCode);
- zephir_array_fetch_string(&exprCode, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1637);
- break;
- }
- ZEPHIR_INIT_NVAR(&_24$$76);
- object_init_ex(&_24$$76, phalcon_mvc_view_engine_volt_exception_ce);
- zephir_array_fetch_string(&_25$$76, &expr, SL("file"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1642);
- zephir_array_fetch_string(&_26$$76, &expr, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1643);
- ZEPHIR_INIT_NVAR(&_27$$76);
- ZEPHIR_CONCAT_SVSVSV(&_27$$76, "Unknown expression ", &type, " in ", &_25$$76, " on line ", &_26$$76);
- ZEPHIR_CALL_METHOD(NULL, &_24$$76, "__construct", &_28, 508, &_27$$76);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_24$$76, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1643);
- ZEPHIR_MM_RESTORE();
- return;
- } while(0);
- break;
+ if (merge) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("modules"), PH_NOISY_CC | PH_READONLY);
+ zephir_fast_array_merge(&_0$$3, &_1$$3, &modules);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("modules"), &_0$$3);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("modules"), &modules);
}
- RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("exprLevel")));
- RETURN_CCTOR(&exprCode);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, fireExtensionEvent)
+static PHP_METHOD(Phalcon_Application_AbstractApplication, setDefaultModule)
{
- zval _3$$6, _4$$7, _5$$11, _6$$12;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, *arguments = NULL, arguments_sub, __$null, extensions, extension, status, _0, *_1$$3, _2$$3;
- zval name;
+ zval *defaultModule_param = NULL;
+ zval defaultModule;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&arguments_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&extensions);
- ZVAL_UNDEF(&extension);
- ZVAL_UNDEF(&status);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$6);
- ZVAL_UNDEF(&_4$$7);
- ZVAL_UNDEF(&_5$$11);
- ZVAL_UNDEF(&_6$$12);
+ ZVAL_UNDEF(&defaultModule);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(name)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(arguments)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(defaultModule)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &name_param, &arguments);
- 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, &defaultModule_param);
+ if (UNEXPECTED(Z_TYPE_P(defaultModule_param) != IS_STRING && Z_TYPE_P(defaultModule_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'defaultModule' 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(defaultModule_param) == IS_STRING)) {
+ zephir_get_strval(&defaultModule, defaultModule_param);
} else {
- ZEPHIR_INIT_VAR(&name);
- }
- if (!arguments) {
- arguments = &arguments_sub;
- arguments = &__$null;
+ ZEPHIR_INIT_VAR(&defaultModule);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("extensions"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&extensions, &_0);
- if (Z_TYPE_P(&extensions) == IS_ARRAY) {
- zephir_is_iterable(&extensions, 0, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1692);
- if (Z_TYPE_P(&extensions) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&extensions), _1$$3)
- {
- ZEPHIR_INIT_NVAR(&extension);
- ZVAL_COPY(&extension, _1$$3);
- if ((zephir_method_exists(&extension, &name) == SUCCESS)) {
- if (Z_TYPE_P(arguments) == IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&_3$$6);
- zephir_create_array(&_3$$6, 2, 0);
- zephir_array_fast_append(&_3$$6, &extension);
- zephir_array_fast_append(&_3$$6, &name);
- ZEPHIR_INIT_NVAR(&status);
- ZEPHIR_CALL_USER_FUNC_ARRAY(&status, &_3$$6, arguments);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&_4$$7);
- zephir_create_array(&_4$$7, 2, 0);
- zephir_array_fast_append(&_4$$7, &extension);
- zephir_array_fast_append(&_4$$7, &name);
- ZEPHIR_INIT_NVAR(&status);
- ZEPHIR_CALL_USER_FUNC(&status, &_4$$7);
- zephir_check_call_status();
- }
- if (Z_TYPE_P(&status) == IS_STRING) {
- RETURN_CCTOR(&status);
- }
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &extensions, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2$$3, &extensions, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_2$$3)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&extension, &extensions, "current", NULL, 0);
- zephir_check_call_status();
- if ((zephir_method_exists(&extension, &name) == SUCCESS)) {
- if (Z_TYPE_P(arguments) == IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&_5$$11);
- zephir_create_array(&_5$$11, 2, 0);
- zephir_array_fast_append(&_5$$11, &extension);
- zephir_array_fast_append(&_5$$11, &name);
- ZEPHIR_INIT_NVAR(&status);
- ZEPHIR_CALL_USER_FUNC_ARRAY(&status, &_5$$11, arguments);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&_6$$12);
- zephir_create_array(&_6$$12, 2, 0);
- zephir_array_fast_append(&_6$$12, &extension);
- zephir_array_fast_append(&_6$$12, &name);
- ZEPHIR_INIT_NVAR(&status);
- ZEPHIR_CALL_USER_FUNC(&status, &_6$$12);
- zephir_check_call_status();
- }
- if (Z_TYPE_P(&status) == IS_STRING) {
- RETURN_CCTOR(&status);
- }
- }
- ZEPHIR_CALL_METHOD(NULL, &extensions, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&extension);
- }
- ZEPHIR_MM_RESTORE();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("defaultModule"), &defaultModule);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall)
+static PHP_METHOD(Phalcon_Application_AbstractApplication, setEventsManager)
{
- zend_bool _8$$5;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *expr_param = NULL, __$true, code, funcArguments, arguments, nameExpr, nameType, name, extensions, functions, definition, extendedBlocks, block, currentBlock, exprLevel, escapedCode, method, arrayHelpers, _14, _0$$5, _12$$5, _13$$5, _2$$6, _4$$9, _5$$9, _6$$9, _7$$9, _9$$15, _10$$16, _11$$17;
- zval expr, _1$$6, _3$$12;
+ zval *eventsManager, eventsManager_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&expr);
- ZVAL_UNDEF(&_1$$6);
- ZVAL_UNDEF(&_3$$12);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_UNDEF(&code);
- ZVAL_UNDEF(&funcArguments);
- ZVAL_UNDEF(&arguments);
- ZVAL_UNDEF(&nameExpr);
- ZVAL_UNDEF(&nameType);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&extensions);
- ZVAL_UNDEF(&functions);
- ZVAL_UNDEF(&definition);
- ZVAL_UNDEF(&extendedBlocks);
- ZVAL_UNDEF(&block);
- ZVAL_UNDEF(¤tBlock);
- ZVAL_UNDEF(&exprLevel);
- ZVAL_UNDEF(&escapedCode);
- ZVAL_UNDEF(&method);
- ZVAL_UNDEF(&arrayHelpers);
- ZVAL_UNDEF(&_14);
- ZVAL_UNDEF(&_0$$5);
- ZVAL_UNDEF(&_12$$5);
- ZVAL_UNDEF(&_13$$5);
- ZVAL_UNDEF(&_2$$6);
- ZVAL_UNDEF(&_4$$9);
- ZVAL_UNDEF(&_5$$9);
- ZVAL_UNDEF(&_6$$9);
- ZVAL_UNDEF(&_7$$9);
- ZVAL_UNDEF(&_9$$15);
- ZVAL_UNDEF(&_10$$16);
- ZVAL_UNDEF(&_11$$17);
+ ZVAL_UNDEF(&eventsManager_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(expr)
+ Z_PARAM_OBJECT_OF_CLASS(eventsManager, phalcon_events_managerinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &expr_param);
- ZEPHIR_OBS_COPY_OR_DUP(&expr, expr_param);
+ zephir_fetch_params_without_memory_grow(1, 0, &eventsManager);
- ZEPHIR_INIT_VAR(&code);
- ZVAL_NULL(&code);
- ZEPHIR_INIT_VAR(&funcArguments);
- ZVAL_NULL(&funcArguments);
- ZEPHIR_OBS_NVAR(&funcArguments);
- if (zephir_array_isset_string_fetch(&funcArguments, &expr, SL("arguments"), 0)) {
- ZEPHIR_CALL_METHOD(&arguments, this_ptr, "expression", NULL, 507, &funcArguments);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&arguments);
- ZVAL_STRING(&arguments, "");
- }
- ZEPHIR_OBS_VAR(&nameExpr);
- zephir_array_fetch_string(&nameExpr, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1718);
- ZEPHIR_OBS_VAR(&nameType);
- zephir_array_fetch_string(&nameType, &nameExpr, SL("type"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1719);
- if (ZEPHIR_IS_LONG(&nameType, 265)) {
- ZEPHIR_OBS_VAR(&name);
- zephir_array_fetch_string(&name, &nameExpr, SL("value"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1725);
- zephir_read_property(&_0$$5, this_ptr, ZEND_STRL("extensions"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&extensions, &_0$$5);
- if (Z_TYPE_P(&extensions) == IS_ARRAY) {
- ZEPHIR_INIT_VAR(&_1$$6);
- zephir_create_array(&_1$$6, 3, 0);
- zephir_array_fast_append(&_1$$6, &name);
- zephir_array_fast_append(&_1$$6, &arguments);
- zephir_array_fast_append(&_1$$6, &funcArguments);
- ZEPHIR_INIT_VAR(&_2$$6);
- ZVAL_STRING(&_2$$6, "compileFunction");
- ZEPHIR_CALL_METHOD(&code, this_ptr, "fireextensionevent", NULL, 510, &_2$$6, &_1$$6);
- zephir_check_call_status();
- if (Z_TYPE_P(&code) == IS_STRING) {
- RETURN_CCTOR(&code);
- }
- }
- zephir_read_property(&_0$$5, this_ptr, ZEND_STRL("functions"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&functions, &_0$$5);
- if (Z_TYPE_P(&functions) == IS_ARRAY) {
- ZEPHIR_OBS_VAR(&definition);
- if (zephir_array_isset_fetch(&definition, &functions, &name, 0)) {
- if (Z_TYPE_P(&definition) == IS_STRING) {
- ZEPHIR_CONCAT_VSVS(return_value, &definition, "(", &arguments, ")");
- RETURN_MM();
- }
- if (Z_TYPE_P(&definition) == IS_OBJECT) {
- if (zephir_is_instance_of(&definition, SL("Closure"))) {
- ZEPHIR_INIT_VAR(&_3$$12);
- zephir_create_array(&_3$$12, 2, 0);
- zephir_array_fast_append(&_3$$12, &arguments);
- zephir_array_fast_append(&_3$$12, &funcArguments);
- ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &definition, &_3$$12);
- zephir_check_call_status();
- RETURN_MM();
- }
- }
- ZEPHIR_INIT_VAR(&_4$$9);
- object_init_ex(&_4$$9, phalcon_mvc_view_engine_volt_exception_ce);
- zephir_array_fetch_string(&_5$$9, &expr, SL("file"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1775);
- zephir_array_fetch_string(&_6$$9, &expr, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1776);
- ZEPHIR_INIT_VAR(&_7$$9);
- ZEPHIR_CONCAT_SVSVSV(&_7$$9, "Invalid definition for user function '", &name, "' in ", &_5$$9, " on line ", &_6$$9);
- ZEPHIR_CALL_METHOD(NULL, &_4$$9, "__construct", NULL, 508, &_7$$9);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_4$$9, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1776);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- _8$$5 = ZEPHIR_IS_STRING(&name, "get_content");
- if (!(_8$$5)) {
- _8$$5 = ZEPHIR_IS_STRING(&name, "content");
- }
- if (_8$$5) {
- RETURN_MM_STRING("$this->getContent()");
- }
- if (ZEPHIR_IS_STRING(&name, "partial")) {
- ZEPHIR_CONCAT_SVS(return_value, "$this->partial(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "super")) {
- zephir_read_property(&_9$$15, this_ptr, ZEND_STRL("extendedBlocks"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&extendedBlocks, &_9$$15);
- if (Z_TYPE_P(&extendedBlocks) == IS_ARRAY) {
- zephir_read_property(&_10$$16, this_ptr, ZEND_STRL("currentBlock"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(¤tBlock, &_10$$16);
- ZEPHIR_OBS_VAR(&block);
- if (zephir_array_isset_fetch(&block, &extendedBlocks, ¤tBlock, 0)) {
- zephir_read_property(&_11$$17, this_ptr, ZEND_STRL("exprLevel"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&exprLevel, &_11$$17);
- if (Z_TYPE_P(&block) == IS_ARRAY) {
- ZEPHIR_CALL_METHOD(&code, this_ptr, "statementlistorextends", NULL, 0, &block);
- zephir_check_call_status();
- if (ZEPHIR_IS_LONG(&exprLevel, 1)) {
- ZEPHIR_CPY_WRT(&escapedCode, &code);
- } else {
- ZEPHIR_INIT_NVAR(&escapedCode);
- zephir_addslashes(&escapedCode, &code);
- }
- } else {
- if (ZEPHIR_IS_LONG(&exprLevel, 1)) {
- ZEPHIR_CPY_WRT(&escapedCode, &block);
- } else {
- ZEPHIR_INIT_NVAR(&escapedCode);
- zephir_addslashes(&escapedCode, &block);
- }
- }
- if (ZEPHIR_IS_LONG(&exprLevel, 1)) {
- RETURN_CCTOR(&escapedCode);
- }
- ZEPHIR_CONCAT_SVS(return_value, "'", &escapedCode, "'");
- RETURN_MM();
- }
- }
- RETURN_MM_STRING("''");
- }
- ZEPHIR_INIT_VAR(&_12$$5);
- zephir_camelize(&_12$$5, &name, NULL );
- ZEPHIR_CALL_FUNCTION(&method, "lcfirst", NULL, 96, &_12$$5);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&arrayHelpers);
- zephir_create_array(&arrayHelpers, 16, 0);
- zephir_array_update_string(&arrayHelpers, SL("link_to"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("image"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("form"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("submit_button"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("radio_field"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("check_field"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("file_field"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("hidden_field"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("password_field"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("text_area"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("text_field"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("email_field"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("date_field"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("tel_field"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("numeric_field"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&arrayHelpers, SL("image_input"), &__$true, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_VAR(&_13$$5);
- ZVAL_STRING(&_13$$5, "Phalcon\\Tag");
- if ((zephir_method_exists(&_13$$5, &method) == SUCCESS)) {
- if (zephir_array_isset(&arrayHelpers, &name)) {
- ZEPHIR_CONCAT_SVSVS(return_value, "$this->tag->", &method, "([", &arguments, "])");
- RETURN_MM();
- }
- ZEPHIR_CONCAT_SVSVS(return_value, "$this->tag->", &method, "(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "url")) {
- ZEPHIR_CONCAT_SVS(return_value, "$this->url->get(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "static_url")) {
- ZEPHIR_CONCAT_SVS(return_value, "$this->url->getStatic(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "date")) {
- ZEPHIR_CONCAT_SVS(return_value, "date(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "time")) {
- RETURN_MM_STRING("time()");
- }
- if (ZEPHIR_IS_STRING(&name, "dump")) {
- ZEPHIR_CONCAT_SVS(return_value, "var_dump(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "version")) {
- RETURN_MM_STRING("(new Phalcon\\Support\\Version)->get()");
- }
- if (ZEPHIR_IS_STRING(&name, "version_id")) {
- RETURN_MM_STRING("(new Phalcon\\Support\\Version)->getId()");
- }
- if (ZEPHIR_IS_STRING(&name, "preload")) {
- ZEPHIR_CONCAT_SVS(return_value, "$this->tag->preload(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "constant")) {
- ZEPHIR_CONCAT_SVS(return_value, "constant(", &arguments, ")");
- RETURN_MM();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("eventsManager"), eventsManager);
+}
+
+zend_object *zephir_init_properties_Phalcon_Application_AbstractApplication(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_MM_GROW();
+
+ {
+ 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("modules"), 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("modules"), &_1$$3);
}
- ZEPHIR_CONCAT_SVSVS(return_value, "$this->callMacro('", &name, "', [", &arguments, "])");
- RETURN_MM();
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
}
- ZEPHIR_CALL_METHOD(&_14, this_ptr, "expression", NULL, 507, &nameExpr);
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Application_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Application, Exception, phalcon, application_exception, phalcon_exception_ce, NULL, 0);
+
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Filter, Exception, phalcon, filter_exception, phalcon_exception_ce, NULL, 0);
+
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_FilterFactory)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter, FilterFactory, phalcon, filter_filterfactory, phalcon_filter_filterfactory_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Filter_FilterFactory, newInstance)
+{
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+
+
+ ZEPHIR_MM_GROW();
+
+ object_init_ex(return_value, phalcon_filter_ce);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapters", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 236, &_0);
zephir_check_call_status();
- ZEPHIR_CONCAT_VSVS(return_value, &_14, "(", &arguments, ")");
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getCompiledTemplatePath)
-{
- zval *this_ptr = getThis();
+static PHP_METHOD(Phalcon_Filter_FilterFactory, getAdapters)
+{
+ zval *this_ptr = getThis();
+
+
+
+ zephir_create_array(return_value, 21, 0);
+ add_assoc_stringl_ex(return_value, SL("absint"), SL("Phalcon\\Filter\\Sanitize\\AbsInt"));
+ add_assoc_stringl_ex(return_value, SL("alnum"), SL("Phalcon\\Filter\\Sanitize\\Alnum"));
+ add_assoc_stringl_ex(return_value, SL("alpha"), SL("Phalcon\\Filter\\Sanitize\\Alpha"));
+ add_assoc_stringl_ex(return_value, SL("bool"), SL("Phalcon\\Filter\\Sanitize\\BoolVal"));
+ add_assoc_stringl_ex(return_value, SL("email"), SL("Phalcon\\Filter\\Sanitize\\Email"));
+ add_assoc_stringl_ex(return_value, SL("float"), SL("Phalcon\\Filter\\Sanitize\\FloatVal"));
+ add_assoc_stringl_ex(return_value, SL("int"), SL("Phalcon\\Filter\\Sanitize\\IntVal"));
+ add_assoc_stringl_ex(return_value, SL("lower"), SL("Phalcon\\Filter\\Sanitize\\Lower"));
+ add_assoc_stringl_ex(return_value, SL("lowerFirst"), SL("Phalcon\\Filter\\Sanitize\\LowerFirst"));
+ add_assoc_stringl_ex(return_value, SL("regex"), SL("Phalcon\\Filter\\Sanitize\\Regex"));
+ add_assoc_stringl_ex(return_value, SL("remove"), SL("Phalcon\\Filter\\Sanitize\\Remove"));
+ add_assoc_stringl_ex(return_value, SL("replace"), SL("Phalcon\\Filter\\Sanitize\\Replace"));
+ add_assoc_stringl_ex(return_value, SL("special"), SL("Phalcon\\Filter\\Sanitize\\Special"));
+ add_assoc_stringl_ex(return_value, SL("specialFull"), SL("Phalcon\\Filter\\Sanitize\\SpecialFull"));
+ add_assoc_stringl_ex(return_value, SL("string"), SL("Phalcon\\Filter\\Sanitize\\StringVal"));
+ add_assoc_stringl_ex(return_value, SL("striptags"), SL("Phalcon\\Filter\\Sanitize\\Striptags"));
+ add_assoc_stringl_ex(return_value, SL("trim"), SL("Phalcon\\Filter\\Sanitize\\Trim"));
+ add_assoc_stringl_ex(return_value, SL("upper"), SL("Phalcon\\Filter\\Sanitize\\Upper"));
+ add_assoc_stringl_ex(return_value, SL("upperFirst"), SL("Phalcon\\Filter\\Sanitize\\UpperFirst"));
+ add_assoc_stringl_ex(return_value, SL("upperWords"), SL("Phalcon\\Filter\\Sanitize\\UpperWords"));
+ add_assoc_stringl_ex(return_value, SL("url"), SL("Phalcon\\Filter\\Sanitize\\Url"));
+ return;
+}
+
- RETURN_MEMBER(getThis(), "compiledTemplatePath");
-}
+#ifdef HAVE_CONFIG_H
+#endif
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getDI)
-{
- zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "container");
-}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getExtensions)
+ZEPHIR_INIT_CLASS(Phalcon_Filter_FilterInterface)
{
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Filter, FilterInterface, phalcon, filter_filterinterface, phalcon_filter_filterinterface_method_entry);
+ return SUCCESS;
+}
+ZEPHIR_DOC_METHOD(Phalcon_Filter_FilterInterface, sanitize);
- RETURN_MEMBER(getThis(), "extensions");
-}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getFilters)
-{
- zval *this_ptr = getThis();
+#ifdef HAVE_CONFIG_H
+#endif
- RETURN_MEMBER(getThis(), "filters");
-}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getFunctions)
-{
- zval *this_ptr = getThis();
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_AbsInt)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, AbsInt, phalcon, filter_sanitize_absint, phalcon_filter_sanitize_absint_method_entry, 0);
- RETURN_MEMBER(getThis(), "functions");
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getOption)
+static PHP_METHOD(Phalcon_Filter_Sanitize_AbsInt, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *option_param = NULL, value, _0;
- zval option;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *input, input_sub, _0, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&option);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&input_sub);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(option)
+ Z_PARAM_ZVAL(input)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &option_param);
- if (UNEXPECTED(Z_TYPE_P(option_param) != IS_STRING && Z_TYPE_P(option_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'option' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(option_param) == IS_STRING)) {
- zephir_get_strval(&option, option_param);
- } else {
- ZEPHIR_INIT_VAR(&option);
- }
+ zephir_fetch_params(1, 1, 0, &input);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&value, &_0, &option, 1))) {
- RETURN_MM_NULL();
- }
- RETURN_CTOR(&value);
+ ZVAL_LONG(&_0, 519);
+ ZEPHIR_CALL_FUNCTION(&_1, "filter_var", NULL, 237, input, &_0);
+ zephir_check_call_status();
+ ZVAL_LONG(&_0, zephir_get_intval(&_1));
+ ZEPHIR_RETURN_CALL_FUNCTION("abs", NULL, 238, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getOptions)
-{
- zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "options");
-}
+#ifdef HAVE_CONFIG_H
+#endif
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getTemplatePath)
-{
- zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "currentPath");
-}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getUniquePrefix)
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_Alnum)
{
- zval _7$$5;
- zval _0, _3, _8, _1$$3, _2$$3, _4$$4, _5$$5, _6$$5;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_4$$4);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&_7$$5);
-
-
- ZEPHIR_MM_GROW();
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, Alnum, phalcon, filter_sanitize_alnum, phalcon_filter_sanitize_alnum_method_entry, 0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_is_true(&_0))) {
- ZEPHIR_INIT_VAR(&_1$$3);
- zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("currentPath"), PH_NOISY_CC | PH_READONLY);
- zephir_unique_path_key(&_1$$3, &_2$$3);
- zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_1$$3);
- }
- ZEPHIR_OBS_VAR(&_3);
- zephir_read_property(&_3, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC);
- if (Z_TYPE_P(&_3) == IS_OBJECT) {
- ZEPHIR_OBS_VAR(&_4$$4);
- zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC);
- if (zephir_is_instance_of(&_4$$4, SL("Closure"))) {
- ZEPHIR_INIT_VAR(&_5$$5);
- zephir_read_property(&_6$$5, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_7$$5);
- zephir_create_array(&_7$$5, 1, 0);
- zephir_array_fast_append(&_7$$5, this_ptr);
- ZEPHIR_CALL_USER_FUNC_ARRAY(&_5$$5, &_6$$5, &_7$$5);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_5$$5);
- }
- }
- ZEPHIR_OBS_VAR(&_8);
- zephir_read_property(&_8, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC);
- if (UNEXPECTED(Z_TYPE_P(&_8) != IS_STRING)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "The unique compilation prefix is invalid", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2097);
- return;
- }
- RETURN_MM_MEMBER(getThis(), "prefix");
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, parse)
+static PHP_METHOD(Phalcon_Filter_Sanitize_Alnum, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *viewCode_param = NULL, currentPath;
- zval viewCode;
+ zval *input, input_sub, _0, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&viewCode);
- ZVAL_UNDEF(¤tPath);
+ ZVAL_UNDEF(&input_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(viewCode)
+ Z_PARAM_ZVAL(input)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &viewCode_param);
- if (UNEXPECTED(Z_TYPE_P(viewCode_param) != IS_STRING && Z_TYPE_P(viewCode_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewCode' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(viewCode_param) == IS_STRING)) {
- zephir_get_strval(&viewCode, viewCode_param);
- } else {
- ZEPHIR_INIT_VAR(&viewCode);
- }
+ zephir_fetch_params(1, 1, 0, &input);
- ZEPHIR_INIT_VAR(¤tPath);
- ZVAL_STRING(¤tPath, "eval code");
- ZEPHIR_LAST_CALL_STATUS = phvolt_parse_view(return_value, &viewCode, ¤tPath);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "/[^A-Za-z0-9]/");
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "");
+ ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 50, &_0, &_1, input);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveTest)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_Alpha)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, Alpha, phalcon, filter_sanitize_alpha, phalcon_filter_sanitize_alpha_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Filter_Sanitize_Alpha, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval left;
- zval *test_param = NULL, *left_param = NULL, type, name, testName, _6, _0$$12, _1$$12, _2$$13, _3$$13, _4$$14, _5$$14;
- zval test;
+ zval *input, input_sub, _0, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&test);
- ZVAL_UNDEF(&type);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&testName);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_0$$12);
- ZVAL_UNDEF(&_1$$12);
- ZVAL_UNDEF(&_2$$13);
- ZVAL_UNDEF(&_3$$13);
- ZVAL_UNDEF(&_4$$14);
- ZVAL_UNDEF(&_5$$14);
- ZVAL_UNDEF(&left);
+ ZVAL_UNDEF(&input_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ARRAY(test)
- Z_PARAM_STR(left)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(input)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &test_param, &left_param);
- ZEPHIR_OBS_COPY_OR_DUP(&test, test_param);
- zephir_get_strval(&left, left_param);
+ zephir_fetch_params(1, 1, 0, &input);
- ZEPHIR_OBS_VAR(&type);
- zephir_array_fetch_string(&type, &test, SL("type"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2131);
- if (ZEPHIR_IS_LONG(&type, 265)) {
- ZEPHIR_OBS_VAR(&name);
- zephir_array_fetch_string(&name, &test, SL("value"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2137);
- if (ZEPHIR_IS_STRING(&name, "empty")) {
- ZEPHIR_CONCAT_SVS(return_value, "empty(", &left, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "even")) {
- ZEPHIR_CONCAT_SVS(return_value, "(((", &left, ") % 2) == 0)");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "odd")) {
- ZEPHIR_CONCAT_SVS(return_value, "(((", &left, ") % 2) != 0)");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "numeric")) {
- ZEPHIR_CONCAT_SVS(return_value, "is_numeric(", &left, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "scalar")) {
- ZEPHIR_CONCAT_SVS(return_value, "is_scalar(", &left, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "iterable")) {
- ZEPHIR_CONCAT_SVSVS(return_value, "(is_array(", &left, ") || (", &left, ") instanceof Traversable)");
- RETURN_MM();
- }
- }
- if (ZEPHIR_IS_LONG(&type, 350)) {
- ZEPHIR_OBS_VAR(&testName);
- zephir_array_fetch_string(&testName, &test, SL("name"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2187);
- ZEPHIR_OBS_NVAR(&name);
- if (zephir_array_isset_string_fetch(&name, &testName, SL("value"), 0)) {
- if (ZEPHIR_IS_STRING(&name, "divisibleby")) {
- zephir_array_fetch_string(&_1$$12, &test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2191);
- ZEPHIR_CALL_METHOD(&_0$$12, this_ptr, "expression", NULL, 507, &_1$$12);
- zephir_check_call_status();
- ZEPHIR_CONCAT_SVSVS(return_value, "(((", &left, ") % (", &_0$$12, ")) == 0)");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "sameas")) {
- zephir_array_fetch_string(&_3$$13, &test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2198);
- ZEPHIR_CALL_METHOD(&_2$$13, this_ptr, "expression", NULL, 507, &_3$$13);
- zephir_check_call_status();
- ZEPHIR_CONCAT_SVSVS(return_value, "(", &left, ") === (", &_2$$13, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "type")) {
- zephir_array_fetch_string(&_5$$14, &test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2205);
- ZEPHIR_CALL_METHOD(&_4$$14, this_ptr, "expression", NULL, 507, &_5$$14);
- zephir_check_call_status();
- ZEPHIR_CONCAT_SVSVS(return_value, "gettype(", &left, ") === (", &_4$$14, ")");
- RETURN_MM();
- }
- }
- }
- ZEPHIR_CALL_METHOD(&_6, this_ptr, "expression", NULL, 507, &test);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "/[^A-Za-z]/");
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "");
+ ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 50, &_0, &_1, input);
zephir_check_call_status();
- ZEPHIR_CONCAT_VSV(return_value, &left, " == ", &_6);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, setDI)
-{
- zval *container, container_sub;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&container_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
+
+
+#ifdef HAVE_CONFIG_H
#endif
- zephir_fetch_params_without_memory_grow(1, 0, &container);
- zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container);
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_BoolVal)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, BoolVal, phalcon, filter_sanitize_boolval, phalcon_filter_sanitize_boolval_method_entry, 0);
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, setOption)
+static PHP_METHOD(Phalcon_Filter_Sanitize_BoolVal, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *option_param = NULL, *value, value_sub;
- zval option;
+ zval *input, input_sub, falseArray, trueArray, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&option);
- ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&input_sub);
+ ZVAL_UNDEF(&falseArray);
+ ZVAL_UNDEF(&trueArray);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(option)
- Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(input)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &option_param, &value);
- if (UNEXPECTED(Z_TYPE_P(option_param) != IS_STRING && Z_TYPE_P(option_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'option' must be of the type string"));
- RETURN_MM_NULL();
+ zephir_fetch_params(1, 1, 0, &input);
+
+
+ ZEPHIR_INIT_VAR(&trueArray);
+ zephir_create_array(&trueArray, 5, 0);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "true");
+ zephir_array_fast_append(&trueArray, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "on");
+ zephir_array_fast_append(&trueArray, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "yes");
+ zephir_array_fast_append(&trueArray, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "y");
+ zephir_array_fast_append(&trueArray, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "1");
+ zephir_array_fast_append(&trueArray, &_0);
+ ZEPHIR_INIT_VAR(&falseArray);
+ zephir_create_array(&falseArray, 5, 0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "false");
+ zephir_array_fast_append(&falseArray, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "off");
+ zephir_array_fast_append(&falseArray, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "no");
+ zephir_array_fast_append(&falseArray, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "n");
+ zephir_array_fast_append(&falseArray, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "0");
+ zephir_array_fast_append(&falseArray, &_0);
+ if (1 == zephir_fast_in_array(input, &trueArray)) {
+ RETURN_MM_BOOL(1);
}
- if (EXPECTED(Z_TYPE_P(option_param) == IS_STRING)) {
- zephir_get_strval(&option, option_param);
- } else {
- ZEPHIR_INIT_VAR(&option);
+ if (1 == zephir_fast_in_array(input, &falseArray)) {
+ RETURN_MM_BOOL(0);
}
+ RETURN_MM_BOOL(zephir_get_boolval(input));
+}
- zephir_update_property_array(this_ptr, SL("options"), &option, value);
- ZEPHIR_MM_RESTORE();
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_Email)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, Email, phalcon, filter_sanitize_email, phalcon_filter_sanitize_email_method_entry, 0);
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, setOptions)
+static PHP_METHOD(Phalcon_Filter_Sanitize_Email, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *options_param = NULL;
- zval options;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *input, input_sub, _0, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&input_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(options)
+ Z_PARAM_ZVAL(input)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &options_param);
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_fetch_params(1, 1, 0, &input);
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
- ZEPHIR_MM_RESTORE();
+ ZVAL_LONG(&_0, 517);
+ ZVAL_LONG(&_1, 1048576);
+ ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 237, input, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, setUniquePrefix)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *prefix_param = NULL;
- zval prefix;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&prefix);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(prefix)
- ZEND_PARSE_PARAMETERS_END();
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &prefix_param);
- 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_update_property_zval(this_ptr, ZEND_STRL("prefix"), &prefix);
- RETURN_THIS();
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_FloatVal)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, FloatVal, phalcon, filter_sanitize_floatval, phalcon_filter_sanitize_floatval_method_entry, 0);
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSource)
+static PHP_METHOD(Phalcon_Filter_Sanitize_FloatVal, __invoke)
{
- zend_string *_6$$7;
- zend_ulong _5$$7;
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool extendsMode;
- zval *viewCode_param = NULL, *extendsMode_param = NULL, currentPath, intermediate, extended, finalCompilation, blocks, extendedBlocks, name, block, blockCompilation, localBlock, compilation, options, autoescape, _0, _1, _2$$7, *_3$$7, _4$$7;
- zval viewCode;
+ zval *input, input_sub, _1, _2;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&viewCode);
- ZVAL_UNDEF(¤tPath);
- ZVAL_UNDEF(&intermediate);
- ZVAL_UNDEF(&extended);
- ZVAL_UNDEF(&finalCompilation);
- ZVAL_UNDEF(&blocks);
- ZVAL_UNDEF(&extendedBlocks);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&block);
- ZVAL_UNDEF(&blockCompilation);
- ZVAL_UNDEF(&localBlock);
- ZVAL_UNDEF(&compilation);
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&autoescape);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&input_sub);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2$$7);
- ZVAL_UNDEF(&_4$$7);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(viewCode)
- Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(extendsMode)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(input)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &viewCode_param, &extendsMode_param);
- if (UNEXPECTED(Z_TYPE_P(viewCode_param) != IS_STRING && Z_TYPE_P(viewCode_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewCode' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(viewCode_param) == IS_STRING)) {
- zephir_get_strval(&viewCode, viewCode_param);
- } else {
- ZEPHIR_INIT_VAR(&viewCode);
- }
- if (!extendsMode_param) {
- extendsMode = 0;
- } else {
- extendsMode = zephir_get_boolval(extendsMode_param);
- }
+ zephir_fetch_params(1, 1, 0, &input);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("currentPath"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(¤tPath, &_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&options, &_0);
- if (Z_TYPE_P(&options) == IS_ARRAY) {
- ZEPHIR_OBS_VAR(&autoescape);
- if (zephir_array_isset_string_fetch(&autoescape, &options, SL("autoescape"), 0)) {
- if (UNEXPECTED(((Z_TYPE_P(&autoescape) == IS_TRUE || Z_TYPE_P(&autoescape) == IS_FALSE) != 1))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "'autoescape' must be bool", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2274);
- return;
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("autoescape"), &autoescape);
- }
- }
- ZEPHIR_INIT_VAR(&intermediate);
- ZEPHIR_LAST_CALL_STATUS = phvolt_parse_view(&intermediate, &viewCode, ¤tPath);
- zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&intermediate) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Invalid intermediate representation", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2287);
- return;
- }
- if (extendsMode) {
- ZVAL_BOOL(&_0, 1);
- } else {
- ZVAL_BOOL(&_0, 0);
- }
- ZEPHIR_CALL_METHOD(&compilation, this_ptr, "statementlist", NULL, 509, &intermediate, &_0);
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_create_array(&_0, 1, 0);
+ add_assoc_long_ex(&_0, SL("flags"), 4096);
+ ZVAL_LONG(&_1, 520);
+ ZEPHIR_CALL_FUNCTION(&_2, "filter_var", NULL, 237, input, &_1, &_0);
zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("extended"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&extended, &_1);
- if (ZEPHIR_IS_TRUE_IDENTICAL(&extended)) {
- ZEPHIR_INIT_VAR(&finalCompilation);
- if (extendsMode == 1) {
- array_init(&finalCompilation);
- } else {
- ZVAL_NULL(&finalCompilation);
- }
- zephir_read_property(&_2$$7, this_ptr, ZEND_STRL("blocks"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&blocks, &_2$$7);
- zephir_read_property(&_2$$7, this_ptr, ZEND_STRL("extendedBlocks"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&extendedBlocks, &_2$$7);
- zephir_is_iterable(&extendedBlocks, 0, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2359);
- if (Z_TYPE_P(&extendedBlocks) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&extendedBlocks), _5$$7, _6$$7, _3$$7)
- {
- ZEPHIR_INIT_NVAR(&name);
- if (_6$$7 != NULL) {
- ZVAL_STR_COPY(&name, _6$$7);
- } else {
- ZVAL_LONG(&name, _5$$7);
- }
- ZEPHIR_INIT_NVAR(&block);
- ZVAL_COPY(&block, _3$$7);
- if (Z_TYPE_P(&name) == IS_STRING) {
- if (zephir_array_isset(&blocks, &name)) {
- ZEPHIR_OBS_NVAR(&localBlock);
- zephir_array_fetch(&localBlock, &blocks, &name, PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2319);
- zephir_update_property_zval(this_ptr, ZEND_STRL("currentBlock"), &name);
- if (Z_TYPE_P(&localBlock) == IS_NULL) {
- ZEPHIR_INIT_NVAR(&localBlock);
- array_init(&localBlock);
- }
- ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 509, &localBlock);
- zephir_check_call_status();
- } else {
- if (Z_TYPE_P(&block) == IS_ARRAY) {
- ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 509, &block);
- zephir_check_call_status();
- } else {
- ZEPHIR_CPY_WRT(&blockCompilation, &block);
- }
- }
- if (extendsMode) {
- zephir_array_update_zval(&finalCompilation, &name, &blockCompilation, PH_COPY | PH_SEPARATE);
- } else {
- zephir_concat_self(&finalCompilation, &blockCompilation);
- }
- } else {
- if (extendsMode) {
- zephir_array_append(&finalCompilation, &block, PH_SEPARATE, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2352);
- } else {
- zephir_concat_self(&finalCompilation, &block);
- }
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &extendedBlocks, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_4$$7, &extendedBlocks, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_4$$7)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&name, &extendedBlocks, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&block, &extendedBlocks, "current", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&name) == IS_STRING) {
- if (zephir_array_isset(&blocks, &name)) {
- ZEPHIR_OBS_NVAR(&localBlock);
- zephir_array_fetch(&localBlock, &blocks, &name, PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2319);
- zephir_update_property_zval(this_ptr, ZEND_STRL("currentBlock"), &name);
- if (Z_TYPE_P(&localBlock) == IS_NULL) {
- ZEPHIR_INIT_NVAR(&localBlock);
- array_init(&localBlock);
- }
- ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 509, &localBlock);
- zephir_check_call_status();
- } else {
- if (Z_TYPE_P(&block) == IS_ARRAY) {
- ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 509, &block);
- zephir_check_call_status();
- } else {
- ZEPHIR_CPY_WRT(&blockCompilation, &block);
- }
- }
- if (extendsMode) {
- zephir_array_update_zval(&finalCompilation, &name, &blockCompilation, PH_COPY | PH_SEPARATE);
- } else {
- zephir_concat_self(&finalCompilation, &blockCompilation);
- }
- } else {
- if (extendsMode) {
- zephir_array_append(&finalCompilation, &block, PH_SEPARATE, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2352);
- } else {
- zephir_concat_self(&finalCompilation, &block);
- }
- }
- ZEPHIR_CALL_METHOD(NULL, &extendedBlocks, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&block);
- ZEPHIR_INIT_NVAR(&name);
- RETURN_CCTOR(&finalCompilation);
- }
- if (extendsMode) {
- RETURN_MM_MEMBER(getThis(), "blocks");
- }
- RETURN_CCTOR(&compilation);
+ RETURN_MM_DOUBLE(zephir_get_doubleval(&_2));
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getFinalPath)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_IntVal)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, IntVal, phalcon, filter_sanitize_intval, phalcon_filter_sanitize_intval_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Filter_Sanitize_IntVal, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *path_param = NULL, view, viewsDirs, viewsDir, _0, *_1$$4, _2$$4, _3$$5, _4$$7;
- zval path;
+ zval *input, input_sub, _0, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&path);
- ZVAL_UNDEF(&view);
- ZVAL_UNDEF(&viewsDirs);
- ZVAL_UNDEF(&viewsDir);
+ ZVAL_UNDEF(&input_sub);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$5);
- ZVAL_UNDEF(&_4$$7);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(path)
+ Z_PARAM_ZVAL(input)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &path_param);
- zephir_get_strval(&path, path_param);
+ zephir_fetch_params(1, 1, 0, &input);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("view"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&view, &_0);
- if (Z_TYPE_P(&view) == IS_OBJECT) {
- ZEPHIR_CALL_METHOD(&viewsDirs, &view, "getviewsdir", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&viewsDirs) == IS_ARRAY) {
- zephir_is_iterable(&viewsDirs, 0, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2393);
- if (Z_TYPE_P(&viewsDirs) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&viewsDirs), _1$$4)
- {
- ZEPHIR_INIT_NVAR(&viewsDir);
- ZVAL_COPY(&viewsDir, _1$$4);
- ZEPHIR_INIT_NVAR(&_3$$5);
- ZEPHIR_CONCAT_VV(&_3$$5, &viewsDir, &path);
- if ((zephir_file_exists(&_3$$5) == SUCCESS)) {
- ZEPHIR_CONCAT_VV(return_value, &viewsDir, &path);
- RETURN_MM();
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &viewsDirs, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2$$4, &viewsDirs, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_2$$4)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&viewsDir, &viewsDirs, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_4$$7);
- ZEPHIR_CONCAT_VV(&_4$$7, &viewsDir, &path);
- if ((zephir_file_exists(&_4$$7) == SUCCESS)) {
- ZEPHIR_CONCAT_VV(return_value, &viewsDir, &path);
- RETURN_MM();
- }
- ZEPHIR_CALL_METHOD(NULL, &viewsDirs, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&viewsDir);
- ZEPHIR_CONCAT_VV(return_value, &viewsDir, &path);
- RETURN_MM();
- } else {
- ZEPHIR_CONCAT_VV(return_value, &viewsDirs, &path);
- RETURN_MM();
- }
- }
- RETURN_CTOR(&path);
+ ZVAL_LONG(&_0, 519);
+ ZEPHIR_CALL_FUNCTION(&_1, "filter_var", NULL, 237, input, &_0);
+ zephir_check_call_status();
+ RETURN_MM_LONG(zephir_get_intval(&_1));
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveFilter)
-{
- zend_bool _14, _21, _22;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval left;
- zval *filter_param = NULL, *left_param = NULL, code, type, functionName, name, file, line, extensions, filters, funcArguments, arguments, definition, _6, _23, _24, _25, _26, _0$$5, _1$$5, _2$$5, _3$$5, _8$$9, _10$$11, _11$$11, _12$$11, _13$$11, _15$$29, _16$$29, _17$$29, _18$$29, _19$$29, _20$$29;
- zval filter, _4$$7, _5$$7, _7$$9, _9$$14;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&filter);
- ZVAL_UNDEF(&_4$$7);
- ZVAL_UNDEF(&_5$$7);
- ZVAL_UNDEF(&_7$$9);
- ZVAL_UNDEF(&_9$$14);
- ZVAL_UNDEF(&code);
- ZVAL_UNDEF(&type);
- ZVAL_UNDEF(&functionName);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&file);
- ZVAL_UNDEF(&line);
- ZVAL_UNDEF(&extensions);
- ZVAL_UNDEF(&filters);
- ZVAL_UNDEF(&funcArguments);
- ZVAL_UNDEF(&arguments);
- ZVAL_UNDEF(&definition);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_23);
- ZVAL_UNDEF(&_24);
- ZVAL_UNDEF(&_25);
- ZVAL_UNDEF(&_26);
- ZVAL_UNDEF(&_0$$5);
- ZVAL_UNDEF(&_1$$5);
- ZVAL_UNDEF(&_2$$5);
- ZVAL_UNDEF(&_3$$5);
- ZVAL_UNDEF(&_8$$9);
- ZVAL_UNDEF(&_10$$11);
- ZVAL_UNDEF(&_11$$11);
- ZVAL_UNDEF(&_12$$11);
- ZVAL_UNDEF(&_13$$11);
- ZVAL_UNDEF(&_15$$29);
- ZVAL_UNDEF(&_16$$29);
- ZVAL_UNDEF(&_17$$29);
- ZVAL_UNDEF(&_18$$29);
- ZVAL_UNDEF(&_19$$29);
- ZVAL_UNDEF(&_20$$29);
- ZVAL_UNDEF(&left);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ARRAY(filter)
- Z_PARAM_STR(left)
- ZEND_PARSE_PARAMETERS_END();
-#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &filter_param, &left_param);
- ZEPHIR_OBS_COPY_OR_DUP(&filter, filter_param);
- zephir_get_strval(&left, left_param);
+#ifdef HAVE_CONFIG_H
+#endif
- ZEPHIR_INIT_VAR(&code);
- ZVAL_NULL(&code);
- ZEPHIR_OBS_VAR(&type);
- zephir_array_fetch_string(&type, &filter, SL("type"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2411);
- if (ZEPHIR_IS_LONG(&type, 265)) {
- ZEPHIR_OBS_VAR(&name);
- zephir_array_fetch_string(&name, &filter, SL("value"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2417);
- } else {
- if (UNEXPECTED(!ZEPHIR_IS_LONG(&type, 350))) {
- ZEPHIR_INIT_VAR(&_0$$5);
- object_init_ex(&_0$$5, phalcon_mvc_view_engine_volt_exception_ce);
- zephir_array_fetch_string(&_1$$5, &filter, SL("file"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2424);
- zephir_array_fetch_string(&_2$$5, &filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2425);
- ZEPHIR_INIT_VAR(&_3$$5);
- ZEPHIR_CONCAT_SVSV(&_3$$5, "Unknown filter type in ", &_1$$5, " on line ", &_2$$5);
- ZEPHIR_CALL_METHOD(NULL, &_0$$5, "__construct", NULL, 508, &_3$$5);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_0$$5, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2425);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_OBS_VAR(&functionName);
- zephir_array_fetch_string(&functionName, &filter, SL("name"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2428);
- ZEPHIR_OBS_NVAR(&name);
- zephir_array_fetch_string(&name, &functionName, SL("value"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2429);
- }
- ZEPHIR_INIT_VAR(&funcArguments);
- ZVAL_NULL(&funcArguments);
- ZEPHIR_INIT_VAR(&arguments);
- ZVAL_NULL(&arguments);
- ZEPHIR_OBS_NVAR(&funcArguments);
- if (zephir_array_isset_string_fetch(&funcArguments, &filter, SL("arguments"), 0)) {
- if (!ZEPHIR_IS_STRING(&name, "default")) {
- ZEPHIR_OBS_VAR(&file);
- zephir_array_fetch_string(&file, &filter, SL("file"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2443);
- ZEPHIR_OBS_VAR(&line);
- zephir_array_fetch_string(&line, &filter, SL("line"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2444);
- ZEPHIR_INIT_VAR(&_4$$7);
- zephir_create_array(&_4$$7, 3, 0);
- ZEPHIR_INIT_VAR(&_5$$7);
- zephir_create_array(&_5$$7, 4, 0);
- add_assoc_long_ex(&_5$$7, SL("type"), 364);
- zephir_array_update_string(&_5$$7, SL("value"), &left, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_5$$7, SL("file"), &file, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_5$$7, SL("line"), &line, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_4$$7, SL("expr"), &_5$$7, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_4$$7, SL("file"), &file, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_4$$7, SL("line"), &line, PH_COPY | PH_SEPARATE);
- ZEPHIR_MAKE_REF(&funcArguments);
- ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 0, &funcArguments, &_4$$7);
- ZEPHIR_UNREF(&funcArguments);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_METHOD(&arguments, this_ptr, "expression", NULL, 507, &funcArguments);
- zephir_check_call_status();
- } else {
- ZEPHIR_CPY_WRT(&arguments, &left);
- }
- zephir_read_property(&_6, this_ptr, ZEND_STRL("extensions"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&extensions, &_6);
- if (Z_TYPE_P(&extensions) == IS_ARRAY) {
- ZEPHIR_INIT_VAR(&_7$$9);
- zephir_create_array(&_7$$9, 3, 0);
- zephir_array_fast_append(&_7$$9, &name);
- zephir_array_fast_append(&_7$$9, &arguments);
- zephir_array_fast_append(&_7$$9, &funcArguments);
- ZEPHIR_INIT_VAR(&_8$$9);
- ZVAL_STRING(&_8$$9, "compileFilter");
- ZEPHIR_CALL_METHOD(&code, this_ptr, "fireextensionevent", NULL, 510, &_8$$9, &_7$$9);
- zephir_check_call_status();
- if (Z_TYPE_P(&code) == IS_STRING) {
- RETURN_CCTOR(&code);
- }
- }
- zephir_read_property(&_6, this_ptr, ZEND_STRL("filters"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&filters, &_6);
- ZEPHIR_OBS_VAR(&definition);
- if (zephir_array_isset_fetch(&definition, &filters, &name, 0)) {
- if (Z_TYPE_P(&definition) == IS_STRING) {
- ZEPHIR_CONCAT_VSVS(return_value, &definition, "(", &arguments, ")");
- RETURN_MM();
- }
- if (Z_TYPE_P(&definition) == IS_OBJECT) {
- if (zephir_is_instance_of(&definition, SL("Closure"))) {
- ZEPHIR_INIT_VAR(&_9$$14);
- zephir_create_array(&_9$$14, 2, 0);
- zephir_array_fast_append(&_9$$14, &arguments);
- zephir_array_fast_append(&_9$$14, &funcArguments);
- ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &definition, &_9$$14);
- zephir_check_call_status();
- RETURN_MM();
- }
- }
- ZEPHIR_INIT_VAR(&_10$$11);
- object_init_ex(&_10$$11, phalcon_mvc_view_engine_volt_exception_ce);
- zephir_array_fetch_string(&_11$$11, &filter, SL("file"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2518);
- zephir_array_fetch_string(&_12$$11, &filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2519);
- ZEPHIR_INIT_VAR(&_13$$11);
- ZEPHIR_CONCAT_SVSVSV(&_13$$11, "Invalid definition for user filter '", &name, "' in ", &_11$$11, " on line ", &_12$$11);
- ZEPHIR_CALL_METHOD(NULL, &_10$$11, "__construct", NULL, 508, &_13$$11);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_10$$11, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2519);
- ZEPHIR_MM_RESTORE();
- return;
- }
- if (ZEPHIR_IS_STRING(&name, "length")) {
- ZEPHIR_CONCAT_SVS(return_value, "$this->length(", &arguments, ")");
- RETURN_MM();
- }
- _14 = ZEPHIR_IS_STRING(&name, "e");
- if (!(_14)) {
- _14 = ZEPHIR_IS_STRING(&name, "escape");
- }
- if (_14) {
- ZEPHIR_CONCAT_SVS(return_value, "$this->escaper->escapeHtml(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "escape_css")) {
- ZEPHIR_CONCAT_SVS(return_value, "$this->escaper->escapeCss(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "escape_js")) {
- ZEPHIR_CONCAT_SVS(return_value, "$this->escaper->escapeJs(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "escape_attr")) {
- ZEPHIR_CONCAT_SVS(return_value, "$this->escaper->escapeHtmlAttr(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "trim")) {
- ZEPHIR_CONCAT_SVS(return_value, "trim(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "left_trim")) {
- ZEPHIR_CONCAT_SVS(return_value, "ltrim(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "right_trim")) {
- ZEPHIR_CONCAT_SVS(return_value, "rtrim(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "striptags")) {
- ZEPHIR_CONCAT_SVS(return_value, "strip_tags(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "url_encode")) {
- ZEPHIR_CONCAT_SVS(return_value, "urlencode(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "slashes")) {
- ZEPHIR_CONCAT_SVS(return_value, "addslashes(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "stripslashes")) {
- ZEPHIR_CONCAT_SVS(return_value, "stripslashes(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "nl2br")) {
- ZEPHIR_CONCAT_SVS(return_value, "nl2br(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "keys")) {
- ZEPHIR_CONCAT_SVS(return_value, "array_keys(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "join")) {
- zephir_array_fetch_long(&_15$$29, &funcArguments, 1, PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2625);
- zephir_array_fetch_string(&_16$$29, &_15$$29, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2625);
- zephir_array_fetch_string(&_17$$29, &_16$$29, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2625);
- zephir_array_fetch_long(&_18$$29, &funcArguments, 0, PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2625);
- zephir_array_fetch_string(&_19$$29, &_18$$29, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2625);
- zephir_array_fetch_string(&_20$$29, &_19$$29, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2625);
- ZEPHIR_CONCAT_SVSVS(return_value, "join('", &_17$$29, "', ", &_20$$29, ")");
- RETURN_MM();
- }
- _21 = ZEPHIR_IS_STRING(&name, "lower");
- if (!(_21)) {
- _21 = ZEPHIR_IS_STRING(&name, "lowercase");
- }
- if (_21) {
- ZEPHIR_CONCAT_SVS(return_value, "Phalcon\\Text::lower(", &arguments, ")");
- RETURN_MM();
- }
- _22 = ZEPHIR_IS_STRING(&name, "upper");
- if (!(_22)) {
- _22 = ZEPHIR_IS_STRING(&name, "uppercase");
- }
- if (_22) {
- ZEPHIR_CONCAT_SVS(return_value, "Phalcon\\Text::upper(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "capitalize")) {
- ZEPHIR_CONCAT_SVS(return_value, "ucwords(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "sort")) {
- ZEPHIR_CONCAT_SVS(return_value, "$this->sort(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "json_encode")) {
- ZEPHIR_CONCAT_SVS(return_value, "json_encode(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "json_decode")) {
- ZEPHIR_CONCAT_SVS(return_value, "json_decode(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "format")) {
- ZEPHIR_CONCAT_SVS(return_value, "sprintf(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "abs")) {
- ZEPHIR_CONCAT_SVS(return_value, "abs(", &arguments, ")");
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&name, "slice")) {
- ZEPHIR_CONCAT_SVS(return_value, "$this->slice(", &arguments, ")");
- RETURN_MM();
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_Lower)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, Lower, phalcon, filter_sanitize_lower, phalcon_filter_sanitize_lower_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Filter_Sanitize_Lower, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *input_param = NULL, _0$$3, _1$$3, _2;
+ zval input;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&input);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(input)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &input_param);
+ if (UNEXPECTED(Z_TYPE_P(input_param) != IS_STRING && Z_TYPE_P(input_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'input' must be of the type string"));
+ RETURN_MM_NULL();
}
- if (ZEPHIR_IS_STRING(&name, "default")) {
- ZEPHIR_CONCAT_SVSVSVS(return_value, "(empty(", &left, ") ? (", &arguments, ") : (", &left, "))");
- RETURN_MM();
+ if (EXPECTED(Z_TYPE_P(input_param) == IS_STRING)) {
+ zephir_get_strval(&input, input_param);
+ } else {
+ ZEPHIR_INIT_VAR(&input);
}
- if (ZEPHIR_IS_STRING(&name, "convert_encoding")) {
- ZEPHIR_CONCAT_SVS(return_value, "$this->convertEncoding(", &arguments, ")");
+
+
+ if (1 == (zephir_function_exists_ex(ZEND_STRL("mb_convert_case")) == SUCCESS)) {
+ ZVAL_LONG(&_0$$3, 1);
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "UTF-8");
+ ZEPHIR_RETURN_CALL_FUNCTION("mb_convert_case", NULL, 239, &input, &_0$$3, &_1$$3);
+ zephir_check_call_status();
RETURN_MM();
}
- ZEPHIR_INIT_VAR(&_23);
- object_init_ex(&_23, phalcon_mvc_view_engine_volt_exception_ce);
- zephir_array_fetch_string(&_24, &filter, SL("file"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2712);
- zephir_array_fetch_string(&_25, &filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2713);
- ZEPHIR_INIT_VAR(&_26);
- ZEPHIR_CONCAT_SVSVSV(&_26, "Unknown filter \"", &name, "\" in ", &_24, " on line ", &_25);
- ZEPHIR_CALL_METHOD(NULL, &_23, "__construct", NULL, 508, &_26);
+ ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 240, &input);
zephir_check_call_status();
- zephir_throw_exception_debug(&_23, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2713);
- ZEPHIR_MM_RESTORE();
- return;
+ zephir_fast_strtolower(return_value, &_2);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_LowerFirst)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, LowerFirst, phalcon, filter_sanitize_lowerfirst, phalcon_filter_sanitize_lowerfirst_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Filter_Sanitize_LowerFirst, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_8 = NULL, *_11 = NULL, *_15 = NULL, *_17 = NULL, *_20 = NULL, *_22 = NULL, *_27 = NULL, *_29 = NULL, *_31 = NULL, *_35 = NULL, *_37 = NULL, *_40 = NULL, *_42 = NULL, *_44 = NULL, *_47 = NULL, *_49 = NULL, *_52 = NULL, *_55 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool extendsMode, _1;
- zval *statements_param = NULL, *extendsMode_param = NULL, __$true, __$false, extended, blockMode, compilation, extensions, statement, tempCompilation, type, blockName, blockStatements, blocks, path, finalPath, subCompiler, level, _0, *_2, _3, _4$$7, _5$$7, _6$$7, _7$$7, _10$$8, _12$$10, _13$$11, _14$$11, _16$$12, _18$$13, _19$$13, _21$$14, _23$$15, _24$$15, _25$$16, _26$$16, _28$$17, _30$$18, _32$$19, _33$$24, _34$$24, _36$$25, _38$$26, _39$$27, _41$$28, _43$$29, _45$$30, _46$$30, _48$$33, _50$$34, _51$$34, _53$$35, _54$$35, _56$$37, _57$$37, _58$$37, _59$$37, _60$$40, _61$$40, _62$$40, _63$$40, _65$$41, _66$$43, _67$$44, _68$$44, _69$$45, _70$$46, _71$$46, _72$$47, _73$$48, _74$$48, _75$$49, _76$$49, _77$$50, _78$$51, _79$$52, _80$$57, _81$$57, _82$$58, _83$$59, _84$$60, _85$$61, _86$$62, _87$$63, _88$$63, _89$$66, _90$$67, _91$$67, _92$$68, _93$$68, _94$$70, _95$$70, _96$$70, _97$$70;
- zval statements, _9$$8, _64$$41;
+ zval *input_param = NULL;
+ zval input;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statements);
- ZVAL_UNDEF(&_9$$8);
- ZVAL_UNDEF(&_64$$41);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&extended);
- ZVAL_UNDEF(&blockMode);
- ZVAL_UNDEF(&compilation);
- ZVAL_UNDEF(&extensions);
- ZVAL_UNDEF(&statement);
- ZVAL_UNDEF(&tempCompilation);
- ZVAL_UNDEF(&type);
- ZVAL_UNDEF(&blockName);
- ZVAL_UNDEF(&blockStatements);
- ZVAL_UNDEF(&blocks);
- ZVAL_UNDEF(&path);
- ZVAL_UNDEF(&finalPath);
- ZVAL_UNDEF(&subCompiler);
- ZVAL_UNDEF(&level);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4$$7);
- ZVAL_UNDEF(&_5$$7);
- ZVAL_UNDEF(&_6$$7);
- ZVAL_UNDEF(&_7$$7);
- ZVAL_UNDEF(&_10$$8);
- ZVAL_UNDEF(&_12$$10);
- ZVAL_UNDEF(&_13$$11);
- ZVAL_UNDEF(&_14$$11);
- ZVAL_UNDEF(&_16$$12);
- ZVAL_UNDEF(&_18$$13);
- ZVAL_UNDEF(&_19$$13);
- ZVAL_UNDEF(&_21$$14);
- ZVAL_UNDEF(&_23$$15);
- ZVAL_UNDEF(&_24$$15);
- ZVAL_UNDEF(&_25$$16);
- ZVAL_UNDEF(&_26$$16);
- ZVAL_UNDEF(&_28$$17);
- ZVAL_UNDEF(&_30$$18);
- ZVAL_UNDEF(&_32$$19);
- ZVAL_UNDEF(&_33$$24);
- ZVAL_UNDEF(&_34$$24);
- ZVAL_UNDEF(&_36$$25);
- ZVAL_UNDEF(&_38$$26);
- ZVAL_UNDEF(&_39$$27);
- ZVAL_UNDEF(&_41$$28);
- ZVAL_UNDEF(&_43$$29);
- ZVAL_UNDEF(&_45$$30);
- ZVAL_UNDEF(&_46$$30);
- ZVAL_UNDEF(&_48$$33);
- ZVAL_UNDEF(&_50$$34);
- ZVAL_UNDEF(&_51$$34);
- ZVAL_UNDEF(&_53$$35);
- ZVAL_UNDEF(&_54$$35);
- ZVAL_UNDEF(&_56$$37);
- ZVAL_UNDEF(&_57$$37);
- ZVAL_UNDEF(&_58$$37);
- ZVAL_UNDEF(&_59$$37);
- ZVAL_UNDEF(&_60$$40);
- ZVAL_UNDEF(&_61$$40);
- ZVAL_UNDEF(&_62$$40);
- ZVAL_UNDEF(&_63$$40);
- ZVAL_UNDEF(&_65$$41);
- ZVAL_UNDEF(&_66$$43);
- ZVAL_UNDEF(&_67$$44);
- ZVAL_UNDEF(&_68$$44);
- ZVAL_UNDEF(&_69$$45);
- ZVAL_UNDEF(&_70$$46);
- ZVAL_UNDEF(&_71$$46);
- ZVAL_UNDEF(&_72$$47);
- ZVAL_UNDEF(&_73$$48);
- ZVAL_UNDEF(&_74$$48);
- ZVAL_UNDEF(&_75$$49);
- ZVAL_UNDEF(&_76$$49);
- ZVAL_UNDEF(&_77$$50);
- ZVAL_UNDEF(&_78$$51);
- ZVAL_UNDEF(&_79$$52);
- ZVAL_UNDEF(&_80$$57);
- ZVAL_UNDEF(&_81$$57);
- ZVAL_UNDEF(&_82$$58);
- ZVAL_UNDEF(&_83$$59);
- ZVAL_UNDEF(&_84$$60);
- ZVAL_UNDEF(&_85$$61);
- ZVAL_UNDEF(&_86$$62);
- ZVAL_UNDEF(&_87$$63);
- ZVAL_UNDEF(&_88$$63);
- ZVAL_UNDEF(&_89$$66);
- ZVAL_UNDEF(&_90$$67);
- ZVAL_UNDEF(&_91$$67);
- ZVAL_UNDEF(&_92$$68);
- ZVAL_UNDEF(&_93$$68);
- ZVAL_UNDEF(&_94$$70);
- ZVAL_UNDEF(&_95$$70);
- ZVAL_UNDEF(&_96$$70);
- ZVAL_UNDEF(&_97$$70);
+ ZVAL_UNDEF(&input);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ARRAY(statements)
- Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(extendsMode)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(input)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &statements_param, &extendsMode_param);
- ZEPHIR_OBS_COPY_OR_DUP(&statements, statements_param);
- if (!extendsMode_param) {
- extendsMode = 0;
+ zephir_fetch_params(1, 1, 0, &input_param);
+ if (UNEXPECTED(Z_TYPE_P(input_param) != IS_STRING && Z_TYPE_P(input_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'input' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(input_param) == IS_STRING)) {
+ zephir_get_strval(&input, input_param);
} else {
- extendsMode = zephir_get_boolval(extendsMode_param);
+ ZEPHIR_INIT_VAR(&input);
}
- if (!(zephir_fast_count_int(&statements))) {
- RETURN_MM_STRING("");
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("extended"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&extended, &_0);
- _1 = zephir_is_true(&extended);
- if (!(_1)) {
- _1 = extendsMode;
- }
- ZEPHIR_INIT_VAR(&blockMode);
- ZVAL_BOOL(&blockMode, _1);
- if (ZEPHIR_IS_TRUE_IDENTICAL(&blockMode)) {
- RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("blockLevel")));
- }
- RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("level")));
- ZEPHIR_INIT_VAR(&compilation);
- ZVAL_NULL(&compilation);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("extensions"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&extensions, &_0);
- zephir_is_iterable(&statements, 0, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 3001);
- if (Z_TYPE_P(&statements) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&statements), _2)
- {
- ZEPHIR_INIT_NVAR(&statement);
- ZVAL_COPY(&statement, _2);
- if (UNEXPECTED(Z_TYPE_P(&statement) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2753);
- return;
- }
- if (UNEXPECTED(!(zephir_array_isset_string(&statement, SL("type"))))) {
- ZEPHIR_INIT_NVAR(&_4$$7);
- object_init_ex(&_4$$7, phalcon_mvc_view_engine_volt_exception_ce);
- zephir_array_fetch_string(&_5$$7, &statement, SL("file"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2761);
- zephir_array_fetch_string(&_6$$7, &statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2761);
- ZEPHIR_INIT_NVAR(&_7$$7);
- ZEPHIR_CONCAT_SVSV(&_7$$7, "Invalid statement in ", &_5$$7, " on line ", &_6$$7);
- ZEPHIR_CALL_METHOD(NULL, &_4$$7, "__construct", &_8, 508, &_7$$7, &statement);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_4$$7, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2763);
- ZEPHIR_MM_RESTORE();
- return;
- }
- if (Z_TYPE_P(&extensions) == IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&_9$$8);
- zephir_create_array(&_9$$8, 1, 0);
- zephir_array_fast_append(&_9$$8, &statement);
- ZEPHIR_INIT_NVAR(&_10$$8);
- ZVAL_STRING(&_10$$8, "compileStatement");
- ZEPHIR_CALL_METHOD(&tempCompilation, this_ptr, "fireextensionevent", &_11, 510, &_10$$8, &_9$$8);
- zephir_check_call_status();
- if (Z_TYPE_P(&tempCompilation) == IS_STRING) {
- zephir_concat_self(&compilation, &tempCompilation);
- continue;
- }
- }
- ZEPHIR_OBS_NVAR(&type);
- zephir_array_fetch_string(&type, &statement, SL("type"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2789);
- do {
- if (ZEPHIR_IS_LONG(&type, 357)) {
- zephir_array_fetch_string(&_12$$10, &statement, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2797);
- zephir_concat_self(&compilation, &_12$$10);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 300)) {
- if (extendsMode) {
- ZVAL_BOOL(&_14$$11, 1);
- } else {
- ZVAL_BOOL(&_14$$11, 0);
- }
- ZEPHIR_CALL_METHOD(&_13$$11, this_ptr, "compileif", &_15, 0, &statement, &_14$$11);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_13$$11);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 302)) {
- ZEPHIR_CALL_METHOD(&_16$$12, this_ptr, "compileelseif", &_17, 0, &statement);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_16$$12);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 411)) {
- if (extendsMode) {
- ZVAL_BOOL(&_19$$13, 1);
- } else {
- ZVAL_BOOL(&_19$$13, 0);
- }
- ZEPHIR_CALL_METHOD(&_18$$13, this_ptr, "compileswitch", &_20, 0, &statement, &_19$$13);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_18$$13);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 412)) {
- ZEPHIR_CALL_METHOD(&_21$$14, this_ptr, "compilecase", &_22, 0, &statement);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_21$$14);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 413)) {
- ZVAL_BOOL(&_24$$15, 0);
- ZEPHIR_CALL_METHOD(&_23$$15, this_ptr, "compilecase", &_22, 0, &statement, &_24$$15);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_23$$15);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 304)) {
- if (extendsMode) {
- ZVAL_BOOL(&_26$$16, 1);
- } else {
- ZVAL_BOOL(&_26$$16, 0);
- }
- ZEPHIR_CALL_METHOD(&_25$$16, this_ptr, "compileforeach", &_27, 0, &statement, &_26$$16);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_25$$16);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 306)) {
- ZEPHIR_CALL_METHOD(&_28$$17, this_ptr, "compileset", &_29, 0, &statement);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_28$$17);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 359)) {
- ZEPHIR_CALL_METHOD(&_30$$18, this_ptr, "compileecho", &_31, 0, &statement);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_30$$18);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 307)) {
- ZEPHIR_OBS_NVAR(&blockName);
- zephir_array_fetch_string(&blockName, &statement, SL("name"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2845);
- ZEPHIR_OBS_NVAR(&blockStatements);
- zephir_array_isset_string_fetch(&blockStatements, &statement, SL("block_statements"), 0);
- zephir_read_property(&_32$$19, this_ptr, ZEND_STRL("blocks"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&blocks, &_32$$19);
- if (zephir_is_true(&blockMode)) {
- if (Z_TYPE_P(&blocks) != IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&blocks);
- array_init(&blocks);
- }
- if (Z_TYPE_P(&compilation) != IS_NULL) {
- zephir_array_append(&blocks, &compilation, PH_SEPARATE, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2860);
- ZEPHIR_INIT_NVAR(&compilation);
- ZVAL_NULL(&compilation);
- }
- zephir_array_update_zval(&blocks, &blockName, &blockStatements, PH_COPY | PH_SEPARATE);
- zephir_update_property_zval(this_ptr, ZEND_STRL("blocks"), &blocks);
- } else {
- if (Z_TYPE_P(&blockStatements) == IS_ARRAY) {
- if (extendsMode) {
- ZVAL_BOOL(&_34$$24, 1);
- } else {
- ZVAL_BOOL(&_34$$24, 0);
- }
- ZEPHIR_CALL_METHOD(&_33$$24, this_ptr, "statementlist", &_35, 509, &blockStatements, &_34$$24);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_33$$24);
- }
- }
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 310)) {
- ZEPHIR_OBS_NVAR(&path);
- zephir_array_fetch_string(&path, &statement, SL("path"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2886);
- zephir_array_fetch_string(&_36$$25, &path, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2890);
- ZEPHIR_CALL_METHOD(&finalPath, this_ptr, "getfinalpath", &_37, 0, &_36$$25);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&extended);
- ZVAL_BOOL(&extended, 1);
- ZEPHIR_INIT_NVAR(&subCompiler);
- if (zephir_clone(&subCompiler, this_ptr) == FAILURE) {
- RETURN_MM();
- }
- ZEPHIR_CALL_METHOD(&tempCompilation, &subCompiler, "compile", NULL, 0, &finalPath, &extended);
- zephir_check_call_status();
- if (Z_TYPE_P(&tempCompilation) == IS_NULL) {
- ZEPHIR_CALL_METHOD(&_38$$26, &subCompiler, "getcompiledtemplatepath", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&tempCompilation);
- zephir_file_get_contents(&tempCompilation, &_38$$26);
- }
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("extended"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("extended"), &__$false);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("extendedBlocks"), &tempCompilation);
- ZEPHIR_CPY_WRT(&blockMode, &extended);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 313)) {
- ZEPHIR_CALL_METHOD(&_39$$27, this_ptr, "compileinclude", &_40, 0, &statement);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_39$$27);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 316)) {
- ZEPHIR_CALL_METHOD(&_41$$28, this_ptr, "compiledo", &_42, 0, &statement);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_41$$28);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 327)) {
- ZEPHIR_CALL_METHOD(&_43$$29, this_ptr, "compilereturn", &_44, 0, &statement);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_43$$29);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 317)) {
- if (extendsMode) {
- ZVAL_BOOL(&_46$$30, 1);
- } else {
- ZVAL_BOOL(&_46$$30, 0);
- }
- ZEPHIR_CALL_METHOD(&_45$$30, this_ptr, "compileautoescape", &_47, 0, &statement, &_46$$30);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_45$$30);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 319)) {
- zephir_concat_self_str(&compilation, SL(""));
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 320)) {
- zephir_concat_self_str(&compilation, SL(""));
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 321)) {
- ZEPHIR_CALL_METHOD(&_48$$33, this_ptr, "compileforelse", &_49, 0);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_48$$33);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 322)) {
- if (extendsMode) {
- ZVAL_BOOL(&_51$$34, 1);
- } else {
- ZVAL_BOOL(&_51$$34, 0);
- }
- ZEPHIR_CALL_METHOD(&_50$$34, this_ptr, "compilemacro", &_52, 0, &statement, &_51$$34);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_50$$34);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 325)) {
- if (extendsMode) {
- ZVAL_BOOL(&_54$$35, 1);
- } else {
- ZVAL_BOOL(&_54$$35, 0);
- }
- ZEPHIR_CALL_METHOD(&_53$$35, this_ptr, "compilecall", &_55, 0, &statement, &_54$$35);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_53$$35);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 358)) {
- break;
- }
- ZEPHIR_INIT_NVAR(&_56$$37);
- object_init_ex(&_56$$37, phalcon_mvc_view_engine_volt_exception_ce);
- zephir_array_fetch_string(&_57$$37, &statement, SL("file"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2992);
- zephir_array_fetch_string(&_58$$37, &statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2993);
- ZEPHIR_INIT_NVAR(&_59$$37);
- ZEPHIR_CONCAT_SVSVSV(&_59$$37, "Unknown statement ", &type, " in ", &_57$$37, " on line ", &_58$$37);
- ZEPHIR_CALL_METHOD(NULL, &_56$$37, "__construct", &_8, 508, &_59$$37);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_56$$37, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2993);
- ZEPHIR_MM_RESTORE();
- return;
- } while(0);
+ ZEPHIR_RETURN_CALL_FUNCTION("lcfirst", NULL, 96, &input);
+ zephir_check_call_status();
+ RETURN_MM();
+}
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &statements, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_3, &statements, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_3)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&statement, &statements, "current", NULL, 0);
- zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&statement) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2753);
- return;
- }
- if (UNEXPECTED(!(zephir_array_isset_string(&statement, SL("type"))))) {
- ZEPHIR_INIT_NVAR(&_60$$40);
- object_init_ex(&_60$$40, phalcon_mvc_view_engine_volt_exception_ce);
- zephir_array_fetch_string(&_61$$40, &statement, SL("file"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2761);
- zephir_array_fetch_string(&_62$$40, &statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2761);
- ZEPHIR_INIT_NVAR(&_63$$40);
- ZEPHIR_CONCAT_SVSV(&_63$$40, "Invalid statement in ", &_61$$40, " on line ", &_62$$40);
- ZEPHIR_CALL_METHOD(NULL, &_60$$40, "__construct", &_8, 508, &_63$$40, &statement);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_60$$40, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2763);
- ZEPHIR_MM_RESTORE();
- return;
- }
- if (Z_TYPE_P(&extensions) == IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&_64$$41);
- zephir_create_array(&_64$$41, 1, 0);
- zephir_array_fast_append(&_64$$41, &statement);
- ZEPHIR_INIT_NVAR(&_65$$41);
- ZVAL_STRING(&_65$$41, "compileStatement");
- ZEPHIR_CALL_METHOD(&tempCompilation, this_ptr, "fireextensionevent", &_11, 510, &_65$$41, &_64$$41);
- zephir_check_call_status();
- if (Z_TYPE_P(&tempCompilation) == IS_STRING) {
- zephir_concat_self(&compilation, &tempCompilation);
- continue;
- }
- }
- ZEPHIR_OBS_NVAR(&type);
- zephir_array_fetch_string(&type, &statement, SL("type"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2789);
- do {
- if (ZEPHIR_IS_LONG(&type, 357)) {
- zephir_array_fetch_string(&_66$$43, &statement, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2797);
- zephir_concat_self(&compilation, &_66$$43);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 300)) {
- if (extendsMode) {
- ZVAL_BOOL(&_68$$44, 1);
- } else {
- ZVAL_BOOL(&_68$$44, 0);
- }
- ZEPHIR_CALL_METHOD(&_67$$44, this_ptr, "compileif", &_15, 0, &statement, &_68$$44);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_67$$44);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 302)) {
- ZEPHIR_CALL_METHOD(&_69$$45, this_ptr, "compileelseif", &_17, 0, &statement);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_69$$45);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 411)) {
- if (extendsMode) {
- ZVAL_BOOL(&_71$$46, 1);
- } else {
- ZVAL_BOOL(&_71$$46, 0);
- }
- ZEPHIR_CALL_METHOD(&_70$$46, this_ptr, "compileswitch", &_20, 0, &statement, &_71$$46);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_70$$46);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 412)) {
- ZEPHIR_CALL_METHOD(&_72$$47, this_ptr, "compilecase", &_22, 0, &statement);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_72$$47);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 413)) {
- ZVAL_BOOL(&_74$$48, 0);
- ZEPHIR_CALL_METHOD(&_73$$48, this_ptr, "compilecase", &_22, 0, &statement, &_74$$48);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_73$$48);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 304)) {
- if (extendsMode) {
- ZVAL_BOOL(&_76$$49, 1);
- } else {
- ZVAL_BOOL(&_76$$49, 0);
- }
- ZEPHIR_CALL_METHOD(&_75$$49, this_ptr, "compileforeach", &_27, 0, &statement, &_76$$49);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_75$$49);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 306)) {
- ZEPHIR_CALL_METHOD(&_77$$50, this_ptr, "compileset", &_29, 0, &statement);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_77$$50);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 359)) {
- ZEPHIR_CALL_METHOD(&_78$$51, this_ptr, "compileecho", &_31, 0, &statement);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_78$$51);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 307)) {
- ZEPHIR_OBS_NVAR(&blockName);
- zephir_array_fetch_string(&blockName, &statement, SL("name"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2845);
- ZEPHIR_OBS_NVAR(&blockStatements);
- zephir_array_isset_string_fetch(&blockStatements, &statement, SL("block_statements"), 0);
- zephir_read_property(&_79$$52, this_ptr, ZEND_STRL("blocks"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&blocks, &_79$$52);
- if (zephir_is_true(&blockMode)) {
- if (Z_TYPE_P(&blocks) != IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&blocks);
- array_init(&blocks);
- }
- if (Z_TYPE_P(&compilation) != IS_NULL) {
- zephir_array_append(&blocks, &compilation, PH_SEPARATE, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2860);
- ZEPHIR_INIT_NVAR(&compilation);
- ZVAL_NULL(&compilation);
- }
- zephir_array_update_zval(&blocks, &blockName, &blockStatements, PH_COPY | PH_SEPARATE);
- zephir_update_property_zval(this_ptr, ZEND_STRL("blocks"), &blocks);
- } else {
- if (Z_TYPE_P(&blockStatements) == IS_ARRAY) {
- if (extendsMode) {
- ZVAL_BOOL(&_81$$57, 1);
- } else {
- ZVAL_BOOL(&_81$$57, 0);
- }
- ZEPHIR_CALL_METHOD(&_80$$57, this_ptr, "statementlist", &_35, 509, &blockStatements, &_81$$57);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_80$$57);
- }
- }
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 310)) {
- ZEPHIR_OBS_NVAR(&path);
- zephir_array_fetch_string(&path, &statement, SL("path"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2886);
- zephir_array_fetch_string(&_82$$58, &path, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2890);
- ZEPHIR_CALL_METHOD(&finalPath, this_ptr, "getfinalpath", &_37, 0, &_82$$58);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&extended);
- ZVAL_BOOL(&extended, 1);
- ZEPHIR_INIT_NVAR(&subCompiler);
- if (zephir_clone(&subCompiler, this_ptr) == FAILURE) {
- RETURN_MM();
- }
- ZEPHIR_CALL_METHOD(&tempCompilation, &subCompiler, "compile", NULL, 0, &finalPath, &extended);
- zephir_check_call_status();
- if (Z_TYPE_P(&tempCompilation) == IS_NULL) {
- ZEPHIR_CALL_METHOD(&_83$$59, &subCompiler, "getcompiledtemplatepath", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&tempCompilation);
- zephir_file_get_contents(&tempCompilation, &_83$$59);
- }
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("extended"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("extended"), &__$false);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("extendedBlocks"), &tempCompilation);
- ZEPHIR_CPY_WRT(&blockMode, &extended);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 313)) {
- ZEPHIR_CALL_METHOD(&_84$$60, this_ptr, "compileinclude", &_40, 0, &statement);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_84$$60);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 316)) {
- ZEPHIR_CALL_METHOD(&_85$$61, this_ptr, "compiledo", &_42, 0, &statement);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_85$$61);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 327)) {
- ZEPHIR_CALL_METHOD(&_86$$62, this_ptr, "compilereturn", &_44, 0, &statement);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_86$$62);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 317)) {
- if (extendsMode) {
- ZVAL_BOOL(&_88$$63, 1);
- } else {
- ZVAL_BOOL(&_88$$63, 0);
- }
- ZEPHIR_CALL_METHOD(&_87$$63, this_ptr, "compileautoescape", &_47, 0, &statement, &_88$$63);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_87$$63);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 319)) {
- zephir_concat_self_str(&compilation, SL(""));
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 320)) {
- zephir_concat_self_str(&compilation, SL(""));
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 321)) {
- ZEPHIR_CALL_METHOD(&_89$$66, this_ptr, "compileforelse", &_49, 0);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_89$$66);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 322)) {
- if (extendsMode) {
- ZVAL_BOOL(&_91$$67, 1);
- } else {
- ZVAL_BOOL(&_91$$67, 0);
- }
- ZEPHIR_CALL_METHOD(&_90$$67, this_ptr, "compilemacro", &_52, 0, &statement, &_91$$67);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_90$$67);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 325)) {
- if (extendsMode) {
- ZVAL_BOOL(&_93$$68, 1);
- } else {
- ZVAL_BOOL(&_93$$68, 0);
- }
- ZEPHIR_CALL_METHOD(&_92$$68, this_ptr, "compilecall", &_55, 0, &statement, &_93$$68);
- zephir_check_call_status();
- zephir_concat_self(&compilation, &_92$$68);
- break;
- }
- if (ZEPHIR_IS_LONG(&type, 358)) {
- break;
- }
- ZEPHIR_INIT_NVAR(&_94$$70);
- object_init_ex(&_94$$70, phalcon_mvc_view_engine_volt_exception_ce);
- zephir_array_fetch_string(&_95$$70, &statement, SL("file"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2992);
- zephir_array_fetch_string(&_96$$70, &statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2993);
- ZEPHIR_INIT_NVAR(&_97$$70);
- ZEPHIR_CONCAT_SVSVSV(&_97$$70, "Unknown statement ", &type, " in ", &_95$$70, " on line ", &_96$$70);
- ZEPHIR_CALL_METHOD(NULL, &_94$$70, "__construct", &_8, 508, &_97$$70);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_94$$70, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2993);
- ZEPHIR_MM_RESTORE();
- return;
- } while(0);
- ZEPHIR_CALL_METHOD(NULL, &statements, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&statement);
- if (ZEPHIR_IS_TRUE_IDENTICAL(&blockMode)) {
- zephir_read_property(&level, this_ptr, ZEND_STRL("blockLevel"), PH_NOISY_CC | PH_READONLY);
- if (ZEPHIR_IS_LONG(&level, 1)) {
- if (Z_TYPE_P(&compilation) != IS_NULL) {
- zephir_update_property_array_append(this_ptr, SL("blocks"), &compilation);
- }
- }
- RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("blockLevel")));
- }
- RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("level")));
- RETURN_CCTOR(&compilation);
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_Regex)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, Regex, phalcon, filter_sanitize_regex, phalcon_filter_sanitize_regex_method_entry, 0);
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementListOrExtends)
+static PHP_METHOD(Phalcon_Filter_Sanitize_Regex, __invoke)
{
- zend_bool isStatementList = 0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *statements, statements_sub, statement, *_0$$4, _1$$4;
+ zval *input, input_sub, *pattern, pattern_sub, *replace, replace_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statements_sub);
- ZVAL_UNDEF(&statement);
- ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&input_sub);
+ ZVAL_UNDEF(&pattern_sub);
+ ZVAL_UNDEF(&replace_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(statements)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_ZVAL(input)
+ Z_PARAM_ZVAL(pattern)
+ Z_PARAM_ZVAL(replace)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &statements);
+ zephir_fetch_params(1, 3, 0, &input, &pattern, &replace);
- if (Z_TYPE_P(statements) != IS_ARRAY) {
- RETVAL_ZVAL(statements, 1, 0);
- RETURN_MM();
- }
- isStatementList = 1;
- if (!(zephir_array_isset_string(statements, SL("type")))) {
- zephir_is_iterable(statements, 0, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 3050);
- if (Z_TYPE_P(statements) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(statements), _0$$4)
- {
- ZEPHIR_INIT_NVAR(&statement);
- ZVAL_COPY(&statement, _0$$4);
- if (Z_TYPE_P(&statement) != IS_ARRAY) {
- isStatementList = 0;
- break;
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, statements, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1$$4, statements, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1$$4)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&statement, statements, "current", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&statement) != IS_ARRAY) {
- isStatementList = 0;
- break;
- }
- ZEPHIR_CALL_METHOD(NULL, statements, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&statement);
- }
- if (isStatementList) {
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "statementlist", NULL, 509, statements);
- zephir_check_call_status();
- RETURN_MM();
- }
- RETVAL_ZVAL(statements, 1, 0);
+ ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 50, pattern, replace, input);
+ zephir_check_call_status();
RETURN_MM();
}
-zend_object *zephir_init_properties_Phalcon_Mvc_View_Engine_Volt_Compiler(zend_class_entry *class_type)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_Remove)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, Remove, phalcon, filter_sanitize_remove, phalcon_filter_sanitize_remove_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Filter_Sanitize_Remove, __invoke)
{
- zval _0, _2, _4, _6, _8, _10, _12, _1$$3, _3$$4, _5$$5, _7$$6, _9$$7, _11$$8, _13$$9;
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(&_12);
- 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(&_13$$9);
-
+ zval *input, input_sub, *replace, replace_sub, _0, _1;
+ zval *this_ptr = getThis();
- ZEPHIR_MM_GROW();
-
- {
- 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_ex(&_2, this_ptr, ZEND_STRL("macros"), 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("macros"), &_3$$4);
- }
- zephir_read_property_ex(&_4, this_ptr, ZEND_STRL("loopPointers"), 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("loopPointers"), &_5$$5);
- }
- zephir_read_property_ex(&_6, this_ptr, ZEND_STRL("functions"), 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("functions"), &_7$$6);
- }
- zephir_read_property_ex(&_8, this_ptr, ZEND_STRL("forElsePointers"), 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("forElsePointers"), &_9$$7);
- }
- zephir_read_property_ex(&_10, this_ptr, ZEND_STRL("filters"), 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("filters"), &_11$$8);
- }
- zephir_read_property_ex(&_12, this_ptr, ZEND_STRL("extensions"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_12) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_13$$9);
- array_init(&_13$$9);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("extensions"), &_13$$9);
- }
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
- }
+ ZVAL_UNDEF(&input_sub);
+ ZVAL_UNDEF(&replace_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ZVAL(input)
+ Z_PARAM_ZVAL(replace)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &input, &replace);
+
+
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "");
+ ZEPHIR_INIT_VAR(&_1);
+ zephir_fast_str_replace(&_1, replace, &_0, input);
+ RETURN_CCTOR(&_1);
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_Replace)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, Replace, phalcon, filter_sanitize_replace, phalcon_filter_sanitize_replace_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Filter_Sanitize_Replace, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *input, input_sub, *from, from_sub, *to, to_sub, _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&input_sub);
+ ZVAL_UNDEF(&from_sub);
+ ZVAL_UNDEF(&to_sub);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_ZVAL(input)
+ Z_PARAM_ZVAL(from)
+ Z_PARAM_ZVAL(to)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 0, &input, &from, &to);
+
+
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_fast_str_replace(&_0, from, to, input);
+ RETURN_CCTOR(&_0);
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_Special)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, Special, phalcon, filter_sanitize_special, phalcon_filter_sanitize_special_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Filter_Sanitize_Special, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *input, input_sub, _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&input_sub);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(input)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &input);
+
+
+ ZVAL_LONG(&_0, 515);
+ ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 237, input, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
}
@@ -182825,2983 +170556,5995 @@ zend_object *zephir_init_properties_Phalcon_Mvc_View_Engine_Volt_Compiler(zend_c
-ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Engine_Volt_Exception)
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_SpecialFull)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\View\\Engine\\Volt, Exception, phalcon, mvc_view_engine_volt_exception, phalcon_mvc_view_exception_ce, phalcon_mvc_view_engine_volt_exception_method_entry, 0);
-
- zend_declare_property_null(phalcon_mvc_view_engine_volt_exception_ce, SL("statement"), ZEND_ACC_PROTECTED);
- phalcon_mvc_view_engine_volt_exception_ce->create_object = zephir_init_properties_Phalcon_Mvc_View_Engine_Volt_Exception;
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, SpecialFull, phalcon, filter_sanitize_specialfull, phalcon_filter_sanitize_specialfull_method_entry, 0);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Exception, __construct)
+static PHP_METHOD(Phalcon_Filter_Sanitize_SpecialFull, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long code, ZEPHIR_LAST_CALL_STATUS;
- zval statement;
- zval *message_param = NULL, *statement_param = NULL, *code_param = NULL, *previous = NULL, previous_sub, __$null, _0;
- zval message;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *input, input_sub, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&message);
- ZVAL_UNDEF(&previous_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&input_sub);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&statement);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 4)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR(message)
- Z_PARAM_ARRAY(statement)
- Z_PARAM_LONG(code)
- Z_PARAM_OBJECT_OF_CLASS_OR_NULL(previous, zend_ce_exception)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(input)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 4, &message_param, &statement_param, &code_param, &previous);
- if (!message_param) {
- ZEPHIR_INIT_VAR(&message);
- ZVAL_STRING(&message, "");
- } else {
- zephir_get_strval(&message, message_param);
- }
- if (!statement_param) {
- ZEPHIR_INIT_VAR(&statement);
- array_init(&statement);
- } else {
- zephir_get_arrval(&statement, statement_param);
- }
- if (!code_param) {
- code = 0;
- } else {
- code = zephir_get_intval(code_param);
- }
- if (!previous) {
- previous = &previous_sub;
- previous = &__$null;
- }
+ zephir_fetch_params(1, 1, 0, &input);
- zephir_update_property_zval(this_ptr, ZEND_STRL("statement"), &statement);
- ZVAL_LONG(&_0, code);
- ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_view_engine_volt_exception_ce, getThis(), "__construct", NULL, 0, &message, &_0, previous);
+ ZVAL_LONG(&_0, 522);
+ ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 237, input, &_0);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Exception, getStatement)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_StringVal)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, StringVal, phalcon, filter_sanitize_stringval, phalcon_filter_sanitize_stringval_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Filter_Sanitize_StringVal, __invoke)
{
- zval statement, _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *input, input_sub, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&statement);
+ ZVAL_UNDEF(&input_sub);
ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(input)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &input);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("statement"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&statement, &_0);
- if (Z_TYPE_P(&statement) != IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&statement);
- array_init(&statement);
- }
- RETURN_CCTOR(&statement);
+
+ ZVAL_LONG(&_0, 513);
+ ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 237, input, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-zend_object *zephir_init_properties_Phalcon_Mvc_View_Engine_Volt_Exception(zend_class_entry *class_type)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_Striptags)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, Striptags, phalcon, filter_sanitize_striptags, phalcon_filter_sanitize_striptags_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Filter_Sanitize_Striptags, __invoke)
{
- zval _0, _1$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
-
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *input_param = NULL;
+ zval input;
+ zval *this_ptr = getThis();
- ZEPHIR_MM_GROW();
-
- {
- 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("statement"), 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("statement"), &_1$$3);
- }
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
+ ZVAL_UNDEF(&input);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(input)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &input_param);
+ if (UNEXPECTED(Z_TYPE_P(input_param) != IS_STRING && Z_TYPE_P(input_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'input' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(input_param) == IS_STRING)) {
+ zephir_get_strval(&input, input_param);
+ } else {
+ ZEPHIR_INIT_VAR(&input);
}
+
+
+ ZEPHIR_RETURN_CALL_FUNCTION("strip_tags", NULL, 241, &input);
+ zephir_check_call_status();
+ RETURN_MM();
}
-/* Driver template for the LEMON parser generator.
-** The author disclaims copyright to this source code.
-*/
-/* First off, code is include which follows the "include" declaration
-** in the input file. */
-// 38 "parser.php.lemon"
+
+#ifdef HAVE_CONFIG_H
+#endif
-/* Change next line to "#if 1"
- * to enable parser tracing. */
-#if 0
-# ifdef NDEBUG
-# undef NDEBUG
-# endif
-#else
-# ifndef NDEBUG
-# define NDEBUG 1
-# endif
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_Trim)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, Trim, phalcon, filter_sanitize_trim, phalcon_filter_sanitize_trim_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Filter_Sanitize_Trim, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *input_param = NULL;
+ zval input;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&input);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(input)
+ ZEND_PARSE_PARAMETERS_END();
#endif
-// 24 "parser.php.c"
-/* Next is all token values, in a form suitable for use by makeheaders.
-** This section will be null unless lemon is run with the -m switch.
-*/
-/* Make sure the INTERFACE macro is defined.
-*/
-#ifndef INTERFACE
-# define INTERFACE 1
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &input_param);
+ if (UNEXPECTED(Z_TYPE_P(input_param) != IS_STRING && Z_TYPE_P(input_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'input' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(input_param) == IS_STRING)) {
+ zephir_get_strval(&input, input_param);
+ } else {
+ ZEPHIR_INIT_VAR(&input);
+ }
+
+
+ zephir_fast_trim(return_value, &input, NULL , ZEPHIR_TRIM_BOTH);
+ RETURN_MM();
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
#endif
-/* The next thing included is series of defines which control
-** various aspects of the generated parser.
-** VVCODETYPE is the data type used for storing terminal
-** and nonterminal numbers. "unsigned char" is
-** used if there are fewer than 250 terminals
-** and nonterminals. "int" is used otherwise.
-** VVNOCODE is a number of type VVCODETYPE which corresponds
-** to no legal terminal or nonterminal number. This
-** number is used to fill in empty slots of the hash
-** table.
-** VVFALLBACK If defined, this indicates that one or more tokens
-** have fall-back values which should be used if the
-** original value of the token will not parse.
-** VVACTIONTYPE is the data type used for storing terminal
-** and nonterminal numbers. "unsigned char" is
-** used if there are fewer than 250 rules and
-** states combined. "int" is used otherwise.
-** phvolt_TOKENTYPE is the data type used for minor tokens given
-** directly to the parser from the tokenizer.
-** VVMINORTYPE is the data type used for all minor tokens.
-** This is typically a union of many types, one of
-** which is phvolt_TOKENTYPE. The entry in the union
-** for base tokens is called "vv0".
-** VVSTACKDEPTH is the maximum depth of the parser's stack.
-** phvolt_ARG_SDECL A static variable declaration for the %extra_argument
-** phvolt_ARG_PDECL A parameter declaration for the %extra_argument
-** phvolt_ARG_STORE Code to store %extra_argument into vvpParser
-** phvolt_ARG_FETCH Code to extract %extra_argument from vvpParser
-** VVNSTATE the combined number of states.
-** VVNRULE the number of rules in the grammar
-** VVERRORSYMBOL is the code number of the error symbol. If not
-** defined, then do no error processing.
-*/
-#define VVCODETYPE unsigned char
-#define VVNOCODE 131
-#define VVACTIONTYPE unsigned short int
-#define phvolt_TOKENTYPE phvolt_parser_token*
-typedef union {
- phvolt_TOKENTYPE vv0;
- zval vv186;
- int vv261;
-} VVMINORTYPE;
-#define VVSTACKDEPTH 100
-#define phvolt_ARG_SDECL phvolt_parser_status *status;
-#define phvolt_ARG_PDECL ,phvolt_parser_status *status
-#define phvolt_ARG_FETCH phvolt_parser_status *status = vvpParser->status
-#define phvolt_ARG_STORE vvpParser->status = status
-#define VVNSTATE 365
-#define VVNRULE 158
-#define VVERRORSYMBOL 89
-#define VVERRSYMDT vv261
-#define VV_NO_ACTION (VVNSTATE+VVNRULE+2)
-#define VV_ACCEPT_ACTION (VVNSTATE+VVNRULE+1)
-#define VV_ERROR_ACTION (VVNSTATE+VVNRULE)
-/* Next are that tables used to determine what action to take based on the
-** current state and lookahead token. These tables are used to implement
-** functions that take a state number and lookahead value and return an
-** action integer.
-**
-** Suppose the action integer is N. Then the action is determined as
-** follows
-**
-** 0 <= N < VVNSTATE Shift N. That is, push the lookahead
-** token onto the stack and goto state N.
-**
-** VVNSTATE <= N < VVNSTATE+VVNRULE Reduce by rule N-VVNSTATE.
-**
-** N == VVNSTATE+VVNRULE A syntax error has occurred.
-**
-** N == VVNSTATE+VVNRULE+1 The parser accepts its input.
-**
-** N == VVNSTATE+VVNRULE+2 No such action. Denotes unused
-** slots in the vv_action[] table.
-**
-** The action table is constructed as a single large table named vv_action[].
-** Given state S and lookahead X, the action is computed as
-**
-** vv_action[ vv_shift_ofst[S] + X ]
-**
-** If the index value vv_shift_ofst[S]+X is out of range or if the value
-** vv_lookahead[vv_shift_ofst[S]+X] is not equal to X or if vv_shift_ofst[S]
-** is equal to VV_SHIFT_USE_DFLT, it means that the action is not in the table
-** and that vv_default[S] should be used instead.
-**
-** The formula above is for computing the action when the lookahead is
-** a terminal symbol. If the lookahead is a non-terminal (as occurs after
-** a reduce action) then the vv_reduce_ofst[] array is used in place of
-** the vv_shift_ofst[] array and VV_REDUCE_USE_DFLT is used in place of
-** VV_SHIFT_USE_DFLT.
-**
-** The following are the tables generated in this section:
-**
-** vv_action[] A single table containing all actions.
-** vv_lookahead[] A table containing the lookahead for each entry in
-** vv_action. Used to detect hash collisions.
-** vv_shift_ofst[] For each state, the offset into vv_action for
-** shifting terminals.
-** vv_reduce_ofst[] For each state, the offset into vv_action for
-** shifting non-terminals after a reduce.
-** vv_default[] Default action for each state.
-*/
-static VVACTIONTYPE vv_action[] = {
- /* 0 */ 95, 111, 63, 55, 57, 85, 69, 65, 67, 75,
- /* 10 */ 77, 79, 81, 71, 73, 51, 49, 53, 46, 43,
- /* 20 */ 59, 92, 61, 87, 90, 91, 99, 83, 365, 245,
- /* 30 */ 87, 90, 91, 99, 83, 300, 51, 49, 53, 46,
- /* 40 */ 43, 59, 92, 61, 87, 90, 91, 99, 83, 110,
- /* 50 */ 338, 299, 194, 215, 198, 95, 174, 63, 55, 57,
- /* 60 */ 85, 69, 65, 67, 75, 77, 79, 81, 71, 73,
- /* 70 */ 51, 49, 53, 46, 43, 59, 92, 61, 87, 90,
- /* 80 */ 91, 99, 83, 331, 176, 95, 33, 63, 55, 57,
- /* 90 */ 85, 69, 65, 67, 75, 77, 79, 81, 71, 73,
- /* 100 */ 51, 49, 53, 46, 43, 59, 92, 61, 87, 90,
- /* 110 */ 91, 99, 83, 95, 265, 63, 55, 57, 85, 69,
- /* 120 */ 65, 67, 75, 77, 79, 81, 71, 73, 51, 49,
- /* 130 */ 53, 46, 43, 59, 92, 61, 87, 90, 91, 99,
- /* 140 */ 83, 347, 342, 46, 43, 59, 92, 61, 87, 90,
- /* 150 */ 91, 99, 83, 35, 266, 197, 198, 39, 95, 88,
- /* 160 */ 63, 55, 57, 85, 69, 65, 67, 75, 77, 79,
- /* 170 */ 81, 71, 73, 51, 49, 53, 46, 43, 59, 92,
- /* 180 */ 61, 87, 90, 91, 99, 83, 95, 29, 63, 55,
- /* 190 */ 57, 85, 69, 65, 67, 75, 77, 79, 81, 71,
- /* 200 */ 73, 51, 49, 53, 46, 43, 59, 92, 61, 87,
- /* 210 */ 90, 91, 99, 83, 95, 42, 63, 55, 57, 85,
- /* 220 */ 69, 65, 67, 75, 77, 79, 81, 71, 73, 51,
- /* 230 */ 49, 53, 46, 43, 59, 92, 61, 87, 90, 91,
- /* 240 */ 99, 83, 92, 61, 87, 90, 91, 99, 83, 321,
- /* 250 */ 322, 323, 324, 325, 326, 309, 327, 276, 287, 118,
- /* 260 */ 134, 94, 139, 140, 503, 95, 97, 63, 55, 57,
- /* 270 */ 85, 69, 65, 67, 75, 77, 79, 81, 71, 73,
- /* 280 */ 51, 49, 53, 46, 43, 59, 92, 61, 87, 90,
- /* 290 */ 91, 99, 83, 95, 504, 63, 55, 57, 85, 69,
- /* 300 */ 65, 67, 75, 77, 79, 81, 71, 73, 51, 49,
- /* 310 */ 53, 46, 43, 59, 92, 61, 87, 90, 91, 99,
- /* 320 */ 83, 100, 146, 142, 142, 144, 107, 147, 129, 503,
- /* 330 */ 504, 318, 107, 120, 137, 109, 145, 116, 120, 141,
- /* 340 */ 141, 114, 105, 116, 120, 219, 95, 171, 63, 55,
- /* 350 */ 57, 85, 69, 65, 67, 75, 77, 79, 81, 71,
- /* 360 */ 73, 51, 49, 53, 46, 43, 59, 92, 61, 87,
- /* 370 */ 90, 91, 99, 83, 95, 183, 63, 55, 57, 85,
- /* 380 */ 69, 65, 67, 75, 77, 79, 81, 71, 73, 51,
- /* 390 */ 49, 53, 46, 43, 59, 92, 61, 87, 90, 91,
- /* 400 */ 99, 83, 95, 190, 63, 55, 57, 85, 69, 65,
- /* 410 */ 67, 75, 77, 79, 81, 71, 73, 51, 49, 53,
- /* 420 */ 46, 43, 59, 92, 61, 87, 90, 91, 99, 83,
- /* 430 */ 100, 173, 131, 28, 93, 180, 107, 228, 100, 187,
- /* 440 */ 165, 192, 120, 137, 143, 120, 120, 128, 120, 211,
- /* 450 */ 120, 132, 120, 95, 213, 63, 55, 57, 85, 69,
- /* 460 */ 65, 67, 75, 77, 79, 81, 71, 73, 51, 49,
- /* 470 */ 53, 46, 43, 59, 92, 61, 87, 90, 91, 99,
- /* 480 */ 83, 95, 130, 63, 55, 57, 85, 69, 65, 67,
- /* 490 */ 75, 77, 79, 81, 71, 73, 51, 49, 53, 46,
- /* 500 */ 43, 59, 92, 61, 87, 90, 91, 99, 83, 214,
- /* 510 */ 262, 217, 95, 254, 63, 55, 57, 85, 69, 65,
- /* 520 */ 67, 75, 77, 79, 81, 71, 73, 51, 49, 53,
- /* 530 */ 46, 43, 59, 92, 61, 87, 90, 91, 99, 83,
- /* 540 */ 95, 268, 63, 55, 57, 85, 69, 65, 67, 75,
- /* 550 */ 77, 79, 81, 71, 73, 51, 49, 53, 46, 43,
- /* 560 */ 59, 92, 61, 87, 90, 91, 99, 83, 95, 271,
- /* 570 */ 63, 55, 57, 85, 69, 65, 67, 75, 77, 79,
- /* 580 */ 81, 71, 73, 51, 49, 53, 46, 43, 59, 92,
- /* 590 */ 61, 87, 90, 91, 99, 83, 95, 274, 63, 55,
- /* 600 */ 57, 85, 69, 65, 67, 75, 77, 79, 81, 71,
- /* 610 */ 73, 51, 49, 53, 46, 43, 59, 92, 61, 87,
- /* 620 */ 90, 91, 99, 83, 95, 333, 63, 55, 57, 85,
- /* 630 */ 69, 65, 67, 75, 77, 79, 81, 71, 73, 51,
- /* 640 */ 49, 53, 46, 43, 59, 92, 61, 87, 90, 91,
- /* 650 */ 99, 83, 95, 349, 63, 55, 57, 85, 69, 65,
- /* 660 */ 67, 75, 77, 79, 81, 71, 73, 51, 49, 53,
- /* 670 */ 46, 43, 59, 92, 61, 87, 90, 91, 99, 83,
- /* 680 */ 95, 218, 63, 55, 57, 85, 69, 65, 67, 75,
- /* 690 */ 77, 79, 81, 71, 73, 51, 49, 53, 46, 43,
- /* 700 */ 59, 92, 61, 87, 90, 91, 227, 83, 524, 1,
- /* 710 */ 2, 286, 4, 5, 6, 7, 8, 9, 10, 11,
- /* 720 */ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- /* 730 */ 22, 23, 24, 25, 63, 55, 57, 85, 69, 65,
- /* 740 */ 67, 75, 77, 79, 81, 71, 73, 51, 49, 53,
- /* 750 */ 46, 43, 59, 92, 61, 87, 90, 91, 99, 83,
- /* 760 */ 55, 57, 85, 69, 65, 67, 75, 77, 79, 81,
- /* 770 */ 71, 73, 51, 49, 53, 46, 43, 59, 92, 61,
- /* 780 */ 87, 90, 91, 99, 83, 30, 286, 4, 5, 6,
- /* 790 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- /* 800 */ 17, 18, 19, 20, 21, 22, 23, 24, 25, 36,
- /* 810 */ 286, 4, 5, 6, 7, 8, 9, 10, 11, 12,
- /* 820 */ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- /* 830 */ 23, 24, 25, 177, 286, 4, 5, 6, 7, 8,
- /* 840 */ 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- /* 850 */ 19, 20, 21, 22, 23, 24, 25, 184, 286, 4,
- /* 860 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- /* 870 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- /* 880 */ 25, 221, 286, 4, 5, 6, 7, 8, 9, 10,
- /* 890 */ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- /* 900 */ 21, 22, 23, 24, 25, 231, 286, 4, 5, 6,
- /* 910 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- /* 920 */ 17, 18, 19, 20, 21, 22, 23, 24, 25, 239,
- /* 930 */ 286, 4, 5, 6, 7, 8, 9, 10, 11, 12,
- /* 940 */ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- /* 950 */ 23, 24, 25, 246, 286, 4, 5, 6, 7, 8,
- /* 960 */ 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- /* 970 */ 19, 20, 21, 22, 23, 24, 25, 278, 286, 4,
- /* 980 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- /* 990 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- /* 1000 */ 25, 289, 286, 4, 5, 6, 7, 8, 9, 10,
- /* 1010 */ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- /* 1020 */ 21, 22, 23, 24, 25, 295, 286, 4, 5, 6,
- /* 1030 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- /* 1040 */ 17, 18, 19, 20, 21, 22, 23, 24, 25, 312,
- /* 1050 */ 286, 4, 5, 6, 7, 8, 9, 10, 11, 12,
- /* 1060 */ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- /* 1070 */ 23, 24, 25, 334, 286, 4, 5, 6, 7, 8,
- /* 1080 */ 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- /* 1090 */ 19, 20, 21, 22, 23, 24, 25, 343, 286, 4,
- /* 1100 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- /* 1110 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- /* 1120 */ 25, 350, 286, 4, 5, 6, 7, 8, 9, 10,
- /* 1130 */ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- /* 1140 */ 21, 22, 23, 24, 25, 3, 4, 5, 6, 7,
- /* 1150 */ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
- /* 1160 */ 18, 19, 20, 21, 22, 23, 24, 25, 27, 235,
- /* 1170 */ 32, 34, 40, 170, 172, 41, 196, 181, 169, 188,
- /* 1180 */ 191, 193, 45, 168, 48, 220, 50, 120, 216, 224,
- /* 1190 */ 120, 230, 52, 111, 120, 120, 120, 225, 120, 234,
- /* 1200 */ 256, 236, 293, 243, 120, 250, 195, 260, 263, 237,
- /* 1210 */ 269, 272, 275, 238, 282, 284, 85, 69, 65, 67,
- /* 1220 */ 75, 77, 79, 81, 71, 73, 51, 49, 53, 46,
- /* 1230 */ 43, 59, 92, 61, 87, 90, 91, 99, 83, 255,
- /* 1240 */ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
- /* 1250 */ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
- /* 1260 */ 24, 25, 27, 235, 358, 360, 40, 170, 172, 366,
- /* 1270 */ 26, 181, 26, 188, 191, 193, 54, 357, 56, 115,
- /* 1280 */ 58, 60, 216, 242, 62, 249, 64, 131, 120, 316,
- /* 1290 */ 120, 225, 120, 120, 251, 236, 120, 243, 120, 250,
- /* 1300 */ 66, 260, 263, 257, 269, 272, 275, 258, 282, 284,
- /* 1310 */ 119, 277, 120, 281, 27, 235, 38, 306, 40, 170,
- /* 1320 */ 172, 283, 120, 181, 285, 188, 191, 193, 288, 68,
- /* 1330 */ 292, 252, 294, 252, 216, 31, 298, 229, 252, 310,
- /* 1340 */ 354, 120, 37, 225, 178, 437, 328, 236, 259, 243,
- /* 1350 */ 259, 250, 438, 260, 263, 259, 269, 272, 275, 303,
- /* 1360 */ 282, 284, 305, 69, 65, 67, 75, 77, 79, 81,
- /* 1370 */ 71, 73, 51, 49, 53, 46, 43, 59, 92, 61,
- /* 1380 */ 87, 90, 91, 99, 83, 307, 27, 235, 70, 308,
- /* 1390 */ 40, 170, 172, 311, 179, 181, 252, 188, 191, 193,
- /* 1400 */ 120, 252, 315, 252, 244, 252, 216, 252, 319, 185,
- /* 1410 */ 318, 222, 317, 259, 330, 225, 120, 320, 259, 236,
- /* 1420 */ 259, 243, 259, 250, 259, 260, 263, 232, 269, 272,
- /* 1430 */ 275, 301, 282, 284, 337, 339, 340, 346, 27, 235,
- /* 1440 */ 209, 353, 40, 170, 172, 356, 212, 181, 186, 188,
- /* 1450 */ 191, 193, 359, 240, 253, 361, 332, 362, 216, 290,
- /* 1460 */ 363, 199, 201, 203, 205, 207, 120, 225, 120, 364,
- /* 1470 */ 252, 236, 252, 243, 247, 250, 290, 260, 263, 279,
- /* 1480 */ 269, 272, 275, 290, 282, 284, 290, 259, 252, 259,
- /* 1490 */ 27, 235, 252, 290, 40, 170, 172, 290, 296, 181,
- /* 1500 */ 290, 188, 191, 193, 72, 259, 290, 290, 74, 259,
- /* 1510 */ 216, 290, 223, 290, 252, 290, 120, 290, 290, 225,
- /* 1520 */ 120, 290, 290, 236, 290, 243, 290, 250, 290, 260,
- /* 1530 */ 263, 259, 269, 272, 275, 252, 282, 284, 76, 290,
- /* 1540 */ 252, 290, 27, 235, 252, 290, 40, 170, 172, 290,
- /* 1550 */ 120, 181, 259, 188, 191, 193, 78, 259, 290, 252,
- /* 1560 */ 290, 259, 216, 290, 290, 290, 290, 290, 120, 290,
- /* 1570 */ 290, 225, 233, 290, 290, 236, 259, 243, 313, 250,
- /* 1580 */ 80, 260, 263, 335, 269, 272, 275, 344, 282, 284,
- /* 1590 */ 290, 290, 120, 290, 27, 235, 82, 84, 40, 170,
- /* 1600 */ 172, 86, 351, 181, 89, 188, 191, 193, 120, 120,
- /* 1610 */ 290, 290, 96, 120, 216, 290, 120, 290, 98, 290,
- /* 1620 */ 102, 290, 290, 225, 120, 290, 290, 236, 241, 243,
- /* 1630 */ 120, 250, 120, 260, 263, 290, 269, 272, 275, 252,
- /* 1640 */ 282, 284, 104, 290, 252, 290, 27, 235, 252, 290,
- /* 1650 */ 40, 170, 172, 290, 120, 181, 259, 188, 191, 193,
- /* 1660 */ 135, 259, 290, 252, 167, 259, 216, 290, 290, 290,
- /* 1670 */ 290, 290, 120, 290, 290, 225, 120, 290, 290, 236,
- /* 1680 */ 259, 243, 248, 250, 290, 260, 263, 290, 269, 272,
- /* 1690 */ 275, 290, 282, 284, 175, 290, 182, 290, 27, 235,
- /* 1700 */ 189, 200, 40, 170, 172, 202, 120, 181, 120, 188,
- /* 1710 */ 191, 193, 120, 120, 204, 290, 206, 120, 216, 290,
- /* 1720 */ 208, 290, 210, 290, 226, 290, 120, 225, 120, 290,
- /* 1730 */ 290, 236, 120, 243, 120, 250, 120, 260, 263, 290,
- /* 1740 */ 269, 272, 275, 280, 282, 284, 261, 290, 264, 290,
- /* 1750 */ 27, 235, 290, 267, 40, 170, 172, 270, 120, 181,
- /* 1760 */ 120, 188, 191, 193, 273, 120, 290, 290, 341, 120,
- /* 1770 */ 216, 290, 348, 290, 290, 290, 120, 290, 290, 225,
- /* 1780 */ 120, 290, 290, 236, 120, 243, 290, 250, 290, 260,
- /* 1790 */ 263, 290, 269, 272, 275, 291, 282, 284, 290, 290,
- /* 1800 */ 290, 290, 27, 235, 290, 290, 40, 170, 172, 290,
- /* 1810 */ 290, 181, 290, 188, 191, 193, 290, 290, 290, 290,
- /* 1820 */ 290, 290, 216, 290, 290, 290, 290, 290, 290, 290,
- /* 1830 */ 290, 225, 290, 290, 290, 236, 290, 243, 297, 250,
- /* 1840 */ 290, 260, 263, 290, 269, 272, 275, 290, 282, 284,
- /* 1850 */ 290, 290, 290, 290, 27, 235, 290, 290, 40, 170,
- /* 1860 */ 172, 290, 290, 181, 290, 188, 191, 193, 290, 290,
- /* 1870 */ 290, 290, 290, 290, 216, 290, 290, 290, 290, 290,
- /* 1880 */ 290, 290, 290, 225, 290, 290, 290, 236, 302, 243,
- /* 1890 */ 290, 250, 290, 260, 263, 290, 269, 272, 275, 290,
- /* 1900 */ 282, 284, 290, 290, 290, 290, 27, 235, 290, 290,
- /* 1910 */ 40, 170, 172, 290, 290, 181, 290, 188, 191, 193,
- /* 1920 */ 290, 290, 290, 290, 290, 290, 216, 290, 314, 290,
- /* 1930 */ 290, 290, 290, 290, 290, 225, 290, 290, 290, 236,
- /* 1940 */ 290, 243, 290, 250, 290, 260, 263, 290, 269, 272,
- /* 1950 */ 275, 290, 282, 284, 290, 290, 290, 290, 27, 235,
- /* 1960 */ 290, 290, 40, 170, 172, 290, 290, 181, 329, 188,
- /* 1970 */ 191, 193, 290, 290, 290, 290, 290, 290, 216, 290,
- /* 1980 */ 290, 290, 290, 290, 290, 290, 290, 225, 290, 290,
- /* 1990 */ 290, 236, 290, 243, 290, 250, 290, 260, 263, 290,
- /* 2000 */ 269, 272, 275, 290, 282, 284, 290, 290, 290, 290,
- /* 2010 */ 27, 235, 290, 290, 40, 170, 172, 290, 336, 181,
- /* 2020 */ 290, 188, 191, 193, 290, 290, 290, 290, 290, 290,
- /* 2030 */ 216, 290, 290, 290, 290, 290, 290, 290, 290, 225,
- /* 2040 */ 290, 290, 290, 236, 290, 243, 290, 250, 290, 260,
- /* 2050 */ 263, 290, 269, 272, 275, 290, 282, 284, 290, 290,
- /* 2060 */ 290, 290, 27, 235, 290, 290, 40, 170, 172, 290,
- /* 2070 */ 345, 181, 290, 188, 191, 193, 290, 290, 290, 290,
- /* 2080 */ 290, 290, 216, 290, 290, 290, 290, 290, 290, 290,
- /* 2090 */ 290, 225, 290, 290, 290, 236, 290, 243, 290, 250,
- /* 2100 */ 290, 260, 263, 290, 269, 272, 275, 290, 282, 284,
- /* 2110 */ 290, 290, 290, 290, 27, 235, 290, 290, 40, 170,
- /* 2120 */ 172, 290, 352, 181, 290, 188, 191, 193, 290, 290,
- /* 2130 */ 290, 290, 290, 290, 216, 290, 290, 290, 290, 290,
- /* 2140 */ 290, 290, 290, 225, 290, 290, 290, 236, 290, 243,
- /* 2150 */ 290, 250, 290, 260, 263, 290, 269, 272, 275, 290,
- /* 2160 */ 282, 284, 290, 290, 290, 290, 27, 235, 355, 290,
- /* 2170 */ 40, 170, 172, 290, 290, 181, 290, 188, 191, 193,
- /* 2180 */ 290, 290, 290, 290, 290, 290, 216, 290, 290, 290,
- /* 2190 */ 290, 290, 290, 290, 290, 225, 290, 290, 290, 236,
- /* 2200 */ 290, 243, 290, 250, 290, 260, 263, 290, 269, 272,
- /* 2210 */ 275, 290, 282, 284, 290, 290, 290, 290, 27, 235,
- /* 2220 */ 290, 290, 40, 170, 172, 290, 290, 181, 290, 188,
- /* 2230 */ 191, 193, 290, 290, 290, 290, 290, 290, 216, 290,
- /* 2240 */ 290, 290, 290, 290, 290, 290, 290, 225, 290, 290,
- /* 2250 */ 290, 236, 290, 243, 290, 250, 290, 260, 263, 290,
- /* 2260 */ 269, 272, 275, 290, 282, 284, 290, 290, 290, 47,
- /* 2270 */ 44, 290, 106, 290, 101, 290, 290, 103, 290, 47,
- /* 2280 */ 44, 290, 106, 290, 101, 290, 121, 103, 290, 290,
- /* 2290 */ 290, 290, 290, 290, 290, 290, 121, 290, 290, 290,
- /* 2300 */ 290, 290, 122, 123, 124, 125, 126, 127, 290, 290,
- /* 2310 */ 290, 290, 122, 123, 124, 125, 126, 127, 290, 290,
- /* 2320 */ 290, 290, 290, 290, 290, 290, 290, 290, 157, 158,
- /* 2330 */ 159, 160, 161, 162, 163, 112, 290, 290, 150, 151,
- /* 2340 */ 152, 153, 154, 155, 156, 112, 290, 290, 166, 290,
- /* 2350 */ 47, 44, 290, 106, 290, 101, 138, 164, 103, 290,
- /* 2360 */ 47, 44, 290, 106, 290, 101, 290, 121, 103, 290,
- /* 2370 */ 290, 290, 290, 47, 44, 290, 106, 121, 101, 290,
- /* 2380 */ 290, 103, 290, 122, 123, 124, 125, 126, 127, 290,
- /* 2390 */ 149, 290, 290, 122, 123, 124, 125, 126, 127, 290,
- /* 2400 */ 290, 290, 290, 290, 290, 290, 148, 123, 124, 125,
- /* 2410 */ 126, 127, 47, 44, 290, 106, 112, 101, 290, 290,
- /* 2420 */ 103, 290, 290, 290, 290, 290, 112, 290, 290, 121,
- /* 2430 */ 290, 290, 290, 290, 290, 290, 290, 290, 290, 112,
- /* 2440 */ 290, 290, 290, 136, 290, 122, 133, 124, 125, 126,
- /* 2450 */ 127, 47, 44, 290, 106, 290, 101, 290, 290, 103,
- /* 2460 */ 290, 290, 290, 290, 290, 290, 290, 290, 121, 290,
- /* 2470 */ 290, 290, 290, 290, 47, 44, 290, 106, 112, 101,
- /* 2480 */ 108, 290, 103, 290, 122, 117, 124, 125, 126, 127,
- /* 2490 */ 290, 121, 290, 290, 290, 290, 47, 44, 290, 106,
- /* 2500 */ 290, 101, 290, 290, 103, 290, 290, 122, 117, 124,
- /* 2510 */ 125, 126, 127, 121, 290, 290, 290, 112, 47, 44,
- /* 2520 */ 290, 106, 290, 101, 290, 290, 103, 304, 290, 122,
- /* 2530 */ 133, 124, 125, 126, 127, 121, 290, 290, 290, 290,
- /* 2540 */ 112, 113, 290, 290, 290, 290, 290, 290, 290, 290,
- /* 2550 */ 290, 122, 123, 124, 125, 126, 127, 290, 290, 290,
- /* 2560 */ 290, 290, 112, 47, 44, 290, 106, 290, 101, 290,
- /* 2570 */ 290, 103, 290, 47, 44, 290, 106, 290, 101, 290,
- /* 2580 */ 121, 103, 290, 290, 112, 290, 290, 290, 290, 290,
- /* 2590 */ 121, 290, 290, 290, 290, 290, 122, 117, 124, 125,
- /* 2600 */ 126, 127, 290, 290, 290, 290, 122, 133, 124, 125,
- /* 2610 */ 126, 127, 290, 290, 290, 290, 290, 290, 290, 290,
- /* 2620 */ 290, 290, 290, 290, 290, 290, 290, 290, 290, 112,
- /* 2630 */ 290, 290, 290, 290, 290, 290, 290, 290, 290, 112,
-};
-static VVCODETYPE vv_lookahead[] = {
- /* 0 */ 3, 2, 5, 6, 7, 8, 9, 10, 11, 12,
- /* 10 */ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- /* 20 */ 23, 24, 25, 26, 27, 28, 29, 30, 0, 32,
- /* 30 */ 26, 27, 28, 29, 30, 38, 18, 19, 20, 21,
- /* 40 */ 22, 23, 24, 25, 26, 27, 28, 29, 30, 50,
- /* 50 */ 2, 54, 117, 118, 119, 3, 8, 5, 6, 7,
- /* 60 */ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
- /* 70 */ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
- /* 80 */ 28, 29, 30, 31, 32, 3, 32, 5, 6, 7,
- /* 90 */ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
- /* 100 */ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
- /* 110 */ 28, 29, 30, 3, 32, 5, 6, 7, 8, 9,
- /* 120 */ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
- /* 130 */ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- /* 140 */ 30, 31, 32, 21, 22, 23, 24, 25, 26, 27,
- /* 150 */ 28, 29, 30, 32, 72, 118, 119, 32, 3, 8,
- /* 160 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- /* 170 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- /* 180 */ 25, 26, 27, 28, 29, 30, 3, 32, 5, 6,
- /* 190 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- /* 200 */ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- /* 210 */ 27, 28, 29, 30, 3, 32, 5, 6, 7, 8,
- /* 220 */ 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- /* 230 */ 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- /* 240 */ 29, 30, 24, 25, 26, 27, 28, 29, 30, 54,
- /* 250 */ 55, 56, 57, 58, 59, 120, 121, 58, 59, 4,
- /* 260 */ 4, 50, 126, 50, 50, 3, 4, 5, 6, 7,
- /* 270 */ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
- /* 280 */ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
- /* 290 */ 28, 29, 30, 3, 50, 5, 6, 7, 8, 9,
- /* 300 */ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
- /* 310 */ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- /* 320 */ 30, 116, 126, 38, 38, 4, 116, 50, 123, 4,
- /* 330 */ 4, 38, 116, 128, 129, 125, 50, 127, 128, 54,
- /* 340 */ 54, 125, 52, 127, 128, 52, 3, 32, 5, 6,
- /* 350 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- /* 360 */ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- /* 370 */ 27, 28, 29, 30, 3, 32, 5, 6, 7, 8,
- /* 380 */ 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- /* 390 */ 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- /* 400 */ 29, 30, 3, 32, 5, 6, 7, 8, 9, 10,
- /* 410 */ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- /* 420 */ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- /* 430 */ 116, 38, 2, 116, 116, 32, 116, 123, 116, 32,
- /* 440 */ 116, 32, 128, 129, 126, 128, 128, 127, 128, 50,
- /* 450 */ 128, 129, 128, 3, 38, 5, 6, 7, 8, 9,
- /* 460 */ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
- /* 470 */ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- /* 480 */ 30, 3, 52, 5, 6, 7, 8, 9, 10, 11,
- /* 490 */ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- /* 500 */ 22, 23, 24, 25, 26, 27, 28, 29, 30, 119,
- /* 510 */ 32, 38, 3, 63, 5, 6, 7, 8, 9, 10,
- /* 520 */ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- /* 530 */ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- /* 540 */ 3, 32, 5, 6, 7, 8, 9, 10, 11, 12,
- /* 550 */ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- /* 560 */ 23, 24, 25, 26, 27, 28, 29, 30, 3, 32,
- /* 570 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- /* 580 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- /* 590 */ 25, 26, 27, 28, 29, 30, 3, 32, 5, 6,
- /* 600 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- /* 610 */ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- /* 620 */ 27, 28, 29, 30, 3, 32, 5, 6, 7, 8,
- /* 630 */ 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- /* 640 */ 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- /* 650 */ 29, 30, 3, 32, 5, 6, 7, 8, 9, 10,
- /* 660 */ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- /* 670 */ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- /* 680 */ 3, 29, 5, 6, 7, 8, 9, 10, 11, 12,
- /* 690 */ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- /* 700 */ 23, 24, 25, 26, 27, 28, 29, 30, 90, 91,
- /* 710 */ 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
- /* 720 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
- /* 730 */ 112, 113, 114, 115, 5, 6, 7, 8, 9, 10,
- /* 740 */ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- /* 750 */ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- /* 760 */ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- /* 770 */ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- /* 780 */ 26, 27, 28, 29, 30, 92, 93, 94, 95, 96,
- /* 790 */ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
- /* 800 */ 107, 108, 109, 110, 111, 112, 113, 114, 115, 92,
- /* 810 */ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
- /* 820 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
- /* 830 */ 113, 114, 115, 92, 93, 94, 95, 96, 97, 98,
- /* 840 */ 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
- /* 850 */ 109, 110, 111, 112, 113, 114, 115, 92, 93, 94,
- /* 860 */ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- /* 870 */ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
- /* 880 */ 115, 92, 93, 94, 95, 96, 97, 98, 99, 100,
- /* 890 */ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
- /* 900 */ 111, 112, 113, 114, 115, 92, 93, 94, 95, 96,
- /* 910 */ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
- /* 920 */ 107, 108, 109, 110, 111, 112, 113, 114, 115, 92,
- /* 930 */ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
- /* 940 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
- /* 950 */ 113, 114, 115, 92, 93, 94, 95, 96, 97, 98,
- /* 960 */ 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
- /* 970 */ 109, 110, 111, 112, 113, 114, 115, 92, 93, 94,
- /* 980 */ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- /* 990 */ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
- /* 1000 */ 115, 92, 93, 94, 95, 96, 97, 98, 99, 100,
- /* 1010 */ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
- /* 1020 */ 111, 112, 113, 114, 115, 92, 93, 94, 95, 96,
- /* 1030 */ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
- /* 1040 */ 107, 108, 109, 110, 111, 112, 113, 114, 115, 92,
- /* 1050 */ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
- /* 1060 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
- /* 1070 */ 113, 114, 115, 92, 93, 94, 95, 96, 97, 98,
- /* 1080 */ 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
- /* 1090 */ 109, 110, 111, 112, 113, 114, 115, 92, 93, 94,
- /* 1100 */ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- /* 1110 */ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
- /* 1120 */ 115, 92, 93, 94, 95, 96, 97, 98, 99, 100,
- /* 1130 */ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
- /* 1140 */ 111, 112, 113, 114, 115, 93, 94, 95, 96, 97,
- /* 1150 */ 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
- /* 1160 */ 108, 109, 110, 111, 112, 113, 114, 115, 31, 32,
- /* 1170 */ 33, 34, 35, 36, 37, 116, 2, 40, 116, 42,
- /* 1180 */ 43, 44, 116, 116, 116, 32, 116, 128, 51, 32,
- /* 1190 */ 128, 32, 116, 2, 128, 128, 128, 60, 128, 32,
- /* 1200 */ 1, 64, 124, 66, 128, 68, 32, 70, 71, 38,
- /* 1210 */ 73, 74, 75, 32, 77, 78, 8, 9, 10, 11,
- /* 1220 */ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- /* 1230 */ 22, 23, 24, 25, 26, 27, 28, 29, 30, 93,
- /* 1240 */ 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,
- /* 1250 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
- /* 1260 */ 114, 115, 31, 32, 33, 34, 35, 36, 37, 0,
- /* 1270 */ 1, 40, 1, 42, 43, 44, 116, 1, 116, 88,
- /* 1280 */ 116, 116, 51, 32, 116, 32, 116, 2, 128, 2,
- /* 1290 */ 128, 60, 128, 128, 32, 64, 128, 66, 128, 68,
- /* 1300 */ 116, 70, 71, 69, 73, 74, 75, 32, 77, 78,
- /* 1310 */ 116, 32, 128, 32, 31, 32, 33, 1, 35, 36,
- /* 1320 */ 37, 32, 128, 40, 32, 42, 43, 44, 32, 116,
- /* 1330 */ 32, 62, 32, 62, 51, 1, 32, 52, 62, 52,
- /* 1340 */ 1, 128, 1, 60, 1, 32, 1, 64, 79, 66,
- /* 1350 */ 79, 68, 32, 70, 71, 79, 73, 74, 75, 32,
- /* 1360 */ 77, 78, 32, 9, 10, 11, 12, 13, 14, 15,
- /* 1370 */ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- /* 1380 */ 26, 27, 28, 29, 30, 61, 31, 32, 116, 32,
- /* 1390 */ 35, 36, 37, 32, 39, 40, 62, 42, 43, 44,
- /* 1400 */ 128, 62, 32, 62, 116, 62, 51, 62, 45, 1,
- /* 1410 */ 38, 1, 121, 79, 32, 60, 128, 122, 79, 64,
- /* 1420 */ 79, 66, 79, 68, 79, 70, 71, 1, 73, 74,
- /* 1430 */ 75, 1, 77, 78, 32, 38, 8, 32, 31, 32,
- /* 1440 */ 24, 32, 35, 36, 37, 32, 30, 40, 41, 42,
- /* 1450 */ 43, 44, 32, 1, 116, 32, 116, 1, 51, 130,
- /* 1460 */ 33, 45, 46, 47, 48, 49, 128, 60, 128, 32,
- /* 1470 */ 62, 64, 62, 66, 1, 68, 130, 70, 71, 1,
- /* 1480 */ 73, 74, 75, 1, 77, 78, 130, 79, 62, 79,
- /* 1490 */ 31, 32, 62, 130, 35, 36, 37, 130, 1, 40,
- /* 1500 */ 130, 42, 43, 44, 116, 79, 130, 130, 116, 79,
- /* 1510 */ 51, 130, 53, 130, 62, 130, 128, 130, 130, 60,
- /* 1520 */ 128, 130, 130, 64, 130, 66, 130, 68, 130, 70,
- /* 1530 */ 71, 79, 73, 74, 75, 62, 77, 78, 116, 130,
- /* 1540 */ 62, 130, 31, 32, 62, 130, 35, 36, 37, 130,
- /* 1550 */ 128, 40, 79, 42, 43, 44, 116, 79, 130, 62,
- /* 1560 */ 130, 79, 51, 130, 130, 130, 130, 130, 128, 130,
- /* 1570 */ 130, 60, 61, 130, 130, 64, 79, 66, 1, 68,
- /* 1580 */ 116, 70, 71, 1, 73, 74, 75, 1, 77, 78,
- /* 1590 */ 130, 130, 128, 130, 31, 32, 116, 116, 35, 36,
- /* 1600 */ 37, 116, 1, 40, 116, 42, 43, 44, 128, 128,
- /* 1610 */ 130, 130, 116, 128, 51, 130, 128, 130, 116, 130,
- /* 1620 */ 116, 130, 130, 60, 128, 130, 130, 64, 65, 66,
- /* 1630 */ 128, 68, 128, 70, 71, 130, 73, 74, 75, 62,
- /* 1640 */ 77, 78, 116, 130, 62, 130, 31, 32, 62, 130,
- /* 1650 */ 35, 36, 37, 130, 128, 40, 79, 42, 43, 44,
- /* 1660 */ 116, 79, 130, 62, 116, 79, 51, 130, 130, 130,
- /* 1670 */ 130, 130, 128, 130, 130, 60, 128, 130, 130, 64,
- /* 1680 */ 79, 66, 67, 68, 130, 70, 71, 130, 73, 74,
- /* 1690 */ 75, 130, 77, 78, 116, 130, 116, 130, 31, 32,
- /* 1700 */ 116, 116, 35, 36, 37, 116, 128, 40, 128, 42,
- /* 1710 */ 43, 44, 128, 128, 116, 130, 116, 128, 51, 130,
- /* 1720 */ 116, 130, 116, 130, 116, 130, 128, 60, 128, 130,
- /* 1730 */ 130, 64, 128, 66, 128, 68, 128, 70, 71, 130,
- /* 1740 */ 73, 74, 75, 76, 77, 78, 116, 130, 116, 130,
- /* 1750 */ 31, 32, 130, 116, 35, 36, 37, 116, 128, 40,
- /* 1760 */ 128, 42, 43, 44, 116, 128, 130, 130, 116, 128,
- /* 1770 */ 51, 130, 116, 130, 130, 130, 128, 130, 130, 60,
- /* 1780 */ 128, 130, 130, 64, 128, 66, 130, 68, 130, 70,
- /* 1790 */ 71, 130, 73, 74, 75, 76, 77, 78, 130, 130,
- /* 1800 */ 130, 130, 31, 32, 130, 130, 35, 36, 37, 130,
- /* 1810 */ 130, 40, 130, 42, 43, 44, 130, 130, 130, 130,
- /* 1820 */ 130, 130, 51, 130, 130, 130, 130, 130, 130, 130,
- /* 1830 */ 130, 60, 130, 130, 130, 64, 130, 66, 67, 68,
- /* 1840 */ 130, 70, 71, 130, 73, 74, 75, 130, 77, 78,
- /* 1850 */ 130, 130, 130, 130, 31, 32, 130, 130, 35, 36,
- /* 1860 */ 37, 130, 130, 40, 130, 42, 43, 44, 130, 130,
- /* 1870 */ 130, 130, 130, 130, 51, 130, 130, 130, 130, 130,
- /* 1880 */ 130, 130, 130, 60, 130, 130, 130, 64, 65, 66,
- /* 1890 */ 130, 68, 130, 70, 71, 130, 73, 74, 75, 130,
- /* 1900 */ 77, 78, 130, 130, 130, 130, 31, 32, 130, 130,
- /* 1910 */ 35, 36, 37, 130, 130, 40, 130, 42, 43, 44,
- /* 1920 */ 130, 130, 130, 130, 130, 130, 51, 130, 53, 130,
- /* 1930 */ 130, 130, 130, 130, 130, 60, 130, 130, 130, 64,
- /* 1940 */ 130, 66, 130, 68, 130, 70, 71, 130, 73, 74,
- /* 1950 */ 75, 130, 77, 78, 130, 130, 130, 130, 31, 32,
- /* 1960 */ 130, 130, 35, 36, 37, 130, 130, 40, 41, 42,
- /* 1970 */ 43, 44, 130, 130, 130, 130, 130, 130, 51, 130,
- /* 1980 */ 130, 130, 130, 130, 130, 130, 130, 60, 130, 130,
- /* 1990 */ 130, 64, 130, 66, 130, 68, 130, 70, 71, 130,
- /* 2000 */ 73, 74, 75, 130, 77, 78, 130, 130, 130, 130,
- /* 2010 */ 31, 32, 130, 130, 35, 36, 37, 130, 39, 40,
- /* 2020 */ 130, 42, 43, 44, 130, 130, 130, 130, 130, 130,
- /* 2030 */ 51, 130, 130, 130, 130, 130, 130, 130, 130, 60,
- /* 2040 */ 130, 130, 130, 64, 130, 66, 130, 68, 130, 70,
- /* 2050 */ 71, 130, 73, 74, 75, 130, 77, 78, 130, 130,
- /* 2060 */ 130, 130, 31, 32, 130, 130, 35, 36, 37, 130,
- /* 2070 */ 39, 40, 130, 42, 43, 44, 130, 130, 130, 130,
- /* 2080 */ 130, 130, 51, 130, 130, 130, 130, 130, 130, 130,
- /* 2090 */ 130, 60, 130, 130, 130, 64, 130, 66, 130, 68,
- /* 2100 */ 130, 70, 71, 130, 73, 74, 75, 130, 77, 78,
- /* 2110 */ 130, 130, 130, 130, 31, 32, 130, 130, 35, 36,
- /* 2120 */ 37, 130, 39, 40, 130, 42, 43, 44, 130, 130,
- /* 2130 */ 130, 130, 130, 130, 51, 130, 130, 130, 130, 130,
- /* 2140 */ 130, 130, 130, 60, 130, 130, 130, 64, 130, 66,
- /* 2150 */ 130, 68, 130, 70, 71, 130, 73, 74, 75, 130,
- /* 2160 */ 77, 78, 130, 130, 130, 130, 31, 32, 33, 130,
- /* 2170 */ 35, 36, 37, 130, 130, 40, 130, 42, 43, 44,
- /* 2180 */ 130, 130, 130, 130, 130, 130, 51, 130, 130, 130,
- /* 2190 */ 130, 130, 130, 130, 130, 60, 130, 130, 130, 64,
- /* 2200 */ 130, 66, 130, 68, 130, 70, 71, 130, 73, 74,
- /* 2210 */ 75, 130, 77, 78, 130, 130, 130, 130, 31, 32,
- /* 2220 */ 130, 130, 35, 36, 37, 130, 130, 40, 130, 42,
- /* 2230 */ 43, 44, 130, 130, 130, 130, 130, 130, 51, 130,
- /* 2240 */ 130, 130, 130, 130, 130, 130, 130, 60, 130, 130,
- /* 2250 */ 130, 64, 130, 66, 130, 68, 130, 70, 71, 130,
- /* 2260 */ 73, 74, 75, 130, 77, 78, 130, 130, 130, 21,
- /* 2270 */ 22, 130, 24, 130, 26, 130, 130, 29, 130, 21,
- /* 2280 */ 22, 130, 24, 130, 26, 130, 38, 29, 130, 130,
- /* 2290 */ 130, 130, 130, 130, 130, 130, 38, 130, 130, 130,
- /* 2300 */ 130, 130, 54, 55, 56, 57, 58, 59, 130, 130,
- /* 2310 */ 130, 130, 54, 55, 56, 57, 58, 59, 130, 130,
- /* 2320 */ 130, 130, 130, 130, 130, 130, 130, 130, 80, 81,
- /* 2330 */ 82, 83, 84, 85, 86, 87, 130, 130, 80, 81,
- /* 2340 */ 82, 83, 84, 85, 86, 87, 130, 130, 19, 130,
- /* 2350 */ 21, 22, 130, 24, 130, 26, 4, 18, 29, 130,
- /* 2360 */ 21, 22, 130, 24, 130, 26, 130, 38, 29, 130,
- /* 2370 */ 130, 130, 130, 21, 22, 130, 24, 38, 26, 130,
- /* 2380 */ 130, 29, 130, 54, 55, 56, 57, 58, 59, 130,
- /* 2390 */ 38, 130, 130, 54, 55, 56, 57, 58, 59, 130,
- /* 2400 */ 130, 130, 130, 130, 130, 130, 54, 55, 56, 57,
- /* 2410 */ 58, 59, 21, 22, 130, 24, 87, 26, 130, 130,
- /* 2420 */ 29, 130, 130, 130, 130, 130, 87, 130, 130, 38,
- /* 2430 */ 130, 130, 130, 130, 130, 130, 130, 130, 130, 87,
- /* 2440 */ 130, 130, 130, 52, 130, 54, 55, 56, 57, 58,
- /* 2450 */ 59, 21, 22, 130, 24, 130, 26, 130, 130, 29,
- /* 2460 */ 130, 130, 130, 130, 130, 130, 130, 130, 38, 130,
- /* 2470 */ 130, 130, 130, 130, 21, 22, 130, 24, 87, 26,
- /* 2480 */ 50, 130, 29, 130, 54, 55, 56, 57, 58, 59,
- /* 2490 */ 130, 38, 130, 130, 130, 130, 21, 22, 130, 24,
- /* 2500 */ 130, 26, 130, 130, 29, 130, 130, 54, 55, 56,
- /* 2510 */ 57, 58, 59, 38, 130, 130, 130, 87, 21, 22,
- /* 2520 */ 130, 24, 130, 26, 130, 130, 29, 52, 130, 54,
- /* 2530 */ 55, 56, 57, 58, 59, 38, 130, 130, 130, 130,
- /* 2540 */ 87, 88, 130, 130, 130, 130, 130, 130, 130, 130,
- /* 2550 */ 130, 54, 55, 56, 57, 58, 59, 130, 130, 130,
- /* 2560 */ 130, 130, 87, 21, 22, 130, 24, 130, 26, 130,
- /* 2570 */ 130, 29, 130, 21, 22, 130, 24, 130, 26, 130,
- /* 2580 */ 38, 29, 130, 130, 87, 130, 130, 130, 130, 130,
- /* 2590 */ 38, 130, 130, 130, 130, 130, 54, 55, 56, 57,
- /* 2600 */ 58, 59, 130, 130, 130, 130, 54, 55, 56, 57,
- /* 2610 */ 58, 59, 130, 130, 130, 130, 130, 130, 130, 130,
- /* 2620 */ 130, 130, 130, 130, 130, 130, 130, 130, 130, 87,
- /* 2630 */ 130, 130, 130, 130, 130, 130, 130, 130, 130, 87,
-};
-#define VV_SHIFT_USE_DFLT (-4)
-static short vv_shift_ofst[] = {
- /* 0 */ 1271, 28, 1269, -4, -4, -4, -4, -4, -4, -4,
- /* 10 */ -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
- /* 20 */ -4, -4, -4, -4, -4, -4, 2187, 2497, 155, 1276,
- /* 30 */ 1334, 1137, 54, -4, 121, 1339, 1341, 1283, 125, -4,
- /* 40 */ 2497, 183, -4, 2497, 2497, 218, 2497, 2497, 218, 2329,
- /* 50 */ 122, 2339, 122, 2497, 122, 2497, 1208, 2497, 1208, 2497,
- /* 60 */ 218, 2497, 4, 2497, 754, 2497, 18, 2248, 18, 2258,
- /* 70 */ 18, 2497, 18, 2497, 18, 2497, 18, 2497, 18, 2497,
- /* 80 */ 18, 2497, 18, 2497, -4, 2497, 1354, 151, 2497, 4,
- /* 90 */ -4, -4, 2352, 211, -4, 2497, 262, 2497, 729, 2391,
- /* 100 */ 649, 2497, 4, 2497, 290, -4, 2430, 649, -4, -1,
- /* 110 */ -4, 2542, 2453, -4, 1191, -4, -4, 255, 2497, 649,
- /* 120 */ -4, -4, -4, -4, -4, -4, -4, -4, -4, 430,
- /* 130 */ -4, 2552, -4, 256, 2497, 649, -4, -4, 285, 213,
- /* 140 */ -4, 214, 244, 321, 286, -4, 277, -4, 325, 326,
- /* 150 */ -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
- /* 160 */ -4, -4, -4, -4, 2497, 122, 2497, 122, 218, 218,
- /* 170 */ 315, -4, 393, 48, 2497, 52, 1271, 1343, 1355, 403,
- /* 180 */ -4, 2497, 343, 1345, 1408, 1407, 407, -4, 2497, 371,
- /* 190 */ -4, 409, -4, 416, 1174, -4, 416, -4, 1416, 2497,
- /* 200 */ 649, 2497, 649, 2497, 649, 2497, 649, 2497, 649, 2497,
- /* 210 */ 399, -4, 416, -4, -4, -4, 473, 652, 293, 1153,
- /* 220 */ 1271, 1410, 1459, 1157, -4, 2497, 677, 2475, 1285, 1159,
- /* 230 */ 1271, 1426, 1511, 1167, -4, -4, 1171, 1181, 1430, 1452,
- /* 240 */ 1563, 1251, -4, 2497, -3, 1271, 1473, 1615, 1253, -4,
- /* 250 */ 1262, 1271, 2497, 450, -4, 1199, 1234, 1275, -4, -4,
- /* 260 */ 2497, 478, -4, 2497, 82, -4, 2497, 509, -4, 2497,
- /* 270 */ 537, -4, 2497, 565, -4, 199, 1279, 1271, 1478, 1667,
- /* 280 */ 1281, -4, 1289, -4, 1292, -4, -4, 1296, 1271, 1482,
- /* 290 */ 1719, 1298, -4, 1300, 1271, 1497, 1771, 1304, -4, 1313,
- /* 300 */ 1320, 1823, 1327, -4, 1330, 1316, 1324, 1357, -4, 1287,
- /* 310 */ 1361, 1271, 1577, 1875, 1370, -4, 1372, -4, 1363, 195,
- /* 320 */ -4, -4, -4, -4, -4, -4, -4, -4, 1927, 1382,
- /* 330 */ -4, 2497, 593, 1271, 1582, 1979, 1402, -4, 1397, 1428,
- /* 340 */ 2497, 110, 1271, 1586, 2031, 1405, -4, 2497, 621, 1271,
- /* 350 */ 1601, 2083, 1409, -4, 2135, 1413, -4, 1231, 1420, -4,
- /* 360 */ 1423, 1456, 1427, 1437, -4,
-};
-#define VV_REDUCE_USE_DFLT (-66)
-static short vv_reduce_ofst[] = {
- /* 0 */ 618, -66, 1052, -66, -66, -66, -66, -66, -66, -66,
- /* 10 */ -66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- /* 20 */ -66, -66, -66, -66, -66, -66, -66, 317, -66, 693,
- /* 30 */ 1052, -66, -66, -66, -66, 717, 1052, -66, -66, -66,
- /* 40 */ 1059, -66, -66, 1062, 1066, -66, 1067, 1068, -66, 1070,
- /* 50 */ -66, 1076, -66, 1160, -66, 1162, -66, 1164, -66, 1165,
- /* 60 */ -66, 1168, -66, 1170, -66, 1184, -66, 1213, -66, 1272,
- /* 70 */ -66, 1388, -66, 1392, -66, 1422, -66, 1440, -66, 1464,
- /* 80 */ -66, 1480, -66, 1481, -66, 1485, -66, -66, 1488, -66,
- /* 90 */ -66, -66, 318, -66, -66, 1496, -66, 1502, -66, 205,
- /* 100 */ -66, 1504, -66, 1526, -66, -66, 210, -66, -66, -66,
- /* 110 */ -66, 320, 216, -66, -66, -66, -66, -66, 1194, -66,
- /* 120 */ -66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- /* 130 */ -66, 322, -66, -66, 1544, -66, -66, -66, 136, -66,
- /* 140 */ -66, -66, -66, -66, 196, -66, -66, -66, -66, -66,
- /* 150 */ -66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- /* 160 */ -66, -66, -66, -66, 324, -66, 1548, -66, -66, -66,
- /* 170 */ -66, -66, -66, -66, 1578, -66, 741, 1052, -66, -66,
- /* 180 */ -66, 1580, -66, 765, 1052, -66, -66, -66, 1584, -66,
- /* 190 */ -66, -66, -66, -65, -66, -66, 37, -66, -66, 1585,
- /* 200 */ -66, 1589, -66, 1598, -66, 1600, -66, 1604, -66, 1606,
- /* 210 */ -66, -66, 390, -66, -66, -66, -66, -66, 135, -66,
- /* 220 */ 789, 1052, -66, -66, -66, 1608, -66, 314, -66, -66,
- /* 230 */ 813, 1052, -66, -66, -66, -66, -66, -66, 837, 1052,
- /* 240 */ -66, -66, -66, 1288, 1078, 861, 1052, -66, -66, -66,
- /* 250 */ -66, 1146, 1338, -66, -66, -66, -66, -66, -66, -66,
- /* 260 */ 1630, -66, -66, 1632, -66, -66, 1637, -66, -66, 1641,
- /* 270 */ -66, -66, 1648, -66, -66, -66, -66, 885, 1052, -66,
- /* 280 */ -66, -66, -66, -66, -66, -66, -66, -66, 909, 1052,
- /* 290 */ -66, -66, -66, -66, 933, 1052, -66, -66, -66, -66,
- /* 300 */ -66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- /* 310 */ -66, 957, 1052, -66, -66, -66, 1291, -66, -66, 1295,
- /* 320 */ -66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- /* 330 */ -66, 1340, -66, 981, 1052, -66, -66, -66, -66, -66,
- /* 340 */ 1652, -66, 1005, 1052, -66, -66, -66, 1656, -66, 1029,
- /* 350 */ 1052, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- /* 360 */ -66, -66, -66, -66, -66,
-};
-static VVACTIONTYPE vv_default[] = {
- /* 0 */ 523, 523, 523, 367, 369, 370, 371, 372, 373, 374,
- /* 10 */ 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
- /* 20 */ 385, 386, 387, 388, 389, 390, 523, 523, 523, 523,
- /* 30 */ 523, 523, 523, 391, 523, 523, 523, 523, 523, 393,
- /* 40 */ 523, 523, 396, 523, 523, 450, 523, 523, 451, 523,
- /* 50 */ 454, 523, 456, 523, 458, 523, 459, 523, 460, 523,
- /* 60 */ 461, 523, 462, 523, 463, 523, 464, 523, 480, 523,
- /* 70 */ 479, 523, 481, 523, 482, 523, 483, 523, 484, 523,
- /* 80 */ 485, 523, 486, 523, 487, 523, 488, 523, 523, 489,
- /* 90 */ 491, 492, 523, 523, 498, 523, 523, 523, 499, 523,
- /* 100 */ 514, 523, 490, 523, 523, 493, 523, 508, 494, 523,
- /* 110 */ 495, 523, 523, 496, 523, 497, 506, 518, 523, 507,
- /* 120 */ 509, 516, 517, 518, 519, 520, 521, 522, 505, 523,
- /* 130 */ 510, 523, 512, 518, 523, 515, 511, 513, 523, 523,
- /* 140 */ 500, 523, 523, 523, 523, 501, 523, 502, 517, 516,
- /* 150 */ 466, 468, 470, 472, 474, 476, 478, 465, 467, 469,
- /* 160 */ 471, 473, 475, 477, 523, 457, 523, 455, 453, 452,
- /* 170 */ 523, 397, 523, 523, 523, 523, 523, 523, 523, 523,
- /* 180 */ 398, 523, 523, 523, 523, 523, 523, 402, 523, 523,
- /* 190 */ 404, 523, 405, 523, 523, 406, 523, 407, 523, 523,
- /* 200 */ 409, 523, 410, 523, 411, 523, 412, 523, 413, 523,
- /* 210 */ 523, 415, 523, 414, 416, 408, 523, 523, 523, 523,
- /* 220 */ 523, 523, 523, 523, 417, 523, 523, 523, 523, 510,
- /* 230 */ 523, 523, 523, 523, 429, 431, 523, 523, 523, 523,
- /* 240 */ 523, 523, 433, 523, 523, 523, 523, 523, 523, 435,
- /* 250 */ 523, 523, 523, 523, 432, 523, 523, 523, 439, 449,
- /* 260 */ 523, 523, 440, 523, 523, 441, 523, 523, 442, 523,
- /* 270 */ 523, 443, 523, 523, 444, 523, 523, 523, 523, 523,
- /* 280 */ 523, 445, 523, 447, 523, 448, 368, 523, 523, 523,
- /* 290 */ 523, 523, 446, 523, 523, 523, 523, 523, 436, 523,
- /* 300 */ 523, 523, 523, 434, 511, 523, 523, 523, 430, 523,
- /* 310 */ 523, 523, 523, 523, 523, 418, 523, 419, 421, 523,
- /* 320 */ 422, 423, 424, 425, 426, 427, 428, 420, 523, 523,
- /* 330 */ 403, 523, 523, 523, 523, 523, 523, 399, 523, 523,
- /* 340 */ 523, 523, 523, 523, 523, 523, 400, 523, 523, 523,
- /* 350 */ 523, 523, 523, 401, 523, 523, 394, 523, 523, 392,
- /* 360 */ 523, 523, 523, 523, 395,
-};
-#define VV_SZ_ACTTAB (sizeof(vv_action)/sizeof(vv_action[0]))
-/* The next table maps tokens into fallback tokens. If a construct
-** like the following:
-**
-** %fallback ID X Y Z.
-**
-** appears in the grammer, then ID becomes a fallback token for X, Y,
-** and Z. Whenever one of the tokens X, Y, or Z is input to the parser
-** but it does not parse, the type of the token is changed to ID and
-** the parse is retried before an error is thrown.
-*/
-#ifdef VVFALLBACK
-static const VVCODETYPE vvFallback[] = {
-};
-#endif /* VVFALLBACK */
-/* The following structure represents a single element of the
-** parser's stack. Information stored includes:
-**
-** + The state number for the parser at this level of the stack.
-**
-** + The value of the token stored at this level of the stack.
-** (In other words, the "major" token.)
-**
-** + The semantic value stored at this level of the stack. This is
-** the information used by the action routines in the grammar.
-** It is sometimes called the "minor" token.
-*/
-struct vvStackEntry {
- int stateno; /* The state-number */
- int major; /* The major token value. This is the code
- ** number for the token at this stack level */
- VVMINORTYPE minor; /* The user-supplied minor token value. This
- ** is the value of the token */
-};
-typedef struct vvStackEntry vvStackEntry;
-/* The state of the parser is completely contained in an instance of
-** the following structure */
-struct vvParser {
- int vvidx; /* Index of top element in stack */
- int vverrcnt; /* Shifts left before out of the error */
- phvolt_ARG_SDECL /* A place to hold %extra_argument */
- vvStackEntry vvstack[VVSTACKDEPTH]; /* The parser's stack */
-};
-typedef struct vvParser vvParser;
-#ifndef NDEBUG
-static FILE *vvTraceFILE = 0;
-static char *vvTracePrompt = 0;
-#endif /* NDEBUG */
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_Upper)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, Upper, phalcon, filter_sanitize_upper, phalcon_filter_sanitize_upper_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Filter_Sanitize_Upper, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *input_param = NULL, _0$$3, _1$$3, _2;
+ zval input;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&input);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(input)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &input_param);
+ if (UNEXPECTED(Z_TYPE_P(input_param) != IS_STRING && Z_TYPE_P(input_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'input' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(input_param) == IS_STRING)) {
+ zephir_get_strval(&input, input_param);
+ } else {
+ ZEPHIR_INIT_VAR(&input);
+ }
-#ifndef NDEBUG
-static void phvolt_Trace(FILE *TraceFILE, char *zTracePrompt){
- vvTraceFILE = TraceFILE;
- vvTracePrompt = zTracePrompt;
- if( vvTraceFILE==0 ) vvTracePrompt = 0;
- else if( vvTracePrompt==0 ) vvTraceFILE = 0;
+
+ if (1 == (zephir_function_exists_ex(ZEND_STRL("mb_convert_case")) == SUCCESS)) {
+ ZVAL_LONG(&_0$$3, 0);
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "UTF-8");
+ ZEPHIR_RETURN_CALL_FUNCTION("mb_convert_case", NULL, 239, &input, &_0$$3, &_1$$3);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 240, &input);
+ zephir_check_call_status();
+ zephir_fast_strtoupper(return_value, &_2);
+ RETURN_MM();
}
-#endif /* NDEBUG */
-#ifndef NDEBUG
-/* For tracing shifts, the names of all terminals and nonterminals
-** are required. The following table supplies these names */
-static const char *vvTokenName[] = {
- "$", "OPEN_DELIMITER", "COMMA", "QUESTION",
- "COLON", "RANGE", "AND", "OR",
- "IN", "IS", "EQUALS", "NOTEQUALS",
- "LESS", "GREATER", "GREATEREQUAL", "LESSEQUAL",
- "IDENTICAL", "NOTIDENTICAL", "DIVIDE", "TIMES",
- "MOD", "PLUS", "MINUS", "CONCAT",
- "SBRACKET_OPEN", "PIPE", "NOT", "INCR",
- "DECR", "PARENTHESES_OPEN", "DOT", "IF",
- "CLOSE_DELIMITER", "ENDIF", "ELSE", "ELSEIF",
- "ELSEFOR", "FOR", "IDENTIFIER", "ENDFOR",
- "SWITCH", "ENDSWITCH", "CASE", "DEFAULT",
- "SET", "ASSIGN", "ADD_ASSIGN", "SUB_ASSIGN",
- "MUL_ASSIGN", "DIV_ASSIGN", "SBRACKET_CLOSE", "MACRO",
- "PARENTHESES_CLOSE", "ENDMACRO", "INTEGER", "STRING",
- "DOUBLE", "NULL", "FALSE", "TRUE",
- "CALL", "ENDCALL", "OPEN_EDELIMITER", "CLOSE_EDELIMITER",
- "BLOCK", "ENDBLOCK", "CACHE", "ENDCACHE",
- "RAW", "ENDRAW", "EXTENDS", "INCLUDE",
- "WITH", "DO", "RETURN", "AUTOESCAPE",
- "ENDAUTOESCAPE", "BREAK", "CONTINUE", "RAW_FRAGMENT",
- "DEFINED", "EMPTY", "EVEN", "ODD",
- "NUMERIC", "SCALAR", "ITERABLE", "CBRACKET_OPEN",
- "CBRACKET_CLOSE", "error", "program", "volt_language",
- "statement_list", "statement", "raw_fragment", "if_statement",
- "elseif_statement", "elsefor_statement", "for_statement", "switch_statement",
- "case_clause", "set_statement", "echo_statement", "block_statement",
- "cache_statement", "extends_statement", "include_statement", "do_statement",
- "return_statement", "autoescape_statement", "raw_statement", "break_statement",
- "continue_statement", "macro_statement", "empty_statement", "macro_call_statement",
- "expr", "set_assignments", "set_assignment", "assignable_expr",
- "macro_parameters", "macro_parameter", "macro_parameter_default", "argument_list",
- "cache_lifetime", "array_list", "slice_offset", "array_item",
- "function_call", "argument_item",
-};
-#endif /* NDEBUG */
-#ifndef NDEBUG
-/* For tracing reduce actions, the names of all rules are required.
-*/
-static const char *vvRuleName[] = {
- /* 0 */ "program ::= volt_language",
- /* 1 */ "volt_language ::= statement_list",
- /* 2 */ "statement_list ::= statement_list statement",
- /* 3 */ "statement_list ::= statement",
- /* 4 */ "statement ::= raw_fragment",
- /* 5 */ "statement ::= if_statement",
- /* 6 */ "statement ::= elseif_statement",
- /* 7 */ "statement ::= elsefor_statement",
- /* 8 */ "statement ::= for_statement",
- /* 9 */ "statement ::= switch_statement",
- /* 10 */ "statement ::= case_clause",
- /* 11 */ "statement ::= set_statement",
- /* 12 */ "statement ::= echo_statement",
- /* 13 */ "statement ::= block_statement",
- /* 14 */ "statement ::= cache_statement",
- /* 15 */ "statement ::= extends_statement",
- /* 16 */ "statement ::= include_statement",
- /* 17 */ "statement ::= do_statement",
- /* 18 */ "statement ::= return_statement",
- /* 19 */ "statement ::= autoescape_statement",
- /* 20 */ "statement ::= raw_statement",
- /* 21 */ "statement ::= break_statement",
- /* 22 */ "statement ::= continue_statement",
- /* 23 */ "statement ::= macro_statement",
- /* 24 */ "statement ::= empty_statement",
- /* 25 */ "statement ::= macro_call_statement",
- /* 26 */ "if_statement ::= OPEN_DELIMITER IF expr CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDIF CLOSE_DELIMITER",
- /* 27 */ "if_statement ::= OPEN_DELIMITER IF expr CLOSE_DELIMITER OPEN_DELIMITER ENDIF CLOSE_DELIMITER",
- /* 28 */ "if_statement ::= OPEN_DELIMITER IF expr CLOSE_DELIMITER statement_list OPEN_DELIMITER ELSE CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDIF CLOSE_DELIMITER",
- /* 29 */ "if_statement ::= OPEN_DELIMITER IF expr CLOSE_DELIMITER statement_list OPEN_DELIMITER ELSE CLOSE_DELIMITER OPEN_DELIMITER ENDIF CLOSE_DELIMITER",
- /* 30 */ "if_statement ::= OPEN_DELIMITER IF expr CLOSE_DELIMITER OPEN_DELIMITER ELSE CLOSE_DELIMITER OPEN_DELIMITER ENDIF CLOSE_DELIMITER",
- /* 31 */ "elseif_statement ::= OPEN_DELIMITER ELSEIF expr CLOSE_DELIMITER",
- /* 32 */ "elsefor_statement ::= OPEN_DELIMITER ELSEFOR CLOSE_DELIMITER",
- /* 33 */ "for_statement ::= OPEN_DELIMITER FOR IDENTIFIER IN expr CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDFOR CLOSE_DELIMITER",
- /* 34 */ "for_statement ::= OPEN_DELIMITER FOR IDENTIFIER IN expr IF expr CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDFOR CLOSE_DELIMITER",
- /* 35 */ "for_statement ::= OPEN_DELIMITER FOR IDENTIFIER COMMA IDENTIFIER IN expr CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDFOR CLOSE_DELIMITER",
- /* 36 */ "for_statement ::= OPEN_DELIMITER FOR IDENTIFIER COMMA IDENTIFIER IN expr IF expr CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDFOR CLOSE_DELIMITER",
- /* 37 */ "switch_statement ::= OPEN_DELIMITER SWITCH expr CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDSWITCH CLOSE_DELIMITER",
- /* 38 */ "switch_statement ::= OPEN_DELIMITER SWITCH expr CLOSE_DELIMITER OPEN_DELIMITER ENDSWITCH CLOSE_DELIMITER",
- /* 39 */ "case_clause ::= OPEN_DELIMITER CASE expr CLOSE_DELIMITER",
- /* 40 */ "case_clause ::= OPEN_DELIMITER DEFAULT CLOSE_DELIMITER",
- /* 41 */ "set_statement ::= OPEN_DELIMITER SET set_assignments CLOSE_DELIMITER",
- /* 42 */ "set_assignments ::= set_assignments COMMA set_assignment",
- /* 43 */ "set_assignments ::= set_assignment",
- /* 44 */ "set_assignment ::= assignable_expr ASSIGN expr",
- /* 45 */ "set_assignment ::= assignable_expr ADD_ASSIGN expr",
- /* 46 */ "set_assignment ::= assignable_expr SUB_ASSIGN expr",
- /* 47 */ "set_assignment ::= assignable_expr MUL_ASSIGN expr",
- /* 48 */ "set_assignment ::= assignable_expr DIV_ASSIGN expr",
- /* 49 */ "assignable_expr ::= IDENTIFIER",
- /* 50 */ "assignable_expr ::= assignable_expr SBRACKET_OPEN expr SBRACKET_CLOSE",
- /* 51 */ "assignable_expr ::= assignable_expr DOT assignable_expr",
- /* 52 */ "macro_statement ::= OPEN_DELIMITER MACRO IDENTIFIER PARENTHESES_OPEN PARENTHESES_CLOSE CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDMACRO CLOSE_DELIMITER",
- /* 53 */ "macro_statement ::= OPEN_DELIMITER MACRO IDENTIFIER PARENTHESES_OPEN macro_parameters PARENTHESES_CLOSE CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDMACRO CLOSE_DELIMITER",
- /* 54 */ "macro_parameters ::= macro_parameters COMMA macro_parameter",
- /* 55 */ "macro_parameters ::= macro_parameter",
- /* 56 */ "macro_parameter ::= IDENTIFIER",
- /* 57 */ "macro_parameter ::= IDENTIFIER ASSIGN macro_parameter_default",
- /* 58 */ "macro_parameter_default ::= INTEGER",
- /* 59 */ "macro_parameter_default ::= STRING",
- /* 60 */ "macro_parameter_default ::= DOUBLE",
- /* 61 */ "macro_parameter_default ::= NULL",
- /* 62 */ "macro_parameter_default ::= FALSE",
- /* 63 */ "macro_parameter_default ::= TRUE",
- /* 64 */ "macro_call_statement ::= OPEN_DELIMITER CALL expr PARENTHESES_OPEN argument_list PARENTHESES_CLOSE CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDCALL CLOSE_DELIMITER",
- /* 65 */ "macro_call_statement ::= OPEN_DELIMITER CALL expr PARENTHESES_OPEN PARENTHESES_CLOSE CLOSE_DELIMITER OPEN_DELIMITER ENDCALL CLOSE_DELIMITER",
- /* 66 */ "empty_statement ::= OPEN_DELIMITER CLOSE_DELIMITER",
- /* 67 */ "echo_statement ::= OPEN_EDELIMITER expr CLOSE_EDELIMITER",
- /* 68 */ "block_statement ::= OPEN_DELIMITER BLOCK IDENTIFIER CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDBLOCK CLOSE_DELIMITER",
- /* 69 */ "block_statement ::= OPEN_DELIMITER BLOCK IDENTIFIER CLOSE_DELIMITER OPEN_DELIMITER ENDBLOCK CLOSE_DELIMITER",
- /* 70 */ "cache_statement ::= OPEN_DELIMITER CACHE expr CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDCACHE CLOSE_DELIMITER",
- /* 71 */ "cache_statement ::= OPEN_DELIMITER CACHE expr cache_lifetime CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDCACHE CLOSE_DELIMITER",
- /* 72 */ "cache_lifetime ::= INTEGER",
- /* 73 */ "cache_lifetime ::= IDENTIFIER",
- /* 74 */ "raw_statement ::= OPEN_DELIMITER RAW CLOSE_DELIMITER statement OPEN_DELIMITER ENDRAW CLOSE_DELIMITER",
- /* 75 */ "extends_statement ::= OPEN_DELIMITER EXTENDS expr CLOSE_DELIMITER",
- /* 76 */ "include_statement ::= OPEN_DELIMITER INCLUDE expr CLOSE_DELIMITER",
- /* 77 */ "include_statement ::= OPEN_DELIMITER INCLUDE expr WITH expr CLOSE_DELIMITER",
- /* 78 */ "do_statement ::= OPEN_DELIMITER DO expr CLOSE_DELIMITER",
- /* 79 */ "return_statement ::= OPEN_DELIMITER RETURN expr CLOSE_DELIMITER",
- /* 80 */ "autoescape_statement ::= OPEN_DELIMITER AUTOESCAPE FALSE CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDAUTOESCAPE CLOSE_DELIMITER",
- /* 81 */ "autoescape_statement ::= OPEN_DELIMITER AUTOESCAPE TRUE CLOSE_DELIMITER statement_list OPEN_DELIMITER ENDAUTOESCAPE CLOSE_DELIMITER",
- /* 82 */ "break_statement ::= OPEN_DELIMITER BREAK CLOSE_DELIMITER",
- /* 83 */ "continue_statement ::= OPEN_DELIMITER CONTINUE CLOSE_DELIMITER",
- /* 84 */ "raw_fragment ::= RAW_FRAGMENT",
- /* 85 */ "expr ::= MINUS expr",
- /* 86 */ "expr ::= PLUS expr",
- /* 87 */ "expr ::= expr MINUS expr",
- /* 88 */ "expr ::= expr PLUS expr",
- /* 89 */ "expr ::= expr TIMES expr",
- /* 90 */ "expr ::= expr TIMES TIMES expr",
- /* 91 */ "expr ::= expr DIVIDE expr",
- /* 92 */ "expr ::= expr DIVIDE DIVIDE expr",
- /* 93 */ "expr ::= expr MOD expr",
- /* 94 */ "expr ::= expr AND expr",
- /* 95 */ "expr ::= expr OR expr",
- /* 96 */ "expr ::= expr CONCAT expr",
- /* 97 */ "expr ::= expr PIPE expr",
- /* 98 */ "expr ::= expr RANGE expr",
- /* 99 */ "expr ::= expr EQUALS expr",
- /* 100 */ "expr ::= expr NOTEQUALS DEFINED",
- /* 101 */ "expr ::= expr IS DEFINED",
- /* 102 */ "expr ::= expr NOTEQUALS EMPTY",
- /* 103 */ "expr ::= expr IS EMPTY",
- /* 104 */ "expr ::= expr NOTEQUALS EVEN",
- /* 105 */ "expr ::= expr IS EVEN",
- /* 106 */ "expr ::= expr NOTEQUALS ODD",
- /* 107 */ "expr ::= expr IS ODD",
- /* 108 */ "expr ::= expr NOTEQUALS NUMERIC",
- /* 109 */ "expr ::= expr IS NUMERIC",
- /* 110 */ "expr ::= expr NOTEQUALS SCALAR",
- /* 111 */ "expr ::= expr IS SCALAR",
- /* 112 */ "expr ::= expr NOTEQUALS ITERABLE",
- /* 113 */ "expr ::= expr IS ITERABLE",
- /* 114 */ "expr ::= expr IS expr",
- /* 115 */ "expr ::= expr NOTEQUALS expr",
- /* 116 */ "expr ::= expr IDENTICAL expr",
- /* 117 */ "expr ::= expr NOTIDENTICAL expr",
- /* 118 */ "expr ::= expr LESS expr",
- /* 119 */ "expr ::= expr GREATER expr",
- /* 120 */ "expr ::= expr GREATEREQUAL expr",
- /* 121 */ "expr ::= expr LESSEQUAL expr",
- /* 122 */ "expr ::= expr DOT expr",
- /* 123 */ "expr ::= expr IN expr",
- /* 124 */ "expr ::= expr NOT IN expr",
- /* 125 */ "expr ::= NOT expr",
- /* 126 */ "expr ::= expr INCR",
- /* 127 */ "expr ::= expr DECR",
- /* 128 */ "expr ::= PARENTHESES_OPEN expr PARENTHESES_CLOSE",
- /* 129 */ "expr ::= SBRACKET_OPEN SBRACKET_CLOSE",
- /* 130 */ "expr ::= SBRACKET_OPEN array_list SBRACKET_CLOSE",
- /* 131 */ "expr ::= CBRACKET_OPEN CBRACKET_CLOSE",
- /* 132 */ "expr ::= CBRACKET_OPEN array_list CBRACKET_CLOSE",
- /* 133 */ "expr ::= expr SBRACKET_OPEN expr SBRACKET_CLOSE",
- /* 134 */ "expr ::= expr QUESTION expr COLON expr",
- /* 135 */ "expr ::= expr SBRACKET_OPEN COLON slice_offset SBRACKET_CLOSE",
- /* 136 */ "expr ::= expr SBRACKET_OPEN slice_offset COLON SBRACKET_CLOSE",
- /* 137 */ "expr ::= expr SBRACKET_OPEN slice_offset COLON slice_offset SBRACKET_CLOSE",
- /* 138 */ "slice_offset ::= INTEGER",
- /* 139 */ "slice_offset ::= IDENTIFIER",
- /* 140 */ "array_list ::= array_list COMMA array_item",
- /* 141 */ "array_list ::= array_item",
- /* 142 */ "array_item ::= STRING COLON expr",
- /* 143 */ "array_item ::= expr",
- /* 144 */ "expr ::= function_call",
- /* 145 */ "function_call ::= expr PARENTHESES_OPEN argument_list PARENTHESES_CLOSE",
- /* 146 */ "function_call ::= expr PARENTHESES_OPEN PARENTHESES_CLOSE",
- /* 147 */ "argument_list ::= argument_list COMMA argument_item",
- /* 148 */ "argument_list ::= argument_item",
- /* 149 */ "argument_item ::= expr",
- /* 150 */ "argument_item ::= STRING COLON expr",
- /* 151 */ "expr ::= IDENTIFIER",
- /* 152 */ "expr ::= INTEGER",
- /* 153 */ "expr ::= STRING",
- /* 154 */ "expr ::= DOUBLE",
- /* 155 */ "expr ::= NULL",
- /* 156 */ "expr ::= FALSE",
- /* 157 */ "expr ::= TRUE",
-};
-#endif /* NDEBUG */
-const char *phvolt_TokenName(int tokenType){
-#ifndef NDEBUG
- if( tokenType>0 && tokenType<(sizeof(vvTokenName)/sizeof(vvTokenName[0])) ){
- return vvTokenName[tokenType];
- }else{
- return "Unknown";
- }
-#else
- return "";
+
+#ifdef HAVE_CONFIG_H
#endif
-}
-void *phvolt_Alloc(void *(*mallocProc)(size_t)){
- vvParser *pParser;
- pParser = (vvParser*)(*mallocProc)( (size_t)sizeof(vvParser) );
- if( pParser ){
- pParser->vvidx = -1;
- }
- return pParser;
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_UpperFirst)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, UpperFirst, phalcon, filter_sanitize_upperfirst, phalcon_filter_sanitize_upperfirst_method_entry, 0);
+
+ return SUCCESS;
}
-/* The following function deletes the value associated with a
-** symbol. The symbol can be either a terminal or nonterminal.
-** "vvmajor" is the symbol code, and "vvpminor" is a pointer to
-** the value.
-*/
-static void vv_destructor(VVCODETYPE vvmajor, VVMINORTYPE *vvpminor){
- switch( vvmajor ){
- /* Here is inserted the actions which take place when a
- ** terminal or non-terminal is destroyed. This can happen
- ** when the symbol is popped from the stack during a
- ** reduce or during error processing or when a parser is
- ** being destroyed before it is finished parsing.
- **
- ** Note: during a reduce, the only symbols destroyed are those
- ** which appear on the RHS of the rule, but which are not used
- ** inside the C code.
- */
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- case 26:
- case 27:
- case 28:
- case 29:
- case 30:
- case 31:
- case 32:
- case 33:
- case 34:
- case 35:
- case 36:
- case 37:
- case 38:
- case 39:
- case 40:
- case 41:
- case 42:
- case 43:
- case 44:
- case 45:
- case 46:
- case 47:
- case 48:
- case 49:
- case 50:
- case 51:
- case 52:
- case 53:
- case 54:
- case 55:
- case 56:
- case 57:
- case 58:
- case 59:
- case 60:
- case 61:
- case 62:
- case 63:
- case 64:
- case 65:
- case 66:
- case 67:
- case 68:
- case 69:
- case 70:
- case 71:
- case 72:
- case 73:
- case 74:
- case 75:
- case 76:
- case 77:
- case 78:
- case 79:
- case 80:
- case 81:
- case 82:
- case 83:
- case 84:
- case 85:
- case 86:
- case 87:
- case 88:
-// 158 "parser.php.lemon"
+static PHP_METHOD(Phalcon_Filter_Sanitize_UpperFirst, __invoke)
{
- if ((vvpminor->vv0)) {
- if ((vvpminor->vv0)->free_flag) {
- efree((vvpminor->vv0)->token);
- }
- efree((vvpminor->vv0));
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *input_param = NULL;
+ zval input;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&input);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(input)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &input_param);
+ if (UNEXPECTED(Z_TYPE_P(input_param) != IS_STRING && Z_TYPE_P(input_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'input' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(input_param) == IS_STRING)) {
+ zephir_get_strval(&input, input_param);
+ } else {
+ ZEPHIR_INIT_VAR(&input);
}
+
+
+ zephir_ucfirst(return_value, &input);
+ RETURN_MM();
}
-// 1229 "parser.php.c"
- break;
- case 91:
-// 171 "parser.php.lemon"
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_UpperWords)
{
- if (&(vvpminor->vv186)) {
- zval_ptr_dtor(&(vvpminor->vv186));
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, UpperWords, phalcon, filter_sanitize_upperwords, phalcon_filter_sanitize_upperwords_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Filter_Sanitize_UpperWords, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *input_param = NULL, _0$$3, _1$$3, _2;
+ zval input;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&input);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(input)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &input_param);
+ if (UNEXPECTED(Z_TYPE_P(input_param) != IS_STRING && Z_TYPE_P(input_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'input' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(input_param) == IS_STRING)) {
+ zephir_get_strval(&input, input_param);
+ } else {
+ ZEPHIR_INIT_VAR(&input);
+ }
+
+
+ if (1 == (zephir_function_exists_ex(ZEND_STRL("mb_convert_case")) == SUCCESS)) {
+ ZVAL_LONG(&_0$$3, 2);
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "UTF-8");
+ ZEPHIR_RETURN_CALL_FUNCTION("mb_convert_case", NULL, 239, &input, &_0$$3, &_1$$3);
+ zephir_check_call_status();
+ RETURN_MM();
}
+ ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 240, &input);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_FUNCTION("ucwords", NULL, 242, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
}
-// 1238 "parser.php.c"
- break;
- case 89:
- case 90:
- case 92:
- case 93:
- case 94:
- case 95:
- case 96:
- case 97:
- case 98:
- case 99:
- case 100:
- case 101:
- case 102:
- case 103:
- case 104:
- case 105:
- case 106:
- case 107:
- case 108:
- case 109:
- case 110:
- case 111:
- case 112:
- case 113:
- case 114:
- case 115:
- case 116:
- case 117:
- case 118:
- case 119:
- case 120:
- case 121:
- case 122:
- case 123:
- case 124:
- case 125:
- case 126:
- case 127:
- case 128:
- case 129:
-// 14 "parser.php.lemon"
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_Url)
{
- if (&(vvpminor->vv186)) {
- zval_ptr_dtor(&(vvpminor->vv186));
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Filter\\Sanitize, Url, phalcon, filter_sanitize_url, phalcon_filter_sanitize_url_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Filter_Sanitize_Url, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *input, input_sub, _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&input_sub);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(input)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &input);
+
+
+ ZVAL_LONG(&_0, 518);
+ ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 237, input, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Domain_Payload_Payload)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Domain\\Payload, Payload, phalcon, domain_payload_payload, phalcon_domain_payload_payload_method_entry, 0);
+
+ zend_declare_property_null(phalcon_domain_payload_payload_ce, SL("exception"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_domain_payload_payload_ce, SL("extras"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_domain_payload_payload_ce, SL("input"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_domain_payload_payload_ce, SL("messages"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_domain_payload_payload_ce, SL("status"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_domain_payload_payload_ce, SL("output"), ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_domain_payload_payload_ce, 1, phalcon_domain_payload_payloadinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Domain_Payload_Payload, getExtras)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "extras");
+}
+
+static PHP_METHOD(Phalcon_Domain_Payload_Payload, getInput)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "input");
+}
+
+static PHP_METHOD(Phalcon_Domain_Payload_Payload, getMessages)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "messages");
+}
+
+static PHP_METHOD(Phalcon_Domain_Payload_Payload, getStatus)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "status");
+}
+
+static PHP_METHOD(Phalcon_Domain_Payload_Payload, getOutput)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "output");
+}
+
+static PHP_METHOD(Phalcon_Domain_Payload_Payload, getException)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "exception");
+}
+
+static PHP_METHOD(Phalcon_Domain_Payload_Payload, setException)
+{
+ zval *exception, exception_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&exception_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(exception, zend_ce_throwable)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &exception);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("exception"), exception);
+ RETURN_THISW();
+}
+
+static PHP_METHOD(Phalcon_Domain_Payload_Payload, setExtras)
+{
+ zval *extras, extras_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&extras_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(extras)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &extras);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("extras"), extras);
+ RETURN_THISW();
+}
+
+static PHP_METHOD(Phalcon_Domain_Payload_Payload, setInput)
+{
+ zval *input, input_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&input_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(input)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &input);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("input"), input);
+ RETURN_THISW();
+}
+
+static PHP_METHOD(Phalcon_Domain_Payload_Payload, setMessages)
+{
+ zval *messages, messages_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&messages_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(messages)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ 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_Domain_Payload_Payload, setOutput)
+{
+ zval *output, output_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&output_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(output)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &output);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("output"), output);
+ RETURN_THISW();
+}
+
+static PHP_METHOD(Phalcon_Domain_Payload_Payload, setStatus)
+{
+ zval *status, status_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&status_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(status)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &status);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("status"), status);
+ RETURN_THISW();
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Domain_Payload_PayloadFactory)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Domain\\Payload, PayloadFactory, phalcon, domain_payload_payloadfactory, phalcon_domain_payload_payloadfactory_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Domain_Payload_PayloadFactory, newInstance)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+
+
+ ZEPHIR_MM_GROW();
+
+ object_init_ex(return_value, phalcon_domain_payload_payload_ce);
+ if (zephir_has_constructor(return_value)) {
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0);
+ zephir_check_call_status();
}
+
+ RETURN_MM();
}
-// 1286 "parser.php.c"
- break;
- default: break; /* If no destructor action specified: do nothing */
- }
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Domain_Payload_PayloadInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Domain\\Payload, PayloadInterface, phalcon, domain_payload_payloadinterface, NULL);
+
+ zend_class_implements(phalcon_domain_payload_payloadinterface_ce, 1, phalcon_domain_payload_readableinterface_ce);
+ zend_class_implements(phalcon_domain_payload_payloadinterface_ce, 1, phalcon_domain_payload_writeableinterface_ce);
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Domain_Payload_ReadableInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Domain\\Payload, ReadableInterface, phalcon, domain_payload_readableinterface, phalcon_domain_payload_readableinterface_method_entry);
+
+ return SUCCESS;
+}
+
+ZEPHIR_DOC_METHOD(Phalcon_Domain_Payload_ReadableInterface, getException);
+ZEPHIR_DOC_METHOD(Phalcon_Domain_Payload_ReadableInterface, getExtras);
+ZEPHIR_DOC_METHOD(Phalcon_Domain_Payload_ReadableInterface, getInput);
+ZEPHIR_DOC_METHOD(Phalcon_Domain_Payload_ReadableInterface, getMessages);
+ZEPHIR_DOC_METHOD(Phalcon_Domain_Payload_ReadableInterface, getOutput);
+ZEPHIR_DOC_METHOD(Phalcon_Domain_Payload_ReadableInterface, getStatus);
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Domain_Payload_Status)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Domain\\Payload, Status, phalcon, domain_payload_status, phalcon_domain_payload_status_method_entry, 0);
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("ACCEPTED"), "ACCEPTED");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("AUTHENTICATED"), "AUTHENTICATED");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("AUTHORIZED"), "AUTHORIZED");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("CREATED"), "CREATED");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("DELETED"), "DELETED");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("ERROR"), "ERROR");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("FAILURE"), "FAILURE");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("FOUND"), "FOUND");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("NOT_ACCEPTED"), "NOT_ACCEPTED");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("NOT_AUTHENTICATED"), "NOT_AUTHENTICATED");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("NOT_AUTHORIZED"), "NOT_AUTHORIZED");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("NOT_CREATED"), "NOT_CREATED");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("NOT_DELETED"), "NOT_DELETED");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("NOT_FOUND"), "NOT_FOUND");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("NOT_UPDATED"), "NOT_UPDATED");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("NOT_VALID"), "NOT_VALID");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("PROCESSING"), "PROCESSING");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("SUCCESS"), "SUCCESS");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("UPDATED"), "UPDATED");
+
+ zephir_declare_class_constant_string(phalcon_domain_payload_status_ce, SL("VALID"), "VALID");
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Domain_Payload_Status, __construct)
+{
+ zval *this_ptr = getThis();
+
+
+
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Domain_Payload_WriteableInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Domain\\Payload, WriteableInterface, phalcon, domain_payload_writeableinterface, phalcon_domain_payload_writeableinterface_method_entry);
+
+ return SUCCESS;
+}
+
+ZEPHIR_DOC_METHOD(Phalcon_Domain_Payload_WriteableInterface, setException);
+ZEPHIR_DOC_METHOD(Phalcon_Domain_Payload_WriteableInterface, setExtras);
+ZEPHIR_DOC_METHOD(Phalcon_Domain_Payload_WriteableInterface, setInput);
+ZEPHIR_DOC_METHOD(Phalcon_Domain_Payload_WriteableInterface, setMessages);
+ZEPHIR_DOC_METHOD(Phalcon_Domain_Payload_WriteableInterface, setOutput);
+ZEPHIR_DOC_METHOD(Phalcon_Domain_Payload_WriteableInterface, setStatus);
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Helper_Arr)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Helper, Arr, phalcon, helper_arr, phalcon_helper_arr_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Helper_Arr, blackList)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *blackList_param = NULL, _0, _1, _2;
+ zval collection, blackList;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&blackList);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ARRAY(blackList)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &collection_param, &blackList_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&blackList, blackList_param);
+
+
+ ZEPHIR_INIT_VAR(&_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ zephir_create_closure_ex(&_0, NULL, phalcon_6__closure_ce, SL("__invoke"));
+ ZEPHIR_CALL_FUNCTION(&_1, "array_filter", NULL, 248, &blackList, &_0);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&blackList, &_1);
+ ZEPHIR_CALL_FUNCTION(&_2, "array_flip", NULL, 174, &blackList);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_FUNCTION("array_diff_key", NULL, 249, &collection, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static int vv_pop_parser_stack(vvParser *pParser){
- VVCODETYPE vvmajor;
- vvStackEntry *vvtos = &pParser->vvstack[pParser->vvidx];
+static PHP_METHOD(Phalcon_Helper_Arr, chunk)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ 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 *this_ptr = getThis();
- if( pParser->vvidx<0 ) return 0;
-#ifndef NDEBUG
- if( vvTraceFILE && pParser->vvidx>=0 ){
- fprintf(vvTraceFILE,"%sPopping %s\n",
- vvTracePrompt,
- vvTokenName[vvtos->major]);
- }
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 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();
#endif
- vvmajor = vvtos->major;
- vv_destructor( vvmajor, &vvtos->minor);
- pParser->vvidx--;
- return vvmajor;
-}
-static void phvolt_Free(
- void *p, /* The parser to be deleted */
- void (*freeProc)(void*) /* Function used to reclaim memory */
-){
- vvParser *pParser = (vvParser*)p;
- if( pParser==0 ) return;
- while( pParser->vvidx>=0 ) vv_pop_parser_stack(pParser);
- (*freeProc)((void*)pParser);
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 1, &collection_param, &size_param, &preserveKeys_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ size = zephir_get_intval(size_param);
+ if (!preserveKeys_param) {
+ preserveKeys = 0;
+ } else {
+ preserveKeys = zephir_get_boolval(preserveKeys_param);
+ }
+
+
+ ZVAL_LONG(&_0, size);
+ ZVAL_BOOL(&_1, (preserveKeys ? 1 : 0));
+ ZEPHIR_RETURN_CALL_FUNCTION("array_chunk", NULL, 250, &collection, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static int vv_find_shift_action(
- vvParser *pParser, /* The parser */
- int iLookAhead /* The look-ahead token */
-){
- int i;
- int stateno = pParser->vvstack[pParser->vvidx].stateno;
+static PHP_METHOD(Phalcon_Helper_Arr, filter)
+{
+ 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;
+ zval *this_ptr = getThis();
- /* if( pParser->vvidx<0 ) return VV_NO_ACTION; */
- i = vv_shift_ofst[stateno];
- if( i==VV_SHIFT_USE_DFLT ){
- return vv_default[stateno];
- }
- if( iLookAhead==VVNOCODE ){
- return VV_NO_ACTION;
- }
- i += iLookAhead;
- if( i<0 || i>=VV_SZ_ACTTAB || vv_lookahead[i]!=iLookAhead ){
-#ifdef VVFALLBACK
- int iFallback; /* Fallback token */
- if( iLookAhead
%s\n",
- vvTracePrompt, vvTokenName[iLookAhead], vvTokenName[iFallback]);
- }
-#endif
- return vv_find_shift_action(pParser, iFallback);
- }
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_NULL(&__$null);
+#if PHP_VERSION_ID >= 80000
+ 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();
#endif
- return vv_default[stateno];
- }else{
- return vv_action[i];
- }
-}
-static int vv_find_reduce_action(
- vvParser *pParser, /* The parser */
- int iLookAhead /* The look-ahead token */
-){
- int i;
- int stateno = pParser->vvstack[pParser->vvidx].stateno;
- i = vv_reduce_ofst[stateno];
- if( i==VV_REDUCE_USE_DFLT ){
- return vv_default[stateno];
- }
- if( iLookAhead==VVNOCODE ){
- return VV_NO_ACTION;
- }
- i += iLookAhead;
- if( i<0 || i>=VV_SZ_ACTTAB || vv_lookahead[i]!=iLookAhead ){
- return vv_default[stateno];
- }else{
- return vv_action[i];
- }
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &collection_param, &method);
+ zephir_get_arrval(&collection, collection_param);
+ if (!method) {
+ method = &method_sub;
+ method = &__$null;
+ }
+
+
+ _0 = Z_TYPE_P(method) == IS_NULL;
+ if (!(_0)) {
+ _0 = !(zephir_is_callable(method));
+ }
+ if (_0) {
+ RETURN_CTOR(&collection);
+ }
+ ZEPHIR_RETURN_CALL_FUNCTION("array_filter", NULL, 248, &collection, method);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static void vv_shift(
- vvParser *vvpParser, /* The parser to be shifted */
- int vvNewState, /* The new state to shift in */
- int vvMajor, /* The major token to shift in */
- VVMINORTYPE *vvpMinor /* Pointer ot the minor token to shift in */
-){
- vvStackEntry *vvtos;
- vvpParser->vvidx++;
- if( vvpParser->vvidx>=VVSTACKDEPTH ){
- phvolt_ARG_FETCH;
- vvpParser->vvidx--;
-#ifndef NDEBUG
- if( vvTraceFILE ){
- fprintf(vvTraceFILE,"%sStack Overflow!\n",vvTracePrompt);
- }
-#endif
- while( vvpParser->vvidx>=0 ) vv_pop_parser_stack(vvpParser);
- /* Here code is inserted which will execute if the parser
- ** stack every overflows */
- phvolt_ARG_STORE; /* Suppress warning about unused %extra_argument var */
- return;
- }
- vvtos = &vvpParser->vvstack[vvpParser->vvidx];
- vvtos->stateno = vvNewState;
- vvtos->major = vvMajor;
- vvtos->minor = *vvpMinor;
-#ifndef NDEBUG
- if( vvTraceFILE && vvpParser->vvidx>0 ){
- int i;
- fprintf(vvTraceFILE,"%sShift %d\n",vvTracePrompt,vvNewState);
- fprintf(vvTraceFILE,"%sStack:",vvTracePrompt);
- for(i=1; i<=vvpParser->vvidx; i++)
- fprintf(vvTraceFILE," %s",vvTokenName[vvpParser->vvstack[i].major]);
- fprintf(vvTraceFILE,"\n");
- }
+static PHP_METHOD(Phalcon_Helper_Arr, first)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_0 = NULL;
+ 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);
+#if PHP_VERSION_ID >= 80000
+ 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();
#endif
-}
-/* The following table contains information about every rule that
-** is used during the reduce.
-*/
-static struct {
- VVCODETYPE lhs; /* Symbol on the left-hand side of the rule */
- unsigned char nrhs; /* Number of right-hand side symbols in the rule */
-} vvRuleInfo[] = {
- { 90, 1 },
- { 91, 1 },
- { 92, 2 },
- { 92, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 93, 1 },
- { 95, 8 },
- { 95, 7 },
- { 95, 12 },
- { 95, 11 },
- { 95, 10 },
- { 96, 4 },
- { 97, 3 },
- { 98, 10 },
- { 98, 12 },
- { 98, 12 },
- { 98, 14 },
- { 99, 8 },
- { 99, 7 },
- { 100, 4 },
- { 100, 3 },
- { 101, 4 },
- { 117, 3 },
- { 117, 1 },
- { 118, 3 },
- { 118, 3 },
- { 118, 3 },
- { 118, 3 },
- { 118, 3 },
- { 119, 1 },
- { 119, 4 },
- { 119, 3 },
- { 113, 10 },
- { 113, 11 },
- { 120, 3 },
- { 120, 1 },
- { 121, 1 },
- { 121, 3 },
- { 122, 1 },
- { 122, 1 },
- { 122, 1 },
- { 122, 1 },
- { 122, 1 },
- { 122, 1 },
- { 115, 11 },
- { 115, 9 },
- { 114, 2 },
- { 102, 3 },
- { 103, 8 },
- { 103, 7 },
- { 104, 8 },
- { 104, 9 },
- { 124, 1 },
- { 124, 1 },
- { 110, 7 },
- { 105, 4 },
- { 106, 4 },
- { 106, 6 },
- { 107, 4 },
- { 108, 4 },
- { 109, 8 },
- { 109, 8 },
- { 111, 3 },
- { 112, 3 },
- { 94, 1 },
- { 116, 2 },
- { 116, 2 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 4 },
- { 116, 3 },
- { 116, 4 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 3 },
- { 116, 4 },
- { 116, 2 },
- { 116, 2 },
- { 116, 2 },
- { 116, 3 },
- { 116, 2 },
- { 116, 3 },
- { 116, 2 },
- { 116, 3 },
- { 116, 4 },
- { 116, 5 },
- { 116, 5 },
- { 116, 5 },
- { 116, 6 },
- { 126, 1 },
- { 126, 1 },
- { 125, 3 },
- { 125, 1 },
- { 127, 3 },
- { 127, 1 },
- { 116, 1 },
- { 128, 4 },
- { 128, 3 },
- { 123, 3 },
- { 123, 1 },
- { 129, 1 },
- { 129, 3 },
- { 116, 1 },
- { 116, 1 },
- { 116, 1 },
- { 116, 1 },
- { 116, 1 },
- { 116, 1 },
- { 116, 1 },
-};
-static void vv_accept(vvParser*); /* Forward Declaration */
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &collection_param, &method);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!method) {
+ method = &method_sub;
+ method = &__$null;
+ }
-static void vv_reduce(
- vvParser *vvpParser, /* The parser */
- int vvruleno /* Number of the rule by which to reduce */
-){
- int vvgoto; /* The next state */
- int vvact; /* The next action */
- VVMINORTYPE vvgotominor; /* The LHS of the rule reduced */
- vvStackEntry *vvmsp; /* The top of the parser's stack */
- int vvsize; /* Amount to pop the stack */
- phvolt_ARG_FETCH;
- vvmsp = &vvpParser->vvstack[vvpParser->vvidx];
-#ifndef NDEBUG
- if( vvTraceFILE && vvruleno>=0
- && vvruleno
- ** { ... } // User supplied code
- ** //
- ** break;
- */
- case 0:
-// 167 "parser.php.lemon"
-{
- ZVAL_ZVAL(&status->ret, &vvmsp[0].minor.vv186, 1, 1);
-}
-// 1661 "parser.php.c"
- break;
- case 1:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- case 144:
-// 177 "parser.php.lemon"
-{
- vvgotominor.vv186 = vvmsp[0].minor.vv186;
+ ZEPHIR_CALL_SELF(&filtered, "filter", &_0, 251, &collection, method);
+ zephir_check_call_status();
+ ZEPHIR_MAKE_REF(&filtered);
+ ZEPHIR_RETURN_CALL_FUNCTION("reset", NULL, 252, &filtered);
+ ZEPHIR_UNREF(&filtered);
+ zephir_check_call_status();
+ RETURN_MM();
}
-// 1691 "parser.php.c"
- break;
- case 2:
-// 181 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, firstKey)
{
- phvolt_ret_zval_list(&vvgotominor.vv186, &vvmsp[-1].minor.vv186, &vvmsp[0].minor.vv186);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_0 = NULL;
+ 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);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &collection_param, &method);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!method) {
+ method = &method_sub;
+ method = &__$null;
+ }
+
+
+ ZEPHIR_CALL_SELF(&filtered, "filter", &_0, 251, &collection, method);
+ zephir_check_call_status();
+ ZEPHIR_MAKE_REF(&filtered);
+ ZEPHIR_CALL_FUNCTION(NULL, "reset", NULL, 252, &filtered);
+ ZEPHIR_UNREF(&filtered);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_FUNCTION("key", NULL, 253, &filtered);
+ zephir_check_call_status();
+ RETURN_MM();
}
-// 1698 "parser.php.c"
- break;
- case 3:
- case 43:
- case 55:
- case 141:
- case 148:
-// 185 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, flatten)
{
- phvolt_ret_zval_list(&vvgotominor.vv186, NULL, &vvmsp[0].minor.vv186);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_4 = NULL, *_8 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool deep;
+ zval *collection_param = NULL, *deep_param = NULL, data, item, *_0, _1, _2$$6, _3$$6, _5$$6, _6$$7, _7$$7, _9$$11, _10$$11, _11$$11, _12$$12, _13$$12;
+ zval collection;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&item);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$6);
+ ZVAL_UNDEF(&_3$$6);
+ ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&_7$$7);
+ ZVAL_UNDEF(&_9$$11);
+ ZVAL_UNDEF(&_10$$11);
+ ZVAL_UNDEF(&_11$$11);
+ ZVAL_UNDEF(&_12$$12);
+ ZVAL_UNDEF(&_13$$12);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(deep)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &collection_param, &deep_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!deep_param) {
+ deep = 0;
+ } else {
+ deep = zephir_get_boolval(deep_param);
+ }
+
+
+ ZEPHIR_INIT_VAR(&data);
+ array_init(&data);
+ zephir_is_iterable(&collection, 0, "phalcon/Helper/Arr.zep", 148);
+ if (Z_TYPE_P(&collection) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&collection), _0)
+ {
+ ZEPHIR_INIT_NVAR(&item);
+ ZVAL_COPY(&item, _0);
+ if (Z_TYPE_P(&item) != IS_ARRAY) {
+ zephir_array_append(&data, &item, PH_SEPARATE, "phalcon/Helper/Arr.zep", 132);
+ } else {
+ if (deep) {
+ ZEPHIR_INIT_NVAR(&_2$$6);
+ ZVAL_BOOL(&_5$$6, 1);
+ ZEPHIR_CALL_SELF(&_3$$6, "flatten", &_4, 254, &item, &_5$$6);
+ zephir_check_call_status();
+ zephir_fast_array_merge(&_2$$6, &data, &_3$$6);
+ ZEPHIR_CPY_WRT(&data, &_2$$6);
+ } else {
+ ZEPHIR_INIT_NVAR(&_6$$7);
+ ZEPHIR_CALL_FUNCTION(&_7$$7, "array_values", &_8, 12, &item);
+ zephir_check_call_status();
+ zephir_fast_array_merge(&_6$$7, &data, &_7$$7);
+ ZEPHIR_CPY_WRT(&data, &_6$$7);
+ }
+ }
+ } 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();
+ if (Z_TYPE_P(&item) != IS_ARRAY) {
+ zephir_array_append(&data, &item, PH_SEPARATE, "phalcon/Helper/Arr.zep", 132);
+ } else {
+ if (deep) {
+ ZEPHIR_INIT_NVAR(&_9$$11);
+ ZVAL_BOOL(&_11$$11, 1);
+ ZEPHIR_CALL_SELF(&_10$$11, "flatten", &_4, 254, &item, &_11$$11);
+ zephir_check_call_status();
+ zephir_fast_array_merge(&_9$$11, &data, &_10$$11);
+ ZEPHIR_CPY_WRT(&data, &_9$$11);
+ } else {
+ ZEPHIR_INIT_NVAR(&_12$$12);
+ ZEPHIR_CALL_FUNCTION(&_13$$12, "array_values", &_8, 12, &item);
+ zephir_check_call_status();
+ zephir_fast_array_merge(&_12$$12, &data, &_13$$12);
+ ZEPHIR_CPY_WRT(&data, &_12$$12);
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &collection, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&item);
+ RETURN_CCTOR(&data);
}
-// 1709 "parser.php.c"
- break;
- case 26:
-// 278 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, get)
{
- phvolt_ret_if_statement(&vvgotominor.vv186, &vvmsp[-5].minor.vv186, &vvmsp[-3].minor.vv186, NULL, status->scanner_state);
- vv_destructor(1,&vvmsp[-7].minor);
- vv_destructor(31,&vvmsp[-6].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(33,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ 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 *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&cast);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_OBS_VAR(&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, 10, &value, &cast);
+ ZEPHIR_UNREF(&value);
+ zephir_check_call_status();
+ }
+ RETURN_CCTOR(&value);
}
-// 1722 "parser.php.c"
- break;
- case 27:
-// 283 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, group)
{
- phvolt_ret_if_statement(&vvgotominor.vv186, &vvmsp[-4].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(1,&vvmsp[-6].minor);
- vv_destructor(31,&vvmsp[-5].minor);
- vv_destructor(32,&vvmsp[-3].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(33,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zend_bool _2$$3, _3$$3, _5$$7, _6$$7;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_4 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *method, method_sub, element, key, *_0, _1;
+ zval collection, filtered;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&filtered);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(method)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &collection_param, &method);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+
+
+ ZEPHIR_INIT_VAR(&filtered);
+ array_init(&filtered);
+ zephir_is_iterable(&collection, 0, "phalcon/Helper/Arr.zep", 201);
+ if (Z_TYPE_P(&collection) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&collection), _0)
+ {
+ ZEPHIR_INIT_NVAR(&element);
+ ZVAL_COPY(&element, _0);
+ _2$$3 = Z_TYPE_P(method) != IS_STRING;
+ if (_2$$3) {
+ _2$$3 = zephir_is_callable(method);
+ }
+ _3$$3 = _2$$3;
+ if (!(_3$$3)) {
+ _3$$3 = (zephir_function_exists(method) == SUCCESS);
+ }
+ if (_3$$3) {
+ ZEPHIR_CALL_FUNCTION(&key, "call_user_func", &_4, 255, method, &element);
+ zephir_check_call_status();
+ zephir_array_update_multi(&filtered, &element, SL("za"), 2, &key);
+ } else if (Z_TYPE_P(&element) == IS_OBJECT) {
+ ZEPHIR_OBS_NVAR(&key);
+ zephir_read_property_zval(&key, &element, method, PH_NOISY_CC);
+ zephir_array_update_multi(&filtered, &element, SL("za"), 2, &key);
+ } else if (zephir_array_isset(&element, method)) {
+ ZEPHIR_OBS_NVAR(&key);
+ zephir_array_fetch(&key, &element, method, PH_NOISY, "phalcon/Helper/Arr.zep", 196);
+ zephir_array_update_multi(&filtered, &element, SL("za"), 2, &key);
+ }
+ } 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();
+ _5$$7 = Z_TYPE_P(method) != IS_STRING;
+ if (_5$$7) {
+ _5$$7 = zephir_is_callable(method);
+ }
+ _6$$7 = _5$$7;
+ if (!(_6$$7)) {
+ _6$$7 = (zephir_function_exists(method) == SUCCESS);
+ }
+ if (_6$$7) {
+ ZEPHIR_CALL_FUNCTION(&key, "call_user_func", &_4, 255, method, &element);
+ zephir_check_call_status();
+ zephir_array_update_multi(&filtered, &element, SL("za"), 2, &key);
+ } else if (Z_TYPE_P(&element) == IS_OBJECT) {
+ ZEPHIR_OBS_NVAR(&key);
+ zephir_read_property_zval(&key, &element, method, PH_NOISY_CC);
+ zephir_array_update_multi(&filtered, &element, SL("za"), 2, &key);
+ } else if (zephir_array_isset(&element, method)) {
+ ZEPHIR_OBS_NVAR(&key);
+ zephir_array_fetch(&key, &element, method, PH_NOISY, "phalcon/Helper/Arr.zep", 196);
+ zephir_array_update_multi(&filtered, &element, SL("za"), 2, &key);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &collection, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&element);
+ RETURN_CTOR(&filtered);
}
-// 1735 "parser.php.c"
- break;
- case 28:
-// 288 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, has)
{
- phvolt_ret_if_statement(&vvgotominor.vv186, &vvmsp[-9].minor.vv186, &vvmsp[-7].minor.vv186, &vvmsp[-3].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-11].minor);
- vv_destructor(31,&vvmsp[-10].minor);
- vv_destructor(32,&vvmsp[-8].minor);
- vv_destructor(1,&vvmsp[-6].minor);
- vv_destructor(34,&vvmsp[-5].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(33,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *collection_param = NULL, *index, index_sub;
+ zval collection;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&index_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(index)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &collection_param, &index);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+
+
+ RETURN_MM_BOOL(zephir_array_isset(&collection, index));
}
-// 1751 "parser.php.c"
- break;
- case 29:
-// 293 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, isUnique)
{
- phvolt_ret_if_statement(&vvgotominor.vv186, &vvmsp[-8].minor.vv186, &vvmsp[-6].minor.vv186, NULL, status->scanner_state);
- vv_destructor(1,&vvmsp[-10].minor);
- vv_destructor(31,&vvmsp[-9].minor);
- vv_destructor(32,&vvmsp[-7].minor);
- vv_destructor(1,&vvmsp[-5].minor);
- vv_destructor(34,&vvmsp[-4].minor);
- vv_destructor(32,&vvmsp[-3].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(33,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, _0;
+ zval collection;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(collection)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &collection_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+
+
+ ZEPHIR_CALL_FUNCTION(&_0, "array_unique", NULL, 256, &collection);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(zephir_fast_count_int(&collection) == zephir_fast_count_int(&_0));
}
-// 1767 "parser.php.c"
- break;
- case 30:
-// 298 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, last)
{
- phvolt_ret_if_statement(&vvgotominor.vv186, &vvmsp[-7].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(1,&vvmsp[-9].minor);
- vv_destructor(31,&vvmsp[-8].minor);
- vv_destructor(32,&vvmsp[-6].minor);
- vv_destructor(1,&vvmsp[-5].minor);
- vv_destructor(34,&vvmsp[-4].minor);
- vv_destructor(32,&vvmsp[-3].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(33,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_0 = NULL;
+ 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);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &collection_param, &method);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!method) {
+ method = &method_sub;
+ method = &__$null;
+ }
+
+
+ ZEPHIR_CALL_SELF(&filtered, "filter", &_0, 251, &collection, method);
+ zephir_check_call_status();
+ ZEPHIR_MAKE_REF(&filtered);
+ ZEPHIR_RETURN_CALL_FUNCTION("end", NULL, 257, &filtered);
+ ZEPHIR_UNREF(&filtered);
+ zephir_check_call_status();
+ RETURN_MM();
}
-// 1783 "parser.php.c"
- break;
- case 31:
-// 302 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, lastKey)
{
- phvolt_ret_elseif_statement(&vvgotominor.vv186, &vvmsp[-1].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-3].minor);
- vv_destructor(35,&vvmsp[-2].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_0 = NULL;
+ 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);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &collection_param, &method);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!method) {
+ method = &method_sub;
+ method = &__$null;
+ }
+
+
+ ZEPHIR_CALL_SELF(&filtered, "filter", &_0, 251, &collection, method);
+ zephir_check_call_status();
+ ZEPHIR_MAKE_REF(&filtered);
+ ZEPHIR_CALL_FUNCTION(NULL, "end", NULL, 257, &filtered);
+ ZEPHIR_UNREF(&filtered);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_FUNCTION("key", NULL, 253, &filtered);
+ zephir_check_call_status();
+ RETURN_MM();
}
-// 1793 "parser.php.c"
- break;
- case 32:
-// 306 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, order)
{
- phvolt_ret_elsefor_statement(&vvgotominor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(36,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval order;
+ zval *collection_param = NULL, *attribute, attribute_sub, *order_param = NULL, item, key, *_0, _1;
+ zval collection, sorted;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&sorted);
+ ZVAL_UNDEF(&attribute_sub);
+ ZVAL_UNDEF(&item);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&order);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(attribute)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(order)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 1, &collection_param, &attribute, &order_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!order_param) {
+ ZEPHIR_INIT_VAR(&order);
+ ZVAL_STRING(&order, "asc");
+ } else {
+ zephir_get_strval(&order, order_param);
+ }
+
+
+ ZEPHIR_INIT_VAR(&sorted);
+ array_init(&sorted);
+ zephir_is_iterable(&collection, 0, "phalcon/Helper/Arr.zep", 297);
+ if (Z_TYPE_P(&collection) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&collection), _0)
+ {
+ ZEPHIR_INIT_NVAR(&item);
+ ZVAL_COPY(&item, _0);
+ if (Z_TYPE_P(&item) == IS_OBJECT) {
+ ZEPHIR_OBS_NVAR(&key);
+ zephir_read_property_zval(&key, &item, attribute, PH_NOISY_CC);
+ } else {
+ ZEPHIR_OBS_NVAR(&key);
+ zephir_array_fetch(&key, &item, attribute, PH_NOISY, "phalcon/Helper/Arr.zep", 291);
+ }
+ zephir_array_update_zval(&sorted, &key, &item, PH_COPY | PH_SEPARATE);
+ } 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();
+ if (Z_TYPE_P(&item) == IS_OBJECT) {
+ ZEPHIR_OBS_NVAR(&key);
+ zephir_read_property_zval(&key, &item, attribute, PH_NOISY_CC);
+ } else {
+ ZEPHIR_OBS_NVAR(&key);
+ zephir_array_fetch(&key, &item, attribute, PH_NOISY, "phalcon/Helper/Arr.zep", 291);
+ }
+ zephir_array_update_zval(&sorted, &key, &item, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &collection, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&item);
+ if (ZEPHIR_IS_STRING_IDENTICAL(&order, "asc")) {
+ ZEPHIR_MAKE_REF(&sorted);
+ ZEPHIR_CALL_FUNCTION(NULL, "ksort", NULL, 258, &sorted);
+ ZEPHIR_UNREF(&sorted);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_MAKE_REF(&sorted);
+ ZEPHIR_CALL_FUNCTION(NULL, "krsort", NULL, 259, &sorted);
+ ZEPHIR_UNREF(&sorted);
+ zephir_check_call_status();
+ }
+ ZEPHIR_RETURN_CALL_FUNCTION("array_values", NULL, 12, &sorted);
+ zephir_check_call_status();
+ RETURN_MM();
}
-// 1803 "parser.php.c"
- break;
- case 33:
-// 310 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, pluck)
{
- phvolt_ret_for_statement(&vvgotominor.vv186, vvmsp[-7].minor.vv0, NULL, &vvmsp[-5].minor.vv186, NULL, &vvmsp[-3].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-9].minor);
- vv_destructor(37,&vvmsp[-8].minor);
- vv_destructor(8,&vvmsp[-6].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(39,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ 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 element;
+ zval *collection_param = NULL, *element_param = NULL, item, *_0, _1, _4$$4, _5$$5, _8$$7, _9$$8;
+ zval collection, filtered;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&filtered);
+ ZVAL_UNDEF(&item);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_8$$7);
+ ZVAL_UNDEF(&_9$$8);
+ ZVAL_UNDEF(&element);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_STR(element)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &collection_param, &element_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ zephir_get_strval(&element, element_param);
+
+
+ ZEPHIR_INIT_VAR(&filtered);
+ array_init(&filtered);
+ zephir_is_iterable(&collection, 0, "phalcon/Helper/Arr.zep", 329);
+ if (Z_TYPE_P(&collection) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&collection), _0)
+ {
+ 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);
+ }
+ _3$$3 = Z_TYPE_P(&item) == IS_ARRAY;
+ if (_3$$3) {
+ _3$$3 = zephir_array_isset(&item, &element);
+ }
+ 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/Helper/Arr.zep", 323);
+ } else if (_3$$3) {
+ zephir_array_fetch(&_5$$5, &item, &element, PH_NOISY | PH_READONLY, "phalcon/Helper/Arr.zep", 325);
+ zephir_array_append(&filtered, &_5$$5, PH_SEPARATE, "phalcon/Helper/Arr.zep", 325);
+ }
+ } 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();
+ _6$$6 = Z_TYPE_P(&item) == IS_OBJECT;
+ if (_6$$6) {
+ _6$$6 = zephir_isset_property_zval(&item, &element);
+ }
+ _7$$6 = Z_TYPE_P(&item) == IS_ARRAY;
+ if (_7$$6) {
+ _7$$6 = zephir_array_isset(&item, &element);
+ }
+ 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/Helper/Arr.zep", 323);
+ } else if (_7$$6) {
+ zephir_array_fetch(&_9$$8, &item, &element, PH_NOISY | PH_READONLY, "phalcon/Helper/Arr.zep", 325);
+ zephir_array_append(&filtered, &_9$$8, PH_SEPARATE, "phalcon/Helper/Arr.zep", 325);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &collection, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&item);
+ RETURN_CTOR(&filtered);
}
-// 1817 "parser.php.c"
- break;
- case 34:
-// 314 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, set)
{
- phvolt_ret_for_statement(&vvgotominor.vv186, vvmsp[-9].minor.vv0, NULL, &vvmsp[-7].minor.vv186, &vvmsp[-5].minor.vv186, &vvmsp[-3].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-11].minor);
- vv_destructor(37,&vvmsp[-10].minor);
- vv_destructor(8,&vvmsp[-8].minor);
- vv_destructor(31,&vvmsp[-6].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(39,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *collection_param = NULL, *value, value_sub, *index = NULL, index_sub, __$null;
+ zval collection;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_NULL(&__$null);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 1, &collection_param, &value, &index);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!index) {
+ index = &index_sub;
+ index = &__$null;
+ }
+
+
+ if (Z_TYPE_P(index) == IS_NULL) {
+ zephir_array_append(&collection, value, PH_SEPARATE, "phalcon/Helper/Arr.zep", 347);
+ } else {
+ zephir_array_update_zval(&collection, index, value, PH_COPY | PH_SEPARATE);
+ }
+ RETURN_CTOR(&collection);
}
-// 1832 "parser.php.c"
- break;
- case 35:
-// 318 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, sliceLeft)
{
- phvolt_ret_for_statement(&vvgotominor.vv186, vvmsp[-7].minor.vv0, vvmsp[-9].minor.vv0, &vvmsp[-5].minor.vv186, NULL, &vvmsp[-3].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-11].minor);
- vv_destructor(37,&vvmsp[-10].minor);
- vv_destructor(2,&vvmsp[-8].minor);
- vv_destructor(8,&vvmsp[-6].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(39,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ 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 *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(elements)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &collection_param, &elements_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!elements_param) {
+ elements = 1;
+ } else {
+ elements = zephir_get_intval(elements_param);
+ }
+
+
+ ZVAL_LONG(&_0, 0);
+ ZVAL_LONG(&_1, elements);
+ ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 260, &collection, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
-// 1847 "parser.php.c"
- break;
- case 36:
-// 322 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, sliceRight)
{
- phvolt_ret_for_statement(&vvgotominor.vv186, vvmsp[-9].minor.vv0, vvmsp[-11].minor.vv0, &vvmsp[-7].minor.vv186, &vvmsp[-5].minor.vv186, &vvmsp[-3].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-13].minor);
- vv_destructor(37,&vvmsp[-12].minor);
- vv_destructor(2,&vvmsp[-10].minor);
- vv_destructor(8,&vvmsp[-8].minor);
- vv_destructor(31,&vvmsp[-6].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(39,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long elements, ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *elements_param = NULL, _0;
+ zval collection;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(elements)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &collection_param, &elements_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!elements_param) {
+ elements = 1;
+ } else {
+ elements = zephir_get_intval(elements_param);
+ }
+
+
+ ZVAL_LONG(&_0, elements);
+ ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 260, &collection, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-// 1863 "parser.php.c"
- break;
- case 37:
-// 327 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, split)
{
- phvolt_ret_switch_statement(&vvgotominor.vv186, &vvmsp[-5].minor.vv186, &vvmsp[-3].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-7].minor);
- vv_destructor(40,&vvmsp[-6].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(41,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, _0, _1;
+ zval collection;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(collection)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &collection_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+
+
+ zephir_create_array(return_value, 2, 0);
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_array_keys(&_0, &collection);
+ zephir_array_fast_append(return_value, &_0);
+ ZEPHIR_CALL_FUNCTION(&_1, "array_values", NULL, 12, &collection);
+ zephir_check_call_status();
+ zephir_array_fast_append(return_value, &_1);
+ RETURN_MM();
}
-// 1876 "parser.php.c"
- break;
- case 38:
-// 332 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, toObject)
{
- phvolt_ret_switch_statement(&vvgotominor.vv186, &vvmsp[-4].minor.vv186, NULL, status->scanner_state);
- vv_destructor(1,&vvmsp[-6].minor);
- vv_destructor(40,&vvmsp[-5].minor);
- vv_destructor(32,&vvmsp[-3].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(41,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *collection_param = NULL;
+ zval collection;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(collection)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &collection_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+
+
+ zephir_convert_to_object(&collection);
+ RETURN_CTOR(&collection);
}
-// 1889 "parser.php.c"
- break;
- case 39:
-// 337 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, validateAll)
{
- phvolt_ret_case_clause(&vvgotominor.vv186, &vvmsp[-1].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-3].minor);
- vv_destructor(42,&vvmsp[-2].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_1 = NULL;
+ zval *collection_param = NULL, *method = NULL, method_sub, __$null, _0;
+ zval collection;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &collection_param, &method);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!method) {
+ method = &method_sub;
+ method = &__$null;
+ }
+
+
+ ZEPHIR_CALL_SELF(&_0, "filter", &_1, 251, &collection, method);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(zephir_fast_count_int(&_0) == zephir_fast_count_int(&collection));
}
-// 1899 "parser.php.c"
- break;
- case 40:
-// 342 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, validateAny)
{
- phvolt_ret_case_clause(&vvgotominor.vv186, NULL, status->scanner_state);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(43,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_1 = NULL;
+ zval *collection_param = NULL, *method = NULL, method_sub, __$null, _0;
+ zval collection;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &collection_param, &method);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!method) {
+ method = &method_sub;
+ method = &__$null;
+ }
+
+
+ ZEPHIR_CALL_SELF(&_0, "filter", &_1, 251, &collection, method);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(zephir_fast_count_int(&_0) > 0);
}
-// 1909 "parser.php.c"
- break;
- case 41:
-// 346 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Arr, whiteList)
{
- phvolt_ret_set_statement(&vvgotominor.vv186, &vvmsp[-1].minor.vv186);
- vv_destructor(1,&vvmsp[-3].minor);
- vv_destructor(44,&vvmsp[-2].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *whiteList_param = NULL, _0, _1, _2;
+ zval collection, whiteList;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&whiteList);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ARRAY(whiteList)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &collection_param, &whiteList_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&whiteList, whiteList_param);
+
+
+ ZEPHIR_INIT_VAR(&_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ zephir_create_closure_ex(&_0, NULL, phalcon_7__closure_ce, SL("__invoke"));
+ ZEPHIR_CALL_FUNCTION(&_1, "array_filter", NULL, 248, &whiteList, &_0);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&whiteList, &_1);
+ ZEPHIR_CALL_FUNCTION(&_2, "array_flip", NULL, 174, &whiteList);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_FUNCTION("array_intersect_key", NULL, 2, &collection, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
}
-// 1919 "parser.php.c"
- break;
- case 42:
- case 54:
- case 140:
- case 147:
-// 350 "parser.php.lemon"
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Helper_Base64)
{
- phvolt_ret_zval_list(&vvgotominor.vv186, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186);
- vv_destructor(2,&vvmsp[-1].minor);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Helper, Base64, phalcon, helper_base64, phalcon_helper_base64_method_entry, 0);
+
+ return SUCCESS;
}
-// 1930 "parser.php.c"
- break;
- case 44:
-// 358 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Base64, encodeUrl)
{
- phvolt_ret_set_assignment(&vvgotominor.vv186, &vvmsp[-2].minor.vv186, PHVOLT_T_ASSIGN, &vvmsp[0].minor.vv186, status->scanner_state);
- vv_destructor(45,&vvmsp[-1].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *input_param = NULL, _0, _1, _2, _3, _4;
+ zval input;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&input);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(input)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &input_param);
+ if (UNEXPECTED(Z_TYPE_P(input_param) != IS_STRING && Z_TYPE_P(input_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'input' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(input_param) == IS_STRING)) {
+ zephir_get_strval(&input, input_param);
+ } else {
+ ZEPHIR_INIT_VAR(&input);
+ }
+
+
+ ZEPHIR_CALL_FUNCTION(&_0, "base64_encode", NULL, 191, &input);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "+/");
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "-_");
+ ZEPHIR_CALL_FUNCTION(&_3, "strtr", NULL, 5, &_0, &_1, &_2);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "=");
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "");
+ ZEPHIR_INIT_VAR(&_4);
+ zephir_fast_str_replace(&_4, &_1, &_2, &_3);
+ RETURN_CCTOR(&_4);
}
-// 1938 "parser.php.c"
- break;
- case 45:
-// 362 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Base64, decodeUrl)
{
- phvolt_ret_set_assignment(&vvgotominor.vv186, &vvmsp[-2].minor.vv186, PHVOLT_T_ADD_ASSIGN, &vvmsp[0].minor.vv186, status->scanner_state);
- vv_destructor(46,&vvmsp[-1].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS, remainder = 0;
+ zval *input_param = NULL, data, _3, _4, _5, _0$$3, _1$$3, _2$$3;
+ zval input;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&input);
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(input)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &input_param);
+ if (UNEXPECTED(Z_TYPE_P(input_param) != IS_STRING && Z_TYPE_P(input_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'input' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(input_param) == IS_STRING)) {
+ zephir_get_strval(&input, input_param);
+ } else {
+ ZEPHIR_INIT_VAR(&input);
+ }
+
+
+ remainder = (long) (zephir_safe_mod_long_long(zephir_fast_strlen_ev(&input), 4));
+ if (remainder) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZVAL_STRING(&_0$$3, "=");
+ ZVAL_LONG(&_1$$3, (4 - remainder));
+ ZEPHIR_CALL_FUNCTION(&_2$$3, "str_repeat", NULL, 1, &_0$$3, &_1$$3);
+ zephir_check_call_status();
+ zephir_concat_self(&input, &_2$$3);
+ }
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "-_");
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_STRING(&_4, "+/");
+ ZEPHIR_CALL_FUNCTION(&_5, "strtr", NULL, 5, &input, &_3, &_4);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&data, "base64_decode", NULL, 188, &_5);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&data)) {
+ ZEPHIR_INIT_NVAR(&data);
+ ZVAL_STRING(&data, "");
+ }
+ RETURN_CCTOR(&data);
}
-// 1946 "parser.php.c"
- break;
- case 46:
-// 366 "parser.php.lemon"
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Helper_Exception)
{
- phvolt_ret_set_assignment(&vvgotominor.vv186, &vvmsp[-2].minor.vv186, PHVOLT_T_SUB_ASSIGN, &vvmsp[0].minor.vv186, status->scanner_state);
- vv_destructor(47,&vvmsp[-1].minor);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Helper, Exception, phalcon, helper_exception, phalcon_exception_ce, NULL, 0);
+
+ return SUCCESS;
}
-// 1954 "parser.php.c"
- break;
- case 47:
-// 370 "parser.php.lemon"
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Helper_Fs)
{
- phvolt_ret_set_assignment(&vvgotominor.vv186, &vvmsp[-2].minor.vv186, PHVOLT_T_MUL_ASSIGN, &vvmsp[0].minor.vv186, status->scanner_state);
- vv_destructor(48,&vvmsp[-1].minor);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Helper, Fs, phalcon, helper_fs, phalcon_helper_fs_method_entry, 0);
+
+ return SUCCESS;
}
-// 1962 "parser.php.c"
- break;
- case 48:
-// 374 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Fs, basename)
{
- phvolt_ret_set_assignment(&vvgotominor.vv186, &vvmsp[-2].minor.vv186, PHVOLT_T_DIV_ASSIGN, &vvmsp[0].minor.vv186, status->scanner_state);
- vv_destructor(49,&vvmsp[-1].minor);
+ 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 *this_ptr = getThis();
+
+ 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$$3);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_9$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(uri)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(suffix)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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, 261, &_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_OBS_VAR(&filename);
+ zephir_array_fetch_long(&filename, &matches, 0, PH_NOISY, "phalcon/Helper/Fs.zep", 37);
+ } 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, 261, 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, 50, &_8$$3, &_6$$3, &filename);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&filename, &_9$$3);
+ }
+ RETURN_CCTOR(&filename);
}
-// 1970 "parser.php.c"
- break;
- case 49:
- case 73:
- case 139:
- case 151:
-// 378 "parser.php.lemon"
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Helper_Json)
{
- phvolt_ret_literal_zval(&vvgotominor.vv186, PHVOLT_T_IDENTIFIER, vvmsp[0].minor.vv0, status->scanner_state);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Helper, Json, phalcon, helper_json, phalcon_helper_json_method_entry, 0);
+
+ return SUCCESS;
}
-// 1980 "parser.php.c"
- break;
- case 50:
- case 133:
-// 382 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Json, decode)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_ARRAYACCESS, &vvmsp[-3].minor.vv186, &vvmsp[-1].minor.vv186, NULL, status->scanner_state);
- vv_destructor(24,&vvmsp[-2].minor);
- vv_destructor(50,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long depth, options, ZEPHIR_LAST_CALL_STATUS;
+ zend_bool associative;
+ zval *data_param = NULL, *associative_param = NULL, *depth_param = NULL, *options_param = NULL, decoded, _0, _1, _2, _3, _4$$3, _5$$3, _6$$3;
+ zval data;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&decoded);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STR(data)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(associative)
+ Z_PARAM_LONG(depth)
+ Z_PARAM_LONG(options)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 3, &data_param, &associative_param, &depth_param, &options_param);
+ if (UNEXPECTED(Z_TYPE_P(data_param) != IS_STRING && Z_TYPE_P(data_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'data' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(data_param) == IS_STRING)) {
+ zephir_get_strval(&data, data_param);
+ } else {
+ ZEPHIR_INIT_VAR(&data);
+ }
+ if (!associative_param) {
+ associative = 0;
+ } else {
+ associative = zephir_get_boolval(associative_param);
+ }
+ if (!depth_param) {
+ depth = 512;
+ } else {
+ depth = zephir_get_intval(depth_param);
+ }
+ if (!options_param) {
+ options = 0;
+ } else {
+ options = zephir_get_intval(options_param);
+ }
+
+
+ ZVAL_BOOL(&_0, (associative ? 1 : 0));
+ ZVAL_LONG(&_1, depth);
+ ZVAL_LONG(&_2, options);
+ ZEPHIR_INIT_VAR(&decoded);
+ zephir_json_decode(&decoded, &data, zephir_get_intval(&_0) );
+ ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 262);
+ zephir_check_call_status();
+ if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_3, 0))) {
+ ZEPHIR_INIT_VAR(&_4$$3);
+ object_init_ex(&_4$$3, spl_ce_InvalidArgumentException);
+ ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 263);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_6$$3);
+ ZEPHIR_CONCAT_SV(&_6$$3, "json_decode error: ", &_5$$3);
+ ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 40, &_6$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_4$$3, "phalcon/Helper/Json.zep", 60);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ RETURN_CCTOR(&decoded);
}
-// 1990 "parser.php.c"
- break;
- case 51:
- case 122:
-// 386 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Json, encode)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_DOT, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(30,&vvmsp[-1].minor);
+ 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, encoded, _0, _1, _2, _3$$3, _4$$3, _5$$3;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&encoded);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &data, &options_param, &depth_param);
+ if (!options_param) {
+ options = 0;
+ } else {
+ options = zephir_get_intval(options_param);
+ }
+ if (!depth_param) {
+ depth = 512;
+ } else {
+ depth = zephir_get_intval(depth_param);
+ }
+
+
+ ZVAL_LONG(&_0, options);
+ ZVAL_LONG(&_1, depth);
+ ZEPHIR_INIT_VAR(&encoded);
+ zephir_json_encode(&encoded, data, zephir_get_intval(&_0) );
+ ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 262);
+ zephir_check_call_status();
+ if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_2, 0))) {
+ ZEPHIR_INIT_VAR(&_3$$3);
+ object_init_ex(&_3$$3, spl_ce_InvalidArgumentException);
+ ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 263);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_5$$3);
+ ZEPHIR_CONCAT_SV(&_5$$3, "json_encode error: ", &_4$$3);
+ ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 40, &_5$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_3$$3, "phalcon/Helper/Json.zep", 104);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ RETURN_CCTOR(&encoded);
}
-// 1999 "parser.php.c"
- break;
- case 52:
-// 390 "parser.php.lemon"
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Helper_Number)
{
- phvolt_ret_macro_statement(&vvgotominor.vv186, vvmsp[-7].minor.vv0, NULL, &vvmsp[-3].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-9].minor);
- vv_destructor(51,&vvmsp[-8].minor);
- vv_destructor(29,&vvmsp[-6].minor);
- vv_destructor(52,&vvmsp[-5].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(53,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Helper, Number, phalcon, helper_number, phalcon_helper_number_method_entry, 0);
+
+ return SUCCESS;
}
-// 2014 "parser.php.c"
- break;
- case 53:
-// 394 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Number, between)
{
- phvolt_ret_macro_statement(&vvgotominor.vv186, vvmsp[-8].minor.vv0, &vvmsp[-6].minor.vv186, &vvmsp[-3].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-10].minor);
- vv_destructor(51,&vvmsp[-9].minor);
- vv_destructor(29,&vvmsp[-7].minor);
- vv_destructor(52,&vvmsp[-5].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(53,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zend_bool _0;
+ zval *value_param = NULL, *from_param = NULL, *to_param = NULL;
+ zend_long value, from, to;
+ zval *this_ptr = getThis();
+
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_LONG(value)
+ Z_PARAM_LONG(from)
+ Z_PARAM_LONG(to)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(3, 0, &value_param, &from_param, &to_param);
+ value = zephir_get_intval(value_param);
+ from = zephir_get_intval(from_param);
+ to = zephir_get_intval(to_param);
+
+
+ _0 = value >= from;
+ if (_0) {
+ _0 = value <= to;
+ }
+ RETURN_BOOL(_0);
}
-// 2029 "parser.php.c"
- break;
- case 56:
-// 406 "parser.php.lemon"
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Helper_Str)
{
- phvolt_ret_macro_parameter(&vvgotominor.vv186, vvmsp[0].minor.vv0, NULL, status->scanner_state);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Helper, Str, phalcon, helper_str, phalcon_helper_str_method_entry, 0);
+
+ zephir_declare_class_constant_long(phalcon_helper_str_ce, SL("RANDOM_ALNUM"), 0);
+
+ zephir_declare_class_constant_long(phalcon_helper_str_ce, SL("RANDOM_ALPHA"), 1);
+
+ zephir_declare_class_constant_long(phalcon_helper_str_ce, SL("RANDOM_DISTINCT"), 5);
+
+ zephir_declare_class_constant_long(phalcon_helper_str_ce, SL("RANDOM_HEXDEC"), 2);
+
+ zephir_declare_class_constant_long(phalcon_helper_str_ce, SL("RANDOM_NOZERO"), 4);
+
+ zephir_declare_class_constant_long(phalcon_helper_str_ce, SL("RANDOM_NUMERIC"), 3);
+
+ return SUCCESS;
}
-// 2036 "parser.php.c"
- break;
- case 57:
-// 410 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, camelize)
{
- phvolt_ret_macro_parameter(&vvgotominor.vv186, vvmsp[-2].minor.vv0, &vvmsp[0].minor.vv186, status->scanner_state);
- vv_destructor(45,&vvmsp[-1].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *text_param = NULL, *delimiter = NULL, delimiter_sub, __$null, _0;
+ zval text;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&delimiter_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(delimiter)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &text_param, &delimiter);
+ 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 (!delimiter) {
+ delimiter = &delimiter_sub;
+ delimiter = &__$null;
+ }
+
+
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_camelize(&_0, &text, delimiter );
+ RETURN_CCTOR(&_0);
}
-// 2044 "parser.php.c"
- break;
- case 58:
- case 72:
- case 138:
- case 152:
-// 414 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, concat)
{
- phvolt_ret_literal_zval(&vvgotominor.vv186, PHVOLT_T_INTEGER, vvmsp[0].minor.vv0, status->scanner_state);
+ zval argument, arguments, data, first, last, prefix, delimiter, suffix, _1, _5, *_7, _8, _11, _9$$6, _10$$7;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_0 = NULL, *_2 = NULL, *_3 = NULL, *_4 = NULL, *_6 = NULL;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&argument);
+ ZVAL_UNDEF(&arguments);
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&first);
+ ZVAL_UNDEF(&last);
+ ZVAL_UNDEF(&prefix);
+ ZVAL_UNDEF(&delimiter);
+ ZVAL_UNDEF(&suffix);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&_9$$6);
+ ZVAL_UNDEF(&_10$$7);
+
+
+ ZEPHIR_MM_GROW();
+
+ ZEPHIR_INIT_VAR(&arguments);
+ zephir_get_args(&arguments);
+ if (UNEXPECTED(zephir_fast_count_int(&arguments) < 3)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_helper_exception_ce, "concat needs at least three parameters", "phalcon/Helper/Str.zep", 78);
+ return;
+ }
+ ZEPHIR_CALL_CE_STATIC(&delimiter, phalcon_helper_arr_ce, "first", &_0, 264, &arguments);
+ zephir_check_call_status();
+ ZEPHIR_CALL_CE_STATIC(&_1, phalcon_helper_arr_ce, "sliceright", &_2, 265, &arguments);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&arguments, &_1);
+ ZEPHIR_CALL_CE_STATIC(&first, phalcon_helper_arr_ce, "first", &_0, 264, &arguments);
+ zephir_check_call_status();
+ ZEPHIR_CALL_CE_STATIC(&last, phalcon_helper_arr_ce, "last", &_3, 266, &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);
+ ZEPHIR_CALL_SELF(&_1, "startswith", &_4, 17, &first, &delimiter);
+ zephir_check_call_status();
+ if (zephir_is_true(&_1)) {
+ ZEPHIR_CPY_WRT(&prefix, &delimiter);
+ }
+ ZEPHIR_CALL_SELF(&_5, "endswith", &_6, 267, &last, &delimiter);
+ zephir_check_call_status();
+ if (zephir_is_true(&_5)) {
+ ZEPHIR_CPY_WRT(&suffix, &delimiter);
+ }
+ zephir_is_iterable(&arguments, 0, "phalcon/Helper/Str.zep", 102);
+ if (Z_TYPE_P(&arguments) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&arguments), _7)
+ {
+ ZEPHIR_INIT_NVAR(&argument);
+ ZVAL_COPY(&argument, _7);
+ ZEPHIR_INIT_NVAR(&_9$$6);
+ zephir_fast_trim(&_9$$6, &argument, &delimiter, ZEPHIR_TRIM_BOTH);
+ zephir_array_append(&data, &_9$$6, PH_SEPARATE, "phalcon/Helper/Str.zep", 99);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &arguments, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_8, &arguments, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_8)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&argument, &arguments, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_10$$7);
+ zephir_fast_trim(&_10$$7, &argument, &delimiter, ZEPHIR_TRIM_BOTH);
+ zephir_array_append(&data, &_10$$7, PH_SEPARATE, "phalcon/Helper/Str.zep", 99);
+ ZEPHIR_CALL_METHOD(NULL, &arguments, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&argument);
+ ZEPHIR_INIT_VAR(&_11);
+ zephir_fast_join(&_11, &delimiter, &data);
+ ZEPHIR_CONCAT_VVV(return_value, &prefix, &_11, &suffix);
+ RETURN_MM();
}
-// 2054 "parser.php.c"
- break;
- case 59:
- case 153:
-// 418 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, countVowels)
{
- phvolt_ret_literal_zval(&vvgotominor.vv186, PHVOLT_T_STRING, vvmsp[0].minor.vv0, status->scanner_state);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *text_param = NULL, matches, _0, _1, _2, _3;
+ zval text;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&matches);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(text)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &text_param);
+ 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);
+ }
+
+
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "/[aeiou]/i");
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "/[aeiou]/i");
+ zephir_preg_match(&_1, &_2, &text, &matches, 1, 0 , 0 );
+ zephir_array_fetch_long(&_3, &matches, 0, PH_NOISY | PH_READONLY, "phalcon/Helper/Str.zep", 119);
+ RETURN_MM_LONG(zephir_fast_count_int(&_3));
}
-// 2062 "parser.php.c"
- break;
- case 60:
- case 154:
-// 422 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, decapitalize)
{
- phvolt_ret_literal_zval(&vvgotominor.vv186, PHVOLT_T_DOUBLE, vvmsp[0].minor.vv0, status->scanner_state);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool upperRest;
+ zval *text_param = NULL, *upperRest_param = NULL, *encoding_param = NULL, substr, suffix, _0$$3, _1$$4, _2$$9, _3$$9, _4$$9, _5$$9, _6$$10, _7$$10, _8$$10, _9$$10;
+ zval text, encoding;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&encoding);
+ ZVAL_UNDEF(&substr);
+ ZVAL_UNDEF(&suffix);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$9);
+ ZVAL_UNDEF(&_3$$9);
+ ZVAL_UNDEF(&_4$$9);
+ ZVAL_UNDEF(&_5$$9);
+ ZVAL_UNDEF(&_6$$10);
+ ZVAL_UNDEF(&_7$$10);
+ ZVAL_UNDEF(&_8$$10);
+ ZVAL_UNDEF(&_9$$10);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(upperRest)
+ Z_PARAM_STR(encoding)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &text_param, &upperRest_param, &encoding_param);
+ 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 (!upperRest_param) {
+ upperRest = 0;
+ } else {
+ upperRest = zephir_get_boolval(upperRest_param);
+ }
+ if (!encoding_param) {
+ ZEPHIR_INIT_VAR(&encoding);
+ ZVAL_STRING(&encoding, "UTF-8");
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(encoding_param) != IS_STRING && Z_TYPE_P(encoding_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'encoding' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(encoding_param) == IS_STRING)) {
+ zephir_get_strval(&encoding, encoding_param);
+ } else {
+ ZEPHIR_INIT_VAR(&encoding);
+ }
+ }
+
+
+ if ((zephir_function_exists_ex(ZEND_STRL("mb_substr")) == SUCCESS)) {
+ ZVAL_LONG(&_0$$3, 1);
+ ZEPHIR_CALL_FUNCTION(&substr, "mb_substr", NULL, 184, &text, &_0$$3);
+ zephir_check_call_status();
+ } else {
+ ZVAL_LONG(&_1$$4, 1);
+ ZEPHIR_INIT_NVAR(&substr);
+ zephir_substr(&substr, &text, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
+ }
+ if (upperRest) {
+ if ((zephir_function_exists_ex(ZEND_STRL("mb_strtoupper")) == SUCCESS)) {
+ ZEPHIR_CALL_FUNCTION(&suffix, "mb_strtoupper", NULL, 268, &substr, &encoding);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CALL_METHOD(&suffix, &substr, "upper", NULL, 0);
+ zephir_check_call_status();
+ }
+ } else {
+ ZEPHIR_CPY_WRT(&suffix, &substr);
+ }
+ if ((zephir_function_exists_ex(ZEND_STRL("mb_strtolower")) == SUCCESS)) {
+ ZVAL_LONG(&_2$$9, 0);
+ ZVAL_LONG(&_3$$9, 1);
+ ZEPHIR_CALL_FUNCTION(&_4$$9, "mb_substr", NULL, 184, &text, &_2$$9, &_3$$9);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&_5$$9, "mb_strtolower", NULL, 25, &_4$$9, &encoding);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VV(return_value, &_5$$9, &suffix);
+ RETURN_MM();
+ } else {
+ ZEPHIR_INIT_VAR(&_6$$10);
+ ZVAL_LONG(&_7$$10, 0);
+ ZVAL_LONG(&_8$$10, 1);
+ ZEPHIR_INIT_VAR(&_9$$10);
+ zephir_substr(&_9$$10, &text, 0 , 1 , 0);
+ zephir_fast_strtolower(&_6$$10, &_9$$10);
+ ZEPHIR_CONCAT_VV(return_value, &_6$$10, &suffix);
+ RETURN_MM();
+ }
}
-// 2070 "parser.php.c"
- break;
- case 61:
- case 155:
-// 426 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, decrement)
{
- phvolt_ret_literal_zval(&vvgotominor.vv186, PHVOLT_T_NULL, NULL, status->scanner_state);
- vv_destructor(57,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *text_param = NULL, *separator_param = NULL, parts, number, _1, _0$$4;
+ zval text, separator;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&separator);
+ ZVAL_UNDEF(&parts);
+ ZVAL_UNDEF(&number);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_0$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(separator)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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);
+ }
+
+
+ ZEPHIR_INIT_VAR(&parts);
+ zephir_fast_explode(&parts, &separator, &text, LONG_MAX);
+ ZEPHIR_OBS_VAR(&number);
+ if (zephir_array_isset_long_fetch(&number, &parts, 1, 0)) {
+ ZEPHIR_SEPARATE(&number);
+ zephir_decrement(&number);
+ if (ZEPHIR_LE_LONG(&number, 0)) {
+ zephir_array_fetch_long(&_0$$4, &parts, 0, PH_NOISY | PH_READONLY, "phalcon/Helper/Str.zep", 189);
+ RETURN_CTOR(&_0$$4);
+ }
+ }
+ zephir_array_fetch_long(&_1, &parts, 0, PH_NOISY | PH_READONLY, "phalcon/Helper/Str.zep", 193);
+ ZEPHIR_CONCAT_VVV(return_value, &_1, &separator, &number);
+ RETURN_MM();
}
-// 2079 "parser.php.c"
- break;
- case 62:
- case 156:
-// 430 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, dirFromFile)
{
- phvolt_ret_literal_zval(&vvgotominor.vv186, PHVOLT_T_FALSE, NULL, status->scanner_state);
- vv_destructor(58,&vvmsp[0].minor);
+ 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 *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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(file)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(file_param) == IS_STRING)) {
+ zephir_get_strval(&file, file_param);
+ } else {
+ ZEPHIR_INIT_VAR(&file);
+ }
+
+
+ ZVAL_LONG(&_0, 8);
+ ZEPHIR_CALL_FUNCTION(&name, "pathinfo", NULL, 109, &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 (!(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_INIT_VAR(&_7);
+ ZVAL_LONG(&_8, 2);
+ ZEPHIR_CALL_FUNCTION(&_9, "str_split", NULL, 108, &start, &_8);
+ zephir_check_call_status();
+ zephir_fast_join_str(&_7, SL("/"), &_9);
+ ZEPHIR_CONCAT_VS(return_value, &_7, "/");
+ RETURN_MM();
}
-// 2088 "parser.php.c"
- break;
- case 63:
- case 157:
-// 434 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, dirSeparator)
{
- phvolt_ret_literal_zval(&vvgotominor.vv186, PHVOLT_T_TRUE, NULL, status->scanner_state);
- vv_destructor(59,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *directory_param = NULL, _0, _1;
+ zval directory;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&directory);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(directory)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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);
+ } else {
+ ZEPHIR_INIT_VAR(&directory);
+ }
+
+
+ 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();
}
-// 2097 "parser.php.c"
- break;
- case 64:
-// 438 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, dynamic)
{
- phvolt_ret_macro_call_statement(&vvgotominor.vv186, &vvmsp[-8].minor.vv186, &vvmsp[-6].minor.vv186, &vvmsp[-3].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-10].minor);
- vv_destructor(60,&vvmsp[-9].minor);
- vv_destructor(29,&vvmsp[-7].minor);
- vv_destructor(52,&vvmsp[-5].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(61,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ 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 *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 *this_ptr = getThis();
+
+ 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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(leftDelimiter)
+ Z_PARAM_STR(rightDelimiter)
+ Z_PARAM_STR(separator)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 3, &text_param, &leftDelimiter_param, &rightDelimiter_param, &separator_param);
+ 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 (!leftDelimiter_param) {
+ ZEPHIR_INIT_VAR(&leftDelimiter);
+ ZVAL_STRING(&leftDelimiter, "{");
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(leftDelimiter_param) != IS_STRING && Z_TYPE_P(leftDelimiter_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'leftDelimiter' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(leftDelimiter_param) == IS_STRING)) {
+ zephir_get_strval(&leftDelimiter, leftDelimiter_param);
+ } else {
+ ZEPHIR_INIT_VAR(&leftDelimiter);
+ }
+ }
+ if (!rightDelimiter_param) {
+ ZEPHIR_INIT_VAR(&rightDelimiter);
+ ZVAL_STRING(&rightDelimiter, "}");
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(rightDelimiter_param) != IS_STRING && Z_TYPE_P(rightDelimiter_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'rightDelimiter' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(rightDelimiter_param) == IS_STRING)) {
+ zephir_get_strval(&rightDelimiter, rightDelimiter_param);
+ } else {
+ ZEPHIR_INIT_VAR(&rightDelimiter);
+ }
+ }
+ 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);
+ }
+ }
+
+
+ ZEPHIR_CALL_FUNCTION(&_0, "substr_count", NULL, 269, &text, &leftDelimiter);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&_1, "substr_count", NULL, 269, &text, &rightDelimiter);
+ zephir_check_call_status();
+ 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, 270, &_3$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_2$$3, "phalcon/Helper/Str.zep", 290);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_CALL_FUNCTION(&ldS, "preg_quote", NULL, 261, &leftDelimiter);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&rdS, "preg_quote", NULL, 261, &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/Helper/Str.zep", 313);
+ 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/Helper/Str.zep", 308);
+ 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, 201, &words);
+ zephir_check_call_status();
+ zephir_array_fetch(&word, &words, &_10$$6, PH_NOISY, "phalcon/Helper/Str.zep", 309);
+ zephir_array_fetch_long(&_12$$6, &match, 0, PH_NOISY | PH_READONLY, "phalcon/Helper/Str.zep", 310);
+ ZEPHIR_CALL_FUNCTION(&sub, "preg_quote", NULL, 261, &_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, 50, &_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/Helper/Str.zep", 308);
+ 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, 201, &words);
+ zephir_check_call_status();
+ zephir_array_fetch(&word, &words, &_19$$8, PH_NOISY, "phalcon/Helper/Str.zep", 309);
+ zephir_array_fetch_long(&_20$$8, &match, 0, PH_NOISY | PH_READONLY, "phalcon/Helper/Str.zep", 310);
+ ZEPHIR_CALL_FUNCTION(&sub, "preg_quote", NULL, 261, &_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, 50, &_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);
}
-// 2112 "parser.php.c"
- break;
- case 65:
-// 442 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, endsWith)
{
- phvolt_ret_macro_call_statement(&vvgotominor.vv186, &vvmsp[-6].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(1,&vvmsp[-8].minor);
- vv_destructor(60,&vvmsp[-7].minor);
- vv_destructor(29,&vvmsp[-5].minor);
- vv_destructor(52,&vvmsp[-4].minor);
- vv_destructor(32,&vvmsp[-3].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(61,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_bool ignoreCase;
+ zval *text_param = NULL, *end_param = NULL, *ignoreCase_param = NULL, _0;
+ zval text, end;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&end);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(text)
+ Z_PARAM_STR(end)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(ignoreCase)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 1, &text_param, &end_param, &ignoreCase_param);
+ zephir_get_strval(&text, text_param);
+ zephir_get_strval(&end, end_param);
+ if (!ignoreCase_param) {
+ ignoreCase = 1;
+ } else {
+ ignoreCase = zephir_get_boolval(ignoreCase_param);
+ }
+
+
+ ZVAL_BOOL(&_0, (ignoreCase ? 1 : 0));
+ RETURN_MM_BOOL(zephir_end_with(&text, &end, &_0));
}
-// 2127 "parser.php.c"
- break;
- case 66:
-// 446 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, firstBetween)
{
- phvolt_ret_empty_statement(&vvgotominor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *text_param = NULL, *start_param = NULL, *end_param = NULL, __$true, _0$$3, _1$$3, _3$$4, _4$$4;
+ zval text, start, end, _2$$3, _5$$4, _6;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&start);
+ ZVAL_UNDEF(&end);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_4$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(text)
+ Z_PARAM_STR(start)
+ Z_PARAM_STR(end)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 0, &text_param, &start_param, &end_param);
+ 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 (UNEXPECTED(Z_TYPE_P(start_param) != IS_STRING && Z_TYPE_P(start_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'start' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(start_param) == IS_STRING)) {
+ zephir_get_strval(&start, start_param);
+ } else {
+ ZEPHIR_INIT_VAR(&start);
+ }
+ if (UNEXPECTED(Z_TYPE_P(end_param) != IS_STRING && Z_TYPE_P(end_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'end' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(end_param) == IS_STRING)) {
+ zephir_get_strval(&end, end_param);
+ } else {
+ ZEPHIR_INIT_VAR(&end);
+ }
+
+
+ if ((zephir_function_exists_ex(ZEND_STRL("mb_strstr")) == SUCCESS)) {
+ ZEPHIR_CALL_FUNCTION(&_0$$3, "mb_strstr", NULL, 271, &text, &start);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&_1$$3, "mb_strstr", NULL, 271, &_0$$3, &end, &__$true);
+ zephir_check_call_status();
+ zephir_cast_to_string(&_2$$3, &_1$$3);
+ ZEPHIR_CPY_WRT(&text, &_2$$3);
+ } else {
+ ZEPHIR_CALL_FUNCTION(&_3$$4, "strstr", NULL, 272, &text, &start);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&_4$$4, "strstr", NULL, 272, &_3$$4, &end, &__$true);
+ zephir_check_call_status();
+ zephir_cast_to_string(&_5$$4, &_4$$4);
+ ZEPHIR_CPY_WRT(&text, &_5$$4);
+ }
+ ZEPHIR_INIT_VAR(&_6);
+ ZEPHIR_CONCAT_VV(&_6, &start, &end);
+ zephir_fast_trim(return_value, &text, &_6, ZEPHIR_TRIM_BOTH);
+ RETURN_MM();
}
-// 2136 "parser.php.c"
- break;
- case 67:
-// 450 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, friendly)
{
- phvolt_ret_echo_statement(&vvgotominor.vv186, &vvmsp[-1].minor.vv186, status->scanner_state);
- vv_destructor(62,&vvmsp[-2].minor);
- vv_destructor(63,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool lowercase, _0$$3;
+ zval *text_param = NULL, *separator_param = NULL, *lowercase_param = NULL, *replace = NULL, replace_sub, __$null, friendly, matrix, search, _6, _7, _8, _9, _10, _12, *_2$$3, _3$$3, _1$$5, _4$$6, _5$$7, _11$$8;
+ zval text, separator;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&separator);
+ ZVAL_UNDEF(&replace_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&friendly);
+ ZVAL_UNDEF(&matrix);
+ ZVAL_UNDEF(&search);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_1$$5);
+ ZVAL_UNDEF(&_4$$6);
+ ZVAL_UNDEF(&_5$$7);
+ ZVAL_UNDEF(&_11$$8);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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 {
+ lowercase = zephir_get_boolval(lowercase_param);
+ }
+ if (!replace) {
+ replace = &replace_sub;
+ ZEPHIR_CPY_WRT(replace, &__$null);
+ } else {
+ ZEPHIR_SEPARATE_PARAM(replace);
+ }
+
+
+ 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("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(" "));
+ if (zephir_is_true(replace)) {
+ _0$$3 = Z_TYPE_P(replace) != IS_ARRAY;
+ if (_0$$3) {
+ _0$$3 = Z_TYPE_P(replace) != IS_STRING;
+ }
+ if (UNEXPECTED(_0$$3)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_helper_exception_ce, "Parameter replace must be an array or a string", "phalcon/Helper/Str.zep", 414);
+ return;
+ }
+ if (Z_TYPE_P(replace) != IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&_1$$5);
+ zephir_create_array(&_1$$5, 1, 0);
+ zephir_array_fast_append(&_1$$5, replace);
+ ZEPHIR_CPY_WRT(replace, &_1$$5);
+ }
+ zephir_is_iterable(replace, 0, "phalcon/Helper/Str.zep", 424);
+ if (Z_TYPE_P(replace) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(replace), _2$$3)
+ {
+ ZEPHIR_INIT_NVAR(&search);
+ ZVAL_COPY(&search, _2$$3);
+ ZEPHIR_INIT_NVAR(&_4$$6);
+ ZVAL_STRING(&_4$$6, " ");
+ zephir_array_update_zval(&matrix, &search, &_4$$6, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, replace, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3$$3, replace, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&search, replace, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_5$$7);
+ ZVAL_STRING(&_5$$7, " ");
+ zephir_array_update_zval(&matrix, &search, &_5$$7, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, replace, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&search);
+ }
+ ZEPHIR_INIT_VAR(&_6);
+ ZEPHIR_INIT_VAR(&_7);
+ zephir_array_keys(&_7, &matrix);
+ ZEPHIR_CALL_FUNCTION(&_8, "array_values", NULL, 12, &matrix);
+ zephir_check_call_status();
+ zephir_fast_str_replace(&_6, &_7, &_8, &text);
+ zephir_get_strval(&text, &_6);
+ ZEPHIR_INIT_VAR(&_9);
+ ZVAL_STRING(&_9, "/[^a-zA-Z0-9\\/_|+ -]/");
+ ZEPHIR_INIT_VAR(&_10);
+ ZVAL_STRING(&_10, "");
+ ZEPHIR_CALL_FUNCTION(&friendly, "preg_replace", NULL, 50, &_9, &_10, &text);
+ zephir_check_call_status();
+ if (lowercase) {
+ ZEPHIR_INIT_VAR(&_11$$8);
+ zephir_fast_strtolower(&_11$$8, &friendly);
+ ZEPHIR_CPY_WRT(&friendly, &_11$$8);
+ }
+ ZEPHIR_INIT_NVAR(&_9);
+ ZVAL_STRING(&_9, "/[\\/_|+ -]+/");
+ ZEPHIR_CALL_FUNCTION(&_12, "preg_replace", NULL, 50, &_9, &separator, &friendly);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&friendly, &_12);
+ ZEPHIR_INIT_NVAR(&_9);
+ zephir_fast_trim(&_9, &friendly, &separator, ZEPHIR_TRIM_BOTH);
+ ZEPHIR_CPY_WRT(&friendly, &_9);
+ RETURN_CCTOR(&friendly);
}
-// 2145 "parser.php.c"
- break;
- case 68:
-// 454 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, humanize)
{
- phvolt_ret_block_statement(&vvgotominor.vv186, vvmsp[-5].minor.vv0, &vvmsp[-3].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-7].minor);
- vv_destructor(64,&vvmsp[-6].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(65,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *text_param = NULL, _0, _1, _2;
+ zval text;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(text)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &text_param);
+ 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);
+ }
+
+
+ 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_RETURN_CALL_FUNCTION("preg_replace", NULL, 50, &_1, &_2, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-// 2158 "parser.php.c"
- break;
- case 69:
-// 458 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, includes)
{
- phvolt_ret_block_statement(&vvgotominor.vv186, vvmsp[-4].minor.vv0, NULL, status->scanner_state);
- vv_destructor(1,&vvmsp[-6].minor);
- vv_destructor(64,&vvmsp[-5].minor);
- vv_destructor(32,&vvmsp[-3].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(65,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *needle_param = NULL, *haystack_param = NULL, _0$$3, _1$$4;
+ zval needle, haystack;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&needle);
+ ZVAL_UNDEF(&haystack);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(needle)
+ Z_PARAM_STR(haystack)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &needle_param, &haystack_param);
+ if (UNEXPECTED(Z_TYPE_P(needle_param) != IS_STRING && Z_TYPE_P(needle_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'needle' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(needle_param) == IS_STRING)) {
+ zephir_get_strval(&needle, needle_param);
+ } else {
+ ZEPHIR_INIT_VAR(&needle);
+ }
+ if (UNEXPECTED(Z_TYPE_P(haystack_param) != IS_STRING && Z_TYPE_P(haystack_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'haystack' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(haystack_param) == IS_STRING)) {
+ zephir_get_strval(&haystack, haystack_param);
+ } else {
+ ZEPHIR_INIT_VAR(&haystack);
+ }
+
+
+ if ((zephir_function_exists_ex(ZEND_STRL("mb_strpos")) == SUCCESS)) {
+ ZEPHIR_CALL_FUNCTION(&_0$$3, "mb_strpos", NULL, 273, &haystack, &needle);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_0$$3));
+ } else {
+ ZEPHIR_INIT_VAR(&_1$$4);
+ zephir_fast_strpos(&_1$$4, &haystack, &needle, 0 );
+ RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_1$$4));
+ }
}
-// 2171 "parser.php.c"
- break;
- case 70:
-// 462 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, increment)
{
- phvolt_ret_cache_statement(&vvgotominor.vv186, &vvmsp[-5].minor.vv186, NULL, &vvmsp[-3].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-7].minor);
- vv_destructor(66,&vvmsp[-6].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(67,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *text_param = NULL, *separator_param = NULL, parts, number, _0;
+ zval text, separator;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&separator);
+ ZVAL_UNDEF(&parts);
+ ZVAL_UNDEF(&number);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(separator)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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);
+ }
+
+
+ ZEPHIR_INIT_VAR(&parts);
+ zephir_fast_explode(&parts, &separator, &text, LONG_MAX);
+ ZEPHIR_OBS_VAR(&number);
+ if (zephir_array_isset_long_fetch(&number, &parts, 1, 0)) {
+ ZEPHIR_SEPARATE(&number);
+ zephir_increment(&number);
+ } else {
+ ZEPHIR_INIT_NVAR(&number);
+ ZVAL_LONG(&number, 1);
+ }
+ zephir_array_fetch_long(&_0, &parts, 0, PH_NOISY | PH_READONLY, "phalcon/Helper/Str.zep", 507);
+ ZEPHIR_CONCAT_VVV(return_value, &_0, &separator, &number);
+ RETURN_MM();
}
-// 2184 "parser.php.c"
- break;
- case 71:
-// 466 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, isAnagram)
{
- phvolt_ret_cache_statement(&vvgotominor.vv186, &vvmsp[-6].minor.vv186, &vvmsp[-5].minor.vv186, &vvmsp[-3].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-8].minor);
- vv_destructor(66,&vvmsp[-7].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(67,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ 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 *this_ptr = getThis();
+
+ ZVAL_UNDEF(&first);
+ ZVAL_UNDEF(&second);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(first)
+ Z_PARAM_STR(second)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &first_param, &second_param);
+ if (UNEXPECTED(Z_TYPE_P(first_param) != IS_STRING && Z_TYPE_P(first_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'first' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(first_param) == IS_STRING)) {
+ zephir_get_strval(&first, first_param);
+ } else {
+ ZEPHIR_INIT_VAR(&first);
+ }
+ if (UNEXPECTED(Z_TYPE_P(second_param) != IS_STRING && Z_TYPE_P(second_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'second' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(second_param) == IS_STRING)) {
+ zephir_get_strval(&second, second_param);
+ } else {
+ ZEPHIR_INIT_VAR(&second);
+ }
+
+
+ ZVAL_LONG(&_0, 1);
+ ZEPHIR_CALL_FUNCTION(&_1, "count_chars", NULL, 274, &first, &_0);
+ zephir_check_call_status();
+ ZVAL_LONG(&_0, 1);
+ ZEPHIR_CALL_FUNCTION(&_2, "count_chars", NULL, 274, &second, &_0);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(ZEPHIR_IS_IDENTICAL(&_1, &_2));
}
-// 2197 "parser.php.c"
- break;
- case 74:
-// 478 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, isLower)
{
- phvolt_ret_raw_statement(&vvgotominor.vv186, &vvmsp[-3].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-6].minor);
- vv_destructor(68,&vvmsp[-5].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(69,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *text_param = NULL, *encoding_param = NULL, _0$$3, _1$$4, _2$$4;
+ zval text, encoding;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&encoding);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(encoding)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &text_param, &encoding_param);
+ 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 (!encoding_param) {
+ ZEPHIR_INIT_VAR(&encoding);
+ ZVAL_STRING(&encoding, "UTF-8");
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(encoding_param) != IS_STRING && Z_TYPE_P(encoding_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'encoding' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(encoding_param) == IS_STRING)) {
+ zephir_get_strval(&encoding, encoding_param);
+ } else {
+ ZEPHIR_INIT_VAR(&encoding);
+ }
+ }
+
+
+ if ((zephir_function_exists_ex(ZEND_STRL("mb_strtolower")) == SUCCESS)) {
+ ZEPHIR_CALL_FUNCTION(&_0$$3, "mb_strtolower", NULL, 25, &text, &encoding);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(ZEPHIR_IS_IDENTICAL(&text, &_0$$3));
+ } else {
+ ZEPHIR_INIT_VAR(&_2$$4);
+ zephir_fast_strtolower(&_2$$4, &text);
+ RETURN_MM_BOOL(ZEPHIR_IS_IDENTICAL(&text, &_2$$4));
+ }
}
-// 2210 "parser.php.c"
- break;
- case 75:
-// 482 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, isPalindrome)
{
- phvolt_ret_extends_statement(&vvgotominor.vv186, &vvmsp[-1].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-3].minor);
- vv_destructor(70,&vvmsp[-2].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *text_param = NULL, _0;
+ zval text;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(text)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &text_param);
+ 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);
+ }
+
+
+ ZEPHIR_CALL_FUNCTION(&_0, "strrev", NULL, 275, &text);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(ZEPHIR_IS_IDENTICAL(&_0, &text));
}
-// 2220 "parser.php.c"
- break;
- case 76:
-// 486 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, isUpper)
{
- phvolt_ret_include_statement(&vvgotominor.vv186, &vvmsp[-1].minor.vv186, NULL, status->scanner_state);
- vv_destructor(1,&vvmsp[-3].minor);
- vv_destructor(71,&vvmsp[-2].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *text_param = NULL, *encoding_param = NULL, _0$$3, _1$$4, _2$$4;
+ zval text, encoding;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&encoding);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(encoding)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &text_param, &encoding_param);
+ 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 (!encoding_param) {
+ ZEPHIR_INIT_VAR(&encoding);
+ ZVAL_STRING(&encoding, "UTF-8");
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(encoding_param) != IS_STRING && Z_TYPE_P(encoding_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'encoding' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(encoding_param) == IS_STRING)) {
+ zephir_get_strval(&encoding, encoding_param);
+ } else {
+ ZEPHIR_INIT_VAR(&encoding);
+ }
+ }
+
+
+ if ((zephir_function_exists_ex(ZEND_STRL("mb_strtoupper")) == SUCCESS)) {
+ ZEPHIR_CALL_FUNCTION(&_0$$3, "mb_strtoupper", NULL, 268, &text, &encoding);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(ZEPHIR_IS_IDENTICAL(&text, &_0$$3));
+ } else {
+ ZEPHIR_INIT_VAR(&_2$$4);
+ zephir_fast_strtoupper(&_2$$4, &text);
+ RETURN_MM_BOOL(ZEPHIR_IS_IDENTICAL(&text, &_2$$4));
+ }
}
-// 2230 "parser.php.c"
- break;
- case 77:
-// 490 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, lower)
{
- phvolt_ret_include_statement(&vvgotominor.vv186, &vvmsp[-3].minor.vv186, &vvmsp[-1].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-5].minor);
- vv_destructor(71,&vvmsp[-4].minor);
- vv_destructor(72,&vvmsp[-2].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ 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 *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&encoding);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(encoding)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &text_param, &encoding_param);
+ 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 (!encoding_param) {
+ ZEPHIR_INIT_VAR(&encoding);
+ ZVAL_STRING(&encoding, "UTF-8");
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(encoding_param) != IS_STRING && Z_TYPE_P(encoding_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'encoding' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(encoding_param) == IS_STRING)) {
+ zephir_get_strval(&encoding, encoding_param);
+ } else {
+ ZEPHIR_INIT_VAR(&encoding);
+ }
+ }
+
+
+ if ((zephir_function_exists_ex(ZEND_STRL("mb_strtolower")) == SUCCESS)) {
+ ZEPHIR_RETURN_CALL_FUNCTION("mb_strtolower", NULL, 25, &text, &encoding);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_fast_strtolower(&_0, &text);
+ RETURN_CCTOR(&_0);
}
-// 2241 "parser.php.c"
- break;
- case 78:
-// 494 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, random)
{
- phvolt_ret_do_statement(&vvgotominor.vv186, &vvmsp[-1].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-3].minor);
- vv_destructor(73,&vvmsp[-2].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zval text;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ long length;
+ zval *type_param = NULL, *length_param = NULL, pool, _0$$3, _1$$3, _2$$3, _3$$3, _4$$4, _5$$4, _6$$4, _7$$4, _8$$4, _9$$4, _10$$5, _11$$5, _12$$6, _13$$6, _14$$7, _15$$8, _16$$8, _17$$8, _18$$8, _19$$8, _20$$8, _21$$8, _22$$9, _23$$9, _24$$9;
+ zend_long type, ZEPHIR_LAST_CALL_STATUS, end = 0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&pool);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ 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(&_10$$5);
+ ZVAL_UNDEF(&_11$$5);
+ ZVAL_UNDEF(&_12$$6);
+ ZVAL_UNDEF(&_13$$6);
+ ZVAL_UNDEF(&_14$$7);
+ ZVAL_UNDEF(&_15$$8);
+ ZVAL_UNDEF(&_16$$8);
+ ZVAL_UNDEF(&_17$$8);
+ ZVAL_UNDEF(&_18$$8);
+ ZVAL_UNDEF(&_19$$8);
+ ZVAL_UNDEF(&_20$$8);
+ ZVAL_UNDEF(&_21$$8);
+ ZVAL_UNDEF(&_22$$9);
+ ZVAL_UNDEF(&_23$$9);
+ ZVAL_UNDEF(&_24$$9);
+ ZVAL_UNDEF(&text);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 2)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(type)
+ Z_PARAM_LONG(length)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 2, &type_param, &length_param);
+ if (!type_param) {
+ type = 0;
+ } else {
+ type = zephir_get_intval(type_param);
+ }
+ if (!length_param) {
+ length = 8;
+ } else {
+ length = zephir_get_intval(length_param);
+ }
+
+
+ ZEPHIR_INIT_VAR(&text);
+ do {
+ if (type == 1) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZVAL_STRING(&_0$$3, "a");
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "z");
+ ZEPHIR_CALL_FUNCTION(&_2$$3, "range", NULL, 276, &_0$$3, &_1$$3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_0$$3);
+ ZVAL_STRING(&_0$$3, "A");
+ ZEPHIR_INIT_NVAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "Z");
+ ZEPHIR_CALL_FUNCTION(&_3$$3, "range", NULL, 276, &_0$$3, &_1$$3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&pool);
+ zephir_fast_array_merge(&pool, &_2$$3, &_3$$3);
+ break;
+ }
+ if (type == 2) {
+ ZVAL_LONG(&_4$$4, 0);
+ ZVAL_LONG(&_5$$4, 9);
+ ZEPHIR_CALL_FUNCTION(&_6$$4, "range", NULL, 276, &_4$$4, &_5$$4);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_7$$4);
+ ZVAL_STRING(&_7$$4, "a");
+ ZEPHIR_INIT_VAR(&_8$$4);
+ ZVAL_STRING(&_8$$4, "f");
+ ZEPHIR_CALL_FUNCTION(&_9$$4, "range", NULL, 276, &_7$$4, &_8$$4);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&pool);
+ zephir_fast_array_merge(&pool, &_6$$4, &_9$$4);
+ break;
+ }
+ if (type == 3) {
+ ZVAL_LONG(&_10$$5, 0);
+ ZVAL_LONG(&_11$$5, 9);
+ ZEPHIR_CALL_FUNCTION(&pool, "range", NULL, 276, &_10$$5, &_11$$5);
+ zephir_check_call_status();
+ break;
+ }
+ if (type == 4) {
+ ZVAL_LONG(&_12$$6, 1);
+ ZVAL_LONG(&_13$$6, 9);
+ ZEPHIR_CALL_FUNCTION(&pool, "range", NULL, 276, &_12$$6, &_13$$6);
+ zephir_check_call_status();
+ break;
+ }
+ if (type == 5) {
+ ZEPHIR_INIT_VAR(&_14$$7);
+ ZVAL_STRING(&_14$$7, "2345679ACDEFHJKLMNPRSTUVWXYZ");
+ ZEPHIR_CALL_FUNCTION(&pool, "str_split", NULL, 108, &_14$$7);
+ zephir_check_call_status();
+ break;
+ }
+ ZVAL_LONG(&_15$$8, 0);
+ ZVAL_LONG(&_16$$8, 9);
+ ZEPHIR_CALL_FUNCTION(&_17$$8, "range", NULL, 276, &_15$$8, &_16$$8);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_18$$8);
+ ZVAL_STRING(&_18$$8, "a");
+ ZEPHIR_INIT_VAR(&_19$$8);
+ ZVAL_STRING(&_19$$8, "z");
+ ZEPHIR_CALL_FUNCTION(&_20$$8, "range", NULL, 276, &_18$$8, &_19$$8);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_18$$8);
+ ZVAL_STRING(&_18$$8, "A");
+ ZEPHIR_INIT_NVAR(&_19$$8);
+ ZVAL_STRING(&_19$$8, "Z");
+ ZEPHIR_CALL_FUNCTION(&_21$$8, "range", NULL, 276, &_18$$8, &_19$$8);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&pool, "array_merge", NULL, 277, &_17$$8, &_20$$8, &_21$$8);
+ zephir_check_call_status();
+ break;
+ } while(0);
+
+ end = (zephir_fast_count_int(&pool) - 1);
+ while (1) {
+ if (!(zephir_fast_strlen_ev(&text) < length)) {
+ break;
+ }
+ ZVAL_LONG(&_23$$9, 0);
+ ZVAL_LONG(&_24$$9, end);
+ zephir_array_fetch_long(&_22$$9, &pool, zephir_mt_rand(zephir_get_intval(&_23$$9), zephir_get_intval(&_24$$9)), PH_NOISY | PH_READONLY, "phalcon/Helper/Str.zep", 653);
+ zephir_concat_self(&text, &_22$$9);
+ }
+ RETURN_CTOR(&text);
}
-// 2251 "parser.php.c"
- break;
- case 79:
-// 498 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, reduceSlashes)
{
- phvolt_ret_return_statement(&vvgotominor.vv186, &vvmsp[-1].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-3].minor);
- vv_destructor(74,&vvmsp[-2].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *text_param = NULL, _0, _1;
+ zval text;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(text)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &text_param);
+ 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);
+ }
+
+
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "#(?scanner_state);
- vv_destructor(1,&vvmsp[-7].minor);
- vv_destructor(75,&vvmsp[-6].minor);
- vv_destructor(58,&vvmsp[-5].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(76,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_bool ignoreCase;
+ zval *text_param = NULL, *start_param = NULL, *ignoreCase_param = NULL, _0;
+ zval text, start;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&start);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(text)
+ Z_PARAM_STR(start)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(ignoreCase)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 1, &text_param, &start_param, &ignoreCase_param);
+ 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 (UNEXPECTED(Z_TYPE_P(start_param) != IS_STRING && Z_TYPE_P(start_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'start' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(start_param) == IS_STRING)) {
+ zephir_get_strval(&start, start_param);
+ } else {
+ ZEPHIR_INIT_VAR(&start);
+ }
+ if (!ignoreCase_param) {
+ ignoreCase = 1;
+ } else {
+ ignoreCase = zephir_get_boolval(ignoreCase_param);
+ }
+
+
+ ZVAL_BOOL(&_0, (ignoreCase ? 1 : 0));
+ RETURN_MM_BOOL(zephir_start_with(&text, &start, &_0));
}
-// 2275 "parser.php.c"
- break;
- case 81:
-// 506 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, uncamelize)
{
- phvolt_ret_autoescape_statement(&vvgotominor.vv186, 1, &vvmsp[-3].minor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-7].minor);
- vv_destructor(75,&vvmsp[-6].minor);
- vv_destructor(59,&vvmsp[-5].minor);
- vv_destructor(32,&vvmsp[-4].minor);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(76,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *text_param = NULL, *delimiter = NULL, delimiter_sub, __$null, _0;
+ zval text;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&delimiter_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(delimiter)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &text_param, &delimiter);
+ 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 (!delimiter) {
+ delimiter = &delimiter_sub;
+ delimiter = &__$null;
+ }
+
+
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_uncamelize(&_0, &text, delimiter );
+ RETURN_CCTOR(&_0);
}
-// 2289 "parser.php.c"
- break;
- case 82:
-// 510 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, underscore)
{
- phvolt_ret_break_statement(&vvgotominor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(77,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *text_param = NULL, _0, _1, _2;
+ zval text;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(text)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &text_param);
+ 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);
+ }
+
+
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_fast_trim(&_0, &text, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "#\\s+#");
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "_");
+ ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 50, &_1, &_2, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-// 2299 "parser.php.c"
- break;
- case 83:
-// 514 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Helper_Str, upper)
{
- phvolt_ret_continue_statement(&vvgotominor.vv186, status->scanner_state);
- vv_destructor(1,&vvmsp[-2].minor);
- vv_destructor(78,&vvmsp[-1].minor);
- vv_destructor(32,&vvmsp[0].minor);
+ 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 *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&encoding);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(encoding)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &text_param, &encoding_param);
+ 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 (!encoding_param) {
+ ZEPHIR_INIT_VAR(&encoding);
+ ZVAL_STRING(&encoding, "UTF-8");
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(encoding_param) != IS_STRING && Z_TYPE_P(encoding_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'encoding' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(encoding_param) == IS_STRING)) {
+ zephir_get_strval(&encoding, encoding_param);
+ } else {
+ ZEPHIR_INIT_VAR(&encoding);
+ }
+ }
+
+
+ if ((zephir_function_exists_ex(ZEND_STRL("mb_strtoupper")) == SUCCESS)) {
+ ZEPHIR_RETURN_CALL_FUNCTION("mb_strtoupper", NULL, 268, &text, &encoding);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_fast_strtoupper(&_0, &text);
+ RETURN_CCTOR(&_0);
}
-// 2309 "parser.php.c"
- break;
- case 84:
-// 518 "parser.php.lemon"
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Annotations_Annotation)
{
- phvolt_ret_literal_zval(&vvgotominor.vv186, PHVOLT_T_RAW_FRAGMENT, vvmsp[0].minor.vv0, status->scanner_state);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Annotations, Annotation, phalcon, annotations_annotation, phalcon_annotations_annotation_method_entry, 0);
+
+ zend_declare_property_null(phalcon_annotations_annotation_ce, SL("arguments"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_annotations_annotation_ce, SL("exprArguments"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_annotations_annotation_ce, SL("name"), ZEND_ACC_PROTECTED);
+ phalcon_annotations_annotation_ce->create_object = zephir_init_properties_Phalcon_Annotations_Annotation;
+
+ return SUCCESS;
}
-// 2316 "parser.php.c"
- break;
- case 85:
-// 522 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Annotation, __construct)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_MINUS, NULL, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(22,&vvmsp[-1].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_4 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *reflectionData_param = NULL, name, exprArguments, argument, resolvedArgument, _0$$3, *_1$$4, _2$$4, _3$$5, _5$$8;
+ zval reflectionData, arguments;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&reflectionData);
+ ZVAL_UNDEF(&arguments);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&exprArguments);
+ ZVAL_UNDEF(&argument);
+ ZVAL_UNDEF(&resolvedArgument);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&_5$$8);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(reflectionData)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &reflectionData_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&reflectionData, reflectionData_param);
+
+
+ ZEPHIR_OBS_VAR(&name);
+ if (zephir_array_isset_string_fetch(&name, &reflectionData, SL("name"), 0)) {
+ zephir_array_fetch_string(&_0$$3, &reflectionData, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Annotations/Annotation.zep", 48);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &_0$$3);
+ }
+ ZEPHIR_OBS_VAR(&exprArguments);
+ if (zephir_array_isset_string_fetch(&exprArguments, &reflectionData, SL("arguments"), 0)) {
+ ZEPHIR_INIT_VAR(&arguments);
+ array_init(&arguments);
+ zephir_is_iterable(&exprArguments, 0, "phalcon/Annotations/Annotation.zep", 69);
+ if (Z_TYPE_P(&exprArguments) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&exprArguments), _1$$4)
+ {
+ ZEPHIR_INIT_NVAR(&argument);
+ ZVAL_COPY(&argument, _1$$4);
+ zephir_array_fetch_string(&_3$$5, &argument, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Annotations/Annotation.zep", 60);
+ ZEPHIR_CALL_METHOD(&resolvedArgument, this_ptr, "getexpression", &_4, 0, &_3$$5);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&name);
+ if (zephir_array_isset_string_fetch(&name, &argument, SL("name"), 0)) {
+ zephir_array_update_zval(&arguments, &name, &resolvedArgument, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_append(&arguments, &resolvedArgument, PH_SEPARATE, "phalcon/Annotations/Annotation.zep", 65);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &exprArguments, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2$$4, &exprArguments, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2$$4)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&argument, &exprArguments, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_5$$8, &argument, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Annotations/Annotation.zep", 60);
+ ZEPHIR_CALL_METHOD(&resolvedArgument, this_ptr, "getexpression", &_4, 0, &_5$$8);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&name);
+ if (zephir_array_isset_string_fetch(&name, &argument, SL("name"), 0)) {
+ zephir_array_update_zval(&arguments, &name, &resolvedArgument, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_append(&arguments, &resolvedArgument, PH_SEPARATE, "phalcon/Annotations/Annotation.zep", 65);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &exprArguments, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&argument);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("arguments"), &arguments);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("exprArguments"), &exprArguments);
+ }
+ ZEPHIR_MM_RESTORE();
}
-// 2324 "parser.php.c"
- break;
- case 86:
-// 526 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Annotation, getArgument)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_PLUS, NULL, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(21,&vvmsp[-1].minor);
+ zval *position, position_sub, argument, _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&position_sub);
+ ZVAL_UNDEF(&argument);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(position)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &position);
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("arguments"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset_fetch(&argument, &_0, position, 1)) {
+ RETURN_CTORW(&argument);
+ }
+ RETURN_NULL();
}
-// 2332 "parser.php.c"
- break;
- case 87:
-// 530 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Annotation, getArguments)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_SUB, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(22,&vvmsp[-1].minor);
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "arguments");
}
-// 2340 "parser.php.c"
- break;
- case 88:
-// 534 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Annotation, getExprArguments)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_ADD, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(21,&vvmsp[-1].minor);
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "exprArguments");
}
-// 2348 "parser.php.c"
- break;
- case 89:
-// 538 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Annotation, getExpression)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_MUL, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(19,&vvmsp[-1].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_4 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *expr_param = NULL, value, item, resolvedItem, arrayValue, name, type, _0$$7, *_1$$7, _2$$7, _3$$8, _5$$11, _6$$15, _7$$15;
+ zval expr;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expr);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&item);
+ ZVAL_UNDEF(&resolvedItem);
+ ZVAL_UNDEF(&arrayValue);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&_0$$7);
+ ZVAL_UNDEF(&_2$$7);
+ ZVAL_UNDEF(&_3$$8);
+ ZVAL_UNDEF(&_5$$11);
+ ZVAL_UNDEF(&_6$$15);
+ ZVAL_UNDEF(&_7$$15);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(expr)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &expr_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&expr, expr_param);
+
+
+ ZEPHIR_OBS_VAR(&type);
+ zephir_array_fetch_string(&type, &expr, SL("type"), PH_NOISY, "phalcon/Annotations/Annotation.zep", 111);
+ do {
+ if (ZEPHIR_IS_LONG(&type, 301) || ZEPHIR_IS_LONG(&type, 302) || ZEPHIR_IS_LONG(&type, 303) || ZEPHIR_IS_LONG(&type, 307)) {
+ ZEPHIR_OBS_VAR(&value);
+ zephir_array_fetch_string(&value, &expr, SL("value"), PH_NOISY, "phalcon/Annotations/Annotation.zep", 118);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&type, 304)) {
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_NULL(&value);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&type, 305)) {
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_BOOL(&value, 0);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&type, 306)) {
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_BOOL(&value, 1);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&type, 308)) {
+ ZEPHIR_INIT_VAR(&arrayValue);
+ array_init(&arrayValue);
+ zephir_array_fetch_string(&_0$$7, &expr, SL("items"), PH_NOISY | PH_READONLY, "phalcon/Annotations/Annotation.zep", 136);
+ zephir_is_iterable(&_0$$7, 0, "phalcon/Annotations/Annotation.zep", 148);
+ if (Z_TYPE_P(&_0$$7) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0$$7), _1$$7)
+ {
+ ZEPHIR_INIT_NVAR(&item);
+ ZVAL_COPY(&item, _1$$7);
+ zephir_array_fetch_string(&_3$$8, &item, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Annotations/Annotation.zep", 139);
+ ZEPHIR_CALL_METHOD(&resolvedItem, this_ptr, "getexpression", &_4, 154, &_3$$8);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&name);
+ if (zephir_array_isset_string_fetch(&name, &item, SL("name"), 0)) {
+ zephir_array_update_zval(&arrayValue, &name, &resolvedItem, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_append(&arrayValue, &resolvedItem, PH_SEPARATE, "phalcon/Annotations/Annotation.zep", 144);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_0$$7, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2$$7, &_0$$7, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2$$7)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&item, &_0$$7, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_5$$11, &item, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Annotations/Annotation.zep", 139);
+ ZEPHIR_CALL_METHOD(&resolvedItem, this_ptr, "getexpression", &_4, 154, &_5$$11);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&name);
+ if (zephir_array_isset_string_fetch(&name, &item, SL("name"), 0)) {
+ zephir_array_update_zval(&arrayValue, &name, &resolvedItem, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_append(&arrayValue, &resolvedItem, PH_SEPARATE, "phalcon/Annotations/Annotation.zep", 144);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_0$$7, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&item);
+ RETURN_CCTOR(&arrayValue);
+ }
+ if (ZEPHIR_IS_LONG(&type, 300)) {
+ object_init_ex(return_value, phalcon_annotations_annotation_ce);
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 155, &expr);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZEPHIR_INIT_VAR(&_6$$15);
+ object_init_ex(&_6$$15, phalcon_annotations_exception_ce);
+ ZEPHIR_INIT_VAR(&_7$$15);
+ ZEPHIR_CONCAT_SVS(&_7$$15, "The expression ", &type, " is unknown");
+ ZEPHIR_CALL_METHOD(NULL, &_6$$15, "__construct", NULL, 8, &_7$$15);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_6$$15, "phalcon/Annotations/Annotation.zep", 154);
+ ZEPHIR_MM_RESTORE();
+ return;
+ } while(0);
+
+ RETURN_CCTOR(&value);
}
-// 2356 "parser.php.c"
- break;
- case 90:
-// 542 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Annotation, getName)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_POW, &vvmsp[-3].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(19,&vvmsp[-2].minor);
- vv_destructor(19,&vvmsp[-1].minor);
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "name");
}
-// 2365 "parser.php.c"
- break;
- case 91:
-// 546 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Annotation, getNamedArgument)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_DIV, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(18,&vvmsp[-1].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *name_param = NULL, argument, _0;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&argument);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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("arguments"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset_fetch(&argument, &_0, &name, 1)) {
+ RETURN_CTOR(&argument);
+ }
+ RETURN_MM_NULL();
}
-// 2373 "parser.php.c"
- break;
- case 92:
-// 550 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Annotation, getNamedParameter)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_MOD, &vvmsp[-3].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(18,&vvmsp[-2].minor);
- vv_destructor(18,&vvmsp[-1].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_RETURN_CALL_METHOD(this_ptr, "getnamedargument", NULL, 0, &name);
+ zephir_check_call_status();
+ RETURN_MM();
}
-// 2382 "parser.php.c"
- break;
- case 93:
-// 554 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Annotation, hasArgument)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_MOD, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(20,&vvmsp[-1].minor);
+ zval *position, position_sub, _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&position_sub);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(position)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &position);
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("arguments"), PH_NOISY_CC | PH_READONLY);
+ RETURN_BOOL(zephir_array_isset(&_0, position));
}
-// 2390 "parser.php.c"
- break;
- case 94:
-// 558 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Annotation, numberArguments)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_AND, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(6,&vvmsp[-1].minor);
+ zval _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("arguments"), PH_NOISY_CC | PH_READONLY);
+ RETURN_LONG(zephir_fast_count_int(&_0));
}
-// 2398 "parser.php.c"
- break;
- case 95:
-// 562 "parser.php.lemon"
+
+zend_object *zephir_init_properties_Phalcon_Annotations_Annotation(zend_class_entry *class_type)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_OR, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(7,&vvmsp[-1].minor);
+ 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_MM_GROW();
+
+ {
+ 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("exprArguments"), 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("exprArguments"), &_1$$3);
+ }
+ zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("arguments"), 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("arguments"), &_3$$4);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
+ }
}
-// 2406 "parser.php.c"
- break;
- case 96:
-// 566 "parser.php.lemon"
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Annotations_AnnotationsFactory)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_CONCAT, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(23,&vvmsp[-1].minor);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Annotations, AnnotationsFactory, phalcon, annotations_annotationsfactory, phalcon_factory_abstractfactory_ce, phalcon_annotations_annotationsfactory_method_entry, 0);
+
+ zend_declare_property_string(phalcon_annotations_annotationsfactory_ce, SL("exception"), "Phalcon\\Annotations\\Exception", ZEND_ACC_PROTECTED);
+ return SUCCESS;
}
-// 2414 "parser.php.c"
- break;
- case 97:
-// 570 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_AnnotationsFactory, __construct)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_PIPE, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(25,&vvmsp[-1].minor);
+ 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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(services)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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();
}
-// 2422 "parser.php.c"
- break;
- case 98:
-// 574 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_AnnotationsFactory, load)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_RANGE, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(5,&vvmsp[-1].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_1 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *config = NULL, config_sub, name, options, _0, _2, _3;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&config_sub);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(config)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_OBS_VAR(&name);
+ zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Annotations/AnnotationsFactory.zep", 49);
+ zephir_array_unset_string(config, SL("adapter"), PH_SEPARATE);
+ ZEPHIR_INIT_VAR(&_2);
+ array_init(&_2);
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "options");
+ ZEPHIR_CALL_CE_STATIC(&options, phalcon_helper_arr_ce, "get", &_1, 16, config, &_3, &_2);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &options);
+ zephir_check_call_status();
+ RETURN_MM();
}
-// 2430 "parser.php.c"
- break;
- case 99:
-// 578 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_AnnotationsFactory, newInstance)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_EQUALS, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(10,&vvmsp[-1].minor);
+ 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;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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, 1, 0);
+ zephir_array_fast_append(&_0, &options);
+ ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(return_value, &definition, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-// 2438 "parser.php.c"
- break;
- case 100:
-// 582 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_AnnotationsFactory, getAdapters)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_NOT_ISSET, &vvmsp[-2].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(11,&vvmsp[-1].minor);
- vv_destructor(80,&vvmsp[0].minor);
+ zval *this_ptr = getThis();
+
+
+
+ zephir_create_array(return_value, 3, 0);
+ add_assoc_stringl_ex(return_value, SL("apcu"), SL("Phalcon\\Annotations\\Adapter\\Apcu"));
+ add_assoc_stringl_ex(return_value, SL("memory"), SL("Phalcon\\Annotations\\Adapter\\Memory"));
+ add_assoc_stringl_ex(return_value, SL("stream"), SL("Phalcon\\Annotations\\Adapter\\Stream"));
+ return;
}
-// 2447 "parser.php.c"
- break;
- case 101:
-// 586 "parser.php.lemon"
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Annotations_Collection)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_ISSET, &vvmsp[-2].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(9,&vvmsp[-1].minor);
- vv_destructor(80,&vvmsp[0].minor);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Annotations, Collection, phalcon, annotations_collection, phalcon_annotations_collection_method_entry, 0);
+
+ zend_declare_property_null(phalcon_annotations_collection_ce, SL("annotations"), ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_annotations_collection_ce, SL("position"), 0, ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_annotations_collection_ce, 1, zend_ce_iterator);
+ zend_class_implements(phalcon_annotations_collection_ce, 1, zend_ce_countable);
+ return SUCCESS;
}
-// 2456 "parser.php.c"
- break;
- case 102:
-// 590 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Collection, __construct)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_NOT_ISEMPTY, &vvmsp[-2].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(11,&vvmsp[-1].minor);
- vv_destructor(81,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_3 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *reflectionData_param = NULL, annotations, annotationData, *_0, _1, _2$$3, _4$$4;
+ zval reflectionData;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&reflectionData);
+ ZVAL_UNDEF(&annotations);
+ ZVAL_UNDEF(&annotationData);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_4$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(reflectionData)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &reflectionData_param);
+ if (!reflectionData_param) {
+ ZEPHIR_INIT_VAR(&reflectionData);
+ array_init(&reflectionData);
+ } else {
+ zephir_get_arrval(&reflectionData, reflectionData_param);
+ }
+
+
+ ZEPHIR_INIT_VAR(&annotations);
+ array_init(&annotations);
+ zephir_is_iterable(&reflectionData, 0, "phalcon/Annotations/Collection.zep", 58);
+ if (Z_TYPE_P(&reflectionData) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&reflectionData), _0)
+ {
+ ZEPHIR_INIT_NVAR(&annotationData);
+ ZVAL_COPY(&annotationData, _0);
+ ZEPHIR_INIT_NVAR(&_2$$3);
+ object_init_ex(&_2$$3, phalcon_annotations_annotation_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", &_3, 155, &annotationData);
+ zephir_check_call_status();
+ zephir_array_append(&annotations, &_2$$3, PH_SEPARATE, "phalcon/Annotations/Collection.zep", 55);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &reflectionData, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &reflectionData, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&annotationData, &reflectionData, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_4$$4);
+ object_init_ex(&_4$$4, phalcon_annotations_annotation_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", &_3, 155, &annotationData);
+ zephir_check_call_status();
+ zephir_array_append(&annotations, &_4$$4, PH_SEPARATE, "phalcon/Annotations/Collection.zep", 55);
+ ZEPHIR_CALL_METHOD(NULL, &reflectionData, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&annotationData);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("annotations"), &annotations);
+ ZEPHIR_MM_RESTORE();
}
-// 2465 "parser.php.c"
- break;
- case 103:
-// 594 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Collection, count)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_ISEMPTY, &vvmsp[-2].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(9,&vvmsp[-1].minor);
- vv_destructor(81,&vvmsp[0].minor);
+ zval _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("annotations"), PH_NOISY_CC | PH_READONLY);
+ RETURN_LONG(zephir_fast_count_int(&_0));
}
-// 2474 "parser.php.c"
- break;
- case 104:
-// 598 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Collection, current)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_NOT_ISEVEN, &vvmsp[-2].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(11,&vvmsp[-1].minor);
- vv_destructor(82,&vvmsp[0].minor);
+ zval annotation, _0, _1;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&annotation);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("annotations"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("position"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&annotation, &_0, &_1, 1))) {
+ RETURN_BOOL(0);
+ }
+ RETURN_CTORW(&annotation);
}
-// 2483 "parser.php.c"
- break;
- case 105:
-// 602 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Collection, get)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_ISEVEN, &vvmsp[-2].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(9,&vvmsp[-1].minor);
- vv_destructor(82,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL, annotation, annotations, _0, *_1, _2, _5, _3$$3, _4$$5;
+ zval name, _6;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&annotation);
+ ZVAL_UNDEF(&annotations);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$5);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_get_strval(&name, name_param);
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("annotations"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&annotations, &_0);
+ zephir_is_iterable(&annotations, 0, "phalcon/Annotations/Collection.zep", 98);
+ if (Z_TYPE_P(&annotations) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&annotations), _1)
+ {
+ ZEPHIR_INIT_NVAR(&annotation);
+ ZVAL_COPY(&annotation, _1);
+ ZEPHIR_CALL_METHOD(&_3$$3, &annotation, "getname", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EQUAL(&name, &_3$$3)) {
+ RETURN_CCTOR(&annotation);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &annotations, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, &annotations, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&annotation, &annotations, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_4$$5, &annotation, "getname", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EQUAL(&name, &_4$$5)) {
+ RETURN_CCTOR(&annotation);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &annotations, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&annotation);
+ ZEPHIR_INIT_VAR(&_5);
+ object_init_ex(&_5, phalcon_annotations_exception_ce);
+ ZEPHIR_INIT_VAR(&_6);
+ ZEPHIR_CONCAT_SVS(&_6, "Collection doesn't have an annotation called '", &name, "'");
+ ZEPHIR_CALL_METHOD(NULL, &_5, "__construct", NULL, 8, &_6);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_5, "phalcon/Annotations/Collection.zep", 100);
+ ZEPHIR_MM_RESTORE();
+ return;
}
-// 2492 "parser.php.c"
- break;
- case 106:
-// 606 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Collection, getAll)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_NOT_ISODD, &vvmsp[-2].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(11,&vvmsp[-1].minor);
- vv_destructor(83,&vvmsp[0].minor);
+ zval found;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL, annotations, annotation, _0, *_1, _2, _3$$3, _4$$5;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&annotations);
+ ZVAL_UNDEF(&annotation);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&found);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_get_strval(&name, name_param);
+
+
+ ZEPHIR_INIT_VAR(&found);
+ array_init(&found);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("annotations"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&annotations, &_0);
+ zephir_is_iterable(&annotations, 0, "phalcon/Annotations/Collection.zep", 120);
+ if (Z_TYPE_P(&annotations) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&annotations), _1)
+ {
+ ZEPHIR_INIT_NVAR(&annotation);
+ ZVAL_COPY(&annotation, _1);
+ ZEPHIR_CALL_METHOD(&_3$$3, &annotation, "getname", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EQUAL(&name, &_3$$3)) {
+ zephir_array_append(&found, &annotation, PH_SEPARATE, "phalcon/Annotations/Collection.zep", 116);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &annotations, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, &annotations, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&annotation, &annotations, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_4$$5, &annotation, "getname", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EQUAL(&name, &_4$$5)) {
+ zephir_array_append(&found, &annotation, PH_SEPARATE, "phalcon/Annotations/Collection.zep", 116);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &annotations, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&annotation);
+ RETURN_CTOR(&found);
}
-// 2501 "parser.php.c"
- break;
- case 107:
-// 610 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Collection, getAnnotations)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_ISODD, &vvmsp[-2].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(9,&vvmsp[-1].minor);
- vv_destructor(83,&vvmsp[0].minor);
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "annotations");
}
-// 2510 "parser.php.c"
- break;
- case 108:
-// 614 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Collection, has)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_NOT_ISNUMERIC, &vvmsp[-2].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(11,&vvmsp[-1].minor);
- vv_destructor(84,&vvmsp[0].minor);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL, annotations, annotation, _0, *_1, _2, _3$$3, _4$$5;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&annotations);
+ ZVAL_UNDEF(&annotation);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$5);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_get_strval(&name, name_param);
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("annotations"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&annotations, &_0);
+ zephir_is_iterable(&annotations, 0, "phalcon/Annotations/Collection.zep", 146);
+ if (Z_TYPE_P(&annotations) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&annotations), _1)
+ {
+ ZEPHIR_INIT_NVAR(&annotation);
+ ZVAL_COPY(&annotation, _1);
+ ZEPHIR_CALL_METHOD(&_3$$3, &annotation, "getname", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EQUAL(&name, &_3$$3)) {
+ RETURN_MM_BOOL(1);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &annotations, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, &annotations, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&annotation, &annotations, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_4$$5, &annotation, "getname", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EQUAL(&name, &_4$$5)) {
+ RETURN_MM_BOOL(1);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &annotations, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&annotation);
+ RETURN_MM_BOOL(0);
}
-// 2519 "parser.php.c"
- break;
- case 109:
-// 618 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Collection, key)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_ISNUMERIC, &vvmsp[-2].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(9,&vvmsp[-1].minor);
- vv_destructor(84,&vvmsp[0].minor);
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "position");
}
-// 2528 "parser.php.c"
- break;
- case 110:
-// 622 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Collection, next)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_NOT_ISSCALAR, &vvmsp[-2].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(11,&vvmsp[-1].minor);
- vv_destructor(85,&vvmsp[0].minor);
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("position")));
}
-// 2537 "parser.php.c"
- break;
- case 111:
-// 626 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Collection, rewind)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_ISSCALAR, &vvmsp[-2].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(9,&vvmsp[-1].minor);
- vv_destructor(85,&vvmsp[0].minor);
+ zval _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+
+
+
+ ZEPHIR_INIT_ZVAL_NREF(_0);
+ ZVAL_LONG(&_0, 0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("position"), &_0);
}
-// 2546 "parser.php.c"
- break;
- case 112:
-// 630 "parser.php.lemon"
+
+static PHP_METHOD(Phalcon_Annotations_Collection, valid)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_NOT_ISITERABLE, &vvmsp[-2].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(11,&vvmsp[-1].minor);
- vv_destructor(86,&vvmsp[0].minor);
+ zval _0, _1;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("annotations"), 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));
}
-// 2555 "parser.php.c"
- break;
- case 113:
-// 634 "parser.php.lemon"
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Annotations_Exception)
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_ISITERABLE, &vvmsp[-2].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(9,&vvmsp[-1].minor);
- vv_destructor(86,&vvmsp[0].minor);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Annotations, Exception, phalcon, annotations_exception, phalcon_exception_ce, NULL, 0);
+
+ return SUCCESS;
}
-// 2564 "parser.php.c"
- break;
- case 114:
-// 638 "parser.php.lemon"
-{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_IS, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(9,&vvmsp[-1].minor);
+
+
+
+/* Driver template for the LEMON parser generator.
+** The author disclaims copyright to this source code.
+*/
+/* First off, code is include which follows the "include" declaration
+** in the input file. */
+// 18 "parser.php.lemon"
+
+
+// 12 "parser.php.c"
+/* Next is all token values, in a form suitable for use by makeheaders.
+** This section will be null unless lemon is run with the -m switch.
+*/
+/* Make sure the INTERFACE macro is defined.
+*/
+#ifndef INTERFACE
+# define INTERFACE 1
+#endif
+/* The next thing included is series of defines which control
+** various aspects of the generated parser.
+** AACODETYPE is the data type used for storing terminal
+** and nonterminal numbers. "unsigned char" is
+** used if there are fewer than 250 terminals
+** and nonterminals. "int" is used otherwise.
+** AANOCODE is a number of type AACODETYPE which corresponds
+** to no legal terminal or nonterminal number. This
+** number is used to fill in empty slots of the hash
+** table.
+** AAFALLBACK If defined, this indicates that one or more tokens
+** have fall-back values which should be used if the
+** original value of the token will not parse.
+** AAACTIONTYPE is the data type used for storing terminal
+** and nonterminal numbers. "unsigned char" is
+** used if there are fewer than 250 rules and
+** states combined. "int" is used otherwise.
+** phannot_TOKENTYPE is the data type used for minor tokens given
+** directly to the parser from the tokenizer.
+** AAMINORTYPE is the data type used for all minor tokens.
+** This is typically a union of many types, one of
+** which is phannot_TOKENTYPE. The entry in the union
+** for base tokens is called "aa0".
+** AASTACKDEPTH is the maximum depth of the parser's stack.
+** phannot_ARG_SDECL A static variable declaration for the %extra_argument
+** phannot_ARG_PDECL A parameter declaration for the %extra_argument
+** phannot_ARG_STORE Code to store %extra_argument into aapParser
+** phannot_ARG_FETCH Code to extract %extra_argument from aapParser
+** AANSTATE the combined number of states.
+** AANRULE the number of rules in the grammar
+** AAERRORSYMBOL is the code number of the error symbol. If not
+** defined, then do no error processing.
+*/
+#define AACODETYPE unsigned char
+#define AANOCODE 28
+#define AAACTIONTYPE unsigned char
+#define phannot_TOKENTYPE phannot_parser_token*
+typedef union {
+ phannot_TOKENTYPE aa0;
+ zval aa8;
+ int aa55;
+} AAMINORTYPE;
+#define AASTACKDEPTH 100
+#define phannot_ARG_SDECL phannot_parser_status *status;
+#define phannot_ARG_PDECL ,phannot_parser_status *status
+#define phannot_ARG_FETCH phannot_parser_status *status = aapParser->status
+#define phannot_ARG_STORE aapParser->status = status
+#define AANSTATE 40
+#define AANRULE 25
+#define AAERRORSYMBOL 18
+#define AAERRSYMDT aa55
+#define AA_NO_ACTION (AANSTATE+AANRULE+2)
+#define AA_ACCEPT_ACTION (AANSTATE+AANRULE+1)
+#define AA_ERROR_ACTION (AANSTATE+AANRULE)
+
+/* Next are that tables used to determine what action to take based on the
+** current state and lookahead token. These tables are used to implement
+** functions that take a state number and lookahead value and return an
+** action integer.
+**
+** Suppose the action integer is N. Then the action is determined as
+** follows
+**
+** 0 <= N < AANSTATE Shift N. That is, push the lookahead
+** token onto the stack and goto state N.
+**
+** AANSTATE <= N < AANSTATE+AANRULE Reduce by rule N-AANSTATE.
+**
+** N == AANSTATE+AANRULE A syntax error has occurred.
+**
+** N == AANSTATE+AANRULE+1 The parser accepts its input.
+**
+** N == AANSTATE+AANRULE+2 No such action. Denotes unused
+** slots in the aa_action[] table.
+**
+** The action table is constructed as a single large table named aa_action[].
+** Given state S and lookahead X, the action is computed as
+**
+** aa_action[ aa_shift_ofst[S] + X ]
+**
+** If the index value aa_shift_ofst[S]+X is out of range or if the value
+** aa_lookahead[aa_shift_ofst[S]+X] is not equal to X or if aa_shift_ofst[S]
+** is equal to AA_SHIFT_USE_DFLT, it means that the action is not in the table
+** and that aa_default[S] should be used instead.
+**
+** The formula above is for computing the action when the lookahead is
+** a terminal symbol. If the lookahead is a non-terminal (as occurs after
+** a reduce action) then the aa_reduce_ofst[] array is used in place of
+** the aa_shift_ofst[] array and AA_REDUCE_USE_DFLT is used in place of
+** AA_SHIFT_USE_DFLT.
+**
+** The following are the tables generated in this section:
+**
+** aa_action[] A single table containing all actions.
+** aa_lookahead[] A table containing the lookahead for each entry in
+** aa_action. Used to detect hash collisions.
+** aa_shift_ofst[] For each state, the offset into aa_action for
+** shifting terminals.
+** aa_reduce_ofst[] For each state, the offset into aa_action for
+** shifting non-terminals after a reduce.
+** aa_default[] Default action for each state.
+*/
+static AAACTIONTYPE aa_action[] = {
+ /* 0 */ 4, 28, 15, 38, 12, 14, 16, 18, 20, 21,
+ /* 10 */ 22, 23, 24, 4, 31, 4, 28, 15, 40, 12,
+ /* 20 */ 30, 16, 18, 20, 21, 22, 23, 24, 3, 31,
+ /* 30 */ 4, 17, 15, 6, 19, 35, 16, 18, 20, 21,
+ /* 40 */ 22, 23, 24, 5, 31, 15, 7, 27, 11, 16,
+ /* 50 */ 54, 54, 15, 25, 27, 11, 16, 15, 32, 27,
+ /* 60 */ 11, 16, 66, 1, 2, 39, 41, 15, 4, 10,
+ /* 70 */ 11, 16, 15, 9, 9, 37, 16, 8, 13, 36,
+ /* 80 */ 9, 29, 34, 54, 54, 54, 54, 54, 26, 54,
+ /* 90 */ 54, 54, 54, 54, 54, 54, 33,
+};
+static AACODETYPE aa_lookahead[] = {
+ /* 0 */ 2, 3, 22, 5, 6, 25, 26, 9, 10, 11,
+ /* 10 */ 12, 13, 14, 2, 16, 2, 3, 22, 0, 6,
+ /* 20 */ 25, 26, 9, 10, 11, 12, 13, 14, 22, 16,
+ /* 30 */ 2, 3, 22, 4, 6, 25, 26, 9, 10, 11,
+ /* 40 */ 12, 13, 14, 3, 16, 22, 23, 24, 25, 26,
+ /* 50 */ 27, 27, 22, 23, 24, 25, 26, 22, 23, 24,
+ /* 60 */ 25, 26, 19, 20, 21, 22, 0, 22, 2, 24,
+ /* 70 */ 25, 26, 22, 1, 1, 25, 26, 5, 7, 8,
+ /* 80 */ 1, 7, 8, 27, 27, 27, 27, 27, 15, 27,
+ /* 90 */ 27, 27, 27, 27, 27, 27, 17,
+};
+#define AA_SHIFT_USE_DFLT (-3)
+static signed char aa_shift_ofst[] = {
+ /* 0 */ 11, 18, 66, -3, 40, 29, -2, 72, -3, 13,
+ /* 10 */ -3, -3, 71, 28, -3, -3, -3, -3, -3, -3,
+ /* 20 */ -3, -3, -3, -3, 13, 73, -3, -3, 74, 28,
+ /* 30 */ -3, 13, 79, -3, 28, -3, 28, -3, -3, -3,
+};
+#define AA_REDUCE_USE_DFLT (-21)
+static signed char aa_reduce_ofst[] = {
+ /* 0 */ 43, -21, 6, -21, -21, -21, 23, -21, -21, 45,
+ /* 10 */ -21, -21, -21, -20, -21, -21, -21, -21, -21, -21,
+ /* 20 */ -21, -21, -21, -21, 30, -21, -21, -21, -21, -5,
+ /* 30 */ -21, 35, -21, -21, 10, -21, 50, -21, -21, -21,
+};
+static AAACTIONTYPE aa_default[] = {
+ /* 0 */ 65, 65, 65, 42, 65, 46, 65, 65, 44, 65,
+ /* 10 */ 47, 49, 58, 65, 50, 54, 55, 56, 57, 58,
+ /* 20 */ 59, 60, 61, 62, 65, 65, 63, 48, 56, 65,
+ /* 30 */ 52, 65, 65, 64, 65, 53, 65, 51, 45, 43,
+};
+#define AA_SZ_ACTTAB (sizeof(aa_action)/sizeof(aa_action[0]))
+
+/* The next table maps tokens into fallback tokens. If a construct
+** like the following:
+**
+** %fallback ID X Y Z.
+**
+** appears in the grammer, then ID becomes a fallback token for X, Y,
+** and Z. Whenever one of the tokens X, Y, or Z is input to the parser
+** but it does not parse, the type of the token is changed to ID and
+** the parse is retried before an error is thrown.
+*/
+#ifdef AAFALLBACK
+static const AACODETYPE aaFallback[] = {
+};
+#endif /* AAFALLBACK */
+
+/* The following structure represents a single element of the
+** parser's stack. Information stored includes:
+**
+** + The state number for the parser at this level of the stack.
+**
+** + The value of the token stored at this level of the stack.
+** (In other words, the "major" token.)
+**
+** + The semantic value stored at this level of the stack. This is
+** the information used by the action routines in the grammar.
+** It is sometimes called the "minor" token.
+*/
+struct aaStackEntry {
+ int stateno; /* The state-number */
+ int major; /* The major token value. This is the code
+ ** number for the token at this stack level */
+ AAMINORTYPE minor; /* The user-supplied minor token value. This
+ ** is the value of the token */
+};
+typedef struct aaStackEntry aaStackEntry;
+
+/* The state of the parser is completely contained in an instance of
+** the following structure */
+struct aaParser {
+ int aaidx; /* Index of top element in stack */
+ int aaerrcnt; /* Shifts left before out of the error */
+ phannot_ARG_SDECL /* A place to hold %extra_argument */
+ aaStackEntry aastack[AASTACKDEPTH]; /* The parser's stack */
+};
+typedef struct aaParser aaParser;
+
+#ifndef NDEBUG
+static FILE *aaTraceFILE = 0;
+static char *aaTracePrompt = 0;
+#endif /* NDEBUG */
+
+#ifndef NDEBUG
+static void phannot_Trace(FILE *TraceFILE, char *zTracePrompt){
+ aaTraceFILE = TraceFILE;
+ aaTracePrompt = zTracePrompt;
+ if( aaTraceFILE==0 ) aaTracePrompt = 0;
+ else if( aaTracePrompt==0 ) aaTraceFILE = 0;
}
-// 2572 "parser.php.c"
- break;
- case 115:
-// 642 "parser.php.lemon"
-{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_NOTEQUALS, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(11,&vvmsp[-1].minor);
+#endif /* NDEBUG */
+
+#ifndef NDEBUG
+/* For tracing shifts, the names of all terminals and nonterminals
+** are required. The following table supplies these names */
+static const char *aaTokenName[] = {
+ "$", "COMMA", "AT", "IDENTIFIER",
+ "PARENTHESES_OPEN", "PARENTHESES_CLOSE", "STRING", "EQUALS",
+ "COLON", "INTEGER", "DOUBLE", "NULL",
+ "FALSE", "TRUE", "BRACKET_OPEN", "BRACKET_CLOSE",
+ "SBRACKET_OPEN", "SBRACKET_CLOSE", "error", "program",
+ "annotation_language", "annotation_list", "annotation", "argument_list",
+ "argument_item", "expr", "array",
+};
+#endif /* NDEBUG */
+
+#ifndef NDEBUG
+/* For tracing reduce actions, the names of all rules are required.
+*/
+static const char *aaRuleName[] = {
+ /* 0 */ "program ::= annotation_language",
+ /* 1 */ "annotation_language ::= annotation_list",
+ /* 2 */ "annotation_list ::= annotation_list annotation",
+ /* 3 */ "annotation_list ::= annotation",
+ /* 4 */ "annotation ::= AT IDENTIFIER PARENTHESES_OPEN argument_list PARENTHESES_CLOSE",
+ /* 5 */ "annotation ::= AT IDENTIFIER PARENTHESES_OPEN PARENTHESES_CLOSE",
+ /* 6 */ "annotation ::= AT IDENTIFIER",
+ /* 7 */ "argument_list ::= argument_list COMMA argument_item",
+ /* 8 */ "argument_list ::= argument_item",
+ /* 9 */ "argument_item ::= expr",
+ /* 10 */ "argument_item ::= STRING EQUALS expr",
+ /* 11 */ "argument_item ::= STRING COLON expr",
+ /* 12 */ "argument_item ::= IDENTIFIER EQUALS expr",
+ /* 13 */ "argument_item ::= IDENTIFIER COLON expr",
+ /* 14 */ "expr ::= annotation",
+ /* 15 */ "expr ::= array",
+ /* 16 */ "expr ::= IDENTIFIER",
+ /* 17 */ "expr ::= INTEGER",
+ /* 18 */ "expr ::= STRING",
+ /* 19 */ "expr ::= DOUBLE",
+ /* 20 */ "expr ::= NULL",
+ /* 21 */ "expr ::= FALSE",
+ /* 22 */ "expr ::= TRUE",
+ /* 23 */ "array ::= BRACKET_OPEN argument_list BRACKET_CLOSE",
+ /* 24 */ "array ::= SBRACKET_OPEN argument_list SBRACKET_CLOSE",
+};
+#endif /* NDEBUG */
+
+const char *phannot_TokenName(int tokenType){
+#ifndef NDEBUG
+ if( tokenType>0 && tokenType<(sizeof(aaTokenName)/sizeof(aaTokenName[0])) ){
+ return aaTokenName[tokenType];
+ }else{
+ return "Unknown";
+ }
+#else
+ return "";
+#endif
}
-// 2580 "parser.php.c"
- break;
- case 116:
-// 646 "parser.php.lemon"
-{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_IDENTICAL, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(16,&vvmsp[-1].minor);
+
+void *phannot_Alloc(void *(*mallocProc)(size_t)){
+ aaParser *pParser;
+ pParser = (aaParser*)(*mallocProc)( (size_t)sizeof(aaParser) );
+ if( pParser ){
+ pParser->aaidx = -1;
+ }
+ return pParser;
}
-// 2588 "parser.php.c"
- break;
- case 117:
-// 650 "parser.php.lemon"
+
+/* The following function deletes the value associated with a
+** symbol. The symbol can be either a terminal or nonterminal.
+** "aamajor" is the symbol code, and "aapminor" is a pointer to
+** the value.
+*/
+static void aa_destructor(AACODETYPE aamajor, AAMINORTYPE *aapminor){
+ switch( aamajor ){
+ /* Here is inserted the actions which take place when a
+ ** terminal or non-terminal is destroyed. This can happen
+ ** when the symbol is popped from the stack during a
+ ** reduce or during error processing or when a parser is
+ ** being destroyed before it is finished parsing.
+ **
+ ** Note: during a reduce, the only symbols destroyed are those
+ ** which appear on the RHS of the rule, but which are not used
+ ** inside the C code.
+ */
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 16:
+ case 17:
+// 67 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_NOTIDENTICAL, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(17,&vvmsp[-1].minor);
+ if ((aapminor->aa0)) {
+ if ((aapminor->aa0)->free_flag) {
+ efree((aapminor->aa0)->token);
+ }
+ efree((aapminor->aa0));
+ }
}
-// 2596 "parser.php.c"
- break;
- case 118:
-// 654 "parser.php.lemon"
+// 380 "parser.php.c"
+ break;
+ case 20:
+ case 21:
+ case 22:
+ case 23:
+ case 24:
+ case 25:
+// 80 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_LESS, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(12,&vvmsp[-1].minor);
+ zval_ptr_dtor(&(aapminor->aa8));
}
-// 2604 "parser.php.c"
- break;
- case 119:
-// 658 "parser.php.lemon"
-{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_GREATER, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(13,&vvmsp[-1].minor);
+// 392 "parser.php.c"
+ break;
+ default: break; /* If no destructor action specified: do nothing */
+ }
}
-// 2612 "parser.php.c"
- break;
- case 120:
-// 662 "parser.php.lemon"
+
+static int aa_pop_parser_stack(aaParser *pParser){
+ AACODETYPE aamajor;
+ aaStackEntry *aatos = &pParser->aastack[pParser->aaidx];
+
+ if( pParser->aaidx<0 ) return 0;
+#ifndef NDEBUG
+ if( aaTraceFILE && pParser->aaidx>=0 ){
+ fprintf(aaTraceFILE,"%sPopping %s\n",
+ aaTracePrompt,
+ aaTokenName[aatos->major]);
+ }
+#endif
+ aamajor = aatos->major;
+ aa_destructor( aamajor, &aatos->minor);
+ pParser->aaidx--;
+ return aamajor;
+}
+
+static void phannot_Free(
+ void *p, /* The parser to be deleted */
+ void (*freeProc)(void*) /* Function used to reclaim memory */
+){
+ aaParser *pParser = (aaParser*)p;
+ if( pParser==0 ) return;
+ while( pParser->aaidx>=0 ) aa_pop_parser_stack(pParser);
+ (*freeProc)((void*)pParser);
+}
+
+static int aa_find_shift_action(
+ aaParser *pParser, /* The parser */
+ int iLookAhead /* The look-ahead token */
+){
+ int i;
+ int stateno = pParser->aastack[pParser->aaidx].stateno;
+
+ /* if( pParser->aaidx<0 ) return AA_NO_ACTION; */
+ i = aa_shift_ofst[stateno];
+ if( i==AA_SHIFT_USE_DFLT ){
+ return aa_default[stateno];
+ }
+ if( iLookAhead==AANOCODE ){
+ return AA_NO_ACTION;
+ }
+ i += iLookAhead;
+ if( i<0 || i>=AA_SZ_ACTTAB || aa_lookahead[i]!=iLookAhead ){
+#ifdef AAFALLBACK
+ int iFallback; /* Fallback token */
+ if( iLookAhead %s\n",
+ aaTracePrompt, aaTokenName[iLookAhead], aaTokenName[iFallback]);
+ }
+#endif
+ return aa_find_shift_action(pParser, iFallback);
+ }
+#endif
+ return aa_default[stateno];
+ }else{
+ return aa_action[i];
+ }
+}
+
+static int aa_find_reduce_action(
+ aaParser *pParser, /* The parser */
+ int iLookAhead /* The look-ahead token */
+){
+ int i;
+ int stateno = pParser->aastack[pParser->aaidx].stateno;
+
+ i = aa_reduce_ofst[stateno];
+ if( i==AA_REDUCE_USE_DFLT ){
+ return aa_default[stateno];
+ }
+ if( iLookAhead==AANOCODE ){
+ return AA_NO_ACTION;
+ }
+ i += iLookAhead;
+ if( i<0 || i>=AA_SZ_ACTTAB || aa_lookahead[i]!=iLookAhead ){
+ return aa_default[stateno];
+ }else{
+ return aa_action[i];
+ }
+}
+
+static void aa_shift(
+ aaParser *aapParser, /* The parser to be shifted */
+ int aaNewState, /* The new state to shift in */
+ int aaMajor, /* The major token to shift in */
+ AAMINORTYPE *aapMinor /* Pointer ot the minor token to shift in */
+){
+ aaStackEntry *aatos;
+ aapParser->aaidx++;
+ if( aapParser->aaidx>=AASTACKDEPTH ){
+ phannot_ARG_FETCH;
+ aapParser->aaidx--;
+#ifndef NDEBUG
+ if( aaTraceFILE ){
+ fprintf(aaTraceFILE,"%sStack Overflow!\n",aaTracePrompt);
+ }
+#endif
+ while( aapParser->aaidx>=0 ) aa_pop_parser_stack(aapParser);
+ /* Here code is inserted which will execute if the parser
+ ** stack every overflows */
+ phannot_ARG_STORE; /* Suppress warning about unused %extra_argument var */
+ return;
+ }
+ aatos = &aapParser->aastack[aapParser->aaidx];
+ aatos->stateno = aaNewState;
+ aatos->major = aaMajor;
+ aatos->minor = *aapMinor;
+#ifndef NDEBUG
+ if( aaTraceFILE && aapParser->aaidx>0 ){
+ int i;
+ fprintf(aaTraceFILE,"%sShift %d\n",aaTracePrompt,aaNewState);
+ fprintf(aaTraceFILE,"%sStack:",aaTracePrompt);
+ for(i=1; i<=aapParser->aaidx; i++)
+ fprintf(aaTraceFILE," %s",aaTokenName[aapParser->aastack[i].major]);
+ fprintf(aaTraceFILE,"\n");
+ }
+#endif
+}
+
+/* The following table contains information about every rule that
+** is used during the reduce.
+*/
+static struct {
+ AACODETYPE lhs; /* Symbol on the left-hand side of the rule */
+ unsigned char nrhs; /* Number of right-hand side symbols in the rule */
+} aaRuleInfo[] = {
+ { 19, 1 },
+ { 20, 1 },
+ { 21, 2 },
+ { 21, 1 },
+ { 22, 5 },
+ { 22, 4 },
+ { 22, 2 },
+ { 23, 3 },
+ { 23, 1 },
+ { 24, 1 },
+ { 24, 3 },
+ { 24, 3 },
+ { 24, 3 },
+ { 24, 3 },
+ { 25, 1 },
+ { 25, 1 },
+ { 25, 1 },
+ { 25, 1 },
+ { 25, 1 },
+ { 25, 1 },
+ { 25, 1 },
+ { 25, 1 },
+ { 25, 1 },
+ { 26, 3 },
+ { 26, 3 },
+};
+
+static void aa_accept(aaParser*); /* Forward Declaration */
+
+static void aa_reduce(
+ aaParser *aapParser, /* The parser */
+ int aaruleno /* Number of the rule by which to reduce */
+){
+ int aagoto; /* The next state */
+ int aaact; /* The next action */
+ AAMINORTYPE aagotominor; /* The LHS of the rule reduced */
+ aaStackEntry *aamsp; /* The top of the parser's stack */
+ int aasize; /* Amount to pop the stack */
+ phannot_ARG_FETCH;
+ aamsp = &aapParser->aastack[aapParser->aaidx];
+#ifndef NDEBUG
+ if( aaTraceFILE && aaruleno>=0
+ && aaruleno
+ ** { ... } // User supplied code
+ ** //
+ ** break;
+ */
+ case 0:
+// 76 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_GREATEREQUAL, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(14,&vvmsp[-1].minor);
+ ZVAL_ZVAL(&status->ret, &aamsp[0].minor.aa8, 1, 1);
}
-// 2620 "parser.php.c"
+// 634 "parser.php.c"
break;
- case 121:
-// 666 "parser.php.lemon"
+ case 1:
+ case 14:
+ case 15:
+// 84 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_LESSEQUAL, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(15,&vvmsp[-1].minor);
+ aagotominor.aa8 = aamsp[0].minor.aa8;
}
-// 2628 "parser.php.c"
+// 643 "parser.php.c"
break;
- case 123:
-// 674 "parser.php.lemon"
+ case 2:
+// 92 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_IN, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(8,&vvmsp[-1].minor);
+ phannot_ret_zval_list(&aagotominor.aa8, &aamsp[-1].minor.aa8, &aamsp[0].minor.aa8);
}
-// 2636 "parser.php.c"
+// 650 "parser.php.c"
break;
- case 124:
-// 678 "parser.php.lemon"
+ case 3:
+ case 8:
+// 96 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_NOT_IN, &vvmsp[-3].minor.vv186, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(26,&vvmsp[-2].minor);
- vv_destructor(8,&vvmsp[-1].minor);
+ phannot_ret_zval_list(&aagotominor.aa8, NULL, &aamsp[0].minor.aa8);
}
-// 2645 "parser.php.c"
+// 658 "parser.php.c"
break;
- case 125:
-// 682 "parser.php.lemon"
+ case 4:
+// 104 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_NOT, NULL, &vvmsp[0].minor.vv186, NULL, status->scanner_state);
- vv_destructor(26,&vvmsp[-1].minor);
+ phannot_ret_annotation(&aagotominor.aa8, aamsp[-3].minor.aa0, &aamsp[-1].minor.aa8, status->scanner_state);
+ aa_destructor(2,&aamsp[-4].minor);
+ aa_destructor(4,&aamsp[-2].minor);
+ aa_destructor(5,&aamsp[0].minor);
}
-// 2653 "parser.php.c"
+// 668 "parser.php.c"
break;
- case 126:
-// 686 "parser.php.lemon"
+ case 5:
+// 108 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_INCR, &vvmsp[-1].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(27,&vvmsp[0].minor);
+ phannot_ret_annotation(&aagotominor.aa8, aamsp[-2].minor.aa0, NULL, status->scanner_state);
+ aa_destructor(2,&aamsp[-3].minor);
+ aa_destructor(4,&aamsp[-1].minor);
+ aa_destructor(5,&aamsp[0].minor);
}
-// 2661 "parser.php.c"
+// 678 "parser.php.c"
break;
- case 127:
-// 690 "parser.php.lemon"
+ case 6:
+// 112 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_DECR, &vvmsp[-1].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(28,&vvmsp[0].minor);
+ phannot_ret_annotation(&aagotominor.aa8, aamsp[0].minor.aa0, NULL, status->scanner_state);
+ aa_destructor(2,&aamsp[-1].minor);
}
-// 2669 "parser.php.c"
+// 686 "parser.php.c"
break;
- case 128:
-// 694 "parser.php.lemon"
+ case 7:
+// 120 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_ENCLOSED, &vvmsp[-1].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(29,&vvmsp[-2].minor);
- vv_destructor(52,&vvmsp[0].minor);
+ phannot_ret_zval_list(&aagotominor.aa8, &aamsp[-2].minor.aa8, &aamsp[0].minor.aa8);
+ aa_destructor(1,&aamsp[-1].minor);
}
-// 2678 "parser.php.c"
+// 694 "parser.php.c"
break;
- case 129:
-// 698 "parser.php.lemon"
+ case 9:
+// 132 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_ARRAY, NULL, NULL, NULL, status->scanner_state);
- vv_destructor(24,&vvmsp[-1].minor);
- vv_destructor(50,&vvmsp[0].minor);
+ phannot_ret_named_item(&aagotominor.aa8, NULL, &aamsp[0].minor.aa8);
}
-// 2687 "parser.php.c"
+// 701 "parser.php.c"
break;
- case 130:
-// 702 "parser.php.lemon"
+ case 10:
+ case 12:
+// 136 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_ARRAY, &vvmsp[-1].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(24,&vvmsp[-2].minor);
- vv_destructor(50,&vvmsp[0].minor);
+ phannot_ret_named_item(&aagotominor.aa8, aamsp[-2].minor.aa0, &aamsp[0].minor.aa8);
+ aa_destructor(7,&aamsp[-1].minor);
}
-// 2696 "parser.php.c"
+// 710 "parser.php.c"
break;
- case 131:
-// 706 "parser.php.lemon"
+ case 11:
+ case 13:
+// 140 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_ARRAY, NULL, NULL, NULL, status->scanner_state);
- vv_destructor(87,&vvmsp[-1].minor);
- vv_destructor(88,&vvmsp[0].minor);
+ phannot_ret_named_item(&aagotominor.aa8, aamsp[-2].minor.aa0, &aamsp[0].minor.aa8);
+ aa_destructor(8,&aamsp[-1].minor);
}
-// 2705 "parser.php.c"
+// 719 "parser.php.c"
break;
- case 132:
-// 710 "parser.php.lemon"
+ case 16:
+// 164 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_ARRAY, &vvmsp[-1].minor.vv186, NULL, NULL, status->scanner_state);
- vv_destructor(87,&vvmsp[-2].minor);
- vv_destructor(88,&vvmsp[0].minor);
+ phannot_ret_literal_zval(&aagotominor.aa8, PHANNOT_T_IDENTIFIER, aamsp[0].minor.aa0);
}
-// 2714 "parser.php.c"
+// 726 "parser.php.c"
break;
- case 134:
-// 718 "parser.php.lemon"
+ case 17:
+// 168 "parser.php.lemon"
{
- phvolt_ret_expr(&vvgotominor.vv186, PHVOLT_T_TERNARY, &vvmsp[-2].minor.vv186, &vvmsp[0].minor.vv186, &vvmsp[-4].minor.vv186, status->scanner_state);
- vv_destructor(3,&vvmsp[-3].minor);
- vv_destructor(4,&vvmsp[-1].minor);
+ phannot_ret_literal_zval(&aagotominor.aa8, PHANNOT_T_INTEGER, aamsp[0].minor.aa0);
}
-// 2723 "parser.php.c"
+// 733 "parser.php.c"
break;
- case 135:
-// 722 "parser.php.lemon"
+ case 18:
+// 172 "parser.php.lemon"
{
- phvolt_ret_slice(&vvgotominor.vv186, &vvmsp[-4].minor.vv186, NULL, &vvmsp[-1].minor.vv186, status->scanner_state);
- vv_destructor(24,&vvmsp[-3].minor);
- vv_destructor(4,&vvmsp[-2].minor);
- vv_destructor(50,&vvmsp[0].minor);
+ phannot_ret_literal_zval(&aagotominor.aa8, PHANNOT_T_STRING, aamsp[0].minor.aa0);
}
-// 2733 "parser.php.c"
+// 740 "parser.php.c"
break;
- case 136:
-// 726 "parser.php.lemon"
+ case 19:
+// 176 "parser.php.lemon"
{
- phvolt_ret_slice(&vvgotominor.vv186, &vvmsp[-4].minor.vv186, &vvmsp[-2].minor.vv186, NULL, status->scanner_state);
- vv_destructor(24,&vvmsp[-3].minor);
- vv_destructor(4,&vvmsp[-1].minor);
- vv_destructor(50,&vvmsp[0].minor);
+ phannot_ret_literal_zval(&aagotominor.aa8, PHANNOT_T_DOUBLE, aamsp[0].minor.aa0);
}
-// 2743 "parser.php.c"
+// 747 "parser.php.c"
break;
- case 137:
-// 730 "parser.php.lemon"
+ case 20:
+// 180 "parser.php.lemon"
{
- phvolt_ret_slice(&vvgotominor.vv186, &vvmsp[-5].minor.vv186, &vvmsp[-3].minor.vv186, &vvmsp[-1].minor.vv186, status->scanner_state);
- vv_destructor(24,&vvmsp[-4].minor);
- vv_destructor(4,&vvmsp[-2].minor);
- vv_destructor(50,&vvmsp[0].minor);
+ phannot_ret_literal_zval(&aagotominor.aa8, PHANNOT_T_NULL, NULL);
+ aa_destructor(11,&aamsp[0].minor);
}
-// 2753 "parser.php.c"
+// 755 "parser.php.c"
break;
- case 142:
- case 150:
-// 750 "parser.php.lemon"
+ case 21:
+// 184 "parser.php.lemon"
{
- phvolt_ret_named_item(&vvgotominor.vv186, vvmsp[-2].minor.vv0, &vvmsp[0].minor.vv186, status->scanner_state);
- vv_destructor(4,&vvmsp[-1].minor);
+ phannot_ret_literal_zval(&aagotominor.aa8, PHANNOT_T_FALSE, NULL);
+ aa_destructor(12,&aamsp[0].minor);
}
-// 2762 "parser.php.c"
+// 763 "parser.php.c"
break;
- case 143:
- case 149:
-// 754 "parser.php.lemon"
+ case 22:
+// 188 "parser.php.lemon"
{
- phvolt_ret_named_item(&vvgotominor.vv186, NULL, &vvmsp[0].minor.vv186, status->scanner_state);
+ phannot_ret_literal_zval(&aagotominor.aa8, PHANNOT_T_TRUE, NULL);
+ aa_destructor(13,&aamsp[0].minor);
}
-// 2770 "parser.php.c"
+// 771 "parser.php.c"
break;
- case 145:
-// 762 "parser.php.lemon"
+ case 23:
+// 192 "parser.php.lemon"
{
- phvolt_ret_func_call(&vvgotominor.vv186, &vvmsp[-3].minor.vv186, &vvmsp[-1].minor.vv186, status->scanner_state);
- vv_destructor(29,&vvmsp[-2].minor);
- vv_destructor(52,&vvmsp[0].minor);
+ phannot_ret_array(&aagotominor.aa8, &aamsp[-1].minor.aa8);
+ aa_destructor(14,&aamsp[-2].minor);
+ aa_destructor(15,&aamsp[0].minor);
}
-// 2779 "parser.php.c"
+// 780 "parser.php.c"
break;
- case 146:
-// 766 "parser.php.lemon"
+ case 24:
+// 196 "parser.php.lemon"
{
- phvolt_ret_func_call(&vvgotominor.vv186, &vvmsp[-2].minor.vv186, NULL, status->scanner_state);
- vv_destructor(29,&vvmsp[-1].minor);
- vv_destructor(52,&vvmsp[0].minor);
+ phannot_ret_array(&aagotominor.aa8, &aamsp[-1].minor.aa8);
+ aa_destructor(16,&aamsp[-2].minor);
+ aa_destructor(17,&aamsp[0].minor);
}
-// 2788 "parser.php.c"
+// 789 "parser.php.c"
break;
};
- vvgoto = vvRuleInfo[vvruleno].lhs;
- vvsize = vvRuleInfo[vvruleno].nrhs;
- vvpParser->vvidx -= vvsize;
- vvact = vv_find_reduce_action(vvpParser,vvgoto);
- if( vvact < VVNSTATE ){
- vv_shift(vvpParser,vvact,vvgoto,&vvgotominor);
- }else if( vvact == VVNSTATE + VVNRULE + 1 ){
- vv_accept(vvpParser);
+ aagoto = aaRuleInfo[aaruleno].lhs;
+ aasize = aaRuleInfo[aaruleno].nrhs;
+ aapParser->aaidx -= aasize;
+ aaact = aa_find_reduce_action(aapParser,aagoto);
+ if( aaact < AANSTATE ){
+ aa_shift(aapParser,aaact,aagoto,&aagotominor);
+ }else if( aaact == AANSTATE + AANRULE + 1 ){
+ aa_accept(aapParser);
}
}
-static void vv_parse_failed(
- vvParser *vvpParser /* The parser */
+static void aa_parse_failed(
+ aaParser *aapParser /* The parser */
){
- phvolt_ARG_FETCH;
+ phannot_ARG_FETCH;
#ifndef NDEBUG
- if( vvTraceFILE ){
- fprintf(vvTraceFILE,"%sFail!\n",vvTracePrompt);
+ if( aaTraceFILE ){
+ fprintf(aaTraceFILE,"%sFail!\n",aaTracePrompt);
}
#endif
- while( vvpParser->vvidx>=0 ) vv_pop_parser_stack(vvpParser);
+ while( aapParser->aaidx>=0 ) aa_pop_parser_stack(aapParser);
/* Here code is inserted which will be executed whenever the
** parser fails */
- phvolt_ARG_STORE; /* Suppress warning about unused %extra_argument variable */
+ phannot_ARG_STORE; /* Suppress warning about unused %extra_argument variable */
}
-static void vv_syntax_error(
- vvParser *vvpParser, /* The parser */
- int vvmajor, /* The major type of the error token */
- VVMINORTYPE vvminor /* The minor type of the error token */
+static void aa_syntax_error(
+ aaParser *aapParser, /* The parser */
+ int aamajor, /* The major type of the error token */
+ AAMINORTYPE aaminor /* The minor type of the error token */
){
- phvolt_ARG_FETCH;
-#define VTOKEN (vvminor.vv0)
-// 54 "parser.php.lemon"
-
- {
- smart_str error_str = {0};
+ phannot_ARG_FETCH;
+#define ATOKEN (aaminor.aa0)
+// 22 "parser.php.lemon"
+ if (status->scanner_state->start_length) {
char *token_name = NULL;
- const phvolt_token_names *tokens = phvolt_tokens;
- int token_len = 0;
+ const phannot_token_names *tokens = phannot_tokens;
int active_token = status->scanner_state->active_token;
+ unsigned int near_length = status->scanner_state->start_length;
- if (status->scanner_state->start_length) {
-
- if (active_token) {
-
- do {
- if (tokens->code == active_token) {
- token_name = tokens->name;
- token_len = tokens->len;
- break;
- }
- ++tokens;
- } while (tokens[0].code != 0);
-
- }
-
- smart_str_appendl(&error_str, "Syntax error, unexpected token ", sizeof("Syntax error, unexpected token ") - 1);
- if (!token_name) {
- smart_str_appendl(&error_str, "UNKNOWN", sizeof("UNKNOWN") - 1);
- } else {
- smart_str_appendl(&error_str, token_name, token_len);
- }
-
- if (status->token->value) {
- smart_str_appendc(&error_str, '(');
- smart_str_appendl(&error_str, status->token->value, status->token->len);
- smart_str_appendc(&error_str, ')');
- }
-
- smart_str_appendl(&error_str, " in ", sizeof(" in ") - 1);
- smart_str_appendl(&error_str, Z_STRVAL_P(status->scanner_state->active_file), Z_STRLEN_P(status->scanner_state->active_file));
- smart_str_appendl(&error_str, " on line ", sizeof(" on line ") - 1);
-
- {
- char stmp[MAX_LENGTH_OF_LONG + 1];
- int str_len;
- str_len = slprintf(stmp, sizeof(stmp), "%u", status->scanner_state->active_line);
- smart_str_appendl(&error_str, stmp, str_len);
- }
-
- } else {
-
- smart_str_appendl(&error_str, "Syntax error, unexpected EOF in ", sizeof("Syntax error, unexpected EOF in ") - 1);
- smart_str_appendl(&error_str, Z_STRVAL_P(status->scanner_state->active_file), Z_STRLEN_P(status->scanner_state->active_file));
-
- /* Report unclosed 'if' blocks */
- if ((status->scanner_state->if_level + status->scanner_state->old_if_level) > 0) {
- if ((status->scanner_state->if_level + status->scanner_state->old_if_level) == 1) {
- smart_str_appendl(&error_str, ", there is one 'if' block without close", sizeof(", there is one 'if' block without close") - 1);
- } else {
- smart_str_appendl(&error_str, ", there are ", sizeof(", there are ") - 1);
- {
- char stmp[MAX_LENGTH_OF_LONG + 1];
- int str_len;
- str_len = slprintf(stmp, sizeof(stmp), "%u", status->scanner_state->if_level + status->scanner_state->old_if_level);
- smart_str_appendl(&error_str, stmp, str_len);
- }
- smart_str_appendl(&error_str, " 'if' blocks without close", sizeof(" 'if' blocks without close") - 1);
- }
- }
-
- /* Report unclosed 'for' blocks */
- if (status->scanner_state->for_level > 0) {
- if (status->scanner_state->for_level == 1) {
- smart_str_appendl(&error_str, ", there is one 'for' block without close", sizeof(", there is one 'for' block without close") - 1);
- } else {
- smart_str_appendl(&error_str, ", there are ", sizeof(", there are ") - 1);
- {
- char stmp[MAX_LENGTH_OF_LONG + 1];
- int str_len;
- str_len = slprintf(stmp, sizeof(stmp), "%u", status->scanner_state->if_level);
- smart_str_appendl(&error_str, stmp, str_len);
- }
- smart_str_appendl(&error_str, " 'for' blocks without close", sizeof(" 'for' blocks without close") - 1);
- }
- }
-
- /* Report unclosed 'switch' blocks */
- if (status->scanner_state->switch_level > 0) {
- smart_str_appendl(&error_str, ", there is a 'switch' block without 'endswitch'", sizeof(", there is a 'switch' block without 'endswitch'") - 1);
- }
+ if (active_token) {
+ do {
+ if (tokens->code == active_token) {
+ token_name = tokens->name;
+ break;
+ }
+ ++tokens;
+ } while (tokens[0].code != 0);
}
- smart_str_0(&error_str);
+ if (!token_name) {
+ token_name = "UNKNOWN";
+ }
- if (error_str.s) {
- status->syntax_error = estrndup(ZSTR_VAL(error_str.s), ZSTR_LEN(error_str.s));
- status->syntax_error_len = ZSTR_LEN(error_str.s);
+ if (near_length > 0) {
+ if (status->token->value) {
+ spprintf(&status->syntax_error, 0, "Syntax error, unexpected token %s(%s), near to '%s' in %s on line %d", token_name, status->token->value, status->scanner_state->start, status->scanner_state->active_file, status->scanner_state->active_line);
+ } else {
+ spprintf(&status->syntax_error, 0, "Syntax error, unexpected token %s, near to '%s' in %s on line %d", token_name, status->scanner_state->start, status->scanner_state->active_file, status->scanner_state->active_line);
+ }
} else {
- status->syntax_error = NULL;
+ if (active_token != PHANNOT_T_IGNORE) {
+ if (status->token->value) {
+ spprintf(&status->syntax_error, 0, "Syntax error, unexpected token %s(%s), at the end of docblock in %s on line %d", token_name, status->token->value, status->scanner_state->active_file, status->scanner_state->active_line);
+ } else {
+ spprintf(&status->syntax_error, 0, "Syntax error, unexpected token %s, at the end of docblock in %s on line %d", token_name, status->scanner_state->active_file, status->scanner_state->active_line);
+ }
+ } else {
+ spprintf(&status->syntax_error, 0, "Syntax error, unexpected EOF, at the end of docblock in %s on line %d", status->scanner_state->active_file, status->scanner_state->active_line);
+ }
}
+ } else {
+ spprintf(&status->syntax_error, 0, "Syntax error, unexpected EOF in %s", status->scanner_state->active_file);
}
- status->status = PHVOLT_PARSING_FAILED;
+ status->status = PHANNOT_PARSING_FAILED;
-// 2934 "parser.php.c"
- phvolt_ARG_STORE; /* Suppress warning about unused %extra_argument variable */
+// 876 "parser.php.c"
+ phannot_ARG_STORE; /* Suppress warning about unused %extra_argument variable */
}
-static void vv_accept(
- vvParser *vvpParser /* The parser */
+static void aa_accept(
+ aaParser *aapParser /* The parser */
){
- phvolt_ARG_FETCH;
+ phannot_ARG_FETCH;
#ifndef NDEBUG
- if( vvTraceFILE ){
- fprintf(vvTraceFILE,"%sAccept!\n",vvTracePrompt);
+ if( aaTraceFILE ){
+ fprintf(aaTraceFILE,"%sAccept!\n",aaTracePrompt);
}
#endif
- while( vvpParser->vvidx>=0 ) vv_pop_parser_stack(vvpParser);
+ while( aapParser->aaidx>=0 ) aa_pop_parser_stack(aapParser);
/* Here code is inserted which will be executed whenever the
** parser accepts */
- phvolt_ARG_STORE; /* Suppress warning about unused %extra_argument variable */
+ phannot_ARG_STORE; /* Suppress warning about unused %extra_argument variable */
}
/* The main parser program.
** The first argument is a pointer to a structure obtained from
-** "phvolt_Alloc" which describes the current state of the parser.
+** "phannot_Alloc" which describes the current state of the parser.
** The second argument is the major token number. The third is
** the minor token. The fourth optional argument is whatever the
** user wants (and specified in the grammar) and is available for
@@ -185818,57 +176561,57 @@ static void vv_accept(
** Outputs:
** None.
*/
-static void phvolt_(
- void *vvp, /* The parser */
- int vvmajor, /* The major token code number */
- phvolt_TOKENTYPE vvminor /* The value for the token */
- phvolt_ARG_PDECL /* Optional %extra_argument parameter */
+static void phannot_(
+ void *aap, /* The parser */
+ int aamajor, /* The major token code number */
+ phannot_TOKENTYPE aaminor /* The value for the token */
+ phannot_ARG_PDECL /* Optional %extra_argument parameter */
){
- VVMINORTYPE vvminorunion;
- int vvact; /* The parser action. */
- int vvendofinput; /* True if we are at the end of input */
- int vverrorhit = 0; /* True if vvmajor has invoked an error */
- vvParser *vvpParser; /* The parser */
+ AAMINORTYPE aaminorunion;
+ int aaact; /* The parser action. */
+ int aaendofinput; /* True if we are at the end of input */
+ int aaerrorhit = 0; /* True if aamajor has invoked an error */
+ aaParser *aapParser; /* The parser */
/* (re)initialize the parser, if necessary */
- vvpParser = (vvParser*)vvp;
- if( vvpParser->vvidx<0 ){
- if( vvmajor==0 ) return;
- vvpParser->vvidx = 0;
- vvpParser->vverrcnt = -1;
- vvpParser->vvstack[0].stateno = 0;
- vvpParser->vvstack[0].major = 0;
+ aapParser = (aaParser*)aap;
+ if( aapParser->aaidx<0 ){
+ if( aamajor==0 ) return;
+ aapParser->aaidx = 0;
+ aapParser->aaerrcnt = -1;
+ aapParser->aastack[0].stateno = 0;
+ aapParser->aastack[0].major = 0;
}
- vvminorunion.vv0 = vvminor;
- vvendofinput = (vvmajor==0);
- phvolt_ARG_STORE;
+ aaminorunion.aa0 = aaminor;
+ aaendofinput = (aamajor==0);
+ phannot_ARG_STORE;
#ifndef NDEBUG
- if( vvTraceFILE ){
- fprintf(vvTraceFILE,"%sInput %s\n",vvTracePrompt,vvTokenName[vvmajor]);
+ if( aaTraceFILE ){
+ fprintf(aaTraceFILE,"%sInput %s\n",aaTracePrompt,aaTokenName[aamajor]);
}
#endif
do{
- vvact = vv_find_shift_action(vvpParser,vvmajor);
- if( vvactvverrcnt--;
- if( vvendofinput && vvpParser->vvidx>=0 ){
- vvmajor = 0;
+ aaact = aa_find_shift_action(aapParser,aamajor);
+ if( aaactaaerrcnt--;
+ if( aaendofinput && aapParser->aaidx>=0 ){
+ aamajor = 0;
}else{
- vvmajor = VVNOCODE;
+ aamajor = AANOCODE;
}
- }else if( vvact < VVNSTATE + VVNRULE ){
- vv_reduce(vvpParser,vvact-VVNSTATE);
- }else if( vvact == VV_ERROR_ACTION ){
- int vvmx;
+ }else if( aaact < AANSTATE + AANRULE ){
+ aa_reduce(aapParser,aaact-AANSTATE);
+ }else if( aaact == AA_ERROR_ACTION ){
+ int aamx;
#ifndef NDEBUG
- if( vvTraceFILE ){
- fprintf(vvTraceFILE,"%sSyntax Error!\n",vvTracePrompt);
+ if( aaTraceFILE ){
+ fprintf(aaTraceFILE,"%sSyntax Error!\n",aaTracePrompt);
}
#endif
-#ifdef VVERRORSYMBOL
+#ifdef AAERRORSYMBOL
/* A syntax error has occurred.
** The response to an error depends upon whether or not the
** grammar defines an error token "ERROR".
@@ -185888,40 +176631,40 @@ static void phvolt_(
** shifted successfully.
**
*/
- if( vvpParser->vverrcnt<0 ){
- vv_syntax_error(vvpParser,vvmajor,vvminorunion);
+ if( aapParser->aaerrcnt<0 ){
+ aa_syntax_error(aapParser,aamajor,aaminorunion);
}
- vvmx = vvpParser->vvstack[vvpParser->vvidx].major;
- if( vvmx==VVERRORSYMBOL || vverrorhit ){
+ aamx = aapParser->aastack[aapParser->aaidx].major;
+ if( aamx==AAERRORSYMBOL || aaerrorhit ){
#ifndef NDEBUG
- if( vvTraceFILE ){
- fprintf(vvTraceFILE,"%sDiscard input token %s\n",
- vvTracePrompt,vvTokenName[vvmajor]);
+ if( aaTraceFILE ){
+ fprintf(aaTraceFILE,"%sDiscard input token %s\n",
+ aaTracePrompt,aaTokenName[aamajor]);
}
#endif
- vv_destructor(vvmajor,&vvminorunion);
- vvmajor = VVNOCODE;
+ aa_destructor(aamajor,&aaminorunion);
+ aamajor = AANOCODE;
}else{
while(
- vvpParser->vvidx >= 0 &&
- vvmx != VVERRORSYMBOL &&
- (vvact = vv_find_shift_action(vvpParser,VVERRORSYMBOL)) >= VVNSTATE
+ aapParser->aaidx >= 0 &&
+ aamx != AAERRORSYMBOL &&
+ (aaact = aa_find_shift_action(aapParser,AAERRORSYMBOL)) >= AANSTATE
){
- vv_pop_parser_stack(vvpParser);
+ aa_pop_parser_stack(aapParser);
}
- if( vvpParser->vvidx < 0 || vvmajor==0 ){
- vv_destructor(vvmajor,&vvminorunion);
- vv_parse_failed(vvpParser);
- vvmajor = VVNOCODE;
- }else if( vvmx!=VVERRORSYMBOL ){
- VVMINORTYPE u2;
- u2.VVERRSYMDT = 0;
- vv_shift(vvpParser,vvact,VVERRORSYMBOL,&u2);
+ if( aapParser->aaidx < 0 || aamajor==0 ){
+ aa_destructor(aamajor,&aaminorunion);
+ aa_parse_failed(aapParser);
+ aamajor = AANOCODE;
+ }else if( aamx!=AAERRORSYMBOL ){
+ AAMINORTYPE u2;
+ u2.AAERRSYMDT = 0;
+ aa_shift(aapParser,aaact,AAERRORSYMBOL,&u2);
}
}
- vvpParser->vverrcnt = 3;
- vverrorhit = 1;
-#else /* VVERRORSYMBOL is not defined */
+ aapParser->aaerrcnt = 3;
+ aaerrorhit = 1;
+#else /* AAERRORSYMBOL is not defined */
/* This is what we do if the grammar does not define ERROR:
**
** * Report an error message, and throw away the input token.
@@ -185931,25 +176674,24 @@ static void phvolt_(
** As before, subsequent error messages are suppressed until
** three input tokens have been successfully shifted.
*/
- if( vvpParser->vverrcnt<=0 ){
- vv_syntax_error(vvpParser,vvmajor,vvminorunion);
+ if( aapParser->aaerrcnt<=0 ){
+ aa_syntax_error(aapParser,aamajor,aaminorunion);
}
- vvpParser->vverrcnt = 3;
- vv_destructor(vvmajor,&vvminorunion);
- if( vvendofinput ){
- vv_parse_failed(vvpParser);
+ aapParser->aaerrcnt = 3;
+ aa_destructor(aamajor,&aaminorunion);
+ if( aaendofinput ){
+ aa_parse_failed(aapParser);
}
- vvmajor = VVNOCODE;
+ aamajor = AANOCODE;
#endif
}else{
- vv_accept(vvpParser);
- vvmajor = VVNOCODE;
+ aa_accept(aapParser);
+ aamajor = AANOCODE;
}
- }while( vvmajor!=VVNOCODE && vvpParser->vvidx>=0 );
+ }while( aamajor!=AANOCODE && aapParser->aaidx>=0 );
return;
}
/* base.c
- *
* This file is part of the Phalcon Framework.
*
* (c) Phalcon Team
@@ -185958,784 +176700,351 @@ static void phvolt_(
* LICENSE.txt file that was distributed with this source code.
*/
-const phvolt_token_names phvolt_tokens[] =
+const phannot_token_names phannot_tokens[] =
{
- { SL("INTEGER"), PHVOLT_T_INTEGER },
- { SL("DOUBLE"), PHVOLT_T_DOUBLE },
- { SL("STRING"), PHVOLT_T_STRING },
- { SL("IDENTIFIER"), PHVOLT_T_IDENTIFIER },
- { SL("MINUS"), PHVOLT_T_MINUS },
- { SL("+"), PHVOLT_T_ADD },
- { SL("-"), PHVOLT_T_SUB },
- { SL("*"), PHVOLT_T_MUL },
- { SL("/"), PHVOLT_T_DIV },
- { SL("%%"), PHVOLT_T_MOD },
- { SL("!"), PHVOLT_T_NOT },
- { SL("~"), PHVOLT_T_CONCAT },
- { SL("AND"), PHVOLT_T_AND },
- { SL("OR"), PHVOLT_T_OR },
- { SL("DOT"), PHVOLT_T_DOT },
- { SL("COMMA"), PHVOLT_T_COMMA },
- { SL("EQUALS"), PHVOLT_T_EQUALS },
- { SL("NOT EQUALS"), PHVOLT_T_NOTEQUALS },
- { SL("IDENTICAL"), PHVOLT_T_IDENTICAL },
- { SL("NOT IDENTICAL"), PHVOLT_T_NOTIDENTICAL },
- { SL("NOT"), PHVOLT_T_NOT },
- { SL("RANGE"), PHVOLT_T_RANGE },
- { SL("COLON"), PHVOLT_T_COLON },
- { SL("QUESTION MARK"), PHVOLT_T_QUESTION },
- { SL("<"), PHVOLT_T_LESS },
- { SL("<="), PHVOLT_T_LESSEQUAL },
- { SL(">"), PHVOLT_T_GREATER },
- { SL(">="), PHVOLT_T_GREATEREQUAL },
- { SL("("), PHVOLT_T_PARENTHESES_OPEN },
- { SL(")"), PHVOLT_T_PARENTHESES_CLOSE },
- { SL("["), PHVOLT_T_SBRACKET_OPEN },
- { SL("]"), PHVOLT_T_SBRACKET_CLOSE },
- { SL("{"), PHVOLT_T_CBRACKET_OPEN },
- { SL("}"), PHVOLT_T_CBRACKET_CLOSE },
- { SL("{%"), PHVOLT_T_OPEN_DELIMITER },
- { SL("%}"), PHVOLT_T_CLOSE_DELIMITER },
- { SL("{{"), PHVOLT_T_OPEN_EDELIMITER },
- { SL("}}"), PHVOLT_T_CLOSE_EDELIMITER },
- { SL("IF"), PHVOLT_T_IF },
- { SL("ELSE"), PHVOLT_T_ELSE },
- { SL("ELSEIF"), PHVOLT_T_ELSEIF },
- { SL("ELSEFOR"), PHVOLT_T_ELSEFOR },
- { SL("ENDIF"), PHVOLT_T_ENDIF },
- { SL("FOR"), PHVOLT_T_FOR },
- { SL("SWITCH"), PHVOLT_T_SWITCH },
- { SL("CASE"), PHVOLT_T_CASE },
- { SL("DEFAULT"), PHVOLT_T_DEFAULT },
- { SL("ENDSWITCH"), PHVOLT_T_ENDSWITCH },
- { SL("IN"), PHVOLT_T_IN },
- { SL("ENDFOR"), PHVOLT_T_ENDFOR },
- { SL("SET"), PHVOLT_T_SET },
- { SL("ASSIGN"), PHVOLT_T_ASSIGN },
- { SL("+="), PHVOLT_T_ADD_ASSIGN },
- { SL("-="), PHVOLT_T_SUB_ASSIGN },
- { SL("*="), PHVOLT_T_MUL_ASSIGN },
- { SL("/="), PHVOLT_T_DIV_ASSIGN },
- { SL("++"), PHVOLT_T_INCR },
- { SL("--"), PHVOLT_T_DECR },
- { SL("BLOCK"), PHVOLT_T_BLOCK },
- { SL("ENDBLOCK"), PHVOLT_T_ENDBLOCK },
- { SL("CACHE"), PHVOLT_T_CACHE },
- { SL("ENDCACHE"), PHVOLT_T_ENDCACHE },
- { SL("EXTENDS"), PHVOLT_T_EXTENDS },
- { SL("IS"), PHVOLT_T_IS },
- { SL("DEFINED"), PHVOLT_T_DEFINED },
- { SL("EMPTY"), PHVOLT_T_EMPTY },
- { SL("EVEN"), PHVOLT_T_EVEN },
- { SL("ODD"), PHVOLT_T_ODD },
- { SL("NUMERIC"), PHVOLT_T_NUMERIC },
- { SL("SCALAR"), PHVOLT_T_SCALAR },
- { SL("ITERABLE"), PHVOLT_T_ITERABLE },
- { SL("INCLUDE"), PHVOLT_T_INCLUDE },
- { SL("DO"), PHVOLT_T_DO },
- { SL("WHITESPACE"), PHVOLT_T_IGNORE },
- { SL("AUTOESCAPE"), PHVOLT_T_AUTOESCAPE },
- { SL("ENDAUTOESCAPE"), PHVOLT_T_ENDAUTOESCAPE },
- { SL("CONTINUE"), PHVOLT_T_CONTINUE },
- { SL("BREAK"), PHVOLT_T_BREAK },
- { SL("WITH"), PHVOLT_T_WITH },
- { SL("RETURN"), PHVOLT_T_RETURN },
- { SL("MACRO"), PHVOLT_T_MACRO },
- { SL("ENDMACRO"), PHVOLT_T_ENDMACRO },
- { SL("CALL"), PHVOLT_T_CALL },
- { SL("WITH"), PHVOLT_T_WITH },
- { NULL, 0, 0 }
+ { "INTEGER", PHANNOT_T_INTEGER },
+ { "DOUBLE", PHANNOT_T_DOUBLE },
+ { "STRING", PHANNOT_T_STRING },
+ { "IDENTIFIER", PHANNOT_T_IDENTIFIER },
+ { "@", PHANNOT_T_AT },
+ { ",", PHANNOT_T_COMMA },
+ { "=", PHANNOT_T_EQUALS },
+ { ":", PHANNOT_T_COLON },
+ { "(", PHANNOT_T_PARENTHESES_OPEN },
+ { ")", PHANNOT_T_PARENTHESES_CLOSE },
+ { "{", PHANNOT_T_BRACKET_OPEN },
+ { "}", PHANNOT_T_BRACKET_CLOSE },
+ { "[", PHANNOT_T_SBRACKET_OPEN },
+ { "]", PHANNOT_T_SBRACKET_CLOSE },
+ { "ARBITRARY TEXT", PHANNOT_T_ARBITRARY_TEXT },
+ { NULL, 0 }
};
-/* {{{ phvolt_wrapper_alloc
- Wrapper to alloc memory within the parser. */
-static void *phvolt_wrapper_alloc(size_t bytes)
-{
+static void *phannot_wrapper_alloc(size_t bytes){
return emalloc(bytes);
}
-/* }}} */
-/* {{{ phvolt_wrapper_free
- Wrapper to free memory within the parser. */
-static void phvolt_wrapper_free(void *pointer)
-{
+static void phannot_wrapper_free(void *pointer){
efree(pointer);
}
-/* }}} */
-/* {{{ phvolt_parse_with_token
- Creates a parser_token to be passed to the parser. */
-static void phvolt_parse_with_token(void* phvolt_parser, int opcode, int parsercode, phvolt_scanner_token *token,
- phvolt_parser_status *parser_status)
-{
- phvolt_parser_token *pToken;
+static void phannot_parse_with_token(void* phannot_parser, int opcode, int parsercode, phannot_scanner_token *token, phannot_parser_status *parser_status){
- pToken = emalloc(sizeof(phvolt_parser_token));
+ phannot_parser_token *pToken;
+
+ pToken = emalloc(sizeof(phannot_parser_token));
pToken->opcode = opcode;
pToken->token = token->value;
pToken->token_len = token->len;
pToken->free_flag = 1;
- phvolt_(phvolt_parser, parsercode, pToken, parser_status);
+ phannot_(phannot_parser, parsercode, pToken, parser_status);
token->value = NULL;
token->len = 0;
}
-/* }}} */
-
-/* {{{ phvolt_create_error_msg
- Creates an error message. */
-static void phvolt_create_error_msg(phvolt_parser_status *parser_status, char *message)
-{
- unsigned int length = (128 + Z_STRLEN_P(parser_status->scanner_state->active_file));
- char *str = emalloc(sizeof(char) * length);
-
- snprintf(str, length, "%s in %s on line %d", message,
- Z_STRVAL_P(parser_status->scanner_state->active_file), parser_status->scanner_state->active_line);
- str[length - 1] = '\0';
-
- parser_status->syntax_error = estrndup(str, strlen(str));
- efree(str);
-}
-/* }}} */
-/* {{{ phvolt_scanner_error_msg
- Creates an error message when it's triggered by the scanner. */
-static void phvolt_scanner_error_msg(phvolt_parser_status *parser_status, zval **error_msg)
-{
- char *error, *error_part;
- int length;
- phvolt_scanner_state *state = parser_status->scanner_state;
+static void phannot_scanner_error_msg(phannot_parser_status *parser_status, char **error_msg){
- ZVAL_NULL(*error_msg);
+ phannot_scanner_state *state = parser_status->scanner_state;
if (state->start) {
- error = emalloc(sizeof(char) * 72 + state->start_length + Z_STRLEN_P(state->active_file));
if (state->start_length > 16) {
- length = 72 + Z_STRLEN_P(state->active_file);
- error_part = estrndup(state->start, 16);
- snprintf(error, length, "Scanning error before '%s...' in %s on line %d",
- error_part, Z_STRVAL_P(state->active_file), state->active_line);
- error[length - 1] = '\0';
- efree(error_part);
+ spprintf(error_msg, 0, "Scanning error before '%.16s...' in %s on line %d", state->start, state->active_file, state->active_line);
} else {
- length = 48 + state->start_length + Z_STRLEN_P(state->active_file);
- snprintf(error, length, "Scanning error before '%s' in %s on line %d",
- state->start, Z_STRVAL_P(state->active_file), state->active_line);
+ spprintf(error_msg, 0, "Scanning error before '%s' in %s on line %d", state->start, state->active_file, state->active_line);
}
} else {
- error = emalloc(sizeof(char) * (32 + Z_STRLEN_P(state->active_file)));
- length = 32 + Z_STRLEN_P(state->active_file);
- snprintf(error, length, "Scanning error near to EOF in %s", Z_STRVAL_P(state->active_file));
+ spprintf(error_msg, 0, "Scanning error near to EOF in %s", state->active_file);
}
-
- error[length - 1] = '\0';
- ZVAL_STRING(*error_msg, error);
-
- efree(error);
}
-/* }}} */
-
-/* {{{ phvolt_parse_view
- Receives the volt code tokenizes and parses it. */
-static int phvolt_parse_view(zval *result, zval *view_code, zval *template_path)
-{
- zval em, *error_msg = &em;
- ZVAL_NULL(result);
- ZVAL_NULL(error_msg);
- if (Z_TYPE_P(view_code) != IS_STRING) {
- ZEPHIR_THROW_EXCEPTION_STRW(phalcon_mvc_view_exception_ce, "View code must be a string");
- return FAILURE;
- }
+static int phannot_parse_annotations(zval *result, zval *comment, zval *file_path, zval *line) {
- if (phvolt_internal_parse_view(&result, view_code, template_path, &error_msg) == FAILURE) {
- ZEPHIR_THROW_EXCEPTION_STRW(phalcon_mvc_view_exception_ce, Z_STRVAL_P(error_msg));
- zval_dtor(error_msg);
- return FAILURE;
- }
+ char *comment_str;
+ int comment_len;
+ char *file_path_str;
+ int line_num;
- return SUCCESS;
-}
-/* }}} */
+ char *error_msg = NULL;
-/* {{{ phvolt_parse_view
- Checks whether the token has only blank characters. */
-static int phvolt_is_blank_string(phvolt_scanner_token *token)
-{
- char *marker = token->value;
- unsigned int ch, i;
+ ZVAL_NULL(result);
- for (i = 0; i < token->len; i++) {
- ch = *marker;
- if (ch != ' ' && ch != '\t' && ch != '\n' && ch != '\r' && ch != 11) {
- return 0;
- }
- marker++;
+ if (Z_TYPE_P(comment) == IS_STRING) {
+ comment_str = Z_STRVAL_P(comment);
+ comment_len = Z_STRLEN_P(comment);
+ } else {
+ comment_str = "";
+ comment_len = 0;
}
- return 1;
-}
-/* }}} */
-
-/* {{{ Parses a volt template returning an intermediate array representation
- Checks whether the token has only blank characters. */
-static int phvolt_internal_parse_view(zval **result, zval *view_code, zval *template_path, zval **error_msg)
-{
- char *error;
- phvolt_scanner_state *state;
- phvolt_scanner_token token;
- int scanner_status, status = SUCCESS;
- phvolt_parser_status *parser_status = NULL;
- void* phvolt_parser;
-
- /** Check if the view has code */
- if (!Z_STRVAL_P(view_code)) {
- ZVAL_STRING(*error_msg, "View code cannot be null");
- return FAILURE;
+ if (Z_TYPE_P(file_path) == IS_STRING) {
+ file_path_str = Z_STRVAL_P(file_path);
+ } else {
+ file_path_str = "eval";
}
- if (!Z_STRLEN_P(view_code)) {
- array_init(*result);
- return SUCCESS;
+ if (Z_TYPE_P(line) == IS_LONG) {
+ line_num = Z_LVAL_P(line);
+ } else {
+ line_num = 0;
}
- /** Start the reentrant parser */
- phvolt_parser = phvolt_Alloc(phvolt_wrapper_alloc);
- if (unlikely(!phvolt_parser)) {
- ZVAL_STRING(*error_msg, "Memory allocation error");
+ if (phannot_internal_parse_annotations(&result, comment_str, comment_len, file_path_str, line_num, &error_msg) == FAILURE) {
+ if (likely(error_msg != NULL)) {
+ zephir_throw_exception_string(phalcon_annotations_exception_ce, error_msg, strlen(error_msg));
+ efree(error_msg);
+ } else {
+ zephir_throw_exception_string(phalcon_annotations_exception_ce, SL("There was an error parsing annotation"));
+ }
+
return FAILURE;
}
- parser_status = emalloc(sizeof(phvolt_parser_status));
- state = emalloc(sizeof(phvolt_scanner_state));
-
- parser_status->status = PHVOLT_PARSING_OK;
- parser_status->scanner_state = state;
- ZVAL_UNDEF(&parser_status->ret);
-
- parser_status->token = &token;
- parser_status->syntax_error = NULL;
-
- /** Initialize the scanner state */
- state->active_token = 0;
- state->start = Z_STRVAL_P(view_code);
- state->mode = PHVOLT_MODE_RAW;
- state->raw_buffer = emalloc(sizeof(char) * PHVOLT_RAW_BUFFER_SIZE);
- state->raw_buffer_size = PHVOLT_RAW_BUFFER_SIZE;
- state->raw_buffer_cursor = 0;
- state->active_file = template_path;
- state->active_line = 1;
- state->statement_position = 0;
- state->extends_mode = 0;
- state->block_level = 0;
- state->macro_level = 0;
- state->start_length = 0;
- state->old_if_level = 0;
- state->if_level = 0;
- state->for_level = 0;
- state->switch_level = 0;
- state->whitespace_control = 0;
- state->forced_raw_state = 0;
-
- state->end = state->start;
-
- token.value = NULL;
- token.len = 0;
-
- /* To enable parser tracing decalre "#undef NDEBUG" in the lemon file */
-#ifndef NDEBUG
- phvolt_Trace(stderr, "[PARSER] ");
-#endif
- while (0 <= (scanner_status = phvolt_get_token(state, &token))) {
-
- state->active_token = token.opcode;
-
- state->start_length = (Z_STRVAL_P(view_code) + Z_STRLEN_P(view_code) - state->start);
-
- switch (token.opcode) {
- case PHVOLT_T_IGNORE:
- break;
-
- case PHVOLT_T_ADD:
- phvolt_(phvolt_parser, PHVOLT_PLUS, NULL, parser_status);
- break;
-
- case PHVOLT_T_SUB:
- phvolt_(phvolt_parser, PHVOLT_MINUS, NULL, parser_status);
- break;
-
- case PHVOLT_T_MUL:
- phvolt_(phvolt_parser, PHVOLT_TIMES, NULL, parser_status);
- break;
-
- case PHVOLT_T_DIV:
- phvolt_(phvolt_parser, PHVOLT_DIVIDE, NULL, parser_status);
- break;
-
- case PHVOLT_T_MOD:
- phvolt_(phvolt_parser, PHVOLT_MOD, NULL, parser_status);
- break;
-
- case PHVOLT_T_AND:
- phvolt_(phvolt_parser, PHVOLT_AND, NULL, parser_status);
- break;
-
- case PHVOLT_T_OR:
- phvolt_(phvolt_parser, PHVOLT_OR, NULL, parser_status);
- break;
-
- case PHVOLT_T_IS:
- phvolt_(phvolt_parser, PHVOLT_IS, NULL, parser_status);
- break;
-
- case PHVOLT_T_EQUALS:
- phvolt_(phvolt_parser, PHVOLT_EQUALS, NULL, parser_status);
- break;
-
- case PHVOLT_T_NOTEQUALS:
- phvolt_(phvolt_parser, PHVOLT_NOTEQUALS, NULL, parser_status);
- break;
-
- case PHVOLT_T_LESS:
- phvolt_(phvolt_parser, PHVOLT_LESS, NULL, parser_status);
- break;
-
- case PHVOLT_T_GREATER:
- phvolt_(phvolt_parser, PHVOLT_GREATER, NULL, parser_status);
- break;
-
- case PHVOLT_T_GREATEREQUAL:
- phvolt_(phvolt_parser, PHVOLT_GREATEREQUAL, NULL, parser_status);
- break;
-
- case PHVOLT_T_LESSEQUAL:
- phvolt_(phvolt_parser, PHVOLT_LESSEQUAL, NULL, parser_status);
- break;
-
- case PHVOLT_T_IDENTICAL:
- phvolt_(phvolt_parser, PHVOLT_IDENTICAL, NULL, parser_status);
- break;
-
- case PHVOLT_T_NOTIDENTICAL:
- phvolt_(phvolt_parser, PHVOLT_NOTIDENTICAL, NULL, parser_status);
- break;
-
- case PHVOLT_T_NOT:
- phvolt_(phvolt_parser, PHVOLT_NOT, NULL, parser_status);
- break;
-
- case PHVOLT_T_DOT:
- phvolt_(phvolt_parser, PHVOLT_DOT, NULL, parser_status);
- break;
-
- case PHVOLT_T_CONCAT:
- phvolt_(phvolt_parser, PHVOLT_CONCAT, NULL, parser_status);
- break;
-
- case PHVOLT_T_RANGE:
- phvolt_(phvolt_parser, PHVOLT_RANGE, NULL, parser_status);
- break;
-
- case PHVOLT_T_PIPE:
- phvolt_(phvolt_parser, PHVOLT_PIPE, NULL, parser_status);
- break;
-
- case PHVOLT_T_COMMA:
- phvolt_(phvolt_parser, PHVOLT_COMMA, NULL, parser_status);
- break;
-
- case PHVOLT_T_COLON:
- phvolt_(phvolt_parser, PHVOLT_COLON, NULL, parser_status);
- break;
+ return SUCCESS;
+}
- case PHVOLT_T_QUESTION:
- phvolt_(phvolt_parser, PHVOLT_QUESTION, NULL, parser_status);
- break;
+static void phannot_remove_comment_separators(char **ret, int *ret_len, const char *comment, int length, int *start_lines)
+{
+ char ch;
+ int start_mode = 1, j, i, open_parentheses;
+ smart_str processed_str = {0};
- case PHVOLT_T_PARENTHESES_OPEN:
- phvolt_(phvolt_parser, PHVOLT_PARENTHESES_OPEN, NULL, parser_status);
- break;
+ (*start_lines) = 0;
- case PHVOLT_T_PARENTHESES_CLOSE:
- phvolt_(phvolt_parser, PHVOLT_PARENTHESES_CLOSE, NULL, parser_status);
- break;
+ for (i = 0; i < length; i++) {
- case PHVOLT_T_SBRACKET_OPEN:
- phvolt_(phvolt_parser, PHVOLT_SBRACKET_OPEN, NULL, parser_status);
- break;
+ ch = comment[i];
- case PHVOLT_T_SBRACKET_CLOSE:
- phvolt_(phvolt_parser, PHVOLT_SBRACKET_CLOSE, NULL, parser_status);
- break;
+ if (start_mode) {
+ if (ch == ' ' || ch == '*' || ch == '/' || ch == '\t' || ch == 11) {
+ continue;
+ }
+ start_mode = 0;
+ }
- case PHVOLT_T_CBRACKET_OPEN:
- phvolt_(phvolt_parser, PHVOLT_CBRACKET_OPEN, NULL, parser_status);
- break;
+ if (ch == '@') {
- case PHVOLT_T_CBRACKET_CLOSE:
- phvolt_(phvolt_parser, PHVOLT_CBRACKET_CLOSE, NULL, parser_status);
- break;
+ smart_str_appendc(&processed_str, ch);
+ i++;
- case PHVOLT_T_OPEN_DELIMITER:
- phvolt_(phvolt_parser, PHVOLT_OPEN_DELIMITER, NULL, parser_status);
- break;
+ open_parentheses = 0;
+ for (j = i; j < length; j++) {
- case PHVOLT_T_CLOSE_DELIMITER:
- phvolt_(phvolt_parser, PHVOLT_CLOSE_DELIMITER, NULL, parser_status);
- break;
+ ch = comment[j];
- case PHVOLT_T_OPEN_EDELIMITER:
- if (state->extends_mode == 1 && state->block_level == 0) {
- phvolt_create_error_msg(parser_status, "Child templates only may contain blocks");
- parser_status->status = PHVOLT_PARSING_FAILED;
- break;
+ if (start_mode) {
+ if (ch == ' ' || ch == '*' || ch == '/' || ch == '\t' || ch == 11) {
+ continue;
+ }
+ start_mode = 0;
}
- phvolt_(phvolt_parser, PHVOLT_OPEN_EDELIMITER, NULL, parser_status);
- break;
-
- case PHVOLT_T_CLOSE_EDELIMITER:
- phvolt_(phvolt_parser, PHVOLT_CLOSE_EDELIMITER, NULL, parser_status);
- break;
-
- case PHVOLT_T_NULL:
- phvolt_(phvolt_parser, PHVOLT_NULL, NULL, parser_status);
- break;
-
- case PHVOLT_T_TRUE:
- phvolt_(phvolt_parser, PHVOLT_TRUE, NULL, parser_status);
- break;
-
- case PHVOLT_T_FALSE:
- phvolt_(phvolt_parser, PHVOLT_FALSE, NULL, parser_status);
- break;
-
- case PHVOLT_T_INTEGER:
- phvolt_parse_with_token(phvolt_parser, PHVOLT_T_INTEGER, PHVOLT_INTEGER, &token, parser_status);
- break;
- case PHVOLT_T_DOUBLE:
- phvolt_parse_with_token(phvolt_parser, PHVOLT_T_DOUBLE, PHVOLT_DOUBLE, &token, parser_status);
- break;
+ if (open_parentheses == 0) {
- case PHVOLT_T_STRING:
- phvolt_parse_with_token(phvolt_parser, PHVOLT_T_STRING, PHVOLT_STRING, &token, parser_status);
- break;
+ if (isalnum(ch) || '_' == ch || '\\' == ch) {
+ smart_str_appendc(&processed_str, ch);
+ continue;
+ }
- case PHVOLT_T_IDENTIFIER:
- phvolt_parse_with_token(phvolt_parser, PHVOLT_T_IDENTIFIER, PHVOLT_IDENTIFIER, &token, parser_status);
- break;
+ if (ch == '(') {
+ smart_str_appendc(&processed_str, ch);
+ open_parentheses++;
+ continue;
+ }
- case PHVOLT_T_IF:
- if (state->extends_mode == 1 && state->block_level == 0){
- phvolt_create_error_msg(parser_status, "Child templates only may contain blocks");
- parser_status->status = PHVOLT_PARSING_FAILED;
- break;
} else {
- state->if_level++;
- state->block_level++;
- }
- phvolt_(phvolt_parser, PHVOLT_IF, NULL, parser_status);
- break;
- case PHVOLT_T_ELSE:
- if (state->if_level == 0 && state->for_level > 0) {
- phvolt_(phvolt_parser, PHVOLT_ELSEFOR, NULL, parser_status);
- } else {
- phvolt_(phvolt_parser, PHVOLT_ELSE, NULL, parser_status);
- }
- break;
+ smart_str_appendc(&processed_str, ch);
- case PHVOLT_T_ELSEFOR:
- phvolt_(phvolt_parser, PHVOLT_ELSEFOR, NULL, parser_status);
- break;
+ if (ch == '(') {
+ open_parentheses++;
+ } else {
+ if (ch == ')') {
+ open_parentheses--;
+ } else {
+ if (ch == '\n') {
+ (*start_lines)++;
+ start_mode = 1;
+ }
+ }
+ }
- case PHVOLT_T_ELSEIF:
- if (state->if_level == 0) {
- phvolt_create_error_msg(parser_status, "Unexpected ENDIF");
- parser_status->status = PHVOLT_PARSING_FAILED;
- break;
+ if (open_parentheses > 0) {
+ continue;
+ }
}
- phvolt_(phvolt_parser, PHVOLT_ELSEIF, NULL, parser_status);
- break;
-
- case PHVOLT_T_ENDIF:
- state->block_level--;
- state->if_level--;
- phvolt_(phvolt_parser, PHVOLT_ENDIF, NULL, parser_status);
- break;
- case PHVOLT_T_FOR:
- if (state->extends_mode == 1 && state->block_level == 0){
- phvolt_create_error_msg(parser_status, "Child templates only may contain blocks");
- parser_status->status = PHVOLT_PARSING_FAILED;
- break;
- } else {
- state->old_if_level = state->if_level;
- state->if_level = 0;
- state->for_level++;
- state->block_level++;
- }
- phvolt_(phvolt_parser, PHVOLT_FOR, NULL, parser_status);
+ i = j;
+ smart_str_appendc(&processed_str, ' ');
break;
+ }
+ }
- case PHVOLT_T_IN:
- phvolt_(phvolt_parser, PHVOLT_IN, NULL, parser_status);
- break;
+ if (ch == '\n') {
+ (*start_lines)++;
+ start_mode = 1;
+ }
+ }
- case PHVOLT_T_ENDFOR:
- state->block_level--;
- state->for_level--;
- state->if_level = state->old_if_level;
- phvolt_(phvolt_parser, PHVOLT_ENDFOR, NULL, parser_status);
- break;
+ smart_str_0(&processed_str);
- case PHVOLT_T_SWITCH:
- if (state->extends_mode == 1 && state->block_level == 0){
- phvolt_create_error_msg(parser_status, "Child templates only may contain blocks");
- parser_status->status = PHVOLT_PARSING_FAILED;
- break;
- } else if (state->switch_level > 0) {
- phvolt_create_error_msg(parser_status, "A nested switch detected. There is no nested switch-case statements support");
- parser_status->status = PHVOLT_PARSING_FAILED;
- break;
- } else {
- state->switch_level = 1;
- state->block_level++;
- }
- phvolt_(phvolt_parser, PHVOLT_SWITCH, NULL, parser_status);
- break;
+ if (processed_str.s) {
+ *ret = estrndup(ZSTR_VAL(processed_str.s), ZSTR_LEN(processed_str.s));
+ *ret_len = ZSTR_LEN(processed_str.s);
+ smart_str_free(&processed_str);
+ } else {
+ *ret = NULL;
+ *ret_len = 0;
+ }
+}
- case PHVOLT_T_CASE:
- if (state->switch_level == 0) {
- phvolt_create_error_msg(parser_status, "Unexpected CASE");
- parser_status->status = PHVOLT_PARSING_FAILED;
- break;
- }
- phvolt_(phvolt_parser, PHVOLT_CASE, NULL, parser_status);
- break;
+static int phannot_internal_parse_annotations(zval **result, const char *comment, int comment_len, const char *file_path, int line, char **error_msg)
+{
+ phannot_scanner_state *state;
+ phannot_scanner_token token;
+ int start_lines;
+ int scanner_status, status = SUCCESS;
+ phannot_parser_status *parser_status = NULL;
+ void* phannot_parser;
+ char *processed_comment;
+ int processed_comment_len;
- /* only for switch-case statements */
- case PHVOLT_T_DEFAULT:
- if (state->switch_level != 0) {
- phvolt_(phvolt_parser, PHVOLT_DEFAULT, NULL, parser_status);
- efree(token.value);
- } else {
- phvolt_parse_with_token(phvolt_parser, PHVOLT_T_IDENTIFIER, PHVOLT_IDENTIFIER, &token, parser_status);
- }
+ *error_msg = NULL;
- break;
+ if (UNEXPECTED(!comment)) {
+ ZVAL_BOOL(*result, 0);
+ spprintf(error_msg, 0, "Empty annotation");
+ return FAILURE;
+ }
- case PHVOLT_T_ENDSWITCH:
- if (state->switch_level == 0) {
- phvolt_create_error_msg(parser_status, "Unexpected ENDSWITCH");
- parser_status->status = PHVOLT_PARSING_FAILED;
- break;
- } else {
- state->switch_level = 0;
- state->block_level--;
- }
+ if (comment_len < 2) {
+ ZVAL_BOOL(*result, 0);
+ return SUCCESS;
+ }
- phvolt_(phvolt_parser, PHVOLT_ENDSWITCH, NULL, parser_status);
- break;
+ phannot_remove_comment_separators(&processed_comment, &processed_comment_len, comment, comment_len, &start_lines);
- case PHVOLT_T_RAW_FRAGMENT:
- if (token.len > 0) {
- if (state->extends_mode == 1 && state->block_level == 0){
- if (!phvolt_is_blank_string(&token)) {
- phvolt_create_error_msg(parser_status, "Child templates only may contain blocks");
- parser_status->status = PHVOLT_PARSING_FAILED;
- }
- efree(token.value);
- break;
- } else {
- if (!phvolt_is_blank_string(&token)) {
- state->statement_position++;
- }
- }
- phvolt_parse_with_token(phvolt_parser, PHVOLT_T_RAW_FRAGMENT, PHVOLT_RAW_FRAGMENT, &token, parser_status);
- } else {
- efree(token.value);
- }
- break;
+ if (processed_comment_len < 2) {
+ ZVAL_BOOL(*result, 0);
+ if (processed_comment) {
+ efree(processed_comment);
+ }
- case PHVOLT_T_SET:
- if (state->extends_mode == 1 && state->block_level == 0){
- phvolt_create_error_msg(parser_status, "Child templates only may contain blocks");
- parser_status->status = PHVOLT_PARSING_FAILED;
- break;
- }
- phvolt_(phvolt_parser, PHVOLT_SET, NULL, parser_status);
- break;
+ return SUCCESS;
+ }
- case PHVOLT_T_ASSIGN:
- phvolt_(phvolt_parser, PHVOLT_ASSIGN, NULL, parser_status);
- break;
+ phannot_parser = phannot_Alloc(phannot_wrapper_alloc);
+ if (unlikely(!phannot_parser)) {
+ ZVAL_BOOL(*result, 0);
+ return FAILURE;
+ }
- case PHVOLT_T_ADD_ASSIGN:
- phvolt_(phvolt_parser, PHVOLT_ADD_ASSIGN, NULL, parser_status);
- break;
+ parser_status = emalloc(sizeof(phannot_parser_status) + sizeof(phannot_scanner_state));
+ state = (phannot_scanner_state*)((char*)parser_status + sizeof(phannot_parser_status));
- case PHVOLT_T_SUB_ASSIGN:
- phvolt_(phvolt_parser, PHVOLT_SUB_ASSIGN, NULL, parser_status);
- break;
+ parser_status->status = PHANNOT_PARSING_OK;
+ parser_status->scanner_state = state;
+ parser_status->token = &token;
+ parser_status->syntax_error = NULL;
- case PHVOLT_T_MUL_ASSIGN:
- phvolt_(phvolt_parser, PHVOLT_MUL_ASSIGN, NULL, parser_status);
- break;
+ state->active_token = 0;
+ state->start = processed_comment;
+ state->start_length = 0;
+ state->mode = PHANNOT_MODE_RAW;
+ state->active_file = file_path;
- case PHVOLT_T_DIV_ASSIGN:
- phvolt_(phvolt_parser, PHVOLT_DIV_ASSIGN, NULL, parser_status);
- break;
+ token.value = NULL;
+ token.len = 0;
- case PHVOLT_T_INCR:
- phvolt_(phvolt_parser, PHVOLT_INCR, NULL, parser_status);
- break;
+ if (line) {
+ state->active_line = line - start_lines;
+ } else {
+ state->active_line = 1;
+ }
- case PHVOLT_T_DECR:
- phvolt_(phvolt_parser, PHVOLT_DECR, NULL, parser_status);
- break;
+ state->end = state->start;
- case PHVOLT_T_BLOCK:
- if (state->block_level > 0) {
- phvolt_create_error_msg(parser_status, "Embedding blocks into other blocks is not supported");
- parser_status->status = PHVOLT_PARSING_FAILED;
- break;
- } else {
- state->block_level++;
- }
- phvolt_(phvolt_parser, PHVOLT_BLOCK, NULL, parser_status);
- break;
+ while(0 <= (scanner_status = phannot_get_token(state, &token))) {
- case PHVOLT_T_ENDBLOCK:
- state->block_level--;
- phvolt_(phvolt_parser, PHVOLT_ENDBLOCK, NULL, parser_status);
- break;
+ state->active_token = token.opcode;
- case PHVOLT_T_MACRO:
- if (state->macro_level > 0) {
- phvolt_create_error_msg(parser_status, "Embedding macros into other macros is not allowed");
- parser_status->status = PHVOLT_PARSING_FAILED;
- break;
- } else {
- state->macro_level++;
- }
- phvolt_(phvolt_parser, PHVOLT_MACRO, NULL, parser_status);
- break;
- case PHVOLT_T_ENDMACRO:
- state->macro_level--;
- phvolt_(phvolt_parser, PHVOLT_ENDMACRO, NULL, parser_status);
- break;
+ state->start_length = processed_comment + processed_comment_len - state->start;
- case PHVOLT_T_CALL:
- phvolt_(phvolt_parser, PHVOLT_CALL, NULL, parser_status);
- break;
- case PHVOLT_T_ENDCALL:
- phvolt_(phvolt_parser, PHVOLT_ENDCALL, NULL, parser_status);
- break;
+ switch (token.opcode) {
- case PHVOLT_T_CACHE:
- phvolt_(phvolt_parser, PHVOLT_CACHE, NULL, parser_status);
- break;
- case PHVOLT_T_ENDCACHE:
- phvolt_(phvolt_parser, PHVOLT_ENDCACHE, NULL, parser_status);
+ case PHANNOT_T_IGNORE:
break;
- case PHVOLT_T_RAW:
- phvolt_(phvolt_parser, PHVOLT_RAW, NULL, parser_status);
- state->forced_raw_state++;
- break;
- case PHVOLT_T_ENDRAW:
- phvolt_(phvolt_parser, PHVOLT_ENDRAW, NULL, parser_status);
- state->forced_raw_state--;
+ case PHANNOT_T_AT:
+ phannot_(phannot_parser, PHANNOT_AT, NULL, parser_status);
break;
-
- case PHVOLT_T_INCLUDE:
- phvolt_(phvolt_parser, PHVOLT_INCLUDE, NULL, parser_status);
+ case PHANNOT_T_COMMA:
+ phannot_(phannot_parser, PHANNOT_COMMA, NULL, parser_status);
break;
-
- case PHVOLT_T_WITH:
- phvolt_(phvolt_parser, PHVOLT_WITH, NULL, parser_status);
+ case PHANNOT_T_EQUALS:
+ phannot_(phannot_parser, PHANNOT_EQUALS, NULL, parser_status);
break;
-
- case PHVOLT_T_DEFINED:
- phvolt_(phvolt_parser, PHVOLT_DEFINED, NULL, parser_status);
+ case PHANNOT_T_COLON:
+ phannot_(phannot_parser, PHANNOT_COLON, NULL, parser_status);
break;
- case PHVOLT_T_EMPTY:
- phvolt_(phvolt_parser, PHVOLT_EMPTY, NULL, parser_status);
+ case PHANNOT_T_PARENTHESES_OPEN:
+ phannot_(phannot_parser, PHANNOT_PARENTHESES_OPEN, NULL, parser_status);
break;
-
- case PHVOLT_T_EVEN:
- phvolt_(phvolt_parser, PHVOLT_EVEN, NULL, parser_status);
+ case PHANNOT_T_PARENTHESES_CLOSE:
+ phannot_(phannot_parser, PHANNOT_PARENTHESES_CLOSE, NULL, parser_status);
break;
- case PHVOLT_T_ODD:
- phvolt_(phvolt_parser, PHVOLT_ODD, NULL, parser_status);
+ case PHANNOT_T_BRACKET_OPEN:
+ phannot_(phannot_parser, PHANNOT_BRACKET_OPEN, NULL, parser_status);
break;
-
- case PHVOLT_T_NUMERIC:
- phvolt_(phvolt_parser, PHVOLT_NUMERIC, NULL, parser_status);
+ case PHANNOT_T_BRACKET_CLOSE:
+ phannot_(phannot_parser, PHANNOT_BRACKET_CLOSE, NULL, parser_status);
break;
- case PHVOLT_T_SCALAR:
- phvolt_(phvolt_parser, PHVOLT_SCALAR, NULL, parser_status);
+ case PHANNOT_T_SBRACKET_OPEN:
+ phannot_(phannot_parser, PHANNOT_SBRACKET_OPEN, NULL, parser_status);
break;
-
- case PHVOLT_T_ITERABLE:
- phvolt_(phvolt_parser, PHVOLT_ITERABLE, NULL, parser_status);
+ case PHANNOT_T_SBRACKET_CLOSE:
+ phannot_(phannot_parser, PHANNOT_SBRACKET_CLOSE, NULL, parser_status);
break;
- case PHVOLT_T_DO:
- phvolt_(phvolt_parser, PHVOLT_DO, NULL, parser_status);
+ case PHANNOT_T_NULL:
+ phannot_(phannot_parser, PHANNOT_NULL, NULL, parser_status);
break;
- case PHVOLT_T_RETURN:
- phvolt_(phvolt_parser, PHVOLT_RETURN, NULL, parser_status);
+ case PHANNOT_T_TRUE:
+ phannot_(phannot_parser, PHANNOT_TRUE, NULL, parser_status);
break;
-
- case PHVOLT_T_AUTOESCAPE:
- phvolt_(phvolt_parser, PHVOLT_AUTOESCAPE, NULL, parser_status);
+ case PHANNOT_T_FALSE:
+ phannot_(phannot_parser, PHANNOT_FALSE, NULL, parser_status);
break;
- case PHVOLT_T_ENDAUTOESCAPE:
- phvolt_(phvolt_parser, PHVOLT_ENDAUTOESCAPE, NULL, parser_status);
+ case PHANNOT_T_INTEGER:
+ phannot_parse_with_token(phannot_parser, PHANNOT_T_INTEGER, PHANNOT_INTEGER, &token, parser_status);
break;
-
- case PHVOLT_T_BREAK:
- phvolt_(phvolt_parser, PHVOLT_BREAK, NULL, parser_status);
+ case PHANNOT_T_DOUBLE:
+ phannot_parse_with_token(phannot_parser, PHANNOT_T_DOUBLE, PHANNOT_DOUBLE, &token, parser_status);
break;
-
- case PHVOLT_T_CONTINUE:
- phvolt_(phvolt_parser, PHVOLT_CONTINUE, NULL, parser_status);
+ case PHANNOT_T_STRING:
+ phannot_parse_with_token(phannot_parser, PHANNOT_T_STRING, PHANNOT_STRING, &token, parser_status);
break;
-
- case PHVOLT_T_EXTENDS:
- if (state->statement_position != 1) {
- phvolt_create_error_msg(parser_status, "Extends statement must be placed at the first line in the template");
- parser_status->status = PHVOLT_PARSING_FAILED;
- break;
- } else {
- state->extends_mode = 1;
- }
- phvolt_(phvolt_parser, PHVOLT_EXTENDS, NULL, parser_status);
+ case PHANNOT_T_IDENTIFIER:
+ phannot_parse_with_token(phannot_parser, PHANNOT_T_IDENTIFIER, PHANNOT_IDENTIFIER, &token, parser_status);
break;
+ /*case PHANNOT_T_ARBITRARY_TEXT:
+ phannot_parse_with_token(phannot_parser, PHANNOT_T_ARBITRARY_TEXT, PHANNOT_ARBITRARY_TEXT, &token, parser_status);
+ break;*/
default:
- parser_status->status = PHVOLT_PARSING_FAILED;
- error = emalloc(sizeof(char) * (48 + Z_STRLEN_P(state->active_file)));
- snprintf(error, 48 + Z_STRLEN_P(state->active_file) + state->active_line,
- "Scanner: unknown opcode %d on in %s line %d", token.opcode,
- Z_STRVAL_P(state->active_file), state->active_line);
-
- if (Z_TYPE_P(*error_msg) == IS_NULL) {
- ZVAL_STRING((*error_msg), error);
+ parser_status->status = PHANNOT_PARSING_FAILED;
+ if (!*error_msg) {
+ spprintf(error_msg, 0, "Scanner: unknown opcode %d on in %s line %d", token.opcode, state->active_file, state->active_line);
}
-
- efree(error);
break;
}
- if (parser_status->status != PHVOLT_PARSING_OK) {
+ if (parser_status->status != PHANNOT_PARSING_OK) {
status = FAILURE;
break;
}
@@ -186745,596 +177054,696 @@ static int phvolt_internal_parse_view(zval **result, zval *view_code, zval *temp
if (status != FAILURE) {
switch (scanner_status) {
- case PHVOLT_SCANNER_RETCODE_ERR:
- case PHVOLT_SCANNER_RETCODE_IMPOSSIBLE:
+
+ case PHANNOT_SCANNER_RETCODE_ERR:
+ case PHANNOT_SCANNER_RETCODE_IMPOSSIBLE:
if (!*error_msg) {
- phvolt_scanner_error_msg(parser_status, error_msg);
- } else {
- if (Z_TYPE_P(*error_msg) == IS_NULL) {
- phvolt_scanner_error_msg(parser_status, error_msg);
- }
+ phannot_scanner_error_msg(parser_status, error_msg);
}
status = FAILURE;
break;
+
default:
- phvolt_(phvolt_parser, 0, NULL, parser_status);
+ phannot_(phannot_parser, 0, NULL, parser_status);
}
}
state->active_token = 0;
state->start = NULL;
- efree(state->raw_buffer);
- if (parser_status->status != PHVOLT_PARSING_OK) {
+ if (parser_status->status != PHANNOT_PARSING_OK) {
status = FAILURE;
if (parser_status->syntax_error) {
- ZVAL_STRING(*error_msg, parser_status->syntax_error);
- efree(parser_status->syntax_error);
+ if (!*error_msg) {
+ *error_msg = parser_status->syntax_error;
+ } else {
+ efree(parser_status->syntax_error);
+ }
}
}
+ phannot_Free(phannot_parser, phannot_wrapper_free);
+
if (status != FAILURE) {
- if (parser_status->status == PHVOLT_PARSING_OK) {
- if (Z_TYPE(parser_status->ret) != IS_UNDEF) {
- ZVAL_ZVAL(*result, &parser_status->ret, 1, 1);
- } else {
- array_init(*result);
- }
+ if (parser_status->status == PHANNOT_PARSING_OK) {
+ ZVAL_ZVAL(*result, &parser_status->ret, 1, 1);
}
}
- phvolt_Free(phvolt_parser, phvolt_wrapper_free);
-
+ efree(processed_comment);
efree(parser_status);
- efree(state);
return status;
-
}
-/* }}} */
-/* Generated by re2c 1.1.1 */
-/* scanner.re
- *
- * This file is part of the Phalcon Framework.
- *
- * (c) Phalcon Team
- *
- * For the full copyright and license information, please view the
- * LICENSE.txt file that was distributed with this source code.
- */
+#ifdef HAVE_CONFIG_H
+#endif
-/* for re2c */
-#define VVCTYPE unsigned char
-#define VVCURSOR (s->start)
-#define VVLIMIT (s->end)
-#define VVMARKER (s->marker)
-static void phvolt_rtrim(phvolt_scanner_token *token) {
- char *cursor, *removed_str;
- int i;
- char ch;
- if (token->len > 0) {
+ZEPHIR_INIT_CLASS(Phalcon_Annotations_Reader)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Annotations, Reader, phalcon, annotations_reader, phalcon_annotations_reader_method_entry, 0);
- cursor = token->value;
- cursor += (token->len - 1);
- for (i = token->len; i > 0; i--) {
- ch = (*cursor);
- if (ch == '\t' || ch == '\n' || ch == '\r' || ch == ' ' || ch == '\v') {
- cursor--;
- continue;
+ zend_class_implements(phalcon_annotations_reader_ce, 1, phalcon_annotations_readerinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Annotations_Reader, parse)
+{
+ zval annotations;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS, line = 0;
+ zval *className_param = NULL, reflection, comment, properties, methods, property, method, classAnnotations, annotationsProperties, propertyAnnotations, annotationsMethods, methodAnnotations, _0$$3, _1$$3, *_2$$5, _3$$5, _4$$7, _5$$7, _6$$8, _7$$10, _8$$10, _9$$11, *_10$$13, _11$$13, _12$$15, _13$$15, _14$$16, _15$$18, _16$$18, _17$$19;
+ zval className;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&className);
+ ZVAL_UNDEF(&reflection);
+ ZVAL_UNDEF(&comment);
+ ZVAL_UNDEF(&properties);
+ ZVAL_UNDEF(&methods);
+ ZVAL_UNDEF(&property);
+ ZVAL_UNDEF(&method);
+ ZVAL_UNDEF(&classAnnotations);
+ ZVAL_UNDEF(&annotationsProperties);
+ ZVAL_UNDEF(&propertyAnnotations);
+ ZVAL_UNDEF(&annotationsMethods);
+ ZVAL_UNDEF(&methodAnnotations);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&_4$$7);
+ ZVAL_UNDEF(&_5$$7);
+ ZVAL_UNDEF(&_6$$8);
+ ZVAL_UNDEF(&_7$$10);
+ ZVAL_UNDEF(&_8$$10);
+ ZVAL_UNDEF(&_9$$11);
+ ZVAL_UNDEF(&_11$$13);
+ ZVAL_UNDEF(&_12$$15);
+ ZVAL_UNDEF(&_13$$15);
+ ZVAL_UNDEF(&_14$$16);
+ ZVAL_UNDEF(&_15$$18);
+ ZVAL_UNDEF(&_16$$18);
+ ZVAL_UNDEF(&_17$$19);
+ ZVAL_UNDEF(&annotations);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(className)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &className_param);
+ zephir_get_strval(&className, className_param);
+
+
+ ZEPHIR_INIT_VAR(&annotations);
+ array_init(&annotations);
+ ZEPHIR_INIT_VAR(&reflection);
+ object_init_ex(&reflection, zephir_get_internal_ce(SL("reflectionclass")));
+ ZEPHIR_CALL_METHOD(NULL, &reflection, "__construct", NULL, 156, &className);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&comment, &reflection, "getdoccomment", NULL, 157);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&comment) == IS_STRING) {
+ ZEPHIR_INIT_VAR(&classAnnotations);
+ ZEPHIR_CALL_METHOD(&_0$$3, &reflection, "getfilename", NULL, 158);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_1$$3, &reflection, "getstartline", NULL, 159);
+ zephir_check_call_status();
+ ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&classAnnotations, &comment, &_0$$3, &_1$$3);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&classAnnotations) == IS_ARRAY) {
+ zephir_array_update_string(&annotations, SL("class"), &classAnnotations, PH_COPY | PH_SEPARATE);
+ }
+ }
+ ZEPHIR_CALL_METHOD(&properties, &reflection, "getproperties", NULL, 160);
+ zephir_check_call_status();
+ if (zephir_fast_count_int(&properties)) {
+ line = 1;
+ ZEPHIR_INIT_VAR(&annotationsProperties);
+ array_init(&annotationsProperties);
+ zephir_is_iterable(&properties, 0, "phalcon/Annotations/Reader.zep", 92);
+ if (Z_TYPE_P(&properties) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&properties), _2$$5)
+ {
+ ZEPHIR_INIT_NVAR(&property);
+ ZVAL_COPY(&property, _2$$5);
+ ZEPHIR_CALL_METHOD(&comment, &property, "getdoccomment", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&comment) == IS_STRING) {
+ ZEPHIR_INIT_NVAR(&propertyAnnotations);
+ ZEPHIR_CALL_METHOD(&_4$$7, &reflection, "getfilename", NULL, 158);
+ zephir_check_call_status();
+ ZVAL_LONG(&_5$$7, line);
+ ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&propertyAnnotations, &comment, &_4$$7, &_5$$7);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&propertyAnnotations) == IS_ARRAY) {
+ ZEPHIR_OBS_NVAR(&_6$$8);
+ zephir_read_property(&_6$$8, &property, ZEND_STRL("name"), PH_NOISY_CC);
+ zephir_array_update_zval(&annotationsProperties, &_6$$8, &propertyAnnotations, PH_COPY | PH_SEPARATE);
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &properties, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3$$5, &properties, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3$$5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&property, &properties, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&comment, &property, "getdoccomment", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&comment) == IS_STRING) {
+ ZEPHIR_INIT_NVAR(&propertyAnnotations);
+ ZEPHIR_CALL_METHOD(&_7$$10, &reflection, "getfilename", NULL, 158);
+ zephir_check_call_status();
+ ZVAL_LONG(&_8$$10, line);
+ ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&propertyAnnotations, &comment, &_7$$10, &_8$$10);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&propertyAnnotations) == IS_ARRAY) {
+ ZEPHIR_OBS_NVAR(&_9$$11);
+ zephir_read_property(&_9$$11, &property, ZEND_STRL("name"), PH_NOISY_CC);
+ zephir_array_update_zval(&annotationsProperties, &_9$$11, &propertyAnnotations, PH_COPY | PH_SEPARATE);
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &properties, "next", NULL, 0);
+ zephir_check_call_status();
}
- break;
}
+ ZEPHIR_INIT_NVAR(&property);
+ if (zephir_fast_count_int(&annotationsProperties)) {
+ zephir_array_update_string(&annotations, SL("properties"), &annotationsProperties, PH_COPY | PH_SEPARATE);
+ }
+ }
+ ZEPHIR_CALL_METHOD(&methods, &reflection, "getmethods", NULL, 161);
+ zephir_check_call_status();
+ if (zephir_fast_count_int(&methods)) {
+ ZEPHIR_INIT_VAR(&annotationsMethods);
+ array_init(&annotationsMethods);
+ zephir_is_iterable(&methods, 0, "phalcon/Annotations/Reader.zep", 127);
+ if (Z_TYPE_P(&methods) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&methods), _10$$13)
+ {
+ ZEPHIR_INIT_NVAR(&method);
+ ZVAL_COPY(&method, _10$$13);
+ ZEPHIR_CALL_METHOD(&comment, &method, "getdoccomment", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&comment) == IS_STRING) {
+ ZEPHIR_INIT_NVAR(&methodAnnotations);
+ ZEPHIR_CALL_METHOD(&_12$$15, &method, "getfilename", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_13$$15, &method, "getstartline", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&methodAnnotations, &comment, &_12$$15, &_13$$15);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) {
+ ZEPHIR_OBS_NVAR(&_14$$16);
+ zephir_read_property(&_14$$16, &method, ZEND_STRL("name"), PH_NOISY_CC);
+ zephir_array_update_zval(&annotationsMethods, &_14$$16, &methodAnnotations, PH_COPY | PH_SEPARATE);
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &methods, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_11$$13, &methods, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_11$$13)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&method, &methods, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&comment, &method, "getdoccomment", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&comment) == IS_STRING) {
+ ZEPHIR_INIT_NVAR(&methodAnnotations);
+ ZEPHIR_CALL_METHOD(&_15$$18, &method, "getfilename", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_16$$18, &method, "getstartline", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&methodAnnotations, &comment, &_15$$18, &_16$$18);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) {
+ ZEPHIR_OBS_NVAR(&_17$$19);
+ zephir_read_property(&_17$$19, &method, ZEND_STRL("name"), PH_NOISY_CC);
+ zephir_array_update_zval(&annotationsMethods, &_17$$19, &methodAnnotations, PH_COPY | PH_SEPARATE);
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &methods, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&method);
+ if (zephir_fast_count_int(&annotationsMethods)) {
+ zephir_array_update_string(&annotations, SL("methods"), &annotationsMethods, PH_COPY | PH_SEPARATE);
+ }
+ }
+ RETURN_CTOR(&annotations);
+}
- if (i >= 0) {
- removed_str = emalloc(i + 1);
- memcpy(removed_str, token->value, i);
- removed_str[i] = '\0';
+static PHP_METHOD(Phalcon_Annotations_Reader, parseDocBlock)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *docBlock_param = NULL, *file = NULL, file_sub, *line = NULL, line_sub, __$null;
+ zval docBlock;
+ zval *this_ptr = getThis();
- efree(token->value);
- token->value = removed_str;
- token->len = i;
- }
+ ZVAL_UNDEF(&docBlock);
+ ZVAL_UNDEF(&file_sub);
+ ZVAL_UNDEF(&line_sub);
+ ZVAL_NULL(&__$null);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(docBlock)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(file)
+ Z_PARAM_ZVAL_OR_NULL(line)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &docBlock_param, &file, &line);
+ zephir_get_strval(&docBlock, docBlock_param);
+ if (!file) {
+ file = &file_sub;
+ ZEPHIR_CPY_WRT(file, &__$null);
+ } else {
+ ZEPHIR_SEPARATE_PARAM(file);
+ }
+ if (!line) {
+ line = &line_sub;
+ line = &__$null;
}
+
+ if (Z_TYPE_P(file) != IS_STRING) {
+ ZEPHIR_INIT_NVAR(file);
+ ZVAL_STRING(file, "eval code");
+ }
+ ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(return_value, &docBlock, file, line);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static void phvolt_ltrim(phvolt_scanner_token *token) {
- char *cursor, *removed_str;
- int i;
- if (token->len > 0) {
- cursor = token->value;
- for (i = 0; i < token->len; i++) {
- char ch = (*cursor);
- if (ch == '\t' || ch == '\n' || ch == '\r' || ch == ' ' || ch == '\v') {
- cursor++;
- continue;
- }
- break;
- }
+#ifdef HAVE_CONFIG_H
+#endif
+
+
- if (i >= 0) {
- removed_str = emalloc(token->len - i + 1);
- memcpy(removed_str, token->value + i, token->len - i);
- removed_str[token->len - i] = '\0';
- efree(token->value);
- token->value = removed_str;
- token->len = token->len - i;
- }
- }
+ZEPHIR_INIT_CLASS(Phalcon_Annotations_ReaderInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Annotations, ReaderInterface, phalcon, annotations_readerinterface, phalcon_annotations_readerinterface_method_entry);
+
+ return SUCCESS;
}
-static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token) {
- unsigned char next, double_next;
- char *start = VVCURSOR;
- int status = PHVOLT_SCANNER_RETCODE_IMPOSSIBLE;
+ZEPHIR_DOC_METHOD(Phalcon_Annotations_ReaderInterface, parse);
+ZEPHIR_DOC_METHOD(Phalcon_Annotations_ReaderInterface, parseDocBlock);
- while (PHVOLT_SCANNER_RETCODE_IMPOSSIBLE == status) {
- if (s->mode == PHVOLT_MODE_RAW || s->mode == PHVOLT_MODE_COMMENT) {
- next = '\0';
- double_next = '\0';
- if (*VVCURSOR == '\n') {
- s->active_line++;
- }
- if (*VVCURSOR != '\0') {
- next = *(VVCURSOR + 1);
- if (next != '\0') {
- double_next = *(VVCURSOR + 2);
- }
- }
+#ifdef HAVE_CONFIG_H
+#endif
- if (*VVCURSOR == '\0' || (*VVCURSOR == '{' && (next == '%' || next == '{' || next == '#'))) {
- if (next != '#') {
- s->mode = PHVOLT_MODE_CODE;
- if (s->raw_buffer_cursor > 0) {
- token->opcode = PHVOLT_T_RAW_FRAGMENT;
- token->value = emalloc(sizeof(char) * s->raw_buffer_cursor + 1);
- memcpy(token->value, s->raw_buffer, s->raw_buffer_cursor);
- token->value[s->raw_buffer_cursor] = 0;
- token->len = s->raw_buffer_cursor;
- if (s->whitespace_control == 1) {
- phvolt_ltrim(token);
- s->whitespace_control = 0;
- }
- if (double_next == '-') {
- phvolt_rtrim(token);
- }
- s->raw_buffer_cursor = 0;
- } else {
- token->opcode = PHVOLT_T_IGNORE;
- }
- } else {
- while ((next = *(++VVCURSOR))) {
- if (next == '#' && *(VVCURSOR + 1) == '}') {
- VVCURSOR += 2;
- token->opcode = PHVOLT_T_IGNORE;
- return 0;
- } else {
- if (next == '\n') {
- s->active_line++;
- }
- }
- }
+ZEPHIR_INIT_CLASS(Phalcon_Annotations_Reflection)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Annotations, Reflection, phalcon, annotations_reflection, phalcon_annotations_reflection_method_entry, 0);
- return PHVOLT_SCANNER_RETCODE_EOF;
- }
+ zend_declare_property_null(phalcon_annotations_reflection_ce, SL("classAnnotations"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_annotations_reflection_ce, SL("methodAnnotations"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_annotations_reflection_ce, SL("propertyAnnotations"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_annotations_reflection_ce, SL("reflectionData"), ZEND_ACC_PROTECTED);
+ phalcon_annotations_reflection_ce->create_object = zephir_init_properties_Phalcon_Annotations_Reflection;
- return 0;
+ return SUCCESS;
+}
- } else {
- if (s->raw_buffer_cursor == s->raw_buffer_size) {
- s->raw_buffer_size += PHVOLT_RAW_BUFFER_SIZE;
- s->raw_buffer = erealloc(s->raw_buffer, s->raw_buffer_size);
- }
+static PHP_METHOD(Phalcon_Annotations_Reflection, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *reflectionData_param = NULL;
+ zval reflectionData;
+ zval *this_ptr = getThis();
- memcpy(s->raw_buffer+s->raw_buffer_cursor, VVCURSOR, 1);
- s->raw_buffer_cursor++;
+ ZVAL_UNDEF(&reflectionData);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(reflectionData)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &reflectionData_param);
+ if (!reflectionData_param) {
+ ZEPHIR_INIT_VAR(&reflectionData);
+ array_init(&reflectionData);
+ } else {
+ zephir_get_arrval(&reflectionData, reflectionData_param);
+ }
- ++VVCURSOR;
- }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("reflectionData"), &reflectionData);
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Annotations_Reflection, getClassAnnotations)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval __$true, __$false, reflectionClass, _0, _1$$3, _2$$4;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&reflectionClass);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+
+
+ ZEPHIR_MM_GROW();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("classAnnotations"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) == IS_NULL) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("reflectionData"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset_string_fetch(&reflectionClass, &_1$$3, SL("class"), 1)) {
+ ZEPHIR_INIT_VAR(&_2$$4);
+ object_init_ex(&_2$$4, phalcon_annotations_collection_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 48, &reflectionClass);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("classAnnotations"), &_2$$4);
} else {
-
- {
- VVCTYPE vvch;
- unsigned int vvaccept = 0;
- vvch = *VVCURSOR;
- switch (vvch) {
- case 0x00: goto vv2;
- case '\t':
- case '\r':
- case ' ': goto vv6;
- case '\n': goto vv9;
- case '!': goto vv11;
- case '"': goto vv13;
- case '%': goto vv14;
- case '\'': goto vv16;
- case '(': goto vv17;
- case ')': goto vv19;
- case '*': goto vv21;
- case '+': goto vv23;
- case ',': goto vv25;
- case '-': goto vv27;
- case '.': goto vv29;
- case '/': goto vv31;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto vv33;
- case ':': goto vv36;
- case '<': goto vv38;
- case '=': goto vv40;
- case '>': goto vv42;
- case '?': goto vv44;
- case 'A':
- case 'a': goto vv46;
- case 'B':
- case 'b': goto vv48;
- case 'C':
- case 'c': goto vv49;
- case 'D':
- case 'd': goto vv50;
- case 'E':
- case 'e': goto vv51;
- case 'F':
- case 'f': goto vv52;
- case 'G':
- case 'H':
- case 'J':
- case 'K':
- case 'L':
- case 'P':
- case 'Q':
- case 'U':
- case 'V':
- case 'X':
- case 'Y':
- case 'Z':
- case '_':
- case 'g':
- case 'h':
- case 'j':
- case 'k':
- case 'l':
- case 'p':
- case 'q':
- case 'u':
- case 'v':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- case 'I': goto vv55;
- case 'M':
- case 'm': goto vv56;
- case 'N':
- case 'n': goto vv57;
- case 'O':
- case 'o': goto vv58;
- case 'R':
- case 'r': goto vv59;
- case 'S':
- case 's': goto vv60;
- case 'T':
- case 't': goto vv61;
- case 'W':
- case 'w': goto vv62;
- case '[': goto vv63;
- case '\\': goto vv65;
- case ']': goto vv66;
- case 'i': goto vv68;
- case '{': goto vv69;
- case '|': goto vv71;
- case '}': goto vv73;
- case '~': goto vv75;
- default: goto vv4;
- }
-vv2:
- ++VVCURSOR;
- {
- status = PHVOLT_SCANNER_RETCODE_EOF;
- break;
- }
-vv4:
- ++VVCURSOR;
-vv5:
- {
- status = PHVOLT_SCANNER_RETCODE_ERR;
- break;
- }
-vv6:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '\t':
- case '\r':
- case ' ': goto vv6;
- default: goto vv8;
- }
-vv8:
- {
- token->opcode = PHVOLT_T_IGNORE;
- return 0;
- }
-vv9:
- ++VVCURSOR;
- {
- s->active_line++;
- token->opcode = PHVOLT_T_IGNORE;
- return 0;
- }
-vv11:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '=': goto vv77;
- default: goto vv12;
- }
-vv12:
- {
- token->opcode = PHVOLT_T_NOT;
- return 0;
- }
-vv13:
- vvaccept = 0;
- vvch = *(VVMARKER = ++VVCURSOR);
- if (vvch <= 0x00) goto vv5;
- goto vv80;
-vv14:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '}': goto vv85;
- default: goto vv15;
- }
-vv15:
- {
- token->opcode = PHVOLT_T_MOD;
- return 0;
- }
-vv16:
- vvaccept = 0;
- vvch = *(VVMARKER = ++VVCURSOR);
- if (vvch <= 0x00) goto vv5;
- goto vv88;
-vv17:
- ++VVCURSOR;
- {
- token->opcode = PHVOLT_T_PARENTHESES_OPEN;
- return 0;
- }
-vv19:
- ++VVCURSOR;
- {
- token->opcode = PHVOLT_T_PARENTHESES_CLOSE;
- return 0;
- }
-vv21:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '=': goto vv90;
- default: goto vv22;
- }
-vv22:
- {
- token->opcode = PHVOLT_T_MUL;
- return 0;
- }
-vv23:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '+': goto vv92;
- case '=': goto vv94;
- default: goto vv24;
- }
-vv24:
- {
- token->opcode = PHVOLT_T_ADD;
- return 0;
- }
-vv25:
- ++VVCURSOR;
- {
- token->opcode = PHVOLT_T_COMMA;
- return 0;
- }
-vv27:
- vvaccept = 1;
- vvch = *(VVMARKER = ++VVCURSOR);
- switch (vvch) {
- case '%': goto vv96;
- case '-': goto vv97;
- case '=': goto vv99;
- case '}': goto vv101;
- default: goto vv28;
- }
-vv28:
- {
- token->opcode = PHVOLT_T_SUB;
- return 0;
- }
-vv29:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '.': goto vv102;
- default: goto vv30;
- }
-vv30:
- {
- token->opcode = PHVOLT_T_DOT;
- return 0;
- }
-vv31:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '=': goto vv104;
- default: goto vv32;
- }
-vv32:
- {
- token->opcode = PHVOLT_T_DIV;
- return 0;
- }
-vv33:
- vvaccept = 2;
- vvch = *(VVMARKER = ++VVCURSOR);
- switch (vvch) {
- case '.': goto vv106;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto vv33;
- default: goto vv35;
- }
-vv35:
- {
- token->opcode = PHVOLT_T_INTEGER;
- token->value = estrndup(start, VVCURSOR - start);
- token->len = VVCURSOR - start;
- return 0;
- }
-vv36:
- ++VVCURSOR;
- {
- token->opcode = PHVOLT_T_COLON;
- return 0;
- }
-vv38:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '=': goto vv107;
- case '>': goto vv109;
- default: goto vv39;
- }
-vv39:
- {
- token->opcode = PHVOLT_T_LESS;
- return 0;
- }
-vv40:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '=': goto vv111;
- default: goto vv41;
+ if (0) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("classAnnotations"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("classAnnotations"), &__$false);
}
-vv41:
- {
- token->opcode = PHVOLT_T_ASSIGN;
- return 0;
}
-vv42:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '=': goto vv113;
- default: goto vv43;
+ }
+ RETURN_MM_MEMBER(getThis(), "classAnnotations");
+}
+
+static PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations)
+{
+ zend_string *_6$$5;
+ zend_ulong _5$$5;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval __$true, __$false, reflectionMethods, methodName, reflectionMethod, _0, _1$$3, _2$$5, *_3$$5, _4$$5, _7$$6, _9$$7;
+ zephir_fcall_cache_entry *_8 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&reflectionMethods);
+ ZVAL_UNDEF(&methodName);
+ ZVAL_UNDEF(&reflectionMethod);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_9$$7);
+
+
+ ZEPHIR_MM_GROW();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("methodAnnotations"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) == IS_NULL) {
+ ZEPHIR_OBS_VAR(&reflectionMethods);
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("reflectionData"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset_string_fetch(&reflectionMethods, &_1$$3, SL("methods"), 0)) {
+ if (zephir_fast_count_int(&reflectionMethods)) {
+ ZEPHIR_INIT_VAR(&_2$$5);
+ array_init(&_2$$5);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("methodAnnotations"), &_2$$5);
+ zephir_is_iterable(&reflectionMethods, 0, "phalcon/Annotations/Reflection.zep", 100);
+ if (Z_TYPE_P(&reflectionMethods) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&reflectionMethods), _5$$5, _6$$5, _3$$5)
+ {
+ ZEPHIR_INIT_NVAR(&methodName);
+ if (_6$$5 != NULL) {
+ ZVAL_STR_COPY(&methodName, _6$$5);
+ } else {
+ ZVAL_LONG(&methodName, _5$$5);
+ }
+ ZEPHIR_INIT_NVAR(&reflectionMethod);
+ ZVAL_COPY(&reflectionMethod, _3$$5);
+ ZEPHIR_INIT_NVAR(&_7$$6);
+ object_init_ex(&_7$$6, phalcon_annotations_collection_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 48, &reflectionMethod);
+ zephir_check_call_status();
+ zephir_update_property_array(this_ptr, SL("methodAnnotations"), &methodName, &_7$$6);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &reflectionMethods, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_4$$5, &reflectionMethods, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_4$$5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&methodName, &reflectionMethods, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&reflectionMethod, &reflectionMethods, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_9$$7);
+ object_init_ex(&_9$$7, phalcon_annotations_collection_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 48, &reflectionMethod);
+ zephir_check_call_status();
+ zephir_update_property_array(this_ptr, SL("methodAnnotations"), &methodName, &_9$$7);
+ ZEPHIR_CALL_METHOD(NULL, &reflectionMethods, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&reflectionMethod);
+ ZEPHIR_INIT_NVAR(&methodName);
+ RETURN_MM_MEMBER(getThis(), "methodAnnotations");
}
-vv43:
- {
- token->opcode = PHVOLT_T_GREATER;
- return 0;
}
-vv44:
- ++VVCURSOR;
- {
- token->opcode = PHVOLT_T_QUESTION;
- return 0;
+ if (0) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("methodAnnotations"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("methodAnnotations"), &__$false);
}
-vv46:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'N':
- case 'n': goto vv115;
- case 'U':
- case 'u': goto vv116;
- default: goto vv54;
+ }
+ RETURN_MM_MEMBER(getThis(), "methodAnnotations");
+}
+
+static PHP_METHOD(Phalcon_Annotations_Reflection, getPropertiesAnnotations)
+{
+ zend_string *_6$$5;
+ zend_ulong _5$$5;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval __$true, __$false, reflectionProperties, property, reflectionProperty, _0, _1$$3, _2$$5, *_3$$5, _4$$5, _7$$6, _9$$7;
+ zephir_fcall_cache_entry *_8 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&reflectionProperties);
+ ZVAL_UNDEF(&property);
+ ZVAL_UNDEF(&reflectionProperty);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_9$$7);
+
+
+ ZEPHIR_MM_GROW();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("propertyAnnotations"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) == IS_NULL) {
+ ZEPHIR_OBS_VAR(&reflectionProperties);
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("reflectionData"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset_string_fetch(&reflectionProperties, &_1$$3, SL("properties"), 0)) {
+ if (zephir_fast_count_int(&reflectionProperties)) {
+ ZEPHIR_INIT_VAR(&_2$$5);
+ array_init(&_2$$5);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("propertyAnnotations"), &_2$$5);
+ zephir_is_iterable(&reflectionProperties, 0, "phalcon/Annotations/Reflection.zep", 128);
+ if (Z_TYPE_P(&reflectionProperties) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&reflectionProperties), _5$$5, _6$$5, _3$$5)
+ {
+ ZEPHIR_INIT_NVAR(&property);
+ if (_6$$5 != NULL) {
+ ZVAL_STR_COPY(&property, _6$$5);
+ } else {
+ ZVAL_LONG(&property, _5$$5);
+ }
+ ZEPHIR_INIT_NVAR(&reflectionProperty);
+ ZVAL_COPY(&reflectionProperty, _3$$5);
+ ZEPHIR_INIT_NVAR(&_7$$6);
+ object_init_ex(&_7$$6, phalcon_annotations_collection_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 48, &reflectionProperty);
+ zephir_check_call_status();
+ zephir_update_property_array(this_ptr, SL("propertyAnnotations"), &property, &_7$$6);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &reflectionProperties, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_4$$5, &reflectionProperties, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_4$$5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&property, &reflectionProperties, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&reflectionProperty, &reflectionProperties, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_9$$7);
+ object_init_ex(&_9$$7, phalcon_annotations_collection_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 48, &reflectionProperty);
+ zephir_check_call_status();
+ zephir_update_property_array(this_ptr, SL("propertyAnnotations"), &property, &_9$$7);
+ ZEPHIR_CALL_METHOD(NULL, &reflectionProperties, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&reflectionProperty);
+ ZEPHIR_INIT_NVAR(&property);
+ RETURN_MM_MEMBER(getThis(), "propertyAnnotations");
}
-vv47:
- {
- token->opcode = PHVOLT_T_IDENTIFIER;
- token->value = estrndup(start, VVCURSOR - start);
- token->len = VVCURSOR - start;
- return 0;
}
-vv48:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'L':
- case 'l': goto vv117;
- case 'R':
- case 'r': goto vv118;
- default: goto vv54;
- }
-vv49:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv119;
- case 'O':
- case 'o': goto vv120;
- default: goto vv54;
- }
-vv50:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv121;
- case 'O':
- case 'o': goto vv122;
- default: goto vv54;
- }
-vv51:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'L':
- case 'l': goto vv124;
- case 'M':
- case 'm': goto vv125;
- case 'N':
- case 'n': goto vv126;
- case 'V':
- case 'v': goto vv127;
- case 'X':
- case 'x': goto vv128;
- default: goto vv54;
+ if (0) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("propertyAnnotations"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("propertyAnnotations"), &__$false);
+ }
+ }
+ RETURN_MM_MEMBER(getThis(), "propertyAnnotations");
+}
+
+static PHP_METHOD(Phalcon_Annotations_Reflection, getReflectionData)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "reflectionData");
+}
+
+zend_object *zephir_init_properties_Phalcon_Annotations_Reflection(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_MM_GROW();
+
+ {
+ 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("reflectionData"), 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("reflectionData"), &_1$$3);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
+ }
+}
+
+
+
+/* Generated by re2c 1.1.1 */
+/* scanner.re
+ * This file is part of the Phalcon Framework.
+ *
+ * (c) Phalcon Team
+ *
+ * For the full copyright and license information, please view the
+ * LICENSE.txt file that was distributed with this source code.
+ */
+
+
+
+#define AACTYPE unsigned char
+#define AACURSOR (s->start)
+#define AALIMIT (s->end)
+#define AAMARKER q
+
+static int phannot_get_token(phannot_scanner_state *s, phannot_scanner_token *token) {
+
+ char next, *q = AACURSOR, *start = AACURSOR;
+ int status = PHANNOT_SCANNER_RETCODE_IMPOSSIBLE;
+
+ while (PHANNOT_SCANNER_RETCODE_IMPOSSIBLE == status) {
+
+ if (s->mode == PHANNOT_MODE_RAW) {
+
+ if (*AACURSOR == '\n') {
+ s->active_line++;
}
-vv52:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv129;
- case 'O':
- case 'o': goto vv130;
- default: goto vv54;
+
+ next = *(AACURSOR+1);
+
+ if (*AACURSOR == '\0' || *AACURSOR == '@') {
+ if ((next >= 'A' && next <= 'Z') || (next >= 'a' && next <= 'z')) {
+ s->mode = PHANNOT_MODE_ANNOTATION;
+ continue;
+ }
}
-vv53:
- vvch = *++VVCURSOR;
-vv54:
- switch (vvch) {
+
+ ++AACURSOR;
+ token->opcode = PHANNOT_T_IGNORE;
+ return 0;
+
+ } else {
+
+
+ {
+ AACTYPE aach;
+ unsigned int aaaccept = 0;
+ aach = *AACURSOR;
+ switch (aach) {
+ case 0x00: goto aa2;
+ case '\t':
+ case '\r':
+ case ' ': goto aa6;
+ case '\n': goto aa9;
+ case '"': goto aa11;
+ case '\'': goto aa12;
+ case '(': goto aa13;
+ case ')': goto aa15;
+ case ',': goto aa17;
+ case '-': goto aa19;
case '0':
case '1':
case '2':
@@ -187344,150 +177753,15 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case '6':
case '7':
case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv47;
- }
-vv55:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'F':
- case 'f': goto vv131;
- case 'N':
- case 'n': goto vv133;
- case 'S':
- case 's': goto vv135;
- case 'T':
- case 't': goto vv137;
- default: goto vv54;
- }
-vv56:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv138;
- default: goto vv54;
- }
-vv57:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'O':
- case 'o': goto vv139;
- case 'U':
- case 'u': goto vv140;
- default: goto vv54;
- }
-vv58:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'D':
- case 'd': goto vv141;
- case 'R':
- case 'r': goto vv142;
- default: goto vv54;
- }
-vv59:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv144;
- case 'E':
- case 'e': goto vv145;
- default: goto vv54;
- }
-vv60:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'C':
- case 'c': goto vv146;
- case 'E':
- case 'e': goto vv147;
- case 'W':
- case 'w': goto vv148;
- default: goto vv54;
- }
-vv61:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'R':
- case 'r': goto vv149;
- default: goto vv54;
- }
-vv62:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'I':
- case 'i': goto vv150;
- default: goto vv54;
- }
-vv63:
- ++VVCURSOR;
- {
- token->opcode = PHVOLT_T_SBRACKET_OPEN;
- return 0;
- }
-vv65:
- vvch = *++VVCURSOR;
- switch (vvch) {
+ case '9': goto aa20;
+ case ':': goto aa23;
+ case '=': goto aa25;
+ case '@': goto aa27;
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
- case 'F':
case 'G':
case 'H':
case 'I':
@@ -187495,13 +177769,11 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'K':
case 'L':
case 'M':
- case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
- case 'T':
case 'U':
case 'V':
case 'W':
@@ -187514,7 +177786,6 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'c':
case 'd':
case 'e':
- case 'f':
case 'g':
case 'h':
case 'i':
@@ -187522,197 +177793,111 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'k':
case 'l':
case 'm':
- case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
- case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
- case 'z': goto vv53;
- default: goto vv5;
- }
-vv66:
- ++VVCURSOR;
- {
- token->opcode = PHVOLT_T_SBRACKET_CLOSE;
- return 0;
- }
-vv68:
- vvch = *++VVCURSOR;
- switch (vvch) {
+ case 'z': goto aa29;
case 'F':
- case 'f': goto vv131;
+ case 'f': goto aa32;
case 'N':
- case 'n': goto vv133;
- case 'S': goto vv135;
+ case 'n': goto aa33;
case 'T':
- case 't': goto vv137;
- case 's': goto vv151;
- default: goto vv54;
- }
-vv69:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '%': goto vv152;
- case '{': goto vv154;
- default: goto vv70;
- }
-vv70:
- {
- token->opcode = PHVOLT_T_CBRACKET_OPEN;
- return 0;
- }
-vv71:
- ++VVCURSOR;
- {
- token->opcode = PHVOLT_T_PIPE;
- return 0;
- }
-vv73:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '}': goto vv156;
- default: goto vv74;
- }
-vv74:
- {
- token->opcode = PHVOLT_T_CBRACKET_CLOSE;
- return 0;
- }
-vv75:
- ++VVCURSOR;
- {
- token->opcode = PHVOLT_T_CONCAT;
- return 0;
- }
-vv77:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '=': goto vv158;
- default: goto vv78;
- }
-vv78:
- {
- token->opcode = PHVOLT_T_NOTEQUALS;
- return 0;
- }
-vv79:
- vvch = *++VVCURSOR;
-vv80:
- switch (vvch) {
- case 0x00: goto vv81;
- case '"': goto vv82;
- case '\\': goto vv84;
- default: goto vv79;
- }
-vv81:
- VVCURSOR = VVMARKER;
- switch (vvaccept) {
- case 0: goto vv5;
- case 1: goto vv28;
- case 2: goto vv35;
- default: goto vv136;
+ case 't': goto aa34;
+ case '[': goto aa35;
+ case '\\': goto aa37;
+ case ']': goto aa38;
+ case '{': goto aa40;
+ case '}': goto aa42;
+ default: goto aa4;
}
-vv82:
- ++VVCURSOR;
+aa2:
+ ++AACURSOR;
{
- start++;
- token->opcode = PHVOLT_T_STRING;
- token->value = estrndup(start, VVCURSOR - start - 1);
- token->len = VVCURSOR - start - 1;
- return 0;
+ status = PHANNOT_SCANNER_RETCODE_EOF;
+ break;
}
-vv84:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '\n': goto vv81;
- default: goto vv79;
- }
-vv85:
- ++VVCURSOR;
+aa4:
+ ++AACURSOR;
+aa5:
{
- s->mode = PHVOLT_MODE_RAW;
- token->opcode = PHVOLT_T_CLOSE_DELIMITER;
- return 0;
+ status = PHANNOT_SCANNER_RETCODE_ERR;
+ break;
}
-vv87:
- vvch = *++VVCURSOR;
-vv88:
- switch (vvch) {
- case 0x00: goto vv81;
- case '\'': goto vv82;
- case '\\': goto vv89;
- default: goto vv87;
- }
-vv89:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '\n': goto vv81;
- default: goto vv87;
+aa6:
+ aach = *++AACURSOR;
+ switch (aach) {
+ case '\t':
+ case '\r':
+ case ' ': goto aa6;
+ default: goto aa8;
}
-vv90:
- ++VVCURSOR;
+aa8:
{
- token->opcode = PHVOLT_T_MUL_ASSIGN;
+ token->opcode = PHANNOT_T_IGNORE;
return 0;
}
-vv92:
- ++VVCURSOR;
+aa9:
+ ++AACURSOR;
{
- token->opcode = PHVOLT_T_INCR;
+ s->active_line++;
+ token->opcode = PHANNOT_T_IGNORE;
return 0;
}
-vv94:
- ++VVCURSOR;
+aa11:
+ aaaccept = 0;
+ aach = *(AAMARKER = ++AACURSOR);
+ if (aach <= 0x00) goto aa5;
+ goto aa45;
+aa12:
+ aaaccept = 0;
+ aach = *(AAMARKER = ++AACURSOR);
+ if (aach <= 0x00) goto aa5;
+ goto aa51;
+aa13:
+ ++AACURSOR;
{
- token->opcode = PHVOLT_T_ADD_ASSIGN;
+ token->opcode = PHANNOT_T_PARENTHESES_OPEN;
return 0;
}
-vv96:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '}': goto vv160;
- default: goto vv81;
- }
-vv97:
- ++VVCURSOR;
+aa15:
+ ++AACURSOR;
{
- token->opcode = PHVOLT_T_DECR;
+ token->opcode = PHANNOT_T_PARENTHESES_CLOSE;
return 0;
}
-vv99:
- ++VVCURSOR;
+aa17:
+ ++AACURSOR;
{
- token->opcode = PHVOLT_T_SUB_ASSIGN;
+ token->opcode = PHANNOT_T_COMMA;
return 0;
}
-vv101:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '}': goto vv162;
- default: goto vv81;
+aa19:
+ aach = *++AACURSOR;
+ switch (aach) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto aa20;
+ default: goto aa5;
}
-vv102:
- ++VVCURSOR;
- {
- token->opcode = PHVOLT_T_RANGE;
- return 0;
- }
-vv104:
- ++VVCURSOR;
- {
- token->opcode = PHVOLT_T_DIV_ASSIGN;
- return 0;
- }
-vv106:
- vvch = *++VVCURSOR;
- switch (vvch) {
+aa20:
+ aaaccept = 1;
+ aach = *(AAMARKER = ++AACURSOR);
+ switch (aach) {
+ case '.': goto aa53;
case '0':
case '1':
case '2':
@@ -187722,94 +177907,40 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case '6':
case '7':
case '8':
- case '9': goto vv164;
- default: goto vv81;
+ case '9': goto aa20;
+ default: goto aa22;
}
-vv107:
- ++VVCURSOR;
+aa22:
{
- token->opcode = PHVOLT_T_LESSEQUAL;
+ token->opcode = PHANNOT_T_INTEGER;
+ token->value = estrndup(start, AACURSOR - start);
+ token->len = AACURSOR - start;
+ q = AACURSOR;
return 0;
}
-vv109:
- ++VVCURSOR;
+aa23:
+ ++AACURSOR;
{
- token->opcode = PHVOLT_T_NOTEQUALS;
+ token->opcode = PHANNOT_T_COLON;
return 0;
}
-vv111:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '=': goto vv167;
- default: goto vv112;
- }
-vv112:
+aa25:
+ ++AACURSOR;
{
- token->opcode = PHVOLT_T_EQUALS;
+ token->opcode = PHANNOT_T_EQUALS;
return 0;
}
-vv113:
- ++VVCURSOR;
+aa27:
+ ++AACURSOR;
{
- token->opcode = PHVOLT_T_GREATEREQUAL;
+ token->opcode = PHANNOT_T_AT;
return 0;
}
-vv115:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'D':
- case 'd': goto vv169;
- default: goto vv54;
- }
-vv116:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'T':
- case 't': goto vv171;
- default: goto vv54;
- }
-vv117:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'O':
- case 'o': goto vv172;
- default: goto vv54;
- }
-vv118:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv173;
- default: goto vv54;
- }
-vv119:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'C':
- case 'c': goto vv174;
- case 'L':
- case 'l': goto vv175;
- case 'S':
- case 's': goto vv176;
- default: goto vv54;
- }
-vv120:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'N':
- case 'n': goto vv177;
- default: goto vv54;
- }
-vv121:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'F':
- case 'f': goto vv178;
- default: goto vv54;
- }
-vv122:
- vvch = *++VVCURSOR;
- switch (vvch) {
+aa29:
+ aaaccept = 2;
+ aach = *(AAMARKER = ++AACURSOR);
+aa30:
+ switch (aach) {
case '0':
case '1':
case '2':
@@ -187846,7 +177977,6 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'X':
case 'Y':
case 'Z':
- case '\\':
case '_':
case 'a':
case 'b':
@@ -187873,77 +178003,51 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'w':
case 'x':
case 'y':
- case 'z': goto vv53;
- default: goto vv123;
+ case 'z': goto aa29;
+ case '\\': goto aa54;
+ default: goto aa31;
}
-vv123:
+aa31:
{
- s->statement_position++;
- token->opcode = PHVOLT_T_DO;
+ token->opcode = PHANNOT_T_IDENTIFIER;
+ token->value = estrndup(start, AACURSOR - start);
+ token->len = AACURSOR - start;
+ q = AACURSOR;
return 0;
}
-vv124:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'S':
- case 's': goto vv179;
- default: goto vv54;
- }
-vv125:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'P':
- case 'p': goto vv180;
- default: goto vv54;
- }
-vv126:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'D':
- case 'd': goto vv181;
- default: goto vv54;
- }
-vv127:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv182;
- default: goto vv54;
- }
-vv128:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'T':
- case 't': goto vv183;
- default: goto vv54;
+aa32:
+ aaaccept = 2;
+ aach = *(AAMARKER = ++AACURSOR);
+ switch (aach) {
+ case 'A':
+ case 'a': goto aa55;
+ default: goto aa30;
}
-vv129:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'L':
- case 'l': goto vv184;
- default: goto vv54;
+aa33:
+ aaaccept = 2;
+ aach = *(AAMARKER = ++AACURSOR);
+ switch (aach) {
+ case 'U':
+ case 'u': goto aa56;
+ default: goto aa30;
}
-vv130:
- vvch = *++VVCURSOR;
- switch (vvch) {
+aa34:
+ aaaccept = 2;
+ aach = *(AAMARKER = ++AACURSOR);
+ switch (aach) {
case 'R':
- case 'r': goto vv185;
- default: goto vv54;
+ case 'r': goto aa57;
+ default: goto aa30;
}
-vv131:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
+aa35:
+ ++AACURSOR;
+ {
+ token->opcode = PHANNOT_T_SBRACKET_OPEN;
+ return 0;
+ }
+aa37:
+ aach = *++AACURSOR;
+ switch (aach) {
case 'A':
case 'B':
case 'C':
@@ -187970,7 +178074,6 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'X':
case 'Y':
case 'Z':
- case '\\':
case '_':
case 'a':
case 'b':
@@ -187997,213 +178100,79 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'w':
case 'x':
case 'y':
- case 'z': goto vv53;
- default: goto vv132;
+ case 'z': goto aa29;
+ default: goto aa5;
}
-vv132:
+aa38:
+ ++AACURSOR;
{
- s->statement_position++;
- token->opcode = PHVOLT_T_IF;
+ token->opcode = PHANNOT_T_SBRACKET_CLOSE;
return 0;
}
-vv133:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- case 'C':
- case 'c': goto vv187;
- default: goto vv134;
- }
-vv134:
+aa40:
+ ++AACURSOR;
{
- token->opcode = PHVOLT_T_IN;
+ token->opcode = PHANNOT_T_BRACKET_OPEN;
return 0;
}
-vv135:
- vvaccept = 3;
- vvch = *(VVMARKER = ++VVCURSOR);
- switch (vvch) {
- case ' ': goto vv188;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv136;
- }
-vv136:
+aa42:
+ ++AACURSOR;
{
- if (s->active_token == PHVOLT_T_DOT) {
- token->opcode = PHVOLT_T_IDENTIFIER;
- token->value = estrndup(start, VVCURSOR - start);
- token->len = VVCURSOR - start;
- } else {
- s->statement_position++;
- token->opcode = PHVOLT_T_IS;
- }
-
+ token->opcode = PHANNOT_T_BRACKET_CLOSE;
return 0;
}
-vv137:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv189;
- default: goto vv54;
+aa44:
+ aach = *++AACURSOR;
+aa45:
+ switch (aach) {
+ case 0x00: goto aa46;
+ case '"': goto aa47;
+ case '\\': goto aa49;
+ default: goto aa44;
}
-vv138:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'C':
- case 'c': goto vv190;
- default: goto vv54;
+aa46:
+ AACURSOR = AAMARKER;
+ switch (aaaccept) {
+ case 0: goto aa5;
+ case 1: goto aa22;
+ case 2: goto aa31;
+ case 3: goto aa66;
+ case 4: goto aa68;
+ default: goto aa70;
}
-vv139:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'T':
- case 't': goto vv191;
- default: goto vv54;
+aa47:
+ ++AACURSOR;
+ {
+ token->opcode = PHANNOT_T_STRING;
+ token->value = estrndup(q, AACURSOR - q - 1);
+ token->len = AACURSOR - q - 1;
+ q = AACURSOR;
+ return 0;
+ }
+aa49:
+ aach = *++AACURSOR;
+ switch (aach) {
+ case '\n': goto aa46;
+ default: goto aa44;
}
-vv140:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'L':
- case 'l': goto vv193;
- case 'M':
- case 'm': goto vv194;
- default: goto vv54;
+aa50:
+ aach = *++AACURSOR;
+aa51:
+ switch (aach) {
+ case 0x00: goto aa46;
+ case '\'': goto aa47;
+ case '\\': goto aa52;
+ default: goto aa50;
}
-vv141:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'D':
- case 'd': goto vv195;
- default: goto vv54;
+aa52:
+ aach = *++AACURSOR;
+ switch (aach) {
+ case '\n': goto aa46;
+ default: goto aa50;
}
-vv142:
- vvch = *++VVCURSOR;
- switch (vvch) {
+aa53:
+ aach = *++AACURSOR;
+ switch (aach) {
case '0':
case '1':
case '2':
@@ -188213,7 +178182,12 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case '6':
case '7':
case '8':
- case '9':
+ case '9': goto aa58;
+ default: goto aa46;
+ }
+aa54:
+ aach = *++AACURSOR;
+ switch (aach) {
case 'A':
case 'B':
case 'C':
@@ -188240,7 +178214,6 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'X':
case 'Y':
case 'Z':
- case '\\':
case '_':
case 'a':
case 'b':
@@ -188267,68 +178240,92 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'w':
case 'x':
case 'y':
- case 'z': goto vv53;
- default: goto vv143;
+ case 'z': goto aa29;
+ default: goto aa46;
+ }
+aa55:
+ aaaccept = 2;
+ aach = *(AAMARKER = ++AACURSOR);
+ switch (aach) {
+ case 'L':
+ case 'l': goto aa61;
+ default: goto aa30;
+ }
+aa56:
+ aaaccept = 2;
+ aach = *(AAMARKER = ++AACURSOR);
+ switch (aach) {
+ case 'L':
+ case 'l': goto aa62;
+ default: goto aa30;
+ }
+aa57:
+ aaaccept = 2;
+ aach = *(AAMARKER = ++AACURSOR);
+ switch (aach) {
+ case 'U':
+ case 'u': goto aa63;
+ default: goto aa30;
+ }
+aa58:
+ aach = *++AACURSOR;
+ switch (aach) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto aa58;
+ default: goto aa60;
}
-vv143:
+aa60:
{
- token->opcode = PHVOLT_T_OR;
+ token->opcode = PHANNOT_T_DOUBLE;
+ token->value = estrndup(start, AACURSOR - start);
+ token->len = AACURSOR - start;
+ q = AACURSOR;
return 0;
}
-vv144:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'W':
- case 'w': goto vv197;
- default: goto vv54;
- }
-vv145:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'T':
- case 't': goto vv199;
- default: goto vv54;
- }
-vv146:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv200;
- default: goto vv54;
- }
-vv147:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'T':
- case 't': goto vv201;
- default: goto vv54;
+aa61:
+ aaaccept = 2;
+ aach = *(AAMARKER = ++AACURSOR);
+ switch (aach) {
+ case 'S':
+ case 's': goto aa64;
+ default: goto aa30;
}
-vv148:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'I':
- case 'i': goto vv203;
- default: goto vv54;
+aa62:
+ aaaccept = 2;
+ aach = *(AAMARKER = ++AACURSOR);
+ switch (aach) {
+ case 'L':
+ case 'l': goto aa65;
+ default: goto aa30;
}
-vv149:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'U':
- case 'u': goto vv204;
- default: goto vv54;
+aa63:
+ aaaccept = 2;
+ aach = *(AAMARKER = ++AACURSOR);
+ switch (aach) {
+ case 'E':
+ case 'e': goto aa67;
+ default: goto aa30;
}
-vv150:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'T':
- case 't': goto vv205;
- default: goto vv54;
+aa64:
+ aaaccept = 2;
+ aach = *(AAMARKER = ++AACURSOR);
+ switch (aach) {
+ case 'E':
+ case 'e': goto aa69;
+ default: goto aa30;
}
-vv151:
- vvaccept = 3;
- vvch = *(VVMARKER = ++VVCURSOR);
- switch (vvch) {
- case ' ': goto vv206;
+aa65:
+ aaaccept = 3;
+ aach = *(AAMARKER = ++AACURSOR);
+ switch (aach) {
case '0':
case '1':
case '2':
@@ -188365,7 +178362,6 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'X':
case 'Y':
case 'Z':
- case '\\':
case '_':
case 'a':
case 'b':
@@ -188392,94 +178388,19 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'w':
case 'x':
case 'y':
- case 'z': goto vv53;
- default: goto vv136;
- }
-vv152:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '-': goto vv207;
- default: goto vv153;
- }
-vv153:
- {
- s->whitespace_control = 0;
- token->opcode = PHVOLT_T_OPEN_DELIMITER;
- return 0;
- }
-vv154:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '-': goto vv209;
- default: goto vv155;
- }
-vv155:
- {
- s->whitespace_control = 0;
- s->statement_position++;
- token->opcode = PHVOLT_T_OPEN_EDELIMITER;
- return 0;
- }
-vv156:
- ++VVCURSOR;
- {
- s->mode = PHVOLT_MODE_RAW;
- token->opcode = PHVOLT_T_CLOSE_EDELIMITER;
- return 0;
- }
-vv158:
- ++VVCURSOR;
- {
- token->opcode = PHVOLT_T_NOTIDENTICAL;
- return 0;
- }
-vv160:
- ++VVCURSOR;
- {
- s->mode = PHVOLT_MODE_RAW;
- s->whitespace_control = 1;
- token->opcode = PHVOLT_T_CLOSE_DELIMITER;
- return 0;
- }
-vv162:
- ++VVCURSOR;
- {
- s->mode = PHVOLT_MODE_RAW;
- s->whitespace_control = 1;
- token->opcode = PHVOLT_T_CLOSE_EDELIMITER;
- return 0;
- }
-vv164:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto vv164;
- default: goto vv166;
+ case 'z': goto aa29;
+ case '\\': goto aa54;
+ default: goto aa66;
}
-vv166:
- {
- token->opcode = PHVOLT_T_DOUBLE;
- token->value = estrndup(start, VVCURSOR - start);
- token->len = VVCURSOR - start;
- return 0;
- }
-vv167:
- ++VVCURSOR;
+aa66:
{
- token->opcode = PHVOLT_T_IDENTICAL;
+ token->opcode = PHANNOT_T_NULL;
return 0;
}
-vv169:
- vvch = *++VVCURSOR;
- switch (vvch) {
+aa67:
+ aaaccept = 4;
+ aach = *(AAMARKER = ++AACURSOR);
+ switch (aach) {
case '0':
case '1':
case '2':
@@ -188516,7 +178437,6 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'X':
case 'Y':
case 'Z':
- case '\\':
case '_':
case 'a':
case 'b':
@@ -188543,131 +178463,19 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'w':
case 'x':
case 'y':
- case 'z': goto vv53;
- default: goto vv170;
+ case 'z': goto aa29;
+ case '\\': goto aa54;
+ default: goto aa68;
}
-vv170:
+aa68:
{
- token->opcode = PHVOLT_T_AND;
+ token->opcode = PHANNOT_T_TRUE;
return 0;
}
-vv171:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'O':
- case 'o': goto vv211;
- default: goto vv54;
- }
-vv172:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'C':
- case 'c': goto vv212;
- default: goto vv54;
- }
-vv173:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv213;
- default: goto vv54;
- }
-vv174:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'H':
- case 'h': goto vv214;
- default: goto vv54;
- }
-vv175:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'L':
- case 'l': goto vv215;
- default: goto vv54;
- }
-vv176:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv217;
- default: goto vv54;
- }
-vv177:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'T':
- case 't': goto vv219;
- default: goto vv54;
- }
-vv178:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv220;
- case 'I':
- case 'i': goto vv221;
- default: goto vv54;
- }
-vv179:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv222;
- default: goto vv54;
- }
-vv180:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'T':
- case 't': goto vv224;
- default: goto vv54;
- }
-vv181:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv225;
- case 'B':
- case 'b': goto vv226;
- case 'C':
- case 'c': goto vv227;
- case 'F':
- case 'f': goto vv228;
- case 'I':
- case 'i': goto vv229;
- case 'M':
- case 'm': goto vv230;
- case 'R':
- case 'r': goto vv231;
- case 'S':
- case 's': goto vv232;
- default: goto vv54;
- }
-vv182:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'N':
- case 'n': goto vv233;
- default: goto vv54;
- }
-vv183:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv235;
- default: goto vv54;
- }
-vv184:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'S':
- case 's': goto vv236;
- default: goto vv54;
- }
-vv185:
- vvch = *++VVCURSOR;
- switch (vvch) {
+aa69:
+ aaaccept = 5;
+ aach = *(AAMARKER = ++AACURSOR);
+ switch (aach) {
case '0':
case '1':
case '2':
@@ -188704,7 +178512,6 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'X':
case 'Y':
case 'Z':
- case '\\':
case '_':
case 'a':
case 'b':
@@ -188731,3623 +178538,8690 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
case 'w':
case 'x':
case 'y':
- case 'z': goto vv53;
- default: goto vv186;
+ case 'z': goto aa29;
+ case '\\': goto aa54;
+ default: goto aa70;
}
-vv186:
+aa70:
{
- s->statement_position++;
- token->opcode = PHVOLT_T_FOR;
+ token->opcode = PHANNOT_T_FALSE;
return 0;
}
-vv187:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'L':
- case 'l': goto vv237;
- default: goto vv54;
- }
-vv188:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'N':
- case 'n': goto vv238;
- default: goto vv81;
- }
-vv189:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'R':
- case 'r': goto vv239;
- default: goto vv54;
+ }
+
+
+ }
+ }
+
+ return status;
+}
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter_AbstractAdapter)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Annotations\\Adapter, AbstractAdapter, phalcon, annotations_adapter_abstractadapter, phalcon_annotations_adapter_abstractadapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+
+ zend_declare_property_null(phalcon_annotations_adapter_abstractadapter_ce, SL("annotations"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_annotations_adapter_abstractadapter_ce, SL("reader"), ZEND_ACC_PROTECTED);
+ phalcon_annotations_adapter_abstractadapter_ce->create_object = zephir_init_properties_Phalcon_Annotations_Adapter_AbstractAdapter;
+
+ zend_class_implements(phalcon_annotations_adapter_abstractadapter_ce, 1, phalcon_annotations_adapter_adapterinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, get)
+{
+ zend_bool _3;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *className, className_sub, classAnnotations, parsedAnnotations, realClassName, reader, _0, _1$$5, _2$$5;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&className_sub);
+ ZVAL_UNDEF(&classAnnotations);
+ ZVAL_UNDEF(&parsedAnnotations);
+ ZVAL_UNDEF(&realClassName);
+ ZVAL_UNDEF(&reader);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$5);
+ ZVAL_UNDEF(&_2$$5);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(className)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &className);
+
+
+ if (Z_TYPE_P(className) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&realClassName);
+ zephir_get_class(&realClassName, className, 0);
+ } else {
+ ZEPHIR_CPY_WRT(&realClassName, className);
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("annotations"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset(&_0, &realClassName)) {
+ zephir_read_property(&_1$$5, this_ptr, ZEND_STRL("annotations"), PH_NOISY_CC | PH_READONLY);
+ zephir_array_fetch(&_2$$5, &_1$$5, &realClassName, PH_NOISY | PH_READONLY, "phalcon/Annotations/Adapter/AbstractAdapter.zep", 51);
+ RETURN_CTOR(&_2$$5);
+ }
+ ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "read", NULL, 0, &realClassName);
+ zephir_check_call_status();
+ _3 = Z_TYPE_P(&classAnnotations) == IS_NULL;
+ if (!(_3)) {
+ _3 = ZEPHIR_IS_FALSE_IDENTICAL(&classAnnotations);
+ }
+ if (_3) {
+ ZEPHIR_CALL_METHOD(&reader, this_ptr, "getreader", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&parsedAnnotations, &reader, "parse", NULL, 0, &realClassName);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&classAnnotations);
+ object_init_ex(&classAnnotations, phalcon_annotations_reflection_ce);
+ ZEPHIR_CALL_METHOD(NULL, &classAnnotations, "__construct", NULL, 46, &parsedAnnotations);
+ zephir_check_call_status();
+ zephir_update_property_array(this_ptr, SL("annotations"), &realClassName, &classAnnotations);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &realClassName, &classAnnotations);
+ zephir_check_call_status();
+ }
+ RETURN_CCTOR(&classAnnotations);
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethod)
+{
+ zend_string *_3$$3;
+ zend_ulong _2$$3;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_5 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *className_param = NULL, *methodName_param = NULL, classAnnotations, methods, method, methodKey, *_0$$3, _1$$3, _4$$4, _6$$6;
+ zval className, methodName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&className);
+ ZVAL_UNDEF(&methodName);
+ ZVAL_UNDEF(&classAnnotations);
+ ZVAL_UNDEF(&methods);
+ ZVAL_UNDEF(&method);
+ ZVAL_UNDEF(&methodKey);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_6$$6);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(className)
+ Z_PARAM_STR(methodName)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &className_param, &methodName_param);
+ zephir_get_strval(&className, className_param);
+ zephir_get_strval(&methodName, methodName_param);
+
+
+ ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&methods, &classAnnotations, "getmethodsannotations", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&methods) == IS_ARRAY) {
+ zephir_is_iterable(&methods, 0, "phalcon/Annotations/Adapter/AbstractAdapter.zep", 94);
+ if (Z_TYPE_P(&methods) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methods), _2$$3, _3$$3, _0$$3)
+ {
+ ZEPHIR_INIT_NVAR(&methodKey);
+ if (_3$$3 != NULL) {
+ ZVAL_STR_COPY(&methodKey, _3$$3);
+ } else {
+ ZVAL_LONG(&methodKey, _2$$3);
+ }
+ ZEPHIR_INIT_NVAR(&method);
+ ZVAL_COPY(&method, _0$$3);
+ ZEPHIR_CALL_FUNCTION(&_4$$4, "strcasecmp", &_5, 47, &methodKey, &methodName);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_4$$4))) {
+ RETURN_CCTOR(&method);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &methods, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1$$3, &methods, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&methodKey, &methods, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&method, &methods, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&_6$$6, "strcasecmp", &_5, 47, &methodKey, &methodName);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_6$$6))) {
+ RETURN_CCTOR(&method);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &methods, "next", NULL, 0);
+ zephir_check_call_status();
}
-vv190:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'R':
- case 'r': goto vv240;
- default: goto vv54;
+ }
+ ZEPHIR_INIT_NVAR(&method);
+ ZEPHIR_INIT_NVAR(&methodKey);
+ }
+ object_init_ex(return_value, phalcon_annotations_collection_ce);
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 48);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *className_param = NULL, classAnnotations;
+ zval className;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&className);
+ ZVAL_UNDEF(&classAnnotations);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(className)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &className_param);
+ zephir_get_strval(&className, className_param);
+
+
+ ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(&classAnnotations, "getmethodsannotations", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getProperty)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *className_param = NULL, *propertyName_param = NULL, classAnnotations, properties, property;
+ zval className, propertyName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&className);
+ ZVAL_UNDEF(&propertyName);
+ ZVAL_UNDEF(&classAnnotations);
+ ZVAL_UNDEF(&properties);
+ ZVAL_UNDEF(&property);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(className)
+ Z_PARAM_STR(propertyName)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &className_param, &propertyName_param);
+ zephir_get_strval(&className, className_param);
+ zephir_get_strval(&propertyName, propertyName_param);
+
+
+ ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&properties, &classAnnotations, "getpropertiesannotations", NULL, 0);
+ zephir_check_call_status();
+ if (!(zephir_array_isset_fetch(&property, &properties, &propertyName, 1))) {
+ object_init_ex(return_value, phalcon_annotations_collection_ce);
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 48);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ RETURN_CTOR(&property);
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getProperties)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *className_param = NULL, classAnnotations;
+ zval className;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&className);
+ ZVAL_UNDEF(&classAnnotations);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(className)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &className_param);
+ zephir_get_strval(&className, className_param);
+
+
+ ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(&classAnnotations, "getpropertiesannotations", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getReader)
+{
+ zval _0, _1$$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$$3);
+
+
+ ZEPHIR_MM_GROW();
+
+ ZEPHIR_OBS_VAR(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("reader"), PH_NOISY_CC);
+ if (Z_TYPE_P(&_0) != IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ object_init_ex(&_1$$3, phalcon_annotations_reader_ce);
+ if (zephir_has_constructor(&_1$$3)) {
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 0);
+ zephir_check_call_status();
+ }
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("reader"), &_1$$3);
+ }
+ RETURN_MM_MEMBER(getThis(), "reader");
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, setReader)
+{
+ zval *reader, reader_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&reader_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(reader, phalcon_annotations_readerinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &reader);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("reader"), reader);
+}
+
+zend_object *zephir_init_properties_Phalcon_Annotations_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_MM_GROW();
+
+ {
+ 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("annotations"), 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("annotations"), &_1$$3);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
+ }
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter_AdapterInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Annotations\\Adapter, AdapterInterface, phalcon, annotations_adapter_adapterinterface, phalcon_annotations_adapter_adapterinterface_method_entry);
+
+ return SUCCESS;
+}
+
+ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, get);
+ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getMethod);
+ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getMethods);
+ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getProperty);
+ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getProperties);
+ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getReader);
+ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, setReader);
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter_Apcu)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Annotations\\Adapter, Apcu, phalcon, annotations_adapter_apcu, phalcon_annotations_adapter_abstractadapter_ce, phalcon_annotations_adapter_apcu_method_entry, 0);
+
+ zend_declare_property_string(phalcon_annotations_adapter_apcu_ce, SL("prefix"), "", ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_annotations_adapter_apcu_ce, SL("ttl"), 172800, ZEND_ACC_PROTECTED);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_Apcu, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *options_param = NULL, prefix, ttl;
+ zval options;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&prefix);
+ ZVAL_UNDEF(&ttl);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &options_param);
+ if (!options_param) {
+ ZEPHIR_INIT_VAR(&options);
+ array_init(&options);
+ } else {
+ zephir_get_arrval(&options, options_param);
+ }
+
+
+ if (zephir_array_isset_string_fetch(&prefix, &options, SL("prefix"), 1)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &prefix);
+ }
+ if (zephir_array_isset_string_fetch(&ttl, &options, SL("lifetime"), 1)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("ttl"), &ttl);
+ }
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_Apcu, read)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, _0, _1, _2;
+ zval key;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_INIT_VAR(&_0);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_2);
+ ZEPHIR_CONCAT_SVV(&_2, "_PHAN", &_1, &key);
+ zephir_fast_strtolower(&_0, &_2);
+ ZEPHIR_RETURN_CALL_FUNCTION("apcu_fetch", NULL, 121, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_Apcu, write)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, *data, data_sub, _0, _1, _2, _3;
+ zval key;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(key)
+ Z_PARAM_OBJECT_OF_CLASS(data, phalcon_annotations_reflection_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &key_param, &data);
+ 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_INIT_VAR(&_0);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_2);
+ ZEPHIR_CONCAT_SVV(&_2, "_PHAN", &_1, &key);
+ zephir_fast_strtolower(&_0, &_2);
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("ttl"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_FUNCTION("apcu_store", NULL, 124, &_0, data, &_3);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter_Memory)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Annotations\\Adapter, Memory, phalcon, annotations_adapter_memory, phalcon_annotations_adapter_abstractadapter_ce, phalcon_annotations_adapter_memory_method_entry, 0);
+
+ zend_declare_property_null(phalcon_annotations_adapter_memory_ce, SL("data"), ZEND_ACC_PROTECTED);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_Memory, read)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *key_param = NULL, data, _0, _1;
+ zval key;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_1);
+ zephir_fast_strtolower(&_1, &key);
+ if (!(zephir_array_isset_fetch(&data, &_0, &_1, 1))) {
+ RETURN_MM_BOOL(0);
+ }
+ RETURN_CTOR(&data);
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_Memory, write)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *key_param = NULL, *data, data_sub, lowercasedKey;
+ zval key;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&lowercasedKey);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(key)
+ Z_PARAM_OBJECT_OF_CLASS(data, phalcon_annotations_reflection_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &key_param, &data);
+ 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_INIT_VAR(&lowercasedKey);
+ zephir_fast_strtolower(&lowercasedKey, &key);
+ zephir_update_property_array(this_ptr, SL("data"), &lowercasedKey, data);
+ ZEPHIR_MM_RESTORE();
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter_Stream)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Annotations\\Adapter, Stream, phalcon, annotations_adapter_stream, phalcon_annotations_adapter_abstractadapter_ce, phalcon_annotations_adapter_stream_method_entry, 0);
+
+ zend_declare_property_string(phalcon_annotations_adapter_stream_ce, SL("annotationsDir"), "./", ZEND_ACC_PROTECTED);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_Stream, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *options_param = NULL, annotationsDir;
+ zval options;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&annotationsDir);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &options_param);
+ if (!options_param) {
+ ZEPHIR_INIT_VAR(&options);
+ array_init(&options);
+ } else {
+ zephir_get_arrval(&options, options_param);
+ }
+
+
+ if (zephir_array_isset_string_fetch(&annotationsDir, &options, SL("annotationsDir"), 1)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("annotationsDir"), &annotationsDir);
+ }
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_Stream, read)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, __$false, contents, version, _0, _1, _2, _3, _4, _5, _6, _11, _7$$5, _8$$5, _9$$6, _10$$6;
+ zval key, path;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&path);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&contents);
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$6);
+ ZVAL_UNDEF(&_10$$6);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &key_param);
+ zephir_get_strval(&key, key_param);
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("annotationsDir"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "_");
+ zephir_prepare_virtual_path(&_1, &key, &_2);
+ ZEPHIR_INIT_VAR(&_3);
+ ZEPHIR_CONCAT_VVS(&_3, &_0, &_1, ".php");
+ zephir_get_strval(&path, &_3);
+ if (!((zephir_file_exists(&path) == SUCCESS))) {
+ RETURN_MM_BOOL(0);
+ }
+ ZEPHIR_INIT_VAR(&contents);
+ zephir_file_get_contents(&contents, &path);
+ if (UNEXPECTED(ZEPHIR_IS_EMPTY(&contents))) {
+ RETURN_MM_BOOL(0);
+ }
+ ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false);
+ ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 86);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_STRING(&_4, "8.0");
+ ZEPHIR_INIT_VAR(&_5);
+ ZVAL_STRING(&_5, ">=");
+ ZEPHIR_CALL_FUNCTION(&_6, "version_compare", NULL, 87, &version, &_4, &_5);
+ zephir_check_call_status();
+ if (zephir_is_true(&_6)) {
+ ZEPHIR_INIT_VAR(&_7$$5);
+ ZEPHIR_INIT_NVAR(&_7$$5);
+ zephir_create_closure_ex(&_7$$5, NULL, phalcon_4__closure_ce, SL("__invoke"));
+ ZVAL_LONG(&_8$$5, 2);
+ ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_7$$5, &_8$$5);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_VAR(&_9$$6);
+ ZEPHIR_INIT_NVAR(&_9$$6);
+ zephir_create_closure_ex(&_9$$6, NULL, phalcon_5__closure_ce, SL("__invoke"));
+ ZVAL_LONG(&_10$$6, 2);
+ ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_9$$6, &_10$$6);
+ zephir_check_call_status();
+ }
+ ZEPHIR_CALL_FUNCTION(&_11, "unserialize", NULL, 15, &contents);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&contents, &_11);
+ ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 90);
+ zephir_check_call_status();
+ if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "Cannot read annotation data", "phalcon/Annotations/Adapter/Stream.zep", 102);
+ return;
+ }
+ RETURN_CCTOR(&contents);
+}
+
+static PHP_METHOD(Phalcon_Annotations_Adapter_Stream, write)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, *data, data_sub, code, _0, _1, _2, _3, _4;
+ zval key, path;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&path);
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&code);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(key)
+ Z_PARAM_OBJECT_OF_CLASS(data, phalcon_annotations_reflection_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &key_param, &data);
+ 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("annotationsDir"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "_");
+ zephir_prepare_virtual_path(&_1, &key, &_2);
+ ZEPHIR_INIT_VAR(&_3);
+ ZEPHIR_CONCAT_VVS(&_3, &_0, &_1, ".php");
+ zephir_get_strval(&path, &_3);
+ ZEPHIR_CALL_FUNCTION(&code, "serialize", NULL, 13, data);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_4);
+ zephir_file_put_contents(&_4, &path, &code);
+ if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&_4))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_annotations_exception_ce, "Annotations directory cannot be written", "phalcon/Annotations/Adapter/Stream.zep", 123);
+ return;
+ }
+ ZEPHIR_MM_RESTORE();
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Factory_AbstractFactory)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Factory, AbstractFactory, phalcon, factory_abstractfactory, phalcon_factory_abstractfactory_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+
+ zend_declare_property_string(phalcon_factory_abstractfactory_ce, SL("exception"), "Phalcon\\Exception", ZEND_ACC_PROTECTED);
+ 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;
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Factory_AbstractFactory, checkConfig)
+{
+ 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, _4$$5, _5$$5;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&config_sub);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$5);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(config)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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);
+ }
+ if (_0) {
+ ZEPHIR_CALL_METHOD(&_1$$3, config, "toarray", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(config, &_1$$3);
+ }
+ if (UNEXPECTED(Z_TYPE_P(config) != IS_ARRAY)) {
+ ZEPHIR_INIT_VAR(&_3$$4);
+ ZVAL_STRING(&_3$$4, "Config must be array or Phalcon\\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/AbstractFactory.zep", 44);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ if (UNEXPECTED(!(zephir_array_isset_string(config, SL("adapter"))))) {
+ ZEPHIR_INIT_VAR(&_5$$5);
+ ZVAL_STRING(&_5$$5, "You must provide 'adapter' option in factory config parameter.");
+ ZEPHIR_CALL_METHOD(&_4$$5, this_ptr, "getexception", NULL, 0, &_5$$5);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_4$$5, "phalcon/Factory/AbstractFactory.zep", 50);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ RETVAL_ZVAL(config, 1, 0);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Factory_AbstractFactory, getAdapters)
+{
+}
+
+static PHP_METHOD(Phalcon_Factory_AbstractFactory, getService)
+{
+ 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(&_0);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_1$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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("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", 67);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ 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", 70);
+ RETURN_CTOR(&_4);
+}
+
+static PHP_METHOD(Phalcon_Factory_AbstractFactory, init)
+{
+ 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 *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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(services)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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(&adapters, this_ptr, "getadapters", NULL, 0);
+ 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", 87);
+ 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);
}
-vv191:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv192;
+ 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;
}
-vv192:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_NOT;
- return 0;
+ 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();
}
-vv193:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'L':
- case 'l': goto vv241;
- default: goto vv54;
- }
-vv194:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv243;
- default: goto vv54;
- }
-vv195:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv196;
- }
-vv196:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_ODD;
- return 0;
+ }
+ ZEPHIR_INIT_NVAR(&service);
+ ZEPHIR_INIT_NVAR(&name);
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Factory_AbstractFactory, getException)
+{
+ zend_class_entry *_2;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *message_param = NULL, exception, _0, _1;
+ zval message;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&exception);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(message)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &message_param);
+ zephir_get_strval(&message, message_param);
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("exception"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&exception, &_0);
+ zephir_fetch_safe_class(&_1, &exception);
+ _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);
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &message);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+zend_object *zephir_init_properties_Phalcon_Factory_AbstractFactory(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_MM_GROW();
+
+ {
+ 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);
}
-vv197:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv198;
- }
-vv198:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_RAW;
- return 0;
+ 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);
}
-vv199:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'U':
- case 'u': goto vv244;
- default: goto vv54;
- }
-vv200:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'L':
- case 'l': goto vv245;
- default: goto vv54;
- }
-vv201:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv202;
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
+ }
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Factory_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Factory, Exception, phalcon, factory_exception, phalcon_exception_ce, NULL, 0);
+
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_AbstractDb)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Db, AbstractDb, phalcon, db_abstractdb, phalcon_db_abstractdb_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Db_AbstractDb, setup)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *options_param = NULL, escapeIdentifiers, forceCasting;
+ zval options;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&escapeIdentifiers);
+ ZVAL_UNDEF(&forceCasting);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &options_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+
+
+ ZEPHIR_OBS_VAR(&escapeIdentifiers);
+ if (zephir_array_isset_string_fetch(&escapeIdentifiers, &options, SL("escapeSqlIdentifiers"), 0)) {
+ ZEPHIR_GLOBAL(db).escape_identifiers = zend_is_true(&escapeIdentifiers);
+ }
+ ZEPHIR_OBS_VAR(&forceCasting);
+ if (zephir_array_isset_string_fetch(&forceCasting, &options, SL("forceCasting"), 0)) {
+ ZEPHIR_GLOBAL(db).force_casting = zend_is_true(&forceCasting);
+ }
+ ZEPHIR_MM_RESTORE();
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_Column)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Db, Column, phalcon, db_column, phalcon_db_column_method_entry, 0);
+
+ zend_declare_property_null(phalcon_db_column_ce, SL("after"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_db_column_ce, SL("autoIncrement"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_db_column_ce, SL("bindType"), 2, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_column_ce, SL("_default"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_db_column_ce, SL("first"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_db_column_ce, SL("isNumeric"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_column_ce, SL("name"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_column_ce, SL("comment"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_db_column_ce, SL("notNull"), 1, ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_db_column_ce, SL("primary"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_db_column_ce, SL("scale"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_db_column_ce, SL("size"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_column_ce, SL("type"), ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_db_column_ce, SL("typeReference"), -1, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_column_ce, SL("typeValues"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_db_column_ce, SL("unsigned"), 0, ZEND_ACC_PROTECTED);
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_BLOB"), 3);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_BOOL"), 5);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_DECIMAL"), 32);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_INT"), 1);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_NULL"), 0);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_STR"), 2);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_SKIP"), 1024);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_BIGINTEGER"), 14);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_BIT"), 19);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_BINARY"), 26);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_BLOB"), 11);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_BOOLEAN"), 8);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_CHAR"), 5);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_DATE"), 1);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_DATETIME"), 4);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_DECIMAL"), 3);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_DOUBLE"), 9);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_ENUM"), 18);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_FLOAT"), 7);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_INTEGER"), 0);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_JSON"), 15);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_JSONB"), 16);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_LONGBLOB"), 13);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_LONGTEXT"), 24);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_MEDIUMBLOB"), 12);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_MEDIUMINTEGER"), 21);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_MEDIUMTEXT"), 23);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_SMALLINTEGER"), 22);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_TEXT"), 6);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_TIME"), 20);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_TIMESTAMP"), 17);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_TINYBLOB"), 10);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_TINYINTEGER"), 26);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_TINYTEXT"), 25);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_VARBINARY"), 27);
+
+ zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_VARCHAR"), 2);
+
+ zend_class_implements(phalcon_db_column_ce, 1, phalcon_db_columninterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Db_Column, getDefault)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "_default");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, getName)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "name");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, getComment)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "comment");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, getScale)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "scale");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, getSize)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "size");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, getType)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "type");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, getTypeReference)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "typeReference");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, getTypeValues)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "typeValues");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval definition;
+ zval *name_param = NULL, *definition_param = NULL, __$true, __$false, type, notNull, primary, size, scale, dunsigned, first, after, bindType, isNumeric, autoIncrement, defaultValue, typeReference, typeValues, comment;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(¬Null);
+ ZVAL_UNDEF(&primary);
+ ZVAL_UNDEF(&size);
+ ZVAL_UNDEF(&scale);
+ ZVAL_UNDEF(&dunsigned);
+ ZVAL_UNDEF(&first);
+ ZVAL_UNDEF(&after);
+ ZVAL_UNDEF(&bindType);
+ ZVAL_UNDEF(&isNumeric);
+ ZVAL_UNDEF(&autoIncrement);
+ ZVAL_UNDEF(&defaultValue);
+ ZVAL_UNDEF(&typeReference);
+ ZVAL_UNDEF(&typeValues);
+ ZVAL_UNDEF(&comment);
+ ZVAL_UNDEF(&definition);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_ARRAY(definition)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &name_param, &definition_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_OBS_COPY_OR_DUP(&definition, definition_param);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
+ ZEPHIR_OBS_VAR(&type);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&type, &definition, SL("type"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Column type is required", "phalcon/Db/Column.zep", 348);
+ return;
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &type);
+ ZEPHIR_OBS_VAR(&typeReference);
+ if (zephir_array_isset_string_fetch(&typeReference, &definition, SL("typeReference"), 0)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("typeReference"), &typeReference);
+ }
+ ZEPHIR_OBS_VAR(&typeValues);
+ if (zephir_array_isset_string_fetch(&typeValues, &definition, SL("typeValues"), 0)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("typeValues"), &typeValues);
+ }
+ ZEPHIR_OBS_VAR(¬Null);
+ if (zephir_array_isset_string_fetch(¬Null, &definition, SL("notNull"), 0)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("notNull"), ¬Null);
+ }
+ ZEPHIR_OBS_VAR(&primary);
+ if (zephir_array_isset_string_fetch(&primary, &definition, SL("primary"), 0)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("primary"), &primary);
+ }
+ ZEPHIR_OBS_VAR(&size);
+ if (zephir_array_isset_string_fetch(&size, &definition, SL("size"), 0)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("size"), &size);
+ }
+ ZEPHIR_OBS_VAR(&scale);
+ if (zephir_array_isset_string_fetch(&scale, &definition, SL("scale"), 0)) {
+ do {
+ if (ZEPHIR_IS_LONG(&type, 14) || ZEPHIR_IS_LONG(&type, 3) || ZEPHIR_IS_LONG(&type, 9) || ZEPHIR_IS_LONG(&type, 7) || ZEPHIR_IS_LONG(&type, 0) || ZEPHIR_IS_LONG(&type, 21) || ZEPHIR_IS_LONG(&type, 22) || ZEPHIR_IS_LONG(&type, 26)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("scale"), &scale);
+ break;
}
-vv202:
- {
- if (s->active_token == PHVOLT_T_DOT) {
- token->opcode = PHVOLT_T_IDENTIFIER;
- token->value = estrndup(start, VVCURSOR - start);
- token->len = VVCURSOR - start;
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Column type does not support scale parameter", "phalcon/Db/Column.zep", 398);
+ return;
+ } while(0);
+
+ }
+ ZEPHIR_OBS_VAR(&defaultValue);
+ if (zephir_array_isset_string_fetch(&defaultValue, &definition, SL("default"), 0)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("_default"), &defaultValue);
+ }
+ ZEPHIR_OBS_VAR(&dunsigned);
+ if (zephir_array_isset_string_fetch(&dunsigned, &definition, SL("unsigned"), 0)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("unsigned"), &dunsigned);
+ }
+ ZEPHIR_OBS_VAR(&isNumeric);
+ if (zephir_array_isset_string_fetch(&isNumeric, &definition, SL("isNumeric"), 0)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("isNumeric"), &isNumeric);
+ }
+ ZEPHIR_OBS_VAR(&autoIncrement);
+ if (zephir_array_isset_string_fetch(&autoIncrement, &definition, SL("autoIncrement"), 0)) {
+ if (!(zephir_is_true(&autoIncrement))) {
+ if (0) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("autoIncrement"), &__$true);
} else {
- token->opcode = PHVOLT_T_SET;
+ zephir_update_property_zval(this_ptr, ZEND_STRL("autoIncrement"), &__$false);
}
+ } else {
+ do {
+ if (ZEPHIR_IS_LONG(&type, 14) || ZEPHIR_IS_LONG(&type, 0) || ZEPHIR_IS_LONG(&type, 21) || ZEPHIR_IS_LONG(&type, 22) || ZEPHIR_IS_LONG(&type, 26)) {
+ if (1) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("autoIncrement"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("autoIncrement"), &__$false);
+ }
+ break;
+ }
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Column type cannot be auto-increment", "phalcon/Db/Column.zep", 442);
+ return;
+ } while(0);
- return 0;
}
-vv203:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'T':
- case 't': goto vv246;
- default: goto vv54;
- }
-vv204:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv247;
- default: goto vv54;
- }
-vv205:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'H':
- case 'h': goto vv249;
- default: goto vv54;
- }
-vv206:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'N':
- case 'n': goto vv238;
- default: goto vv252;
- }
-vv207:
- ++VVCURSOR;
- {
- s->whitespace_control = 0;
- token->opcode = PHVOLT_T_OPEN_DELIMITER;
- return 0;
+ }
+ if (zephir_array_isset_string_fetch(&first, &definition, SL("first"), 1)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("first"), &first);
+ }
+ if (zephir_array_isset_string_fetch(&after, &definition, SL("after"), 1)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("after"), &after);
+ }
+ if (zephir_array_isset_string_fetch(&bindType, &definition, SL("bindType"), 1)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("bindType"), &bindType);
+ }
+ if (zephir_array_isset_string_fetch(&comment, &definition, SL("comment"), 1)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("comment"), &comment);
+ }
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Db_Column, getAfterPosition)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "after");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, getBindType)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "bindType");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, hasDefault)
+{
+ 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_MM_GROW();
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "isautoincrement", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_0)) {
+ RETURN_MM_BOOL(0);
+ }
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("_default"), PH_NOISY_CC | PH_READONLY);
+ RETURN_MM_BOOL(Z_TYPE_P(&_1) != IS_NULL);
+}
+
+static PHP_METHOD(Phalcon_Db_Column, isAutoIncrement)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "autoIncrement");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, isFirst)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "first");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, isNotNull)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "notNull");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, isNumeric)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "isNumeric");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, isPrimary)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "primary");
+}
+
+static PHP_METHOD(Phalcon_Db_Column, isUnsigned)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "unsigned");
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_ColumnInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Db, ColumnInterface, phalcon, db_columninterface, phalcon_db_columninterface_method_entry);
+
+ return SUCCESS;
+}
+
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, getAfterPosition);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, getBindType);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, getDefault);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, getName);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, getScale);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, getSize);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, getType);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, getTypeReference);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, getTypeValues);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, hasDefault);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, isAutoIncrement);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, isFirst);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, isNotNull);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, isNumeric);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, isPrimary);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ColumnInterface, isUnsigned);
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_Dialect)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Db, Dialect, phalcon, db_dialect, phalcon_db_dialect_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+
+ zend_declare_property_null(phalcon_db_dialect_ce, SL("escapeChar"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_dialect_ce, SL("customFunctions"), ZEND_ACC_PROTECTED);
+ phalcon_db_dialect_ce->create_object = zephir_init_properties_Phalcon_Db_Dialect;
+
+ zend_class_implements(phalcon_db_dialect_ce, 1, phalcon_db_dialectinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, createSavepoint)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *name_param = NULL;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_CONCAT_SV(return_value, "SAVEPOINT ", &name);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, escape)
+{
+ zend_bool _2$$5, _12$$7, _13$$7, _17$$9, _18$$9;
+ zend_string *_11;
+ zend_ulong _10;
+ zval _7;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *str_param = NULL, *escapeChar_param = NULL, parts, key, part, newParts, _5, _6, *_8, _9, _0$$4, _3$$6, _14$$7, _16$$7, _19$$9, _21$$9;
+ zval str, escapeChar, _1$$4, _4$$6, _15$$7, _20$$9;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&str);
+ ZVAL_UNDEF(&escapeChar);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_4$$6);
+ ZVAL_UNDEF(&_15$$7);
+ ZVAL_UNDEF(&_20$$9);
+ ZVAL_UNDEF(&parts);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&part);
+ ZVAL_UNDEF(&newParts);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_0$$4);
+ ZVAL_UNDEF(&_3$$6);
+ ZVAL_UNDEF(&_14$$7);
+ ZVAL_UNDEF(&_16$$7);
+ ZVAL_UNDEF(&_19$$9);
+ ZVAL_UNDEF(&_21$$9);
+ ZVAL_UNDEF(&_7);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(str)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &str_param, &escapeChar_param);
+ if (UNEXPECTED(Z_TYPE_P(str_param) != IS_STRING && Z_TYPE_P(str_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'str' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(str_param) == IS_STRING)) {
+ zephir_get_strval(&str, str_param);
+ } else {
+ ZEPHIR_INIT_VAR(&str);
+ }
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+
+
+ if (!(ZEPHIR_GLOBAL(db).escape_identifiers)) {
+ RETURN_CTOR(&str);
+ }
+ if (ZEPHIR_IS_EMPTY(&escapeChar)) {
+ ZEPHIR_OBS_VAR(&_0$$4);
+ zephir_read_property(&_0$$4, this_ptr, ZEND_STRL("escapeChar"), PH_NOISY_CC);
+ zephir_cast_to_string(&_1$$4, &_0$$4);
+ ZEPHIR_CPY_WRT(&escapeChar, &_1$$4);
+ }
+ if (!(zephir_memnstr_str(&str, SL("."), "phalcon/Db/Dialect.zep", 52))) {
+ _2$$5 = !ZEPHIR_IS_STRING(&escapeChar, "");
+ if (_2$$5) {
+ _2$$5 = !ZEPHIR_IS_STRING(&str, "*");
}
-vv209:
- ++VVCURSOR;
- {
- s->whitespace_control = 0;
- s->statement_position++;
- token->opcode = PHVOLT_T_OPEN_EDELIMITER;
- return 0;
+ if (_2$$5) {
+ ZEPHIR_INIT_VAR(&_3$$6);
+ ZEPHIR_INIT_VAR(&_4$$6);
+ ZEPHIR_CONCAT_VV(&_4$$6, &escapeChar, &escapeChar);
+ zephir_fast_str_replace(&_3$$6, &escapeChar, &_4$$6, &str);
+ ZEPHIR_CONCAT_VVV(return_value, &escapeChar, &_3$$6, &escapeChar);
+ RETURN_MM();
}
-vv211:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv253;
- default: goto vv54;
+ RETURN_CTOR(&str);
+ }
+ ZEPHIR_INIT_VAR(&_5);
+ ZEPHIR_INIT_VAR(&_6);
+ zephir_fast_trim(&_6, &str, &escapeChar, ZEPHIR_TRIM_BOTH);
+ zephir_fast_explode_str(&_5, SL("."), &_6, LONG_MAX);
+ zephir_get_arrval(&_7, &_5);
+ ZEPHIR_CPY_WRT(&parts, &_7);
+ ZEPHIR_CPY_WRT(&newParts, &parts);
+ zephir_is_iterable(&parts, 0, "phalcon/Db/Dialect.zep", 72);
+ if (Z_TYPE_P(&parts) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&parts), _10, _11, _8)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ if (_11 != NULL) {
+ ZVAL_STR_COPY(&key, _11);
+ } else {
+ ZVAL_LONG(&key, _10);
}
-vv212:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'K':
- case 'k': goto vv254;
- default: goto vv54;
+ ZEPHIR_INIT_NVAR(&part);
+ ZVAL_COPY(&part, _8);
+ _12$$7 = ZEPHIR_IS_STRING(&escapeChar, "");
+ if (!(_12$$7)) {
+ _12$$7 = ZEPHIR_IS_STRING(&part, "");
}
-vv213:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'K':
- case 'k': goto vv256;
- default: goto vv54;
+ _13$$7 = _12$$7;
+ if (!(_13$$7)) {
+ _13$$7 = ZEPHIR_IS_STRING(&part, "*");
}
-vv214:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv258;
- default: goto vv54;
+ if (_13$$7) {
+ continue;
}
-vv215:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv216;
+ ZEPHIR_INIT_NVAR(&_14$$7);
+ ZEPHIR_INIT_NVAR(&_15$$7);
+ ZEPHIR_CONCAT_VV(&_15$$7, &escapeChar, &escapeChar);
+ zephir_fast_str_replace(&_14$$7, &escapeChar, &_15$$7, &part);
+ ZEPHIR_INIT_NVAR(&_16$$7);
+ ZEPHIR_CONCAT_VVV(&_16$$7, &escapeChar, &_14$$7, &escapeChar);
+ zephir_array_update_zval(&newParts, &key, &_16$$7, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &parts, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_9, &parts, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_9)) {
+ break;
}
-vv216:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_CALL;
- return 0;
+ ZEPHIR_CALL_METHOD(&key, &parts, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&part, &parts, "current", NULL, 0);
+ zephir_check_call_status();
+ _17$$9 = ZEPHIR_IS_STRING(&escapeChar, "");
+ if (!(_17$$9)) {
+ _17$$9 = ZEPHIR_IS_STRING(&part, "");
+ }
+ _18$$9 = _17$$9;
+ if (!(_18$$9)) {
+ _18$$9 = ZEPHIR_IS_STRING(&part, "*");
+ }
+ if (_18$$9) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&_19$$9);
+ ZEPHIR_INIT_NVAR(&_20$$9);
+ ZEPHIR_CONCAT_VV(&_20$$9, &escapeChar, &escapeChar);
+ zephir_fast_str_replace(&_19$$9, &escapeChar, &_20$$9, &part);
+ ZEPHIR_INIT_NVAR(&_21$$9);
+ ZEPHIR_CONCAT_VVV(&_21$$9, &escapeChar, &_19$$9, &escapeChar);
+ zephir_array_update_zval(&newParts, &key, &_21$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &parts, "next", NULL, 0);
+ zephir_check_call_status();
}
-vv217:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv218;
+ }
+ ZEPHIR_INIT_NVAR(&part);
+ ZEPHIR_INIT_NVAR(&key);
+ zephir_fast_join_str(return_value, SL("."), &newParts);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, escapeSchema)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *str_param = NULL, *escapeChar_param = NULL, _0$$4, _2;
+ zval str, escapeChar, _1$$4;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&str);
+ ZVAL_UNDEF(&escapeChar);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_0$$4);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(str)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &str_param, &escapeChar_param);
+ if (UNEXPECTED(Z_TYPE_P(str_param) != IS_STRING && Z_TYPE_P(str_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'str' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(str_param) == IS_STRING)) {
+ zephir_get_strval(&str, str_param);
+ } else {
+ ZEPHIR_INIT_VAR(&str);
+ }
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+
+
+ if (!(ZEPHIR_GLOBAL(db).escape_identifiers)) {
+ RETURN_CTOR(&str);
+ }
+ if (ZEPHIR_IS_STRING(&escapeChar, "")) {
+ ZEPHIR_OBS_VAR(&_0$$4);
+ zephir_read_property(&_0$$4, this_ptr, ZEND_STRL("escapeChar"), PH_NOISY_CC);
+ zephir_cast_to_string(&_1$$4, &_0$$4);
+ ZEPHIR_CPY_WRT(&escapeChar, &_1$$4);
+ }
+ ZEPHIR_INIT_VAR(&_2);
+ zephir_fast_trim(&_2, &str, &escapeChar, ZEPHIR_TRIM_BOTH);
+ ZEPHIR_CONCAT_VVV(return_value, &escapeChar, &_2, &escapeChar);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, forUpdate)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *sqlQuery_param = NULL;
+ zval sqlQuery;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&sqlQuery);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(sqlQuery)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &sqlQuery_param);
+ if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) {
+ zephir_get_strval(&sqlQuery, sqlQuery_param);
+ } else {
+ ZEPHIR_INIT_VAR(&sqlQuery);
+ }
+
+
+ ZEPHIR_CONCAT_VS(return_value, &sqlQuery, " FOR UPDATE");
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getColumnList)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_3 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar;
+ zval *columnList_param = NULL, *escapeChar_param = NULL, *bindCounts_param = NULL, column, *_0, _1, _2$$3, _4$$4;
+ zval columnList, bindCounts, columns;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&columnList);
+ ZVAL_UNDEF(&bindCounts);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&column);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ARRAY(columnList)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &columnList_param, &escapeChar_param, &bindCounts_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&columnList, columnList_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ ZEPHIR_INIT_VAR(&columns);
+ array_init(&columns);
+ zephir_is_iterable(&columnList, 0, "phalcon/Db/Dialect.zep", 128);
+ if (Z_TYPE_P(&columnList) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&columnList), _0)
+ {
+ ZEPHIR_INIT_NVAR(&column);
+ ZVAL_COPY(&column, _0);
+ ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getsqlcolumn", &_3, 53, &column, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_append(&columns, &_2$$3, PH_SEPARATE, "phalcon/Db/Dialect.zep", 125);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &columnList, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &columnList, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
}
-vv218:
- {
- token->opcode = PHVOLT_T_CASE;
- return 0;
+ ZEPHIR_CALL_METHOD(&column, &columnList, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "getsqlcolumn", &_3, 53, &column, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_append(&columns, &_4$$4, PH_SEPARATE, "phalcon/Db/Dialect.zep", 125);
+ ZEPHIR_CALL_METHOD(NULL, &columnList, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&column);
+ zephir_fast_join_str(return_value, SL(", "), &columns);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getCustomFunctions)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "customFunctions");
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlColumn)
+{
+ zend_bool _5, _3$$4, _4$$4;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval bindCounts;
+ zval escapeChar;
+ zval *column = NULL, column_sub, *escapeChar_param = NULL, *bindCounts_param = NULL, columnExpression, columnAlias, columnField, columnDomain, _6, _0$$3, _1$$6, _2$$7;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&columnExpression);
+ ZVAL_UNDEF(&columnAlias);
+ ZVAL_UNDEF(&columnField);
+ ZVAL_UNDEF(&columnDomain);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$6);
+ ZVAL_UNDEF(&_2$$7);
+ ZVAL_UNDEF(&escapeChar);
+ ZVAL_UNDEF(&bindCounts);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ZVAL(column)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &column, &escapeChar_param, &bindCounts_param);
+ ZEPHIR_SEPARATE_PARAM(column);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ if (Z_TYPE_P(column) != IS_ARRAY) {
+ ZVAL_NULL(&_0$$3);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparequalified", NULL, 0, column, &_0$$3, &escapeChar);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ if (!(zephir_array_isset_string(column, SL("type")))) {
+ ZEPHIR_OBS_VAR(&columnField);
+ zephir_array_fetch_long(&columnField, column, 0, PH_NOISY, "phalcon/Db/Dialect.zep", 160);
+ if (Z_TYPE_P(&columnField) == IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&columnExpression);
+ zephir_create_array(&columnExpression, 2, 0);
+ add_assoc_stringl_ex(&columnExpression, SL("type"), SL("scalar"));
+ zephir_array_update_string(&columnExpression, SL("value"), &columnField, PH_COPY | PH_SEPARATE);
+ } else if (ZEPHIR_IS_STRING_IDENTICAL(&columnField, "*")) {
+ ZEPHIR_INIT_VAR(&_1$$6);
+ zephir_create_array(&_1$$6, 1, 0);
+ add_assoc_stringl_ex(&_1$$6, SL("type"), SL("all"));
+ ZEPHIR_CPY_WRT(&columnExpression, &_1$$6);
+ } else {
+ ZEPHIR_INIT_VAR(&_2$$7);
+ zephir_create_array(&_2$$7, 2, 0);
+ add_assoc_stringl_ex(&_2$$7, SL("type"), SL("qualified"));
+ zephir_array_update_string(&_2$$7, SL("name"), &columnField, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CPY_WRT(&columnExpression, &_2$$7);
+ }
+ ZEPHIR_OBS_VAR(&columnDomain);
+ _3$$4 = zephir_array_isset_long_fetch(&columnDomain, column, 1, 0);
+ if (_3$$4) {
+ _3$$4 = !ZEPHIR_IS_STRING_IDENTICAL(&columnDomain, "");
+ }
+ if (_3$$4) {
+ zephir_array_update_string(&columnExpression, SL("domain"), &columnDomain, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_OBS_VAR(&columnAlias);
+ _4$$4 = zephir_array_isset_long_fetch(&columnAlias, column, 2, 0);
+ if (_4$$4) {
+ _4$$4 = zephir_is_true(&columnAlias);
+ }
+ if (_4$$4) {
+ zephir_array_update_string(&columnExpression, SL("sqlAlias"), &columnAlias, PH_COPY | PH_SEPARATE);
+ }
+ } else {
+ ZEPHIR_CPY_WRT(&columnExpression, column);
+ }
+ ZEPHIR_CALL_METHOD(column, this_ptr, "getsqlexpression", NULL, 0, &columnExpression, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&columnAlias);
+ _5 = zephir_array_isset_string_fetch(&columnAlias, &columnExpression, SL("sqlAlias"), 0);
+ if (!(_5)) {
+ ZEPHIR_OBS_NVAR(&columnAlias);
+ _5 = zephir_array_isset_string_fetch(&columnAlias, &columnExpression, SL("alias"), 0);
+ }
+ if (_5) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparecolumnalias", NULL, 0, column, &columnAlias, &escapeChar);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZVAL_NULL(&_6);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparecolumnalias", NULL, 0, column, &_6, &escapeChar);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpression)
+{
+ zend_bool _1$$9;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS, i = 0, _2$$9;
+ zval escapeChar;
+ zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts_param = NULL, type, times, postTimes, rawValue, value, _11, _12, _0$$7, _3$$9, _4$$11, _5$$11, _6$$8, _7$$14, _8$$14, _9$$18, _10$$18;
+ zval expression, bindCounts, placeholders;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression);
+ ZVAL_UNDEF(&bindCounts);
+ ZVAL_UNDEF(&placeholders);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(×);
+ ZVAL_UNDEF(&postTimes);
+ ZVAL_UNDEF(&rawValue);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_0$$7);
+ ZVAL_UNDEF(&_3$$9);
+ ZVAL_UNDEF(&_4$$11);
+ ZVAL_UNDEF(&_5$$11);
+ ZVAL_UNDEF(&_6$$8);
+ ZVAL_UNDEF(&_7$$14);
+ ZVAL_UNDEF(&_8$$14);
+ ZVAL_UNDEF(&_9$$18);
+ ZVAL_UNDEF(&_10$$18);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ARRAY(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ ZEPHIR_OBS_VAR(&type);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&type, &expression, SL("type"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL expression", "phalcon/Db/Dialect.zep", 224);
+ return;
+ }
+ do {
+ if (ZEPHIR_IS_STRING(&type, "scalar")) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionscalar", NULL, 54, &expression, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ RETURN_MM();
}
-vv219:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'I':
- case 'i': goto vv260;
- default: goto vv54;
- }
-vv220:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'U':
- case 'u': goto vv261;
- default: goto vv54;
- }
-vv221:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'N':
- case 'n': goto vv262;
- default: goto vv54;
- }
-vv222:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'G':
- case 'H':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'g':
- case 'h':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- case 'F':
- case 'f': goto vv263;
- case 'I':
- case 'i': goto vv264;
- default: goto vv223;
- }
-vv223:
- {
- token->opcode = PHVOLT_T_ELSE;
- return 0;
+ if (ZEPHIR_IS_STRING(&type, "object")) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionobject", NULL, 55, &expression, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ RETURN_MM();
}
-vv224:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'Y':
- case 'y': goto vv265;
- default: goto vv54;
- }
-vv225:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'U':
- case 'u': goto vv267;
- default: goto vv54;
- }
-vv226:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'L':
- case 'l': goto vv268;
- default: goto vv54;
- }
-vv227:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv269;
- default: goto vv54;
- }
-vv228:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'O':
- case 'o': goto vv270;
- default: goto vv54;
- }
-vv229:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'F':
- case 'f': goto vv271;
- default: goto vv54;
- }
-vv230:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv273;
- default: goto vv54;
- }
-vv231:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv274;
- default: goto vv54;
- }
-vv232:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'W':
- case 'w': goto vv275;
- default: goto vv54;
- }
-vv233:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv234;
- }
-vv234:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_EVEN;
- return 0;
+ if (ZEPHIR_IS_STRING(&type, "qualified")) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionqualified", NULL, 56, &expression, &escapeChar);
+ zephir_check_call_status();
+ RETURN_MM();
}
-vv235:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'N':
- case 'n': goto vv276;
- default: goto vv54;
- }
-vv236:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv277;
- default: goto vv54;
- }
-vv237:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'U':
- case 'u': goto vv279;
- default: goto vv54;
- }
-vv238:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'O':
- case 'o': goto vv280;
- default: goto vv81;
- }
-vv239:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv281;
- default: goto vv54;
- }
-vv240:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'O':
- case 'o': goto vv282;
- default: goto vv54;
- }
-vv241:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv242;
- }
-vv242:
- {
- token->opcode = PHVOLT_T_NULL;
- return 0;
+ if (ZEPHIR_IS_STRING(&type, "literal")) {
+ zephir_array_fetch_string(&_0$$7, &expression, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 258);
+ RETURN_CTOR(&_0$$7);
}
-vv243:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'R':
- case 'r': goto vv284;
- default: goto vv54;
- }
-vv244:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'R':
- case 'r': goto vv285;
- default: goto vv54;
- }
-vv245:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv286;
- default: goto vv54;
+ if (ZEPHIR_IS_STRING(&type, "placeholder")) {
+ ZEPHIR_OBS_VAR(×);
+ if (zephir_array_isset_string_fetch(×, &expression, SL("times"), 0)) {
+ ZEPHIR_INIT_VAR(&placeholders);
+ array_init(&placeholders);
+ ZEPHIR_OBS_VAR(&rawValue);
+ zephir_array_fetch_string(&rawValue, &expression, SL("rawValue"), PH_NOISY, "phalcon/Db/Dialect.zep", 264);
+ ZEPHIR_OBS_VAR(&value);
+ zephir_array_fetch_string(&value, &expression, SL("value"), PH_NOISY, "phalcon/Db/Dialect.zep", 265);
+ ZEPHIR_OBS_VAR(&postTimes);
+ if (zephir_array_isset_fetch(&postTimes, &bindCounts, &rawValue, 0)) {
+ ZEPHIR_CPY_WRT(×, &postTimes);
+ }
+ ZEPHIR_CPY_WRT(&_3$$9, ×);
+ _2$$9 = 1;
+ _1$$9 = 0;
+ if (ZEPHIR_GE_LONG(&_3$$9, _2$$9)) {
+ while (1) {
+ if (_1$$9) {
+ _2$$9++;
+ if (!(ZEPHIR_GE_LONG(&_3$$9, _2$$9))) {
+ break;
+ }
+ } else {
+ _1$$9 = 1;
+ }
+ i = _2$$9;
+ ZEPHIR_INIT_NVAR(&_4$$11);
+ ZVAL_LONG(&_4$$11, ((i - 1)));
+ ZEPHIR_INIT_NVAR(&_5$$11);
+ ZEPHIR_CONCAT_VV(&_5$$11, &value, &_4$$11);
+ zephir_array_append(&placeholders, &_5$$11, PH_SEPARATE, "phalcon/Db/Dialect.zep", 272);
+ }
+ }
+ zephir_fast_join_str(return_value, SL(", "), &placeholders);
+ RETURN_MM();
}
-vv246:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'C':
- case 'c': goto vv287;
- default: goto vv54;
+ zephir_array_fetch_string(&_6$$8, &expression, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 278);
+ RETURN_CTOR(&_6$$8);
+ }
+ if (ZEPHIR_IS_STRING(&type, "binary-op")) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionbinaryoperations", NULL, 57, &expression, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ if (ZEPHIR_IS_STRING(&type, "unary-op")) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionunaryoperations", NULL, 58, &expression, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ if (ZEPHIR_IS_STRING(&type, "parentheses")) {
+ zephir_array_fetch_string(&_8$$14, &expression, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 304);
+ ZEPHIR_CALL_METHOD(&_7$$14, this_ptr, "getsqlexpression", NULL, 59, &_8$$14, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SVS(return_value, "(", &_7$$14, ")");
+ RETURN_MM();
+ }
+ if (ZEPHIR_IS_STRING(&type, "functionCall")) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionfunctioncall", NULL, 60, &expression, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ if (ZEPHIR_IS_STRING(&type, "list")) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionlist", NULL, 61, &expression, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ if (ZEPHIR_IS_STRING(&type, "all")) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionall", NULL, 62, &expression, &escapeChar);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ if (ZEPHIR_IS_STRING(&type, "select")) {
+ zephir_array_fetch_string(&_10$$18, &expression, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 336);
+ ZEPHIR_CALL_METHOD(&_9$$18, this_ptr, "select", NULL, 0, &_10$$18);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SVS(return_value, "(", &_9$$18, ")");
+ RETURN_MM();
+ }
+ if (ZEPHIR_IS_STRING(&type, "cast")) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressioncastvalue", NULL, 63, &expression, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ if (ZEPHIR_IS_STRING(&type, "convert")) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionconvertvalue", NULL, 64, &expression, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ if (ZEPHIR_IS_STRING(&type, "case")) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressioncase", NULL, 65, &expression, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ } while(0);
+
+ ZEPHIR_INIT_VAR(&_11);
+ object_init_ex(&_11, phalcon_db_exception_ce);
+ ZEPHIR_INIT_VAR(&_12);
+ ZEPHIR_CONCAT_SVS(&_12, "Invalid SQL expression type '", &type, "'");
+ ZEPHIR_CALL_METHOD(NULL, &_11, "__construct", NULL, 8, &_12);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_11, "phalcon/Db/Dialect.zep", 369);
+ ZEPHIR_MM_RESTORE();
+ return;
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlTable)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar;
+ zval *table, table_sub, *escapeChar_param = NULL, tableName, schemaName, aliasName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&table_sub);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&aliasName);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ZVAL(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &table, &escapeChar_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+
+
+ if (Z_TYPE_P(table) == IS_ARRAY) {
+ ZEPHIR_OBS_VAR(&tableName);
+ zephir_array_fetch_long(&tableName, table, 0, PH_NOISY, "phalcon/Db/Dialect.zep", 385);
+ ZEPHIR_OBS_VAR(&schemaName);
+ zephir_array_isset_long_fetch(&schemaName, table, 1, 0);
+ ZEPHIR_OBS_VAR(&aliasName);
+ zephir_array_isset_long_fetch(&aliasName, table, 2, 0);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparetable", NULL, 0, &tableName, &schemaName, &aliasName, &escapeChar);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 66, table, &escapeChar);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, limit)
+{
+ zend_bool _2$$3;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *sqlQuery_param = NULL, *number, number_sub, _0$$3, _1$$3, _3$$3, _4$$4, _5$$4;
+ zval sqlQuery;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&sqlQuery);
+ ZVAL_UNDEF(&number_sub);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(sqlQuery)
+ Z_PARAM_ZVAL(number)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &sqlQuery_param, &number);
+ if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) {
+ zephir_get_strval(&sqlQuery, sqlQuery_param);
+ } else {
+ ZEPHIR_INIT_VAR(&sqlQuery);
+ }
+
+
+ if (Z_TYPE_P(number) == IS_ARRAY) {
+ zephir_array_fetch_long(&_0$$3, number, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 428);
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZEPHIR_CONCAT_SV(&_1$$3, " LIMIT ", &_0$$3);
+ zephir_concat_self(&sqlQuery, &_1$$3);
+ _2$$3 = zephir_array_isset_long(number, 1);
+ if (_2$$3) {
+ zephir_array_fetch_long(&_3$$3, number, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 430);
+ _2$$3 = ((zephir_fast_strlen_ev(&_3$$3)) ? 1 : 0);
+ }
+ if (_2$$3) {
+ zephir_array_fetch_long(&_4$$4, number, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 431);
+ ZEPHIR_INIT_VAR(&_5$$4);
+ ZEPHIR_CONCAT_SV(&_5$$4, " OFFSET ", &_4$$4);
+ zephir_concat_self(&sqlQuery, &_5$$4);
+ }
+ RETURN_CTOR(&sqlQuery);
+ }
+ ZEPHIR_CONCAT_VSV(return_value, &sqlQuery, " LIMIT ", number);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, registerCustomFunction)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *name_param = NULL, *customFunction, customFunction_sub;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&customFunction_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_ZVAL(customFunction)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &name_param, &customFunction);
+ zephir_get_strval(&name, name_param);
+
+
+ zephir_update_property_array(this_ptr, SL("customFunctions"), &name, customFunction);
+ RETURN_THIS();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, releaseSavepoint)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *name_param = NULL;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_CONCAT_SV(return_value, "RELEASE SAVEPOINT ", &name);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, rollbackSavepoint)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *name_param = NULL;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_CONCAT_SV(return_value, "ROLLBACK TO SAVEPOINT ", &name);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, select)
+{
+ zend_bool _5, _9, _12, _15, _18, _21, _23;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *definition_param = NULL, tables, columns, sql, distinct, joins, where, escapeChar, groupBy, having, orderBy, limit, forUpdate, bindCounts, _0, _1, _2, _3, _4, _6$$10, _7$$10, _8$$10, _10$$11, _11$$11, _13$$12, _14$$12, _16$$13, _17$$13, _19$$14, _20$$14;
+ zval definition, _22$$15;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&_22$$15);
+ ZVAL_UNDEF(&tables);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&distinct);
+ ZVAL_UNDEF(&joins);
+ ZVAL_UNDEF(&where);
+ ZVAL_UNDEF(&escapeChar);
+ ZVAL_UNDEF(&groupBy);
+ ZVAL_UNDEF(&having);
+ ZVAL_UNDEF(&orderBy);
+ ZVAL_UNDEF(&limit);
+ ZVAL_UNDEF(&forUpdate);
+ ZVAL_UNDEF(&bindCounts);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_6$$10);
+ ZVAL_UNDEF(&_7$$10);
+ ZVAL_UNDEF(&_8$$10);
+ ZVAL_UNDEF(&_10$$11);
+ ZVAL_UNDEF(&_11$$11);
+ ZVAL_UNDEF(&_13$$12);
+ ZVAL_UNDEF(&_14$$12);
+ ZVAL_UNDEF(&_16$$13);
+ ZVAL_UNDEF(&_17$$13);
+ ZVAL_UNDEF(&_19$$14);
+ ZVAL_UNDEF(&_20$$14);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(definition)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &definition_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param);
+
+
+ ZEPHIR_OBS_VAR(&tables);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&tables, &definition, SL("tables"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'tables' is required in the definition array", "phalcon/Db/Dialect.zep", 477);
+ return;
+ }
+ ZEPHIR_OBS_VAR(&columns);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'columns' is required in the definition array", "phalcon/Db/Dialect.zep", 483);
+ return;
+ }
+ ZEPHIR_OBS_VAR(&distinct);
+ if (zephir_array_isset_string_fetch(&distinct, &definition, SL("distinct"), 0)) {
+ ZEPHIR_INIT_VAR(&sql);
+ if (zephir_is_true(&distinct)) {
+ ZVAL_STRING(&sql, "SELECT DISTINCT");
+ } else {
+ ZVAL_STRING(&sql, "SELECT ALL");
+ }
+ } else {
+ ZEPHIR_INIT_NVAR(&sql);
+ ZVAL_STRING(&sql, "SELECT");
+ }
+ ZEPHIR_OBS_VAR(&bindCounts);
+ zephir_array_isset_string_fetch(&bindCounts, &definition, SL("bindCounts"), 0);
+ if (Z_TYPE_P(&bindCounts) != IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(&bindCounts);
+ array_init(&bindCounts);
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("escapeChar"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&escapeChar, &_0);
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 67, &columns, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_2);
+ ZEPHIR_CONCAT_SV(&_2, " ", &_1);
+ zephir_concat_self(&sql, &_2);
+ ZEPHIR_CALL_METHOD(&_3, this_ptr, "getsqlexpressionfrom", NULL, 68, &tables, &escapeChar);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_4);
+ ZEPHIR_CONCAT_SV(&_4, " ", &_3);
+ zephir_concat_self(&sql, &_4);
+ ZEPHIR_OBS_VAR(&joins);
+ _5 = zephir_array_isset_string_fetch(&joins, &definition, SL("joins"), 0);
+ if (_5) {
+ _5 = zephir_is_true(&joins);
+ }
+ if (_5) {
+ zephir_array_fetch_string(&_7$$10, &definition, SL("joins"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 517);
+ ZEPHIR_CALL_METHOD(&_6$$10, this_ptr, "getsqlexpressionjoins", NULL, 69, &_7$$10, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_8$$10);
+ ZEPHIR_CONCAT_SV(&_8$$10, " ", &_6$$10);
+ zephir_concat_self(&sql, &_8$$10);
+ }
+ ZEPHIR_OBS_VAR(&where);
+ _9 = zephir_array_isset_string_fetch(&where, &definition, SL("where"), 0);
+ if (_9) {
+ _9 = zephir_is_true(&where);
+ }
+ if (_9) {
+ ZEPHIR_CALL_METHOD(&_10$$11, this_ptr, "getsqlexpressionwhere", NULL, 70, &where, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_11$$11);
+ ZEPHIR_CONCAT_SV(&_11$$11, " ", &_10$$11);
+ zephir_concat_self(&sql, &_11$$11);
+ }
+ ZEPHIR_OBS_VAR(&groupBy);
+ _12 = zephir_array_isset_string_fetch(&groupBy, &definition, SL("group"), 0);
+ if (_12) {
+ _12 = zephir_is_true(&groupBy);
+ }
+ if (_12) {
+ ZEPHIR_CALL_METHOD(&_13$$12, this_ptr, "getsqlexpressiongroupby", NULL, 71, &groupBy, &escapeChar);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_14$$12);
+ ZEPHIR_CONCAT_SV(&_14$$12, " ", &_13$$12);
+ zephir_concat_self(&sql, &_14$$12);
+ }
+ ZEPHIR_OBS_VAR(&having);
+ _15 = zephir_array_isset_string_fetch(&having, &definition, SL("having"), 0);
+ if (_15) {
+ _15 = zephir_is_true(&having);
+ }
+ if (_15) {
+ ZEPHIR_CALL_METHOD(&_16$$13, this_ptr, "getsqlexpressionhaving", NULL, 72, &having, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_17$$13);
+ ZEPHIR_CONCAT_SV(&_17$$13, " ", &_16$$13);
+ zephir_concat_self(&sql, &_17$$13);
+ }
+ ZEPHIR_OBS_VAR(&orderBy);
+ _18 = zephir_array_isset_string_fetch(&orderBy, &definition, SL("order"), 0);
+ if (_18) {
+ _18 = zephir_is_true(&orderBy);
+ }
+ if (_18) {
+ ZEPHIR_CALL_METHOD(&_19$$14, this_ptr, "getsqlexpressionorderby", NULL, 73, &orderBy, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_20$$14);
+ ZEPHIR_CONCAT_SV(&_20$$14, " ", &_19$$14);
+ zephir_concat_self(&sql, &_20$$14);
+ }
+ ZEPHIR_OBS_VAR(&limit);
+ _21 = zephir_array_isset_string_fetch(&limit, &definition, SL("limit"), 0);
+ if (_21) {
+ _21 = zephir_is_true(&limit);
+ }
+ if (_21) {
+ ZEPHIR_INIT_VAR(&_22$$15);
+ zephir_create_array(&_22$$15, 2, 0);
+ zephir_array_update_string(&_22$$15, SL("sql"), &sql, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_22$$15, SL("value"), &limit, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(&sql, this_ptr, "getsqlexpressionlimit", NULL, 74, &_22$$15, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ }
+ _23 = zephir_array_isset_string_fetch(&forUpdate, &definition, SL("forUpdate"), 1);
+ if (_23) {
+ _23 = zephir_is_true(&forUpdate);
+ }
+ if (_23) {
+ zephir_concat_self_str(&sql, SL(" FOR UPDATE"));
+ }
+ RETURN_CCTOR(&sql);
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, supportsSavepoints)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_BOOL(1);
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, supportsReleaseSavepoints)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+
+
+ ZEPHIR_MM_GROW();
+
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "supportssavepoints", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getColumnSize)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *column, column_sub, _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &column);
+
+
+ ZEPHIR_CALL_METHOD(&_0, column, "getsize", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SVS(return_value, "(", &_0, ")");
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getColumnSizeAndScale)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *column, column_sub, _0, _1;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &column);
+
+
+ ZEPHIR_CALL_METHOD(&_0, column, "getsize", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_1, column, "getscale", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SVSVS(return_value, "(", &_0, ",", &_1, ")");
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, checkColumnType)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *column, column_sub, _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &column);
+
+
+ ZEPHIR_CALL_METHOD(&_0, column, "gettype", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&_0) == IS_STRING) {
+ ZEPHIR_RETURN_CALL_METHOD(column, "gettypereference", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZEPHIR_RETURN_CALL_METHOD(column, "gettype", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, checkColumnTypeSql)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *column, column_sub, _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &column);
+
+
+ ZEPHIR_CALL_METHOD(&_0, column, "gettype", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&_0) != IS_STRING) {
+ RETURN_MM_STRING("");
+ }
+ ZEPHIR_RETURN_CALL_METHOD(column, "gettype", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionAll)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar;
+ zval *expression_param = NULL, *escapeChar_param = NULL, domain, _0;
+ zval expression;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression);
+ ZVAL_UNDEF(&domain);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &expression_param, &escapeChar_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+
+
+ ZEPHIR_OBS_VAR(&domain);
+ zephir_array_isset_string_fetch(&domain, &expression, SL("domain"), 0);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "*");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparequalified", NULL, 0, &_0, &domain, &escapeChar);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionBinaryOperations)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar;
+ zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts_param = NULL, left, right, _0, _1, _2;
+ zval expression, bindCounts;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression);
+ ZVAL_UNDEF(&bindCounts);
+ ZVAL_UNDEF(&left);
+ ZVAL_UNDEF(&right);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ARRAY(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ zephir_array_fetch_string(&_0, &expression, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 654);
+ ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, &_0, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_1, &expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 660);
+ ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 59, &_1, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_2, &expression, SL("op"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 665);
+ ZEPHIR_CONCAT_VSVSV(return_value, &left, " ", &_2, " ", &right);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionCase)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar, sql;
+ zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts_param = NULL, whenClause, _0, _1, _2, _3, *_4, _5, _6$$3, _7$$4, _8$$4, _9$$4, _10$$4, _11$$4, _12$$5, _13$$5, _14$$5, _15$$6, _16$$7, _17$$7, _18$$7, _19$$7, _20$$7, _21$$8, _22$$8, _23$$8;
+ zval expression, bindCounts;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression);
+ ZVAL_UNDEF(&bindCounts);
+ ZVAL_UNDEF(&whenClause);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$4);
+ ZVAL_UNDEF(&_9$$4);
+ ZVAL_UNDEF(&_10$$4);
+ ZVAL_UNDEF(&_11$$4);
+ ZVAL_UNDEF(&_12$$5);
+ ZVAL_UNDEF(&_13$$5);
+ ZVAL_UNDEF(&_14$$5);
+ ZVAL_UNDEF(&_15$$6);
+ ZVAL_UNDEF(&_16$$7);
+ ZVAL_UNDEF(&_17$$7);
+ ZVAL_UNDEF(&_18$$7);
+ ZVAL_UNDEF(&_19$$7);
+ ZVAL_UNDEF(&_20$$7);
+ ZVAL_UNDEF(&_21$$8);
+ ZVAL_UNDEF(&_22$$8);
+ ZVAL_UNDEF(&_23$$8);
+ ZVAL_UNDEF(&escapeChar);
+ ZVAL_UNDEF(&sql);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ARRAY(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ zephir_array_fetch_string(&_1, &expression, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 682);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getsqlexpression", NULL, 0, &_1, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_2);
+ ZEPHIR_CONCAT_SV(&_2, "CASE ", &_0);
+ zephir_get_strval(&sql, &_2);
+ zephir_array_fetch_string(&_3, &expression, SL("when-clauses"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 684);
+ zephir_is_iterable(&_3, 0, "phalcon/Db/Dialect.zep", 695);
+ if (Z_TYPE_P(&_3) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_3), _4)
+ {
+ ZEPHIR_INIT_NVAR(&whenClause);
+ ZVAL_COPY(&whenClause, _4);
+ zephir_array_fetch_string(&_6$$3, &whenClause, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 685);
+ if (ZEPHIR_IS_STRING(&_6$$3, "when")) {
+ zephir_array_fetch_string(&_8$$4, &whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 687);
+ ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "getsqlexpression", NULL, 59, &_8$$4, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_10$$4, &whenClause, SL("then"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 689);
+ ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "getsqlexpression", NULL, 59, &_10$$4, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_11$$4);
+ ZEPHIR_CONCAT_SVSV(&_11$$4, " WHEN ", &_7$$4, " THEN ", &_9$$4);
+ zephir_concat_self(&sql, &_11$$4);
+ } else {
+ zephir_array_fetch_string(&_13$$5, &whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 691);
+ ZEPHIR_CALL_METHOD(&_12$$5, this_ptr, "getsqlexpression", NULL, 59, &_13$$5, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_14$$5);
+ ZEPHIR_CONCAT_SV(&_14$$5, " ELSE ", &_12$$5);
+ zephir_concat_self(&sql, &_14$$5);
}
-vv247:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv248;
+ } 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;
}
-vv248:
- {
- token->opcode = PHVOLT_T_TRUE;
- return 0;
+ ZEPHIR_CALL_METHOD(&whenClause, &_3, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_15$$6, &whenClause, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 685);
+ if (ZEPHIR_IS_STRING(&_15$$6, "when")) {
+ zephir_array_fetch_string(&_17$$7, &whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 687);
+ ZEPHIR_CALL_METHOD(&_16$$7, this_ptr, "getsqlexpression", NULL, 59, &_17$$7, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_19$$7, &whenClause, SL("then"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 689);
+ ZEPHIR_CALL_METHOD(&_18$$7, this_ptr, "getsqlexpression", NULL, 59, &_19$$7, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_20$$7);
+ ZEPHIR_CONCAT_SVSV(&_20$$7, " WHEN ", &_16$$7, " THEN ", &_18$$7);
+ zephir_concat_self(&sql, &_20$$7);
+ } else {
+ zephir_array_fetch_string(&_22$$8, &whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 691);
+ ZEPHIR_CALL_METHOD(&_21$$8, this_ptr, "getsqlexpression", NULL, 59, &_22$$8, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_23$$8);
+ ZEPHIR_CONCAT_SV(&_23$$8, " ELSE ", &_21$$8);
+ zephir_concat_self(&sql, &_23$$8);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_3, "next", NULL, 0);
+ zephir_check_call_status();
}
-vv249:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv250;
- }
-vv250:
+ }
+ ZEPHIR_INIT_NVAR(&whenClause);
+ ZEPHIR_CONCAT_VS(return_value, &sql, " END");
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionCastValue)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar;
+ zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts_param = NULL, left, right, _0, _1;
+ zval expression, bindCounts;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression);
+ ZVAL_UNDEF(&bindCounts);
+ ZVAL_UNDEF(&left);
+ ZVAL_UNDEF(&right);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ARRAY(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ zephir_array_fetch_string(&_0, &expression, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 712);
+ ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, &_0, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_1, &expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 718);
+ ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 59, &_1, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SVSVS(return_value, "CAST(", &left, " AS ", &right, ")");
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionConvertValue)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar;
+ zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts_param = NULL, left, right, _0, _1;
+ zval expression, bindCounts;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression);
+ ZVAL_UNDEF(&bindCounts);
+ ZVAL_UNDEF(&left);
+ ZVAL_UNDEF(&right);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ARRAY(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ zephir_array_fetch_string(&_0, &expression, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 740);
+ ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, &_0, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_1, &expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 746);
+ ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 59, &_1, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SVSVS(return_value, "CONVERT(", &left, " USING ", &right, ")");
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionFrom)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_3 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar;
+ zval *expression, expression_sub, *escapeChar_param = NULL, table, tables, *_0$$3, _1$$3, _5$$3, _2$$4, _4$$5;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression_sub);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&tables);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ZVAL(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &expression, &escapeChar_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+
+
+ if (Z_TYPE_P(expression) == IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&tables);
+ array_init(&tables);
+ zephir_is_iterable(expression, 0, "phalcon/Db/Dialect.zep", 768);
+ if (Z_TYPE_P(expression) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(expression), _0$$3)
{
- token->opcode = PHVOLT_T_WITH;
- return 0;
- }
-vv251:
- vvch = *++VVCURSOR;
-vv252:
- switch (vvch) {
- case ' ': goto vv251;
- case 'n': goto vv288;
- default: goto vv81;
- }
-vv253:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'S':
- case 's': goto vv289;
- default: goto vv54;
- }
-vv254:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv255;
+ ZEPHIR_INIT_NVAR(&table);
+ ZVAL_COPY(&table, _0$$3);
+ ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getsqltable", &_3, 75, &table, &escapeChar);
+ zephir_check_call_status();
+ zephir_array_append(&tables, &_2$$4, PH_SEPARATE, "phalcon/Db/Dialect.zep", 765);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, expression, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1$$3, expression, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&table, expression, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_4$$5, this_ptr, "getsqltable", &_3, 75, &table, &escapeChar);
+ zephir_check_call_status();
+ zephir_array_append(&tables, &_4$$5, PH_SEPARATE, "phalcon/Db/Dialect.zep", 765);
+ ZEPHIR_CALL_METHOD(NULL, expression, "next", NULL, 0);
+ zephir_check_call_status();
}
-vv255:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_BLOCK;
- return 0;
}
-vv256:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv257;
- }
-vv257:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_BREAK;
- return 0;
+ ZEPHIR_INIT_NVAR(&table);
+ ZEPHIR_INIT_VAR(&_5$$3);
+ zephir_fast_join_str(&_5$$3, SL(", "), &tables);
+ ZEPHIR_CPY_WRT(&tables, &_5$$3);
+ } else {
+ ZEPHIR_CPY_WRT(&tables, expression);
+ }
+ ZEPHIR_CONCAT_SV(return_value, "FROM ", &tables);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionFunctionCall)
+{
+ zend_bool _1, _3$$4;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar;
+ zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts_param = NULL, __$false, name, customFunction, arguments, _0, _4$$4;
+ zval expression, bindCounts, _2$$4;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression);
+ ZVAL_UNDEF(&bindCounts);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&customFunction);
+ ZVAL_UNDEF(&arguments);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ARRAY(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ ZEPHIR_OBS_VAR(&name);
+ zephir_array_fetch_string(&name, &expression, SL("name"), PH_NOISY, "phalcon/Db/Dialect.zep", 789);
+ ZEPHIR_OBS_VAR(&customFunction);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("customFunctions"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset_fetch(&customFunction, &_0, &name, 0)) {
+ ZEPHIR_RETURN_CALL_ZVAL_FUNCTION(&customFunction, NULL, 0, this_ptr, &expression, &escapeChar);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZEPHIR_OBS_VAR(&arguments);
+ _1 = zephir_array_isset_string_fetch(&arguments, &expression, SL("arguments"), 0);
+ if (_1) {
+ _1 = Z_TYPE_P(&arguments) == IS_ARRAY;
+ }
+ if (_1) {
+ ZEPHIR_INIT_VAR(&_2$$4);
+ zephir_create_array(&_2$$4, 3, 0);
+ add_assoc_stringl_ex(&_2$$4, SL("type"), SL("list"));
+ zephir_array_update_string(&_2$$4, SL("parentheses"), &__$false, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_2$$4, SL("value"), &arguments, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(&arguments, this_ptr, "getsqlexpression", NULL, 0, &_2$$4, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ _3$$4 = zephir_array_isset_string(&expression, SL("distinct"));
+ if (_3$$4) {
+ zephir_array_fetch_string(&_4$$4, &expression, SL("distinct"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 806);
+ _3$$4 = zephir_is_true(&_4$$4);
}
-vv258:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv259;
- }
-vv259:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_CACHE;
- return 0;
+ if (_3$$4) {
+ ZEPHIR_CONCAT_VSVS(return_value, &name, "(DISTINCT ", &arguments, ")");
+ RETURN_MM();
}
-vv260:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'N':
- case 'n': goto vv290;
- default: goto vv54;
- }
-vv261:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'L':
- case 'l': goto vv291;
- default: goto vv54;
- }
-vv262:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv292;
- default: goto vv54;
- }
-vv263:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'O':
- case 'o': goto vv293;
- default: goto vv54;
- }
-vv264:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'F':
- case 'f': goto vv294;
- default: goto vv54;
- }
-vv265:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv266;
- }
-vv266:
+ ZEPHIR_CONCAT_VSVS(return_value, &name, "(", &arguments, ")");
+ RETURN_MM();
+ }
+ ZEPHIR_CONCAT_VS(return_value, &name, "()");
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionGroupBy)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_3 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval bindCounts;
+ zval escapeChar;
+ zval *expression, expression_sub, *escapeChar_param = NULL, *bindCounts_param = NULL, field, fields, *_0$$3, _1$$3, _5$$3, _2$$4, _4$$6;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression_sub);
+ ZVAL_UNDEF(&field);
+ ZVAL_UNDEF(&fields);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_4$$6);
+ ZVAL_UNDEF(&escapeChar);
+ ZVAL_UNDEF(&bindCounts);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ZVAL(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression, &escapeChar_param, &bindCounts_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ if (Z_TYPE_P(expression) == IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&fields);
+ array_init(&fields);
+ zephir_is_iterable(expression, 0, "phalcon/Db/Dialect.zep", 844);
+ if (Z_TYPE_P(expression) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(expression), _0$$3)
{
- s->statement_position++;
- token->opcode = PHVOLT_T_EMPTY;
- return 0;
- }
-vv267:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'T':
- case 't': goto vv296;
- default: goto vv54;
- }
-vv268:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'O':
- case 'o': goto vv297;
- default: goto vv54;
- }
-vv269:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'C':
- case 'c': goto vv298;
- case 'L':
- case 'l': goto vv299;
- default: goto vv54;
- }
-vv270:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'R':
- case 'r': goto vv300;
- default: goto vv54;
- }
-vv271:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv272;
+ ZEPHIR_INIT_NVAR(&field);
+ ZVAL_COPY(&field, _0$$3);
+ if (UNEXPECTED(Z_TYPE_P(&field) != IS_ARRAY)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL-GROUP-BY expression", "phalcon/Db/Dialect.zep", 834);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getsqlexpression", &_3, 0, &field, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_append(&fields, &_2$$4, PH_SEPARATE, "phalcon/Db/Dialect.zep", 841);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, expression, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1$$3, expression, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&field, expression, "current", NULL, 0);
+ zephir_check_call_status();
+ if (UNEXPECTED(Z_TYPE_P(&field) != IS_ARRAY)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL-GROUP-BY expression", "phalcon/Db/Dialect.zep", 834);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "getsqlexpression", &_3, 59, &field, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_append(&fields, &_4$$6, PH_SEPARATE, "phalcon/Db/Dialect.zep", 841);
+ ZEPHIR_CALL_METHOD(NULL, expression, "next", NULL, 0);
+ zephir_check_call_status();
}
-vv272:
- {
- token->opcode = PHVOLT_T_ENDIF;
- return 0;
}
-vv273:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'C':
- case 'c': goto vv302;
- default: goto vv54;
+ ZEPHIR_INIT_NVAR(&field);
+ ZEPHIR_INIT_VAR(&_5$$3);
+ zephir_fast_join_str(&_5$$3, SL(", "), &fields);
+ ZEPHIR_CPY_WRT(&fields, &_5$$3);
+ } else {
+ ZEPHIR_CPY_WRT(&fields, expression);
+ }
+ ZEPHIR_CONCAT_SV(return_value, "GROUP BY ", &fields);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionHaving)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar;
+ zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts_param = NULL, _0;
+ zval expression, bindCounts;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression);
+ ZVAL_UNDEF(&bindCounts);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ARRAY(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getsqlexpression", NULL, 0, &expression, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SV(return_value, "HAVING ", &_0);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins)
+{
+ zend_bool _2$$3, _9$$3, _13$$11, _19$$11;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_3 = NULL, *_11 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval bindCounts;
+ zval escapeChar, sql;
+ zval *expression, expression_sub, *escapeChar_param = NULL, *bindCounts_param = NULL, condition, join, joinCondition, joinTable, joinType, joinConditionsArray, *_0, _1, _10$$3, _12$$3, *_4$$6, _5$$6, _8$$6, _6$$7, _7$$8, _20$$11, _21$$11, *_14$$14, _15$$14, _18$$14, _16$$15, _17$$16;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression_sub);
+ ZVAL_UNDEF(&condition);
+ ZVAL_UNDEF(&join);
+ ZVAL_UNDEF(&joinCondition);
+ ZVAL_UNDEF(&joinTable);
+ ZVAL_UNDEF(&joinType);
+ ZVAL_UNDEF(&joinConditionsArray);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_10$$3);
+ ZVAL_UNDEF(&_12$$3);
+ ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&_8$$6);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&_7$$8);
+ ZVAL_UNDEF(&_20$$11);
+ ZVAL_UNDEF(&_21$$11);
+ ZVAL_UNDEF(&_15$$14);
+ ZVAL_UNDEF(&_18$$14);
+ ZVAL_UNDEF(&_16$$15);
+ ZVAL_UNDEF(&_17$$16);
+ ZVAL_UNDEF(&escapeChar);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&bindCounts);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ZVAL(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression, &escapeChar_param, &bindCounts_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ ZEPHIR_INIT_VAR(&joinType);
+ ZVAL_STRING(&joinType, "");
+ ZEPHIR_INIT_VAR(&sql);
+ zephir_is_iterable(expression, 0, "phalcon/Db/Dialect.zep", 918);
+ if (Z_TYPE_P(expression) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(expression), _0)
+ {
+ ZEPHIR_INIT_NVAR(&join);
+ ZVAL_COPY(&join, _0);
+ ZEPHIR_OBS_NVAR(&joinConditionsArray);
+ _2$$3 = zephir_array_isset_string_fetch(&joinConditionsArray, &join, SL("conditions"), 0);
+ if (_2$$3) {
+ _2$$3 = !(ZEPHIR_IS_EMPTY(&joinConditionsArray));
}
-vv274:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'W':
- case 'w': goto vv303;
- default: goto vv54;
+ if (_2$$3) {
+ if (!(zephir_array_isset_long(&joinConditionsArray, 0))) {
+ ZEPHIR_CALL_METHOD(&joinCondition, this_ptr, "getsqlexpression", &_3, 0, &joinConditionsArray, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_NVAR(&joinCondition);
+ array_init(&joinCondition);
+ zephir_is_iterable(&joinConditionsArray, 0, "phalcon/Db/Dialect.zep", 903);
+ if (Z_TYPE_P(&joinConditionsArray) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&joinConditionsArray), _4$$6)
+ {
+ ZEPHIR_INIT_NVAR(&condition);
+ ZVAL_COPY(&condition, _4$$6);
+ ZEPHIR_CALL_METHOD(&_6$$7, this_ptr, "getsqlexpression", &_3, 59, &condition, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_append(&joinCondition, &_6$$7, PH_SEPARATE, "phalcon/Db/Dialect.zep", 900);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &joinConditionsArray, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5$$6, &joinConditionsArray, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5$$6)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&condition, &joinConditionsArray, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_7$$8, this_ptr, "getsqlexpression", &_3, 59, &condition, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_append(&joinCondition, &_7$$8, PH_SEPARATE, "phalcon/Db/Dialect.zep", 900);
+ ZEPHIR_CALL_METHOD(NULL, &joinConditionsArray, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&condition);
+ ZEPHIR_INIT_NVAR(&_8$$6);
+ zephir_fast_join_str(&_8$$6, SL(" AND "), &joinCondition);
+ ZEPHIR_CPY_WRT(&joinCondition, &_8$$6);
+ }
+ } else {
+ ZEPHIR_INIT_NVAR(&joinCondition);
+ ZVAL_LONG(&joinCondition, 1);
}
-vv275:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'I':
- case 'i': goto vv305;
- default: goto vv54;
+ ZEPHIR_OBS_NVAR(&joinType);
+ _9$$3 = zephir_array_isset_string_fetch(&joinType, &join, SL("type"), 0);
+ if (_9$$3) {
+ _9$$3 = zephir_is_true(&joinType);
}
-vv276:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'D':
- case 'd': goto vv306;
- default: goto vv54;
+ if (_9$$3) {
+ zephir_concat_self_str(&joinType, SL(" "));
}
-vv277:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv278;
+ zephir_array_fetch_string(&_10$$3, &join, SL("source"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 913);
+ ZEPHIR_CALL_METHOD(&joinTable, this_ptr, "getsqltable", &_11, 75, &_10$$3, &escapeChar);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_12$$3);
+ ZEPHIR_CONCAT_SVSVSV(&_12$$3, " ", &joinType, "JOIN ", &joinTable, " ON ", &joinCondition);
+ zephir_concat_self(&sql, &_12$$3);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, expression, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, expression, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
}
-vv278:
- {
- token->opcode = PHVOLT_T_FALSE;
- return 0;
+ ZEPHIR_CALL_METHOD(&join, expression, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&joinConditionsArray);
+ _13$$11 = zephir_array_isset_string_fetch(&joinConditionsArray, &join, SL("conditions"), 0);
+ if (_13$$11) {
+ _13$$11 = !(ZEPHIR_IS_EMPTY(&joinConditionsArray));
+ }
+ if (_13$$11) {
+ if (!(zephir_array_isset_long(&joinConditionsArray, 0))) {
+ ZEPHIR_CALL_METHOD(&joinCondition, this_ptr, "getsqlexpression", &_3, 59, &joinConditionsArray, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_NVAR(&joinCondition);
+ array_init(&joinCondition);
+ zephir_is_iterable(&joinConditionsArray, 0, "phalcon/Db/Dialect.zep", 903);
+ if (Z_TYPE_P(&joinConditionsArray) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&joinConditionsArray), _14$$14)
+ {
+ ZEPHIR_INIT_NVAR(&condition);
+ ZVAL_COPY(&condition, _14$$14);
+ ZEPHIR_CALL_METHOD(&_16$$15, this_ptr, "getsqlexpression", &_3, 59, &condition, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_append(&joinCondition, &_16$$15, PH_SEPARATE, "phalcon/Db/Dialect.zep", 900);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &joinConditionsArray, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_15$$14, &joinConditionsArray, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_15$$14)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&condition, &joinConditionsArray, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_17$$16, this_ptr, "getsqlexpression", &_3, 59, &condition, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_append(&joinCondition, &_17$$16, PH_SEPARATE, "phalcon/Db/Dialect.zep", 900);
+ ZEPHIR_CALL_METHOD(NULL, &joinConditionsArray, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&condition);
+ ZEPHIR_INIT_NVAR(&_18$$14);
+ zephir_fast_join_str(&_18$$14, SL(" AND "), &joinCondition);
+ ZEPHIR_CPY_WRT(&joinCondition, &_18$$14);
+ }
+ } else {
+ ZEPHIR_INIT_NVAR(&joinCondition);
+ ZVAL_LONG(&joinCondition, 1);
+ }
+ ZEPHIR_OBS_NVAR(&joinType);
+ _19$$11 = zephir_array_isset_string_fetch(&joinType, &join, SL("type"), 0);
+ if (_19$$11) {
+ _19$$11 = zephir_is_true(&joinType);
+ }
+ if (_19$$11) {
+ zephir_concat_self_str(&joinType, SL(" "));
+ }
+ zephir_array_fetch_string(&_20$$11, &join, SL("source"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 913);
+ ZEPHIR_CALL_METHOD(&joinTable, this_ptr, "getsqltable", &_11, 75, &_20$$11, &escapeChar);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_21$$11);
+ ZEPHIR_CONCAT_SVSVSV(&_21$$11, " ", &joinType, "JOIN ", &joinTable, " ON ", &joinCondition);
+ zephir_concat_self(&sql, &_21$$11);
+ ZEPHIR_CALL_METHOD(NULL, expression, "next", NULL, 0);
+ zephir_check_call_status();
}
-vv279:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'D':
- case 'd': goto vv307;
- default: goto vv54;
- }
-vv280:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'T':
- case 't': goto vv308;
- default: goto vv81;
- }
-vv281:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'B':
- case 'b': goto vv310;
- default: goto vv54;
- }
-vv282:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv283;
- }
-vv283:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_MACRO;
- return 0;
+ }
+ ZEPHIR_INIT_NVAR(&join);
+ RETURN_CTOR(&sql);
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionLimit)
+{
+ zend_bool _2$$4;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval bindCounts, _4;
+ zval escapeChar;
+ zval *expression, expression_sub, *escapeChar_param = NULL, *bindCounts_param = NULL, sql, value, limit, offset, _0$$4, _1$$5, _3$$7;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression_sub);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&limit);
+ ZVAL_UNDEF(&offset);
+ ZVAL_UNDEF(&_0$$4);
+ ZVAL_UNDEF(&_1$$5);
+ ZVAL_UNDEF(&_3$$7);
+ ZVAL_UNDEF(&escapeChar);
+ ZVAL_UNDEF(&bindCounts);
+ ZVAL_UNDEF(&_4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ZVAL(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression, &escapeChar_param, &bindCounts_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ ZEPHIR_INIT_VAR(&sql);
+ ZVAL_STRING(&sql, "");
+ ZEPHIR_INIT_VAR(&offset);
+ ZVAL_NULL(&offset);
+ ZEPHIR_OBS_VAR(&value);
+ zephir_array_fetch_string(&value, expression, SL("value"), PH_NOISY, "phalcon/Db/Dialect.zep", 934);
+ if (zephir_array_isset_string(expression, SL("sql"))) {
+ ZEPHIR_OBS_NVAR(&sql);
+ zephir_array_fetch_string(&sql, expression, SL("sql"), PH_NOISY, "phalcon/Db/Dialect.zep", 937);
+ }
+ if (Z_TYPE_P(&value) == IS_ARRAY) {
+ ZEPHIR_OBS_VAR(&_0$$4);
+ zephir_array_fetch_string(&_0$$4, &value, SL("number"), PH_NOISY, "phalcon/Db/Dialect.zep", 941);
+ if (Z_TYPE_P(&_0$$4) == IS_ARRAY) {
+ zephir_array_fetch_string(&_1$$5, &value, SL("number"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 943);
+ ZEPHIR_CALL_METHOD(&limit, this_ptr, "getsqlexpression", NULL, 0, &_1$$5, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_OBS_NVAR(&limit);
+ zephir_array_fetch_string(&limit, &value, SL("number"), PH_NOISY, "phalcon/Db/Dialect.zep", 948);
}
-vv284:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'I':
- case 'i': goto vv311;
- default: goto vv54;
- }
-vv285:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'N':
- case 'n': goto vv312;
- default: goto vv54;
- }
-vv286:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'R':
- case 'r': goto vv314;
- default: goto vv54;
- }
-vv287:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'H':
- case 'h': goto vv316;
- default: goto vv54;
- }
-vv288:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'o': goto vv318;
- default: goto vv81;
- }
-vv289:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'C':
- case 'c': goto vv319;
- default: goto vv54;
- }
-vv290:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'U':
- case 'u': goto vv320;
- default: goto vv54;
- }
-vv291:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'T':
- case 't': goto vv321;
- default: goto vv54;
- }
-vv292:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'D':
- case 'd': goto vv323;
- default: goto vv54;
- }
-vv293:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'R':
- case 'r': goto vv325;
- default: goto vv54;
- }
-vv294:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv295;
- }
-vv295:
- {
- token->opcode = PHVOLT_T_ELSEIF;
- return 0;
+ ZEPHIR_OBS_NVAR(&offset);
+ _2$$4 = zephir_array_isset_string_fetch(&offset, &value, SL("offset"), 0);
+ if (_2$$4) {
+ _2$$4 = Z_TYPE_P(&offset) == IS_ARRAY;
}
-vv296:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'O':
- case 'o': goto vv327;
- default: goto vv54;
- }
-vv297:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'C':
- case 'c': goto vv328;
- default: goto vv54;
- }
-vv298:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'H':
- case 'h': goto vv329;
- default: goto vv54;
- }
-vv299:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'L':
- case 'l': goto vv330;
- default: goto vv54;
- }
-vv300:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv301;
- }
-vv301:
- {
- token->opcode = PHVOLT_T_ENDFOR;
- return 0;
+ if (_2$$4) {
+ ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "getsqlexpression", NULL, 59, &offset, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&offset, &_3$$7);
}
-vv302:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'R':
- case 'r': goto vv332;
- default: goto vv54;
- }
-vv303:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv304;
- }
-vv304:
+ } else {
+ ZEPHIR_CPY_WRT(&limit, &value);
+ }
+ ZEPHIR_INIT_VAR(&_4);
+ zephir_create_array(&_4, 2, 0);
+ zephir_array_fast_append(&_4, &limit);
+ zephir_array_fast_append(&_4, &offset);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "limit", NULL, 0, &sql, &_4);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionList)
+{
+ zend_bool _0, _1, _7$$4;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_5 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar;
+ zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts_param = NULL, item, values, separator, *_2$$4, _3$$4, _8$$4, _9$$4, _4$$5, _6$$6;
+ zval expression, bindCounts, items;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression);
+ ZVAL_UNDEF(&bindCounts);
+ ZVAL_UNDEF(&items);
+ ZVAL_UNDEF(&item);
+ ZVAL_UNDEF(&values);
+ ZVAL_UNDEF(&separator);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_8$$4);
+ ZVAL_UNDEF(&_9$$4);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_6$$6);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ARRAY(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ ZEPHIR_INIT_VAR(&items);
+ array_init(&items);
+ ZEPHIR_INIT_VAR(&separator);
+ ZVAL_STRING(&separator, ", ");
+ if (zephir_array_isset_string(&expression, SL("separator"))) {
+ ZEPHIR_OBS_NVAR(&separator);
+ zephir_array_fetch_string(&separator, &expression, SL("separator"), PH_NOISY, "phalcon/Db/Dialect.zep", 987);
+ }
+ ZEPHIR_OBS_VAR(&values);
+ _0 = zephir_array_isset_long_fetch(&values, &expression, 0, 0);
+ if (!(_0)) {
+ ZEPHIR_OBS_NVAR(&values);
+ _0 = zephir_array_isset_string_fetch(&values, &expression, SL("value"), 0);
+ }
+ _1 = _0;
+ if (_1) {
+ _1 = Z_TYPE_P(&values) == IS_ARRAY;
+ }
+ if (_1) {
+ zephir_is_iterable(&values, 0, "phalcon/Db/Dialect.zep", 996);
+ if (Z_TYPE_P(&values) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&values), _2$$4)
{
- s->statement_position++;
- token->opcode = PHVOLT_T_ENDRAW;
- return 0;
- }
-vv305:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'T':
- case 't': goto vv333;
- default: goto vv54;
- }
-vv306:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'S':
- case 's': goto vv334;
- default: goto vv54;
- }
-vv307:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv336;
- default: goto vv54;
+ ZEPHIR_INIT_NVAR(&item);
+ ZVAL_COPY(&item, _2$$4);
+ ZEPHIR_CALL_METHOD(&_4$$5, this_ptr, "getsqlexpression", &_5, 0, &item, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_append(&items, &_4$$5, PH_SEPARATE, "phalcon/Db/Dialect.zep", 993);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &values, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3$$4, &values, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3$$4)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&item, &values, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "getsqlexpression", &_5, 59, &item, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_append(&items, &_6$$6, PH_SEPARATE, "phalcon/Db/Dialect.zep", 993);
+ ZEPHIR_CALL_METHOD(NULL, &values, "next", NULL, 0);
+ zephir_check_call_status();
}
-vv308:
- ++VVCURSOR;
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_NOTEQUALS;
- return 0;
}
-vv310:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'L':
- case 'l': goto vv338;
- default: goto vv54;
- }
-vv311:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'C':
- case 'c': goto vv339;
- default: goto vv54;
- }
-vv312:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv313;
- }
-vv313:
+ ZEPHIR_INIT_NVAR(&item);
+ _7$$4 = zephir_array_isset_string(&expression, SL("parentheses"));
+ if (_7$$4) {
+ zephir_array_fetch_string(&_8$$4, &expression, SL("parentheses"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 996);
+ _7$$4 = ZEPHIR_IS_FALSE_IDENTICAL(&_8$$4);
+ }
+ if (_7$$4) {
+ zephir_fast_join(return_value, &separator, &items);
+ RETURN_MM();
+ }
+ ZEPHIR_INIT_VAR(&_9$$4);
+ zephir_fast_join(&_9$$4, &separator, &items);
+ ZEPHIR_CONCAT_SVS(return_value, "(", &_9$$4, ")");
+ RETURN_MM();
+ }
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL-list expression", "phalcon/Db/Dialect.zep", 1003);
+ return;
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionObject)
+{
+ zend_bool _0, _1;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar;
+ zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts_param = NULL, domain, objectExpression;
+ zval expression, bindCounts;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression);
+ ZVAL_UNDEF(&bindCounts);
+ ZVAL_UNDEF(&domain);
+ ZVAL_UNDEF(&objectExpression);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ARRAY(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ ZEPHIR_INIT_VAR(&domain);
+ ZVAL_NULL(&domain);
+ ZEPHIR_INIT_VAR(&objectExpression);
+ zephir_create_array(&objectExpression, 1, 0);
+ add_assoc_stringl_ex(&objectExpression, SL("type"), SL("all"));
+ ZEPHIR_OBS_NVAR(&domain);
+ _0 = zephir_array_isset_string_fetch(&domain, &expression, SL("column"), 0);
+ if (!(_0)) {
+ ZEPHIR_OBS_NVAR(&domain);
+ _0 = zephir_array_isset_string_fetch(&domain, &expression, SL("domain"), 0);
+ }
+ _1 = _0;
+ if (_1) {
+ _1 = !ZEPHIR_IS_STRING(&domain, "");
+ }
+ if (_1) {
+ zephir_array_update_string(&objectExpression, SL("domain"), &domain, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpression", NULL, 0, &objectExpression, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionOrderBy)
+{
+ zend_bool _4$$4, _7$$7;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_3 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval bindCounts;
+ zval escapeChar;
+ zval *expression, expression_sub, *escapeChar_param = NULL, *bindCounts_param = NULL, field, fields, type, fieldSql, *_0$$3, _1$$3, _9$$3, _2$$4, _5$$6, _6$$7, _8$$9;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression_sub);
+ ZVAL_UNDEF(&field);
+ ZVAL_UNDEF(&fields);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&fieldSql);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_9$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&_8$$9);
+ ZVAL_UNDEF(&escapeChar);
+ ZVAL_UNDEF(&bindCounts);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ZVAL(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression, &escapeChar_param, &bindCounts_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ ZEPHIR_INIT_VAR(&fieldSql);
+ ZVAL_NULL(&fieldSql);
+ if (Z_TYPE_P(expression) == IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&fields);
+ array_init(&fields);
+ zephir_is_iterable(expression, 0, "phalcon/Db/Dialect.zep", 1068);
+ if (Z_TYPE_P(expression) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(expression), _0$$3)
{
- token->opcode = PHVOLT_T_RETURN;
- return 0;
+ ZEPHIR_INIT_NVAR(&field);
+ ZVAL_COPY(&field, _0$$3);
+ if (UNEXPECTED(Z_TYPE_P(&field) != IS_ARRAY)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL-ORDER-BY expression", "phalcon/Db/Dialect.zep", 1049);
+ return;
+ }
+ zephir_array_fetch_long(&_2$$4, &field, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 1053);
+ ZEPHIR_CALL_METHOD(&fieldSql, this_ptr, "getsqlexpression", &_3, 0, &_2$$4, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&type);
+ _4$$4 = zephir_array_isset_long_fetch(&type, &field, 1, 0);
+ if (_4$$4) {
+ _4$$4 = !ZEPHIR_IS_STRING(&type, "");
+ }
+ if (_4$$4) {
+ ZEPHIR_INIT_NVAR(&_5$$6);
+ ZEPHIR_CONCAT_SV(&_5$$6, " ", &type);
+ zephir_concat_self(&fieldSql, &_5$$6);
+ }
+ zephir_array_append(&fields, &fieldSql, PH_SEPARATE, "phalcon/Db/Dialect.zep", 1065);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, expression, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1$$3, expression, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&field, expression, "current", NULL, 0);
+ zephir_check_call_status();
+ if (UNEXPECTED(Z_TYPE_P(&field) != IS_ARRAY)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL-ORDER-BY expression", "phalcon/Db/Dialect.zep", 1049);
+ return;
+ }
+ zephir_array_fetch_long(&_6$$7, &field, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 1053);
+ ZEPHIR_CALL_METHOD(&fieldSql, this_ptr, "getsqlexpression", &_3, 59, &_6$$7, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&type);
+ _7$$7 = zephir_array_isset_long_fetch(&type, &field, 1, 0);
+ if (_7$$7) {
+ _7$$7 = !ZEPHIR_IS_STRING(&type, "");
+ }
+ if (_7$$7) {
+ ZEPHIR_INIT_NVAR(&_8$$9);
+ ZEPHIR_CONCAT_SV(&_8$$9, " ", &type);
+ zephir_concat_self(&fieldSql, &_8$$9);
+ }
+ zephir_array_append(&fields, &fieldSql, PH_SEPARATE, "phalcon/Db/Dialect.zep", 1065);
+ ZEPHIR_CALL_METHOD(NULL, expression, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
-vv314:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv315;
+ ZEPHIR_INIT_NVAR(&field);
+ ZEPHIR_INIT_VAR(&_9$$3);
+ zephir_fast_join_str(&_9$$3, SL(", "), &fields);
+ ZEPHIR_CPY_WRT(&fields, &_9$$3);
+ } else {
+ ZEPHIR_CPY_WRT(&fields, expression);
+ }
+ ZEPHIR_CONCAT_SV(return_value, "ORDER BY ", &fields);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionQualified)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar;
+ zval *expression_param = NULL, *escapeChar_param = NULL, column, domain;
+ zval expression;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression);
+ ZVAL_UNDEF(&column);
+ ZVAL_UNDEF(&domain);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &expression_param, &escapeChar_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+
+
+ ZEPHIR_OBS_VAR(&column);
+ zephir_array_fetch_string(&column, &expression, SL("name"), PH_NOISY, "phalcon/Db/Dialect.zep", 1083);
+ ZEPHIR_OBS_VAR(&domain);
+ if (!(zephir_array_isset_string_fetch(&domain, &expression, SL("domain"), 0))) {
+ ZEPHIR_INIT_NVAR(&domain);
+ ZVAL_NULL(&domain);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparequalified", NULL, 0, &column, &domain, &escapeChar);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionScalar)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar;
+ zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts_param = NULL, value, _0$$3;
+ zval expression, bindCounts;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression);
+ ZVAL_UNDEF(&bindCounts);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ARRAY(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ if (zephir_array_isset_string(&expression, SL("column"))) {
+ zephir_array_fetch_string(&_0$$3, &expression, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 1107);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlcolumn", NULL, 53, &_0$$3);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZEPHIR_OBS_VAR(&value);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&value, &expression, SL("value"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL expression", "phalcon/Db/Dialect.zep", 1111);
+ return;
+ }
+ if (Z_TYPE_P(&value) == IS_ARRAY) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpression", NULL, 0, &value, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ RETURN_CCTOR(&value);
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionUnaryOperations)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval escapeChar;
+ zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts_param = NULL, left, right, _0$$3, _1$$3, _2$$4, _3$$4;
+ zval expression, bindCounts;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression);
+ ZVAL_UNDEF(&bindCounts);
+ ZVAL_UNDEF(&left);
+ ZVAL_UNDEF(&right);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&escapeChar);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ARRAY(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ ZEPHIR_OBS_VAR(&left);
+ if (zephir_array_isset_string_fetch(&left, &expression, SL("left"), 0)) {
+ ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getsqlexpression", NULL, 0, &left, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_1$$3, &expression, SL("op"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 1138);
+ ZEPHIR_CONCAT_VSV(return_value, &_0$$3, " ", &_1$$3);
+ RETURN_MM();
+ }
+ ZEPHIR_OBS_VAR(&right);
+ if (zephir_array_isset_string_fetch(&right, &expression, SL("right"), 0)) {
+ zephir_array_fetch_string(&_2$$4, &expression, SL("op"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 1145);
+ ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "getsqlexpression", NULL, 59, &right, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VSV(return_value, &_2$$4, " ", &_3$$4);
+ RETURN_MM();
+ }
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL-unary expression", "phalcon/Db/Dialect.zep", 1148);
+ return;
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionWhere)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval bindCounts;
+ zval escapeChar;
+ zval *expression, expression_sub, *escapeChar_param = NULL, *bindCounts_param = NULL, whereSql;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&expression_sub);
+ ZVAL_UNDEF(&whereSql);
+ ZVAL_UNDEF(&escapeChar);
+ ZVAL_UNDEF(&bindCounts);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ZVAL(expression)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ Z_PARAM_ARRAY(bindCounts)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &expression, &escapeChar_param, &bindCounts_param);
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+ if (!bindCounts_param) {
+ ZEPHIR_INIT_VAR(&bindCounts);
+ array_init(&bindCounts);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindCounts, bindCounts_param);
+ }
+
+
+ if (Z_TYPE_P(expression) == IS_ARRAY) {
+ ZEPHIR_CALL_METHOD(&whereSql, this_ptr, "getsqlexpression", NULL, 0, expression, &escapeChar, &bindCounts);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CPY_WRT(&whereSql, expression);
+ }
+ ZEPHIR_CONCAT_SV(return_value, "WHERE ", &whereSql);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, prepareColumnAlias)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *qualified_param = NULL, *alias_param = NULL, *escapeChar_param = NULL, _0$$3;
+ zval qualified, alias, escapeChar;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&qualified);
+ ZVAL_UNDEF(&alias);
+ ZVAL_UNDEF(&escapeChar);
+ ZVAL_UNDEF(&_0$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(qualified)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(alias)
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &qualified_param, &alias_param, &escapeChar_param);
+ if (UNEXPECTED(Z_TYPE_P(qualified_param) != IS_STRING && Z_TYPE_P(qualified_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'qualified' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(qualified_param) == IS_STRING)) {
+ zephir_get_strval(&qualified, qualified_param);
+ } else {
+ ZEPHIR_INIT_VAR(&qualified);
+ }
+ if (!alias_param) {
+ ZEPHIR_INIT_VAR(&alias);
+ } else {
+ zephir_get_strval(&alias, alias_param);
+ }
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+
+
+ if (!ZEPHIR_IS_STRING(&alias, "")) {
+ ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "escape", NULL, 66, &alias, &escapeChar);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VSV(return_value, &qualified, " AS ", &_0$$3);
+ RETURN_MM();
+ }
+ RETURN_CTOR(&qualified);
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, prepareTable)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *table_param = NULL, *schema_param = NULL, *alias_param = NULL, *escapeChar_param = NULL, _0, _1$$3, _2$$3, _3$$4, _4$$4;
+ zval table, schema, alias, escapeChar;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+ ZVAL_UNDEF(&alias);
+ ZVAL_UNDEF(&escapeChar);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_4$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
+ Z_PARAM_STR_OR_NULL(alias)
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 3, &table_param, &schema_param, &alias_param, &escapeChar_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
+ }
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
+ }
+ if (!alias_param) {
+ ZEPHIR_INIT_VAR(&alias);
+ } else {
+ zephir_get_strval(&alias, alias_param);
+ }
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "escape", NULL, 66, &table, &escapeChar);
+ zephir_check_call_status();
+ zephir_get_strval(&table, &_0);
+ if (!ZEPHIR_IS_STRING(&schema, "")) {
+ ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "escapeschema", NULL, 76, &schema, &escapeChar);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_VSV(&_2$$3, &_1$$3, ".", &table);
+ zephir_get_strval(&table, &_2$$3);
+ }
+ if (!ZEPHIR_IS_STRING(&alias, "")) {
+ ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "escape", NULL, 66, &alias, &escapeChar);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_4$$4);
+ ZEPHIR_CONCAT_VSV(&_4$$4, &table, " AS ", &_3$$4);
+ zephir_get_strval(&table, &_4$$4);
+ }
+ RETURN_CTOR(&table);
+}
+
+static PHP_METHOD(Phalcon_Db_Dialect, prepareQualified)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *column_param = NULL, *domain_param = NULL, *escapeChar_param = NULL;
+ zval column, domain, escapeChar, _0$$3;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&column);
+ ZVAL_UNDEF(&domain);
+ ZVAL_UNDEF(&escapeChar);
+ ZVAL_UNDEF(&_0$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(column)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(domain)
+ Z_PARAM_STR_OR_NULL(escapeChar)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &column_param, &domain_param, &escapeChar_param);
+ if (UNEXPECTED(Z_TYPE_P(column_param) != IS_STRING && Z_TYPE_P(column_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'column' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(column_param) == IS_STRING)) {
+ zephir_get_strval(&column, column_param);
+ } else {
+ ZEPHIR_INIT_VAR(&column);
+ }
+ if (!domain_param) {
+ ZEPHIR_INIT_VAR(&domain);
+ } else {
+ zephir_get_strval(&domain, domain_param);
+ }
+ if (!escapeChar_param) {
+ ZEPHIR_INIT_VAR(&escapeChar);
+ } else {
+ zephir_get_strval(&escapeChar, escapeChar_param);
+ }
+
+
+ if (!ZEPHIR_IS_STRING(&domain, "")) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZEPHIR_CONCAT_VSV(&_0$$3, &domain, ".", &column);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 66, &_0$$3, &escapeChar);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 66, &column, &escapeChar);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+zend_object *zephir_init_properties_Phalcon_Db_Dialect(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_MM_GROW();
+
+ {
+ 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("customFunctions"), 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("customFunctions"), &_1$$3);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
+ }
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_DialectInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Db, DialectInterface, phalcon, db_dialectinterface, phalcon_db_dialectinterface_method_entry);
+
+ return SUCCESS;
+}
+
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, addColumn);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, addForeignKey);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, addIndex);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, addPrimaryKey);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, createSavepoint);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, createTable);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, createView);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, describeColumns);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, describeIndexes);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, describeReferences);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, dropColumn);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, dropForeignKey);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, dropIndex);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, dropPrimaryKey);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, dropTable);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, dropView);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, forUpdate);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, getColumnDefinition);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, getColumnList);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, getCustomFunctions);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, getSqlExpression);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, limit);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, listTables);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, modifyColumn);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, registerCustomFunction);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, releaseSavepoint);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, rollbackSavepoint);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, select);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, sharedLock);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, supportsReleaseSavepoints);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, supportsSavepoints);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, tableExists);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, tableOptions);
+ZEPHIR_DOC_METHOD(Phalcon_Db_DialectInterface, viewExists);
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_Enum)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Db, Enum, phalcon, db_enum, NULL, 0);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_ASSOC"), 2);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_BOTH"), 4);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_BOUND"), 6);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_CLASS"), 8);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_CLASSTYPE"), 262144);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_COLUMN"), 7);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_FUNC"), 10);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_GROUP"), 65536);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_INTO"), 9);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_KEY_PAIR"), 12);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_LAZY"), 1);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_NAMED"), 11);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_NUM"), 3);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_OBJ"), 5);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_PROPS_LATE"), 1048576);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_SERIALIZE"), 524288);
+
+ zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_UNIQUE"), 196608);
+
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Db, Exception, phalcon, db_exception, phalcon_exception_ce, NULL, 0);
+
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_Index)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Db, Index, phalcon, db_index, phalcon_db_index_method_entry, 0);
+
+ zend_declare_property_null(phalcon_db_index_ce, SL("columns"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_index_ce, SL("name"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_index_ce, SL("type"), ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_db_index_ce, 1, phalcon_db_indexinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Db_Index, getColumns)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "columns");
+}
+
+static PHP_METHOD(Phalcon_Db_Index, getName)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "name");
+}
+
+static PHP_METHOD(Phalcon_Db_Index, getType)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "type");
+}
+
+static PHP_METHOD(Phalcon_Db_Index, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval columns;
+ zval *name_param = NULL, *columns_param = NULL, *type_param = NULL;
+ zval name, type;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&columns);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(name)
+ Z_PARAM_ARRAY(columns)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(type)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 1, &name_param, &columns_param, &type_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_OBS_COPY_OR_DUP(&columns, columns_param);
+ if (!type_param) {
+ ZEPHIR_INIT_VAR(&type);
+ ZVAL_STRING(&type, "");
+ } else {
+ zephir_get_strval(&type, type_param);
+ }
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("columns"), &columns);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &type);
+ ZEPHIR_MM_RESTORE();
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_IndexInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Db, IndexInterface, phalcon, db_indexinterface, phalcon_db_indexinterface_method_entry);
+
+ return SUCCESS;
+}
+
+ZEPHIR_DOC_METHOD(Phalcon_Db_IndexInterface, getColumns);
+ZEPHIR_DOC_METHOD(Phalcon_Db_IndexInterface, getName);
+ZEPHIR_DOC_METHOD(Phalcon_Db_IndexInterface, getType);
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_Profiler)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Db, Profiler, phalcon, db_profiler, phalcon_db_profiler_method_entry, 0);
+
+ zend_declare_property_null(phalcon_db_profiler_ce, SL("activeProfile"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_profiler_ce, SL("allProfiles"), ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_db_profiler_ce, SL("totalSeconds"), 0, ZEND_ACC_PROTECTED);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler, getLastProfile)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "activeProfile");
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler, getNumberTotalStatements)
+{
+ zval _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("allProfiles"), PH_NOISY_CC | PH_READONLY);
+ RETURN_LONG(zephir_fast_count_int(&_0));
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler, getTotalElapsedSeconds)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "totalSeconds");
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler, getProfiles)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "allProfiles");
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler, reset)
+{
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+
+
+ ZEPHIR_MM_GROW();
+
+ ZEPHIR_INIT_VAR(&_0);
+ array_init(&_0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("allProfiles"), &_0);
+ RETURN_THIS();
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler, startProfile)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *sqlStatement_param = NULL, *sqlVariables = NULL, sqlVariables_sub, *sqlBindTypes = NULL, sqlBindTypes_sub, __$true, __$null, activeProfile, _0;
+ zval sqlStatement;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&sqlStatement);
+ ZVAL_UNDEF(&sqlVariables_sub);
+ ZVAL_UNDEF(&sqlBindTypes_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&activeProfile);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(sqlStatement)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(sqlVariables)
+ Z_PARAM_ZVAL_OR_NULL(sqlBindTypes)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &sqlStatement_param, &sqlVariables, &sqlBindTypes);
+ zephir_get_strval(&sqlStatement, sqlStatement_param);
+ if (!sqlVariables) {
+ sqlVariables = &sqlVariables_sub;
+ sqlVariables = &__$null;
+ }
+ if (!sqlBindTypes) {
+ sqlBindTypes = &sqlBindTypes_sub;
+ sqlBindTypes = &__$null;
+ }
+
+
+ ZEPHIR_INIT_VAR(&activeProfile);
+ object_init_ex(&activeProfile, phalcon_db_profiler_item_ce);
+ if (zephir_has_constructor(&activeProfile)) {
+ ZEPHIR_CALL_METHOD(NULL, &activeProfile, "__construct", NULL, 0);
+ zephir_check_call_status();
+ }
+
+ ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlstatement", NULL, 217, &sqlStatement);
+ zephir_check_call_status();
+ if (Z_TYPE_P(sqlVariables) == IS_ARRAY) {
+ ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlvariables", NULL, 218, sqlVariables);
+ zephir_check_call_status();
+ }
+ if (Z_TYPE_P(sqlBindTypes) == IS_ARRAY) {
+ ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlbindtypes", NULL, 219, sqlBindTypes);
+ zephir_check_call_status();
+ }
+ ZEPHIR_CALL_FUNCTION(&_0, "hrtime", NULL, 202, &__$true);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setinitialtime", NULL, 220, &_0);
+ zephir_check_call_status();
+ if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("beforestartprofile")) == SUCCESS)) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "beforestartprofile", NULL, 0, &activeProfile);
+ zephir_check_call_status();
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("activeProfile"), &activeProfile);
+ RETURN_THIS();
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler, stopProfile)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval __$true, activeProfile, finalTime, initialTime, _0, _1, _2;
+ zval *this_ptr = getThis();
+
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&activeProfile);
+ ZVAL_UNDEF(&finalTime);
+ ZVAL_UNDEF(&initialTime);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+
+
+ ZEPHIR_MM_GROW();
+
+ ZEPHIR_CALL_FUNCTION(&finalTime, "hrtime", NULL, 202, &__$true);
+ zephir_check_call_status();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("activeProfile"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&activeProfile, &_0);
+ ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setfinaltime", NULL, 0, &finalTime);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&initialTime, &activeProfile, "getinitialtime", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("totalSeconds"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_1);
+ zephir_sub_function(&_1, &finalTime, &initialTime);
+ ZEPHIR_INIT_VAR(&_2);
+ zephir_add_function(&_2, &_0, &_1);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("totalSeconds"), &_2);
+ zephir_update_property_array_append(this_ptr, SL("allProfiles"), &activeProfile);
+ if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("afterendprofile")) == SUCCESS)) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "afterendprofile", NULL, 0, &activeProfile);
+ zephir_check_call_status();
+ }
+ RETURN_THIS();
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_RawValue)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Db, RawValue, phalcon, db_rawvalue, phalcon_db_rawvalue_method_entry, 0);
+
+ zend_declare_property_null(phalcon_db_rawvalue_ce, SL("value"), ZEND_ACC_PROTECTED);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Db_RawValue, getValue)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "value");
+}
+
+static PHP_METHOD(Phalcon_Db_RawValue, __toString)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "value");
+}
+
+static PHP_METHOD(Phalcon_Db_RawValue, __construct)
+{
+ zval _2$$5;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *value, value_sub, _0$$3, _1$$4;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$5);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &value);
+
+
+ if (ZEPHIR_IS_STRING_IDENTICAL(value, "")) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZEPHIR_INIT_NVAR(&_0$$3);
+ ZVAL_STRING(&_0$$3, "''");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("value"), &_0$$3);
+ } else if (Z_TYPE_P(value) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_1$$4);
+ ZEPHIR_INIT_NVAR(&_1$$4);
+ ZVAL_STRING(&_1$$4, "NULL");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("value"), &_1$$4);
+ } else {
+ zephir_cast_to_string(&_2$$5, value);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("value"), &_2$$5);
+ }
+ ZEPHIR_MM_RESTORE();
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_Reference)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Db, Reference, phalcon, db_reference, phalcon_db_reference_method_entry, 0);
+
+ zend_declare_property_null(phalcon_db_reference_ce, SL("columns"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_reference_ce, SL("name"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_reference_ce, SL("referencedColumns"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_reference_ce, SL("referencedSchema"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_reference_ce, SL("referencedTable"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_reference_ce, SL("schemaName"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_reference_ce, SL("onDelete"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_reference_ce, SL("onUpdate"), ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_db_reference_ce, 1, phalcon_db_referenceinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Db_Reference, getColumns)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "columns");
+}
+
+static PHP_METHOD(Phalcon_Db_Reference, getName)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "name");
+}
+
+static PHP_METHOD(Phalcon_Db_Reference, getReferencedColumns)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "referencedColumns");
+}
+
+static PHP_METHOD(Phalcon_Db_Reference, getReferencedSchema)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "referencedSchema");
+}
+
+static PHP_METHOD(Phalcon_Db_Reference, getReferencedTable)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "referencedTable");
+}
+
+static PHP_METHOD(Phalcon_Db_Reference, getSchemaName)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "schemaName");
+}
+
+static PHP_METHOD(Phalcon_Db_Reference, getOnDelete)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "onDelete");
+}
+
+static PHP_METHOD(Phalcon_Db_Reference, getOnUpdate)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "onUpdate");
+}
+
+static PHP_METHOD(Phalcon_Db_Reference, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval definition;
+ zval *name_param = NULL, *definition_param = NULL, columns, schema, referencedTable, referencedSchema, referencedColumns, onDelete, onUpdate;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&schema);
+ ZVAL_UNDEF(&referencedTable);
+ ZVAL_UNDEF(&referencedSchema);
+ ZVAL_UNDEF(&referencedColumns);
+ ZVAL_UNDEF(&onDelete);
+ ZVAL_UNDEF(&onUpdate);
+ ZVAL_UNDEF(&definition);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_ARRAY(definition)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &name_param, &definition_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_OBS_COPY_OR_DUP(&definition, definition_param);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
+ ZEPHIR_OBS_VAR(&referencedTable);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&referencedTable, &definition, SL("referencedTable"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Referenced table is required", "phalcon/Db/Reference.zep", 103);
+ return;
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("referencedTable"), &referencedTable);
+ ZEPHIR_OBS_VAR(&columns);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Foreign key columns are required", "phalcon/Db/Reference.zep", 109);
+ return;
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("columns"), &columns);
+ ZEPHIR_OBS_VAR(&referencedColumns);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&referencedColumns, &definition, SL("referencedColumns"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Referenced columns of the foreign key are required", "phalcon/Db/Reference.zep", 117);
+ return;
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("referencedColumns"), &referencedColumns);
+ ZEPHIR_OBS_VAR(&schema);
+ if (zephir_array_isset_string_fetch(&schema, &definition, SL("schema"), 0)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("schemaName"), &schema);
+ }
+ ZEPHIR_OBS_VAR(&referencedSchema);
+ if (zephir_array_isset_string_fetch(&referencedSchema, &definition, SL("referencedSchema"), 0)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("referencedSchema"), &referencedSchema);
+ }
+ ZEPHIR_OBS_VAR(&onDelete);
+ if (zephir_array_isset_string_fetch(&onDelete, &definition, SL("onDelete"), 0)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("onDelete"), &onDelete);
+ }
+ ZEPHIR_OBS_VAR(&onUpdate);
+ if (zephir_array_isset_string_fetch(&onUpdate, &definition, SL("onUpdate"), 0)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("onUpdate"), &onUpdate);
+ }
+ if (UNEXPECTED(zephir_fast_count_int(&columns) != zephir_fast_count_int(&referencedColumns))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Number of columns is not equals than the number of columns referenced", "phalcon/Db/Reference.zep", 141);
+ return;
+ }
+ ZEPHIR_MM_RESTORE();
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_ReferenceInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Db, ReferenceInterface, phalcon, db_referenceinterface, phalcon_db_referenceinterface_method_entry);
+
+ return SUCCESS;
+}
+
+ZEPHIR_DOC_METHOD(Phalcon_Db_ReferenceInterface, getColumns);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ReferenceInterface, getName);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ReferenceInterface, getOnDelete);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ReferenceInterface, getOnUpdate);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ReferenceInterface, getReferencedColumns);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ReferenceInterface, getReferencedSchema);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ReferenceInterface, getReferencedTable);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ReferenceInterface, getSchemaName);
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_ResultInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Db, ResultInterface, phalcon, db_resultinterface, phalcon_db_resultinterface_method_entry);
+
+ return SUCCESS;
+}
+
+ZEPHIR_DOC_METHOD(Phalcon_Db_ResultInterface, dataSeek);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ResultInterface, execute);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ResultInterface, fetch);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ResultInterface, fetchAll);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ResultInterface, fetchArray);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ResultInterface, getInternalResult);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ResultInterface, numRows);
+ZEPHIR_DOC_METHOD(Phalcon_Db_ResultInterface, setFetchMode);
+
+
+
+
+static int phalcon_db_checktype(zval *return_value, zval *placeholder) {
+
+ if (Z_TYPE_P(placeholder) != IS_STRING) {
+
+ }
+
+ return 0;
+}
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_Profiler_Item)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Db\\Profiler, Item, phalcon, db_profiler_item, phalcon_db_profiler_item_method_entry, 0);
+
+ zend_declare_property_null(phalcon_db_profiler_item_ce, SL("finalTime"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_profiler_item_ce, SL("initialTime"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_profiler_item_ce, SL("sqlBindTypes"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_profiler_item_ce, SL("sqlStatement"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_profiler_item_ce, SL("sqlVariables"), ZEND_ACC_PROTECTED);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler_Item, setFinalTime)
+{
+ zval *finalTime_param = NULL, _0;
+ double finalTime;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(finalTime)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &finalTime_param);
+ finalTime = zephir_get_doubleval(finalTime_param);
+
+
+ ZEPHIR_INIT_ZVAL_NREF(_0);
+ ZVAL_DOUBLE(&_0, finalTime);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("finalTime"), &_0);
+ RETURN_THISW();
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler_Item, getFinalTime)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "finalTime");
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler_Item, setInitialTime)
+{
+ zval *initialTime_param = NULL, _0;
+ double initialTime;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(initialTime)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &initialTime_param);
+ initialTime = zephir_get_doubleval(initialTime_param);
+
+
+ ZEPHIR_INIT_ZVAL_NREF(_0);
+ ZVAL_DOUBLE(&_0, initialTime);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("initialTime"), &_0);
+ RETURN_THISW();
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler_Item, getInitialTime)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "initialTime");
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler_Item, setSqlBindTypes)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *sqlBindTypes_param = NULL;
+ zval sqlBindTypes;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&sqlBindTypes);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(sqlBindTypes)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &sqlBindTypes_param);
+ zephir_get_arrval(&sqlBindTypes, sqlBindTypes_param);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("sqlBindTypes"), &sqlBindTypes);
+ RETURN_THIS();
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler_Item, getSqlBindTypes)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "sqlBindTypes");
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler_Item, setSqlStatement)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *sqlStatement_param = NULL;
+ zval sqlStatement;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&sqlStatement);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(sqlStatement)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &sqlStatement_param);
+ zephir_get_strval(&sqlStatement, sqlStatement_param);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("sqlStatement"), &sqlStatement);
+ RETURN_THIS();
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler_Item, getSqlStatement)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "sqlStatement");
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler_Item, setSqlVariables)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *sqlVariables_param = NULL;
+ zval sqlVariables;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&sqlVariables);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(sqlVariables)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &sqlVariables_param);
+ zephir_get_arrval(&sqlVariables, sqlVariables_param);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("sqlVariables"), &sqlVariables);
+ RETURN_THIS();
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler_Item, getSqlVariables)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "sqlVariables");
+}
+
+static PHP_METHOD(Phalcon_Db_Profiler_Item, getTotalElapsedSeconds)
+{
+ zval _0, _1;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("finalTime"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("initialTime"), PH_NOISY_CC | PH_READONLY);
+ zephir_sub_function(return_value, &_0, &_1);
+ return;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_Adapter_AbstractAdapter)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Db\\Adapter, AbstractAdapter, phalcon, db_adapter_abstractadapter, phalcon_db_adapter_abstractadapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+
+ zend_declare_property_long(phalcon_db_adapter_abstractadapter_ce, SL("connectionConsecutive"), 0, ZEND_ACC_PROTECTED|ZEND_ACC_STATIC);
+ zend_declare_property_null(phalcon_db_adapter_abstractadapter_ce, SL("connectionId"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_adapter_abstractadapter_ce, SL("descriptor"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_adapter_abstractadapter_ce, SL("dialect"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_adapter_abstractadapter_ce, SL("dialectType"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_adapter_abstractadapter_ce, SL("eventsManager"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_adapter_abstractadapter_ce, SL("realSqlStatement"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_adapter_abstractadapter_ce, SL("sqlBindTypes"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_adapter_abstractadapter_ce, SL("sqlStatement"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_adapter_abstractadapter_ce, SL("sqlVariables"), ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_db_adapter_abstractadapter_ce, SL("transactionLevel"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_db_adapter_abstractadapter_ce, SL("transactionsWithSavepoints"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_adapter_abstractadapter_ce, SL("type"), ZEND_ACC_PROTECTED);
+ phalcon_db_adapter_abstractadapter_ce->create_object = zephir_init_properties_Phalcon_Db_Adapter_AbstractAdapter;
+
+ zend_class_implements(phalcon_db_adapter_abstractadapter_ce, 1, phalcon_db_adapter_adapterinterface_ce);
+ zend_class_implements(phalcon_db_adapter_abstractadapter_ce, 1, phalcon_events_eventsawareinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getDialectType)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "dialectType");
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getSqlVariables)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "sqlVariables");
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getType)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "type");
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *descriptor_param = NULL, dialectClass, connectionId, _0, _1$$3, _2$$4;
+ zval descriptor;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&descriptor);
+ ZVAL_UNDEF(&dialectClass);
+ ZVAL_UNDEF(&connectionId);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(descriptor)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &descriptor_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&descriptor, descriptor_param);
+
+
+ ZEPHIR_OBS_VAR(&connectionId);
+ zephir_read_static_property_ce(&connectionId, phalcon_db_adapter_abstractadapter_ce, SL("connectionConsecutive"), PH_NOISY_CC);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("connectionId"), &connectionId);
+ ZEPHIR_INIT_ZVAL_NREF(_0);
+ ZVAL_LONG(&_0, (zephir_get_numberval(&connectionId) + 1));
+ zephir_update_static_property_ce(phalcon_db_adapter_abstractadapter_ce, ZEND_STRL("connectionConsecutive"), &_0);
+ ZEPHIR_OBS_VAR(&dialectClass);
+ if (!(zephir_array_isset_string_fetch(&dialectClass, &descriptor, SL("dialectClass"), 0))) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("dialectType"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&dialectClass);
+ ZEPHIR_CONCAT_SV(&dialectClass, "phalcon\\db\\dialect\\", &_1$$3);
+ }
+ if (Z_TYPE_P(&dialectClass) == IS_STRING) {
+ ZEPHIR_INIT_VAR(&_2$$4);
+ ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&_2$$4, &dialectClass);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("dialect"), &_2$$4);
+ } else if (Z_TYPE_P(&dialectClass) == IS_OBJECT) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("dialect"), &dialectClass);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("descriptor"), &descriptor);
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, addColumn)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, _0, _1;
+ zval tableName, schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &column);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "addcolumn", NULL, 0, &tableName, &schemaName, column);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, addForeignKey)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *reference, reference_sub, _0, _1;
+ zval tableName, schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&reference_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(reference, phalcon_db_referenceinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &reference);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "addforeignkey", NULL, 0, &tableName, &schemaName, reference);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, addIndex)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub, _0, _1;
+ zval tableName, schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(index, phalcon_db_indexinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "addindex", NULL, 0, &tableName, &schemaName, index);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, addPrimaryKey)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub, _0, _1;
+ zval tableName, schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(index, phalcon_db_indexinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "addprimarykey", NULL, 0, &tableName, &schemaName, index);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, createSavepoint)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL, dialect, _0, _1, _2;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&dialect);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&dialect, &_0);
+ ZEPHIR_CALL_METHOD(&_1, &dialect, "supportssavepoints", NULL, 0);
+ zephir_check_call_status();
+ if (UNEXPECTED(!zephir_is_true(&_1))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Savepoints are not supported by this database adapter.", "phalcon/Db/Adapter/AbstractAdapter.zep", 231);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&_2, &dialect, "createsavepoint", NULL, 0, &name);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, createTable)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval definition;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, columns, _0, _1;
+ zval tableName, schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&definition);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_ARRAY(definition)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &definition_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param);
+
+
+ ZEPHIR_OBS_VAR(&columns);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The table must contain at least one column", "phalcon/Db/Adapter/AbstractAdapter.zep", 247);
+ return;
+ }
+ if (UNEXPECTED(!(zephir_fast_count_int(&columns)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The table must contain at least one column", "phalcon/Db/Adapter/AbstractAdapter.zep", 251);
+ return;
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "createtable", NULL, 0, &tableName, &schemaName, &definition);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, createView)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval definition;
+ zval *viewName_param = NULL, *definition_param = NULL, *schemaName_param = NULL, _0, _1;
+ zval viewName, schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&viewName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&definition);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(viewName)
+ Z_PARAM_ARRAY(definition)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 1, &viewName_param, &definition_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) {
+ zephir_get_strval(&viewName, viewName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&viewName);
+ }
+ ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ zephir_get_strval(&schemaName, schemaName_param);
+ }
+
+
+ if (UNEXPECTED(!(zephir_array_isset_string(&definition, SL("sql"))))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The table must contain at least one column", "phalcon/Db/Adapter/AbstractAdapter.zep", 269);
+ return;
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "createview", NULL, 0, &viewName, &definition, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, delete)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval placeholders, dataTypes;
+ zval whereCondition, _0$$3;
+ zval *table, table_sub, *whereCondition_param = NULL, *placeholders_param = NULL, *dataTypes_param = NULL, sql, escapedTable;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&table_sub);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&escapedTable);
+ ZVAL_UNDEF(&whereCondition);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&placeholders);
+ ZVAL_UNDEF(&dataTypes);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_ZVAL(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(whereCondition)
+ Z_PARAM_ARRAY(placeholders)
+ Z_PARAM_ARRAY(dataTypes)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 3, &table, &whereCondition_param, &placeholders_param, &dataTypes_param);
+ if (!whereCondition_param) {
+ ZEPHIR_INIT_VAR(&whereCondition);
+ } else {
+ zephir_get_strval(&whereCondition, whereCondition_param);
+ }
+ if (!placeholders_param) {
+ ZEPHIR_INIT_VAR(&placeholders);
+ array_init(&placeholders);
+ } else {
+ zephir_get_arrval(&placeholders, placeholders_param);
+ }
+ if (!dataTypes_param) {
+ ZEPHIR_INIT_VAR(&dataTypes);
+ array_init(&dataTypes);
+ } else {
+ zephir_get_arrval(&dataTypes, dataTypes_param);
+ }
+
+
+ ZEPHIR_CALL_METHOD(&escapedTable, this_ptr, "escapeidentifier", NULL, 0, table);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&sql);
+ ZEPHIR_CONCAT_SV(&sql, "DELETE FROM ", &escapedTable);
+ if (!(ZEPHIR_IS_EMPTY(&whereCondition))) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZEPHIR_CONCAT_SV(&_0$$3, " WHERE ", &whereCondition);
+ zephir_concat_self(&sql, &_0$$3);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &sql, &placeholders, &dataTypes);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, describeIndexes)
+{
+ zend_string *_11;
+ zend_ulong _10;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_13 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *table_param = NULL, *schema_param = NULL, indexes, index, keyName, indexObjects, name, indexColumns, columns, _0, _1, _2, _3, *_4, _5, *_8, _9, _6$$3, _7$$6, _12$$9, _14$$10;
+ zval table, schema;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+ ZVAL_UNDEF(&indexes);
+ ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&keyName);
+ ZVAL_UNDEF(&indexObjects);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&indexColumns);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_12$$9);
+ ZVAL_UNDEF(&_14$$10);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
+ }
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
+ }
+
+
+ ZEPHIR_INIT_VAR(&indexes);
+ array_init(&indexes);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_2, &_1, "describeindexes", NULL, 0, &table, &schema);
+ zephir_check_call_status();
+ ZVAL_LONG(&_3, 3);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3);
+ zephir_check_call_status();
+ zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/AbstractAdapter.zep", 348);
+ if (Z_TYPE_P(&_0) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4)
+ {
+ ZEPHIR_INIT_NVAR(&index);
+ ZVAL_COPY(&index, _4);
+ zephir_array_fetch_long(&keyName, &index, 2, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 336);
+ if (!(zephir_array_isset(&indexes, &keyName))) {
+ ZEPHIR_INIT_NVAR(&columns);
+ array_init(&columns);
+ } else {
+ ZEPHIR_OBS_NVAR(&columns);
+ zephir_array_fetch(&columns, &indexes, &keyName, PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 341);
}
-vv315:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_SCALAR;
- return 0;
- }
-vv316:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv317;
+ zephir_array_fetch_long(&_6$$3, &index, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 344);
+ zephir_array_append(&columns, &_6$$3, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 344);
+ zephir_array_update_zval(&indexes, &keyName, &columns, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5, &_0, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5)) {
+ break;
}
-vv317:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_SWITCH;
- return 0;
+ ZEPHIR_CALL_METHOD(&index, &_0, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&keyName);
+ zephir_array_fetch_long(&keyName, &index, 2, PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 336);
+ if (!(zephir_array_isset(&indexes, &keyName))) {
+ ZEPHIR_INIT_NVAR(&columns);
+ array_init(&columns);
+ } else {
+ ZEPHIR_OBS_NVAR(&columns);
+ zephir_array_fetch(&columns, &indexes, &keyName, PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 341);
+ }
+ zephir_array_fetch_long(&_7$$6, &index, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 344);
+ zephir_array_append(&columns, &_7$$6, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 344);
+ zephir_array_update_zval(&indexes, &keyName, &columns, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0);
+ zephir_check_call_status();
}
-vv318:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 't': goto vv341;
- default: goto vv81;
- }
-vv319:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv343;
- default: goto vv54;
- }
-vv320:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv344;
- default: goto vv54;
+ }
+ ZEPHIR_INIT_NVAR(&index);
+ ZEPHIR_INIT_VAR(&indexObjects);
+ array_init(&indexObjects);
+ zephir_is_iterable(&indexes, 0, "phalcon/Db/Adapter/AbstractAdapter.zep", 357);
+ if (Z_TYPE_P(&indexes) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&indexes), _10, _11, _8)
+ {
+ ZEPHIR_INIT_NVAR(&name);
+ if (_11 != NULL) {
+ ZVAL_STR_COPY(&name, _11);
+ } else {
+ ZVAL_LONG(&name, _10);
}
-vv321:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv322;
+ ZEPHIR_INIT_NVAR(&indexColumns);
+ ZVAL_COPY(&indexColumns, _8);
+ ZEPHIR_INIT_NVAR(&_12$$9);
+ object_init_ex(&_12$$9, phalcon_db_index_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_12$$9, "__construct", &_13, 32, &name, &indexColumns);
+ zephir_check_call_status();
+ zephir_array_update_zval(&indexObjects, &name, &_12$$9, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &indexes, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_9, &indexes, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_9)) {
+ break;
}
-vv322:
- {
- token->opcode = PHVOLT_T_DEFAULT;
- token->value = estrndup(start, VVCURSOR - start);
- token->len = VVCURSOR - start;
- return 0;
+ ZEPHIR_CALL_METHOD(&name, &indexes, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&indexColumns, &indexes, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_14$$10);
+ object_init_ex(&_14$$10, phalcon_db_index_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_14$$10, "__construct", &_13, 32, &name, &indexColumns);
+ zephir_check_call_status();
+ zephir_array_update_zval(&indexObjects, &name, &_14$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &indexes, "next", NULL, 0);
+ zephir_check_call_status();
}
-vv323:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv324;
+ }
+ ZEPHIR_INIT_NVAR(&indexColumns);
+ ZEPHIR_INIT_NVAR(&name);
+ RETURN_CCTOR(&indexObjects);
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, describeReferences)
+{
+ zval _12$$3, _19$$6, _25$$9, _29$$10;
+ zend_string *_23;
+ zend_ulong _22;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_27 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *table_param = NULL, *schema_param = NULL, references, reference, arrayReference, constraintName, referenceObjects, name, referencedSchema, referencedTable, columns, referencedColumns, _0, _1, _2, _3, *_4, _5, *_20, _21, _6$$5, _7$$5, _8$$5, _9$$5, _10$$3, _11$$3, _13$$8, _14$$8, _15$$8, _16$$8, _17$$6, _18$$6, _24$$9, _26$$9, _28$$10, _30$$10;
+ zval table, schema;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+ ZVAL_UNDEF(&references);
+ ZVAL_UNDEF(&reference);
+ ZVAL_UNDEF(&arrayReference);
+ ZVAL_UNDEF(&constraintName);
+ ZVAL_UNDEF(&referenceObjects);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&referencedSchema);
+ ZVAL_UNDEF(&referencedTable);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&referencedColumns);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_21);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$3);
+ ZVAL_UNDEF(&_11$$3);
+ ZVAL_UNDEF(&_13$$8);
+ ZVAL_UNDEF(&_14$$8);
+ ZVAL_UNDEF(&_15$$8);
+ ZVAL_UNDEF(&_16$$8);
+ ZVAL_UNDEF(&_17$$6);
+ ZVAL_UNDEF(&_18$$6);
+ ZVAL_UNDEF(&_24$$9);
+ ZVAL_UNDEF(&_26$$9);
+ ZVAL_UNDEF(&_28$$10);
+ ZVAL_UNDEF(&_30$$10);
+ ZVAL_UNDEF(&_12$$3);
+ ZVAL_UNDEF(&_19$$6);
+ ZVAL_UNDEF(&_25$$9);
+ ZVAL_UNDEF(&_29$$10);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
+ }
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(schema_param) != IS_STRING && Z_TYPE_P(schema_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schema' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schema_param) == IS_STRING)) {
+ zephir_get_strval(&schema, schema_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schema);
+ }
+ }
+
+
+ ZEPHIR_INIT_VAR(&references);
+ array_init(&references);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_2, &_1, "describereferences", NULL, 0, &table, &schema);
+ zephir_check_call_status();
+ ZVAL_LONG(&_3, 3);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3);
+ zephir_check_call_status();
+ zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/AbstractAdapter.zep", 403);
+ if (Z_TYPE_P(&_0) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4)
+ {
+ ZEPHIR_INIT_NVAR(&reference);
+ ZVAL_COPY(&reference, _4);
+ zephir_array_fetch_long(&constraintName, &reference, 2, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 378);
+ if (!(zephir_array_isset(&references, &constraintName))) {
+ ZEPHIR_OBS_NVAR(&referencedSchema);
+ zephir_array_fetch_long(&referencedSchema, &reference, 3, PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 381);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_long(&referencedTable, &reference, 4, PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 382);
+ ZEPHIR_INIT_NVAR(&columns);
+ array_init(&columns);
+ ZEPHIR_INIT_NVAR(&referencedColumns);
+ array_init(&referencedColumns);
+ } else {
+ zephir_array_fetch(&_6$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 386);
+ ZEPHIR_OBS_NVAR(&referencedSchema);
+ zephir_array_fetch_string(&referencedSchema, &_6$$5, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 386);
+ zephir_array_fetch(&_7$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 387);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_string(&referencedTable, &_7$$5, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 387);
+ zephir_array_fetch(&_8$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 388);
+ ZEPHIR_OBS_NVAR(&columns);
+ zephir_array_fetch_string(&columns, &_8$$5, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 388);
+ zephir_array_fetch(&_9$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 389);
+ ZEPHIR_OBS_NVAR(&referencedColumns);
+ zephir_array_fetch_string(&referencedColumns, &_9$$5, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 389);
}
-vv324:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_DEFINED;
- return 0;
- }
-vv325:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv326;
+ zephir_array_fetch_long(&_10$$3, &reference, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 392);
+ zephir_array_append(&columns, &_10$$3, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 392);
+ zephir_array_fetch_long(&_11$$3, &reference, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 393);
+ zephir_array_append(&referencedColumns, &_11$$3, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 393);
+ ZEPHIR_INIT_NVAR(&_12$$3);
+ zephir_create_array(&_12$$3, 4, 0);
+ zephir_array_update_string(&_12$$3, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_12$$3, SL("referencedTable"), &referencedTable, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_12$$3, SL("columns"), &columns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_12$$3, SL("referencedColumns"), &referencedColumns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_zval(&references, &constraintName, &_12$$3, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5, &_0, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5)) {
+ break;
}
-vv326:
- {
- token->opcode = PHVOLT_T_ELSEFOR;
- return 0;
+ ZEPHIR_CALL_METHOD(&reference, &_0, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&constraintName);
+ zephir_array_fetch_long(&constraintName, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 378);
+ if (!(zephir_array_isset(&references, &constraintName))) {
+ ZEPHIR_OBS_NVAR(&referencedSchema);
+ zephir_array_fetch_long(&referencedSchema, &reference, 3, PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 381);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_long(&referencedTable, &reference, 4, PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 382);
+ ZEPHIR_INIT_NVAR(&columns);
+ array_init(&columns);
+ ZEPHIR_INIT_NVAR(&referencedColumns);
+ array_init(&referencedColumns);
+ } else {
+ zephir_array_fetch(&_13$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 386);
+ ZEPHIR_OBS_NVAR(&referencedSchema);
+ zephir_array_fetch_string(&referencedSchema, &_13$$8, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 386);
+ zephir_array_fetch(&_14$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 387);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_string(&referencedTable, &_14$$8, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 387);
+ zephir_array_fetch(&_15$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 388);
+ ZEPHIR_OBS_NVAR(&columns);
+ zephir_array_fetch_string(&columns, &_15$$8, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 388);
+ zephir_array_fetch(&_16$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 389);
+ ZEPHIR_OBS_NVAR(&referencedColumns);
+ zephir_array_fetch_string(&referencedColumns, &_16$$8, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 389);
+ }
+ zephir_array_fetch_long(&_17$$6, &reference, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 392);
+ zephir_array_append(&columns, &_17$$6, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 392);
+ zephir_array_fetch_long(&_18$$6, &reference, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 393);
+ zephir_array_append(&referencedColumns, &_18$$6, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 393);
+ ZEPHIR_INIT_NVAR(&_19$$6);
+ zephir_create_array(&_19$$6, 4, 0);
+ zephir_array_update_string(&_19$$6, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_19$$6, SL("referencedTable"), &referencedTable, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_19$$6, SL("columns"), &columns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_19$$6, SL("referencedColumns"), &referencedColumns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_zval(&references, &constraintName, &_19$$6, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0);
+ zephir_check_call_status();
}
-vv327:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv346;
- default: goto vv54;
- }
-vv328:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'K':
- case 'k': goto vv347;
- default: goto vv54;
+ }
+ ZEPHIR_INIT_NVAR(&reference);
+ ZEPHIR_INIT_VAR(&referenceObjects);
+ array_init(&referenceObjects);
+ zephir_is_iterable(&references, 0, "phalcon/Db/Adapter/AbstractAdapter.zep", 417);
+ if (Z_TYPE_P(&references) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&references), _22, _23, _20)
+ {
+ ZEPHIR_INIT_NVAR(&name);
+ if (_23 != NULL) {
+ ZVAL_STR_COPY(&name, _23);
+ } else {
+ ZVAL_LONG(&name, _22);
}
-vv329:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv349;
- default: goto vv54;
+ ZEPHIR_INIT_NVAR(&arrayReference);
+ ZVAL_COPY(&arrayReference, _20);
+ ZEPHIR_INIT_NVAR(&_24$$9);
+ object_init_ex(&_24$$9, phalcon_db_reference_ce);
+ ZEPHIR_INIT_NVAR(&_25$$9);
+ zephir_create_array(&_25$$9, 4, 0);
+ ZEPHIR_OBS_NVAR(&_26$$9);
+ zephir_array_fetch_string(&_26$$9, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 409);
+ zephir_array_update_string(&_25$$9, SL("referencedSchema"), &_26$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_26$$9);
+ zephir_array_fetch_string(&_26$$9, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 410);
+ zephir_array_update_string(&_25$$9, SL("referencedTable"), &_26$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_26$$9);
+ zephir_array_fetch_string(&_26$$9, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 411);
+ zephir_array_update_string(&_25$$9, SL("columns"), &_26$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_26$$9);
+ zephir_array_fetch_string(&_26$$9, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 413);
+ zephir_array_update_string(&_25$$9, SL("referencedColumns"), &_26$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &_24$$9, "__construct", &_27, 33, &name, &_25$$9);
+ zephir_check_call_status();
+ zephir_array_update_zval(&referenceObjects, &name, &_24$$9, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &references, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_21, &references, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_21)) {
+ break;
}
-vv330:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv331;
+ ZEPHIR_CALL_METHOD(&name, &references, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&arrayReference, &references, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_28$$10);
+ object_init_ex(&_28$$10, phalcon_db_reference_ce);
+ ZEPHIR_INIT_NVAR(&_29$$10);
+ zephir_create_array(&_29$$10, 4, 0);
+ ZEPHIR_OBS_NVAR(&_30$$10);
+ zephir_array_fetch_string(&_30$$10, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 409);
+ zephir_array_update_string(&_29$$10, SL("referencedSchema"), &_30$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_30$$10);
+ zephir_array_fetch_string(&_30$$10, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 410);
+ zephir_array_update_string(&_29$$10, SL("referencedTable"), &_30$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_30$$10);
+ zephir_array_fetch_string(&_30$$10, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 411);
+ zephir_array_update_string(&_29$$10, SL("columns"), &_30$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_30$$10);
+ zephir_array_fetch_string(&_30$$10, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 413);
+ zephir_array_update_string(&_29$$10, SL("referencedColumns"), &_30$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &_28$$10, "__construct", &_27, 33, &name, &_29$$10);
+ zephir_check_call_status();
+ zephir_array_update_zval(&referenceObjects, &name, &_28$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&arrayReference);
+ ZEPHIR_INIT_NVAR(&name);
+ RETURN_CCTOR(&referenceObjects);
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, dropColumn)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *columnName_param = NULL, _0, _1;
+ zval tableName, schemaName, columnName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&columnName);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_STR(columnName)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &columnName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ zephir_get_strval(&columnName, columnName_param);
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "dropcolumn", NULL, 0, &tableName, &schemaName, &columnName);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, dropForeignKey)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *referenceName_param = NULL, _0, _1;
+ zval tableName, schemaName, referenceName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&referenceName);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_STR(referenceName)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &referenceName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(referenceName_param) != IS_STRING && Z_TYPE_P(referenceName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(referenceName_param) == IS_STRING)) {
+ zephir_get_strval(&referenceName, referenceName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&referenceName);
+ }
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "dropforeignkey", NULL, 0, &tableName, &schemaName, &referenceName);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, dropIndex)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *indexName, indexName_sub, _0, _1;
+ zval tableName, schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&indexName_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_ZVAL(indexName)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &indexName);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "dropindex", NULL, 0, &tableName, &schemaName, indexName);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, dropPrimaryKey)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, _0, _1;
+ zval tableName, schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &tableName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "dropprimarykey", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, dropTable)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool ifExists;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, _0, _1, _2;
+ zval tableName, schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
+ Z_PARAM_BOOL(ifExists)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &tableName_param, &schemaName_param, &ifExists_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ }
+ if (!ifExists_param) {
+ ifExists = 1;
+ } else {
+ ifExists = zephir_get_boolval(ifExists_param);
+ }
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ if (ifExists) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
+ }
+ ZEPHIR_CALL_METHOD(&_1, &_0, "droptable", NULL, 0, &tableName, &schemaName, &_2);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, dropView)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool ifExists;
+ zval *viewName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, _0, _1, _2;
+ zval viewName, schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&viewName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(viewName)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
+ Z_PARAM_BOOL(ifExists)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &viewName_param, &schemaName_param, &ifExists_param);
+ if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) {
+ zephir_get_strval(&viewName, viewName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&viewName);
+ }
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ }
+ if (!ifExists_param) {
+ ifExists = 1;
+ } else {
+ ifExists = zephir_get_boolval(ifExists_param);
+ }
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ if (ifExists) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
+ }
+ ZEPHIR_CALL_METHOD(&_1, &_0, "dropview", NULL, 0, &viewName, &schemaName, &_2);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, escapeIdentifier)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *identifier, identifier_sub, _0$$3, _1$$3, _2$$3, _3$$3, _4$$3, _5$$3, _6;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&identifier_sub);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(identifier)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &identifier);
+
+
+ if (Z_TYPE_P(identifier) == IS_ARRAY) {
+ zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ zephir_array_fetch_long(&_2$$3, identifier, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 522);
+ ZEPHIR_CALL_METHOD(&_1$$3, &_0$$3, "escape", NULL, 0, &_2$$3);
+ zephir_check_call_status();
+ zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ zephir_array_fetch_long(&_5$$3, identifier, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 522);
+ ZEPHIR_CALL_METHOD(&_4$$3, &_3$$3, "escape", NULL, 0, &_5$$3);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VSV(return_value, &_1$$3, ".", &_4$$3);
+ RETURN_MM();
+ }
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_6, "escape", NULL, 0, identifier);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, fetchAll)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval bindParams, bindTypes;
+ zend_long fetchMode, ZEPHIR_LAST_CALL_STATUS;
+ zval *sqlQuery_param = NULL, *fetchMode_param = NULL, *bindParams_param = NULL, *bindTypes_param = NULL, result, _1, _0$$4;
+ zval sqlQuery;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&sqlQuery);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_0$$4);
+ ZVAL_UNDEF(&bindParams);
+ ZVAL_UNDEF(&bindTypes);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STR(sqlQuery)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(fetchMode)
+ Z_PARAM_ARRAY(bindParams)
+ Z_PARAM_ARRAY(bindTypes)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 3, &sqlQuery_param, &fetchMode_param, &bindParams_param, &bindTypes_param);
+ zephir_get_strval(&sqlQuery, sqlQuery_param);
+ if (!fetchMode_param) {
+ fetchMode = 2;
+ } else {
+ fetchMode = zephir_get_intval(fetchMode_param);
+ }
+ if (!bindParams_param) {
+ ZEPHIR_INIT_VAR(&bindParams);
+ array_init(&bindParams);
+ } else {
+ zephir_get_arrval(&bindParams, bindParams_param);
+ }
+ if (!bindTypes_param) {
+ ZEPHIR_INIT_VAR(&bindTypes);
+ array_init(&bindTypes);
+ } else {
+ zephir_get_arrval(&bindTypes, bindTypes_param);
+ }
+
+
+ ZEPHIR_CALL_METHOD(&result, this_ptr, "query", NULL, 0, &sqlQuery, &bindParams, &bindTypes);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&result) != IS_OBJECT) {
+ array_init(return_value);
+ RETURN_MM();
+ }
+ if (UNEXPECTED(fetchMode == 7)) {
+ ZVAL_LONG(&_0$$4, 7);
+ ZEPHIR_RETURN_CALL_METHOD(&result, "fetchall", NULL, 0, &_0$$4);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZVAL_LONG(&_1, fetchMode);
+ ZEPHIR_CALL_METHOD(NULL, &result, "setfetchmode", NULL, 0, &_1);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(&result, "fetchall", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, fetchColumn)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval placeholders;
+ zval *sqlQuery_param = NULL, *placeholders_param = NULL, *column = NULL, column_sub, row, columnValue, _0;
+ zval sqlQuery;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&sqlQuery);
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&row);
+ ZVAL_UNDEF(&columnValue);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&placeholders);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(sqlQuery)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(placeholders)
+ Z_PARAM_ZVAL(column)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &sqlQuery_param, &placeholders_param, &column);
+ zephir_get_strval(&sqlQuery, sqlQuery_param);
+ if (!placeholders_param) {
+ ZEPHIR_INIT_VAR(&placeholders);
+ array_init(&placeholders);
+ } else {
+ zephir_get_arrval(&placeholders, placeholders_param);
+ }
+ if (!column) {
+ column = &column_sub;
+ ZEPHIR_INIT_VAR(column);
+ ZVAL_LONG(column, 0);
+ }
+
+
+ ZVAL_LONG(&_0, 4);
+ ZEPHIR_CALL_METHOD(&row, this_ptr, "fetchone", NULL, 0, &sqlQuery, &_0, &placeholders);
+ zephir_check_call_status();
+ if (!(zephir_array_isset_fetch(&columnValue, &row, column, 1))) {
+ RETURN_MM_BOOL(0);
+ }
+ RETURN_CTOR(&columnValue);
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, fetchOne)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval bindParams, bindTypes;
+ zval *sqlQuery_param = NULL, *fetchMode = NULL, fetchMode_sub, *bindParams_param = NULL, *bindTypes_param = NULL, result;
+ zval sqlQuery;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&sqlQuery);
+ ZVAL_UNDEF(&fetchMode_sub);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&bindParams);
+ ZVAL_UNDEF(&bindTypes);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STR(sqlQuery)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL(fetchMode)
+ Z_PARAM_ARRAY(bindParams)
+ Z_PARAM_ARRAY(bindTypes)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 3, &sqlQuery_param, &fetchMode, &bindParams_param, &bindTypes_param);
+ if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) {
+ zephir_get_strval(&sqlQuery, sqlQuery_param);
+ } else {
+ ZEPHIR_INIT_VAR(&sqlQuery);
+ }
+ if (!fetchMode) {
+ fetchMode = &fetchMode_sub;
+ ZEPHIR_INIT_VAR(fetchMode);
+ ZVAL_LONG(fetchMode, 2);
+ }
+ if (!bindParams_param) {
+ ZEPHIR_INIT_VAR(&bindParams);
+ array_init(&bindParams);
+ } else {
+ zephir_get_arrval(&bindParams, bindParams_param);
+ }
+ if (!bindTypes_param) {
+ ZEPHIR_INIT_VAR(&bindTypes);
+ array_init(&bindTypes);
+ } else {
+ zephir_get_arrval(&bindTypes, bindTypes_param);
+ }
+
+
+ ZEPHIR_CALL_METHOD(&result, this_ptr, "query", NULL, 0, &sqlQuery, &bindParams, &bindTypes);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&result) != IS_OBJECT) {
+ array_init(return_value);
+ RETURN_MM();
+ }
+ if (Z_TYPE_P(fetchMode) != IS_NULL) {
+ ZEPHIR_CALL_METHOD(NULL, &result, "setfetchmode", NULL, 0, fetchMode);
+ zephir_check_call_status();
+ }
+ ZEPHIR_RETURN_CALL_METHOD(&result, "fetch", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, forUpdate)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *sqlQuery_param = NULL, _0;
+ zval sqlQuery;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&sqlQuery);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(sqlQuery)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &sqlQuery_param);
+ if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) {
+ zephir_get_strval(&sqlQuery, sqlQuery_param);
+ } else {
+ ZEPHIR_INIT_VAR(&sqlQuery);
+ }
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "forupdate", NULL, 0, &sqlQuery);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getColumnDefinition)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *column, column_sub, _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &column);
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "getcolumndefinition", NULL, 0, column);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getColumnList)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *columnList, columnList_sub, _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&columnList_sub);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(columnList)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &columnList);
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "getcolumnlist", NULL, 0, columnList);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getConnectionId)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "connectionId");
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getDefaultIdValue)
+{
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+
+
+ ZEPHIR_MM_GROW();
+
+ object_init_ex(return_value, phalcon_db_rawvalue_ce);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "null");
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getDefaultValue)
+{
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+
+
+ ZEPHIR_MM_GROW();
+
+ object_init_ex(return_value, phalcon_db_rawvalue_ce);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "DEFAULT");
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getDescriptor)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "descriptor");
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getDialect)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "dialect");
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getEventsManager)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "eventsManager");
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getNestedTransactionSavepointName)
+{
+ zval _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("transactionLevel"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CONCAT_SV(return_value, "PHALCON_SAVEPOINT_", &_0);
+ return;
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getRealSQLStatement)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "realSqlStatement");
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getSQLBindTypes)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "sqlBindTypes");
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getSQLStatement)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "sqlStatement");
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, insert)
+{
+ zend_bool _6$$4, _11$$12;
+ zend_string *_5;
+ zend_ulong _4;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval values;
+ zval *table_param = NULL, *values_param = NULL, *fields = NULL, fields_sub, *dataTypes = NULL, dataTypes_sub, __$null, bindDataTypes, bindType, escapedTable, escapedFields, field, insertSql, insertValues, joinedValues, placeholders, position, tableName, value, *_2, _3, _16, _17, _0$$3, _9$$8, _10$$9, _14$$16, _15$$17, *_18$$22, _19$$22, _22$$22, _20$$23, _21$$24;
+ zval table, _1$$3, _7$$5, _8$$7, _12$$13, _13$$15;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$7);
+ ZVAL_UNDEF(&_12$$13);
+ ZVAL_UNDEF(&_13$$15);
+ ZVAL_UNDEF(&fields_sub);
+ ZVAL_UNDEF(&dataTypes_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&bindDataTypes);
+ ZVAL_UNDEF(&bindType);
+ ZVAL_UNDEF(&escapedTable);
+ ZVAL_UNDEF(&escapedFields);
+ ZVAL_UNDEF(&field);
+ ZVAL_UNDEF(&insertSql);
+ ZVAL_UNDEF(&insertValues);
+ ZVAL_UNDEF(&joinedValues);
+ ZVAL_UNDEF(&placeholders);
+ ZVAL_UNDEF(&position);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_16);
+ ZVAL_UNDEF(&_17);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_9$$8);
+ ZVAL_UNDEF(&_10$$9);
+ ZVAL_UNDEF(&_14$$16);
+ ZVAL_UNDEF(&_15$$17);
+ ZVAL_UNDEF(&_19$$22);
+ ZVAL_UNDEF(&_22$$22);
+ ZVAL_UNDEF(&_20$$23);
+ ZVAL_UNDEF(&_21$$24);
+ ZVAL_UNDEF(&values);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 4)
+ Z_PARAM_STR(table)
+ Z_PARAM_ARRAY(values)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(fields)
+ Z_PARAM_ZVAL_OR_NULL(dataTypes)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 2, &table_param, &values_param, &fields, &dataTypes);
+ zephir_get_strval(&table, table_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&values, values_param);
+ if (!fields) {
+ fields = &fields_sub;
+ fields = &__$null;
+ }
+ if (!dataTypes) {
+ dataTypes = &dataTypes_sub;
+ dataTypes = &__$null;
+ }
+
+
+ if (UNEXPECTED(!(zephir_fast_count_int(&values)))) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ object_init_ex(&_0$$3, phalcon_db_exception_ce);
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZEPHIR_CONCAT_SVS(&_1$$3, "Unable to insert into ", &table, " without data");
+ ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 8, &_1$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_0$$3, "phalcon/Db/Adapter/AbstractAdapter.zep", 802);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_INIT_VAR(&placeholders);
+ array_init(&placeholders);
+ ZEPHIR_INIT_VAR(&insertValues);
+ array_init(&insertValues);
+ ZEPHIR_INIT_VAR(&bindDataTypes);
+ array_init(&bindDataTypes);
+ zephir_is_iterable(&values, 0, "phalcon/Db/Adapter/AbstractAdapter.zep", 840);
+ if (Z_TYPE_P(&values) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&values), _4, _5, _2)
+ {
+ ZEPHIR_INIT_NVAR(&position);
+ if (_5 != NULL) {
+ ZVAL_STR_COPY(&position, _5);
+ } else {
+ ZVAL_LONG(&position, _4);
}
-vv331:
- {
- token->opcode = PHVOLT_T_ENDCALL;
- return 0;
- }
-vv332:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'O':
- case 'o': goto vv351;
- default: goto vv54;
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _2);
+ _6$$4 = Z_TYPE_P(&value) == IS_OBJECT;
+ if (_6$$4) {
+ _6$$4 = zephir_instance_of_ev(&value, phalcon_db_rawvalue_ce);
}
-vv333:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'C':
- case 'c': goto vv353;
- default: goto vv54;
+ if (_6$$4) {
+ zephir_cast_to_string(&_7$$5, &value);
+ zephir_array_append(&placeholders, &_7$$5, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 815);
+ } else {
+ if (Z_TYPE_P(&value) == IS_OBJECT) {
+ zephir_cast_to_string(&_8$$7, &value);
+ ZEPHIR_CPY_WRT(&value, &_8$$7);
+ }
+ if (Z_TYPE_P(&value) == IS_NULL) {
+ ZEPHIR_INIT_NVAR(&_9$$8);
+ ZVAL_STRING(&_9$$8, "null");
+ zephir_array_append(&placeholders, &_9$$8, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 822);
+ } else {
+ ZEPHIR_INIT_NVAR(&_10$$9);
+ ZVAL_STRING(&_10$$9, "?");
+ zephir_array_append(&placeholders, &_10$$9, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 824);
+ zephir_array_append(&insertValues, &value, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 825);
+ if (Z_TYPE_P(dataTypes) == IS_ARRAY) {
+ ZEPHIR_OBS_NVAR(&bindType);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&bindType, dataTypes, &position, 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Incomplete number of bind types", "phalcon/Db/Adapter/AbstractAdapter.zep", 831);
+ return;
+ }
+ zephir_array_append(&bindDataTypes, &bindType, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 834);
+ }
+ }
}
-vv334:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv335;
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ 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;
}
-vv335:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_EXTENDS;
- return 0;
+ ZEPHIR_CALL_METHOD(&position, &values, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &values, "current", NULL, 0);
+ zephir_check_call_status();
+ _11$$12 = Z_TYPE_P(&value) == IS_OBJECT;
+ if (_11$$12) {
+ _11$$12 = zephir_instance_of_ev(&value, phalcon_db_rawvalue_ce);
+ }
+ if (_11$$12) {
+ zephir_cast_to_string(&_12$$13, &value);
+ zephir_array_append(&placeholders, &_12$$13, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 815);
+ } else {
+ if (Z_TYPE_P(&value) == IS_OBJECT) {
+ zephir_cast_to_string(&_13$$15, &value);
+ ZEPHIR_CPY_WRT(&value, &_13$$15);
+ }
+ if (Z_TYPE_P(&value) == IS_NULL) {
+ ZEPHIR_INIT_NVAR(&_14$$16);
+ ZVAL_STRING(&_14$$16, "null");
+ zephir_array_append(&placeholders, &_14$$16, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 822);
+ } else {
+ ZEPHIR_INIT_NVAR(&_15$$17);
+ ZVAL_STRING(&_15$$17, "?");
+ zephir_array_append(&placeholders, &_15$$17, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 824);
+ zephir_array_append(&insertValues, &value, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 825);
+ if (Z_TYPE_P(dataTypes) == IS_ARRAY) {
+ ZEPHIR_OBS_NVAR(&bindType);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&bindType, dataTypes, &position, 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Incomplete number of bind types", "phalcon/Db/Adapter/AbstractAdapter.zep", 831);
+ return;
+ }
+ zephir_array_append(&bindDataTypes, &bindType, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 834);
+ }
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &values, "next", NULL, 0);
+ zephir_check_call_status();
}
-vv336:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv337;
- }
-vv337:
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&position);
+ ZEPHIR_INIT_VAR(&_16);
+ ZVAL_STRING(&_16, ".");
+ ZEPHIR_INIT_VAR(&_17);
+ zephir_fast_strpos(&_17, &table, &_16, 0 );
+ if (ZEPHIR_GT_LONG(&_17, 0)) {
+ ZEPHIR_INIT_VAR(&tableName);
+ zephir_fast_explode_str(&tableName, SL("."), &table, LONG_MAX);
+ } else {
+ ZEPHIR_CPY_WRT(&tableName, &table);
+ }
+ ZEPHIR_CALL_METHOD(&escapedTable, this_ptr, "escapeidentifier", NULL, 0, &tableName);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&joinedValues);
+ zephir_fast_join_str(&joinedValues, SL(", "), &placeholders);
+ ZEPHIR_INIT_VAR(&insertSql);
+ if (Z_TYPE_P(fields) == IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&escapedFields);
+ array_init(&escapedFields);
+ zephir_is_iterable(fields, 0, "phalcon/Db/Adapter/AbstractAdapter.zep", 860);
+ if (Z_TYPE_P(fields) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(fields), _18$$22)
{
- s->statement_position++;
- token->opcode = PHVOLT_T_INCLUDE;
- return 0;
+ ZEPHIR_INIT_NVAR(&field);
+ ZVAL_COPY(&field, _18$$22);
+ ZEPHIR_CALL_METHOD(&_20$$23, this_ptr, "escapeidentifier", NULL, 0, &field);
+ zephir_check_call_status();
+ zephir_array_append(&escapedFields, &_20$$23, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 857);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, fields, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_19$$22, fields, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_19$$22)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&field, fields, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_21$$24, this_ptr, "escapeidentifier", NULL, 0, &field);
+ zephir_check_call_status();
+ zephir_array_append(&escapedFields, &_21$$24, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 857);
+ ZEPHIR_CALL_METHOD(NULL, fields, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
-vv338:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv354;
- default: goto vv54;
+ ZEPHIR_INIT_NVAR(&field);
+ ZEPHIR_INIT_VAR(&_22$$22);
+ zephir_fast_join_str(&_22$$22, SL(", "), &escapedFields);
+ ZEPHIR_CONCAT_SVSVSVS(&insertSql, "INSERT INTO ", &escapedTable, " (", &_22$$22, ") VALUES (", &joinedValues, ")");
+ } else {
+ ZEPHIR_CONCAT_SVSVS(&insertSql, "INSERT INTO ", &escapedTable, " VALUES (", &joinedValues, ")");
+ }
+ if (!(zephir_fast_count_int(&bindDataTypes))) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &insertSql, &insertValues);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &insertSql, &insertValues, &bindDataTypes);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, insertAsDict)
+{
+ zend_string *_4;
+ zend_ulong _3;
+ zend_bool _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *table_param = NULL, *data, data_sub, *dataTypes = NULL, dataTypes_sub, __$null, values, fields, field, value, *_1, _2;
+ zval table;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&dataTypes_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&values);
+ ZVAL_UNDEF(&fields);
+ ZVAL_UNDEF(&field);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(table)
+ Z_PARAM_ZVAL(data)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(dataTypes)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 1, &table_param, &data, &dataTypes);
+ zephir_get_strval(&table, table_param);
+ if (!dataTypes) {
+ dataTypes = &dataTypes_sub;
+ dataTypes = &__$null;
+ }
+
+
+ ZEPHIR_INIT_VAR(&values);
+ array_init(&values);
+ ZEPHIR_INIT_VAR(&fields);
+ array_init(&fields);
+ _0 = Z_TYPE_P(data) != IS_ARRAY;
+ if (!(_0)) {
+ _0 = ZEPHIR_IS_EMPTY(data);
+ }
+ if (_0) {
+ RETURN_MM_BOOL(0);
+ }
+ zephir_is_iterable(data, 0, "phalcon/Db/Adapter/AbstractAdapter.zep", 906);
+ if (Z_TYPE_P(data) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(data), _3, _4, _1)
+ {
+ ZEPHIR_INIT_NVAR(&field);
+ if (_4 != NULL) {
+ ZVAL_STR_COPY(&field, _4);
+ } else {
+ ZVAL_LONG(&field, _3);
}
-vv339:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv340;
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _1);
+ zephir_array_append(&fields, &field, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 902);
+ zephir_array_append(&values, &value, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 903);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, data, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, data, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
}
-vv340:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_NUMERIC;
- return 0;
- }
-vv341:
- ++VVCURSOR;
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_NOTEQUALS;
- return 0;
+ ZEPHIR_CALL_METHOD(&field, data, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, data, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_append(&fields, &field, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 902);
+ zephir_array_append(&values, &value, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 903);
+ ZEPHIR_CALL_METHOD(NULL, data, "next", NULL, 0);
+ zephir_check_call_status();
}
-vv343:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'P':
- case 'p': goto vv356;
- default: goto vv54;
- }
-vv344:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv345;
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&field);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "insert", NULL, 0, &table, &values, &fields, dataTypes);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, isNestedTransactionsWithSavepoints)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "transactionsWithSavepoints");
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, limit)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long number, ZEPHIR_LAST_CALL_STATUS;
+ zval *sqlQuery_param = NULL, *number_param = NULL, _0, _1;
+ zval sqlQuery;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&sqlQuery);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(sqlQuery)
+ Z_PARAM_LONG(number)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &sqlQuery_param, &number_param);
+ if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) {
+ zephir_get_strval(&sqlQuery, sqlQuery_param);
+ } else {
+ ZEPHIR_INIT_VAR(&sqlQuery);
+ }
+ number = zephir_get_intval(number_param);
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_1, number);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "limit", NULL, 0, &sqlQuery, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, listTables)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *schemaName_param = NULL, tables, table, allTables, _0, _1, _2, *_3, _4, _5$$3, _6$$4;
+ zval schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&tables);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&allTables);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &schemaName_param);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ }
+
+
+ ZEPHIR_INIT_VAR(&allTables);
+ array_init(&allTables);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "listtables", NULL, 0, &schemaName);
+ zephir_check_call_status();
+ ZVAL_LONG(&_2, 3);
+ ZEPHIR_CALL_METHOD(&tables, this_ptr, "fetchall", NULL, 0, &_1, &_2);
+ zephir_check_call_status();
+ zephir_is_iterable(&tables, 0, "phalcon/Db/Adapter/AbstractAdapter.zep", 953);
+ if (Z_TYPE_P(&tables) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&tables), _3)
+ {
+ ZEPHIR_INIT_NVAR(&table);
+ ZVAL_COPY(&table, _3);
+ zephir_array_fetch_long(&_5$$3, &table, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 950);
+ zephir_array_append(&allTables, &_5$$3, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 950);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &tables, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_4, &tables, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_4)) {
+ break;
}
-vv345:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_CONTINUE;
- return 0;
+ ZEPHIR_CALL_METHOD(&table, &tables, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_fetch_long(&_6$$4, &table, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 950);
+ zephir_array_append(&allTables, &_6$$4, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 950);
+ ZEPHIR_CALL_METHOD(NULL, &tables, "next", NULL, 0);
+ zephir_check_call_status();
}
-vv346:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'S':
- case 's': goto vv357;
- default: goto vv54;
+ }
+ ZEPHIR_INIT_NVAR(&table);
+ RETURN_CCTOR(&allTables);
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, listViews)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *schemaName_param = NULL, tables, table, allTables, _0, _1, _2, *_3, _4, _5$$3, _6$$4;
+ zval schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&tables);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&allTables);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &schemaName_param);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ }
+
+
+ ZEPHIR_INIT_VAR(&allTables);
+ array_init(&allTables);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "listviews", NULL, 0, &schemaName);
+ zephir_check_call_status();
+ ZVAL_LONG(&_2, 3);
+ ZEPHIR_CALL_METHOD(&tables, this_ptr, "fetchall", NULL, 0, &_1, &_2);
+ zephir_check_call_status();
+ zephir_is_iterable(&tables, 0, "phalcon/Db/Adapter/AbstractAdapter.zep", 980);
+ if (Z_TYPE_P(&tables) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&tables), _3)
+ {
+ ZEPHIR_INIT_NVAR(&table);
+ ZVAL_COPY(&table, _3);
+ zephir_array_fetch_long(&_5$$3, &table, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 977);
+ zephir_array_append(&allTables, &_5$$3, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 977);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &tables, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_4, &tables, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_4)) {
+ break;
}
-vv347:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv348;
+ ZEPHIR_CALL_METHOD(&table, &tables, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_fetch_long(&_6$$4, &table, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 977);
+ zephir_array_append(&allTables, &_6$$4, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 977);
+ ZEPHIR_CALL_METHOD(NULL, &tables, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&table);
+ RETURN_CCTOR(&allTables);
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, modifyColumn)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, *currentColumn = NULL, currentColumn_sub, __$null, _0, _1;
+ zval tableName, schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(¤tColumn_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 4)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_OBJECT_OF_CLASS_OR_NULL(currentColumn, phalcon_db_columninterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 1, &tableName_param, &schemaName_param, &column, ¤tColumn);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ if (!currentColumn) {
+ currentColumn = ¤tColumn_sub;
+ currentColumn = &__$null;
+ }
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "modifycolumn", NULL, 0, &tableName, &schemaName, column, currentColumn);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, releaseSavepoint)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL, dialect, _0, _1, _2, _3;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&dialect);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&dialect, &_0);
+ ZEPHIR_CALL_METHOD(&_1, &dialect, "supportssavepoints", NULL, 0);
+ zephir_check_call_status();
+ if (UNEXPECTED(!zephir_is_true(&_1))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Savepoints are not supported by this database adapter", "phalcon/Db/Adapter/AbstractAdapter.zep", 1010);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&_2, &dialect, "supportsreleasesavepoints", NULL, 0);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_2))) {
+ RETURN_MM_BOOL(0);
+ }
+ ZEPHIR_CALL_METHOD(&_3, &dialect, "releasesavepoint", NULL, 0, &name);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_3);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, rollbackSavepoint)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL, dialect, _0, _1, _2;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&dialect);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&dialect, &_0);
+ ZEPHIR_CALL_METHOD(&_1, &dialect, "supportssavepoints", NULL, 0);
+ zephir_check_call_status();
+ if (UNEXPECTED(!zephir_is_true(&_1))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Savepoints are not supported by this database adapter", "phalcon/Db/Adapter/AbstractAdapter.zep", 1034);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&_2, &dialect, "rollbacksavepoint", NULL, 0, &name);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, setEventsManager)
+{
+ zval *eventsManager, eventsManager_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&eventsManager_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(eventsManager, phalcon_events_managerinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &eventsManager);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("eventsManager"), eventsManager);
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, setDialect)
+{
+ zval *dialect, dialect_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&dialect_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(dialect, phalcon_db_dialectinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &dialect);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("dialect"), dialect);
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, setNestedTransactionsWithSavepoints)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *nestedTransactionsWithSavepoints_param = NULL, __$true, __$false, _0, _1, _2;
+ zend_bool nestedTransactionsWithSavepoints;
+ zval *this_ptr = getThis();
+
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(nestedTransactionsWithSavepoints)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &nestedTransactionsWithSavepoints_param);
+ nestedTransactionsWithSavepoints = zephir_get_boolval(nestedTransactionsWithSavepoints_param);
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("transactionLevel"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(ZEPHIR_GT_LONG(&_0, 0))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Nested transaction with savepoints behavior cannot be changed while a transaction is open", "phalcon/Db/Adapter/AbstractAdapter.zep", 1066);
+ return;
+ }
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_2, &_1, "supportssavepoints", NULL, 0);
+ zephir_check_call_status();
+ if (UNEXPECTED(!zephir_is_true(&_2))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Savepoints are not supported by this database adapter", "phalcon/Db/Adapter/AbstractAdapter.zep", 1072);
+ return;
+ }
+ if (nestedTransactionsWithSavepoints) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("transactionsWithSavepoints"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("transactionsWithSavepoints"), &__$false);
+ }
+ RETURN_THIS();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, sharedLock)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *sqlQuery_param = NULL, _0;
+ zval sqlQuery;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&sqlQuery);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(sqlQuery)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &sqlQuery_param);
+ if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) {
+ zephir_get_strval(&sqlQuery, sqlQuery_param);
+ } else {
+ ZEPHIR_INIT_VAR(&sqlQuery);
+ }
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "sharedlock", NULL, 0, &sqlQuery);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, supportSequences)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_BOOL(0);
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, tableExists)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, _0, _1, _2, _3, _4;
+ zval tableName, schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &tableName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ }
+
+
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_2, &_1, "tableexists", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ ZVAL_LONG(&_3, 3);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchone", NULL, 0, &_2, &_3);
+ zephir_check_call_status();
+ zephir_array_fetch_long(&_4, &_0, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 1108);
+ RETURN_MM_BOOL(ZEPHIR_GT_LONG(&_4, 0));
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, tableOptions)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, sql, _0, _1, _2, _3;
+ zval tableName, schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &tableName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ zephir_get_strval(&schemaName, schemaName_param);
+ }
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&sql, &_0, "tableoptions", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&sql))) {
+ array_init(return_value);
+ RETURN_MM();
+ }
+ ZVAL_LONG(&_2, 2);
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "fetchall", NULL, 0, &sql, &_2);
+ zephir_check_call_status();
+ zephir_array_fetch_long(&_3, &_1, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 1130);
+ RETURN_CTOR(&_3);
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, update)
+{
+ zend_bool _5$$3, _11$$12;
+ 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 *table_param = NULL, *fields, fields_sub, *values, values_sub, *whereCondition = NULL, whereCondition_sub, *dataTypes = NULL, dataTypes_sub, __$null, bindDataTypes, bindType, conditions, escapedField, escapedTable, field, placeholders, position, setClause, tableName, updateSql, updateValues, value, whereBind, whereTypes, *_0, _1, _17, _18, _7$$5, _9$$8, _10$$9, _13$$14, _15$$17, _16$$18;
+ zval table, _6$$5, _8$$7, _12$$14, _14$$16;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_8$$7);
+ ZVAL_UNDEF(&_12$$14);
+ ZVAL_UNDEF(&_14$$16);
+ ZVAL_UNDEF(&fields_sub);
+ ZVAL_UNDEF(&values_sub);
+ ZVAL_UNDEF(&whereCondition_sub);
+ ZVAL_UNDEF(&dataTypes_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&bindDataTypes);
+ ZVAL_UNDEF(&bindType);
+ ZVAL_UNDEF(&conditions);
+ ZVAL_UNDEF(&escapedField);
+ ZVAL_UNDEF(&escapedTable);
+ ZVAL_UNDEF(&field);
+ ZVAL_UNDEF(&placeholders);
+ ZVAL_UNDEF(&position);
+ ZVAL_UNDEF(&setClause);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&updateSql);
+ ZVAL_UNDEF(&updateValues);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&whereBind);
+ ZVAL_UNDEF(&whereTypes);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_17);
+ ZVAL_UNDEF(&_18);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_9$$8);
+ ZVAL_UNDEF(&_10$$9);
+ ZVAL_UNDEF(&_13$$14);
+ ZVAL_UNDEF(&_15$$17);
+ ZVAL_UNDEF(&_16$$18);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 5)
+ Z_PARAM_STR(table)
+ Z_PARAM_ZVAL(fields)
+ Z_PARAM_ZVAL(values)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(whereCondition)
+ Z_PARAM_ZVAL_OR_NULL(dataTypes)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 2, &table_param, &fields, &values, &whereCondition, &dataTypes);
+ zephir_get_strval(&table, table_param);
+ if (!whereCondition) {
+ whereCondition = &whereCondition_sub;
+ whereCondition = &__$null;
+ }
+ if (!dataTypes) {
+ dataTypes = &dataTypes_sub;
+ dataTypes = &__$null;
+ }
+
+
+ ZEPHIR_INIT_VAR(&placeholders);
+ array_init(&placeholders);
+ ZEPHIR_INIT_VAR(&updateValues);
+ array_init(&updateValues);
+ ZEPHIR_INIT_VAR(&bindDataTypes);
+ array_init(&bindDataTypes);
+ zephir_is_iterable(values, 0, "phalcon/Db/Adapter/AbstractAdapter.zep", 1220);
+ if (Z_TYPE_P(values) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(values), _2, _3, _0)
+ {
+ ZEPHIR_INIT_NVAR(&position);
+ if (_3 != NULL) {
+ ZVAL_STR_COPY(&position, _3);
+ } else {
+ ZVAL_LONG(&position, _2);
}
-vv348:
- {
- token->opcode = PHVOLT_T_ENDBLOCK;
- return 0;
- }
-vv349:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv350;
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _0);
+ ZEPHIR_OBS_NVAR(&field);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&field, fields, &position, 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The number of values in the update is not the same as fields", "phalcon/Db/Adapter/AbstractAdapter.zep", 1185);
+ return;
}
-vv350:
- {
- token->opcode = PHVOLT_T_ENDCACHE;
- return 0;
- }
-vv351:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv352;
+ ZEPHIR_CALL_METHOD(&escapedField, this_ptr, "escapeidentifier", &_4, 0, &field);
+ zephir_check_call_status();
+ _5$$3 = Z_TYPE_P(&value) == IS_OBJECT;
+ if (_5$$3) {
+ _5$$3 = zephir_instance_of_ev(&value, phalcon_db_rawvalue_ce);
}
-vv352:
- {
- token->opcode = PHVOLT_T_ENDMACRO;
- return 0;
- }
-vv353:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'H':
- case 'h': goto vv358;
- default: goto vv54;
+ if (_5$$3) {
+ zephir_cast_to_string(&_6$$5, &value);
+ ZEPHIR_INIT_NVAR(&_7$$5);
+ ZEPHIR_CONCAT_VSV(&_7$$5, &escapedField, " = ", &_6$$5);
+ zephir_array_append(&placeholders, &_7$$5, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 1191);
+ } else {
+ if (Z_TYPE_P(&value) == IS_OBJECT) {
+ zephir_cast_to_string(&_8$$7, &value);
+ ZEPHIR_CPY_WRT(&value, &_8$$7);
+ }
+ if (Z_TYPE_P(&value) == IS_NULL) {
+ ZEPHIR_INIT_NVAR(&_9$$8);
+ ZEPHIR_CONCAT_VS(&_9$$8, &escapedField, " = null");
+ zephir_array_append(&placeholders, &_9$$8, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 1198);
+ } else {
+ zephir_array_append(&updateValues, &value, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 1200);
+ if (Z_TYPE_P(dataTypes) == IS_ARRAY) {
+ ZEPHIR_OBS_NVAR(&bindType);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&bindType, dataTypes, &position, 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Incomplete number of bind types", "phalcon/Db/Adapter/AbstractAdapter.zep", 1206);
+ return;
+ }
+ zephir_array_append(&bindDataTypes, &bindType, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 1209);
+ }
+ ZEPHIR_INIT_NVAR(&_10$$9);
+ ZEPHIR_CONCAT_VS(&_10$$9, &escapedField, " = ?");
+ zephir_array_append(&placeholders, &_10$$9, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 1212);
+ }
}
-vv354:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv355;
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, values, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, values, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
}
-vv355:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_ITERABLE;
- return 0;
+ ZEPHIR_CALL_METHOD(&position, values, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, values, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&field);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&field, fields, &position, 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The number of values in the update is not the same as fields", "phalcon/Db/Adapter/AbstractAdapter.zep", 1185);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&escapedField, this_ptr, "escapeidentifier", &_4, 0, &field);
+ zephir_check_call_status();
+ _11$$12 = Z_TYPE_P(&value) == IS_OBJECT;
+ if (_11$$12) {
+ _11$$12 = zephir_instance_of_ev(&value, phalcon_db_rawvalue_ce);
+ }
+ if (_11$$12) {
+ zephir_cast_to_string(&_12$$14, &value);
+ ZEPHIR_INIT_NVAR(&_13$$14);
+ ZEPHIR_CONCAT_VSV(&_13$$14, &escapedField, " = ", &_12$$14);
+ zephir_array_append(&placeholders, &_13$$14, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 1191);
+ } else {
+ if (Z_TYPE_P(&value) == IS_OBJECT) {
+ zephir_cast_to_string(&_14$$16, &value);
+ ZEPHIR_CPY_WRT(&value, &_14$$16);
+ }
+ if (Z_TYPE_P(&value) == IS_NULL) {
+ ZEPHIR_INIT_NVAR(&_15$$17);
+ ZEPHIR_CONCAT_VS(&_15$$17, &escapedField, " = null");
+ zephir_array_append(&placeholders, &_15$$17, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 1198);
+ } else {
+ zephir_array_append(&updateValues, &value, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 1200);
+ if (Z_TYPE_P(dataTypes) == IS_ARRAY) {
+ ZEPHIR_OBS_NVAR(&bindType);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&bindType, dataTypes, &position, 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Incomplete number of bind types", "phalcon/Db/Adapter/AbstractAdapter.zep", 1206);
+ return;
+ }
+ zephir_array_append(&bindDataTypes, &bindType, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 1209);
+ }
+ ZEPHIR_INIT_NVAR(&_16$$18);
+ ZEPHIR_CONCAT_VS(&_16$$18, &escapedField, " = ?");
+ zephir_array_append(&placeholders, &_16$$18, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 1212);
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, values, "next", NULL, 0);
+ zephir_check_call_status();
}
-vv356:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv360;
- default: goto vv54;
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&position);
+ ZEPHIR_INIT_VAR(&_17);
+ ZVAL_STRING(&_17, ".");
+ ZEPHIR_INIT_VAR(&_18);
+ zephir_fast_strpos(&_18, &table, &_17, 0 );
+ if (ZEPHIR_GT_LONG(&_18, 0)) {
+ ZEPHIR_INIT_VAR(&tableName);
+ zephir_fast_explode_str(&tableName, SL("."), &table, LONG_MAX);
+ } else {
+ ZEPHIR_CPY_WRT(&tableName, &table);
+ }
+ ZEPHIR_CALL_METHOD(&escapedTable, this_ptr, "escapeidentifier", &_4, 0, &tableName);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&setClause);
+ zephir_fast_join_str(&setClause, SL(", "), &placeholders);
+ ZEPHIR_INIT_VAR(&updateSql);
+ if (Z_TYPE_P(whereCondition) != IS_NULL) {
+ ZEPHIR_CONCAT_SVSVS(&updateSql, "UPDATE ", &escapedTable, " SET ", &setClause, " WHERE ");
+ if (Z_TYPE_P(whereCondition) == IS_STRING) {
+ zephir_concat_self(&updateSql, whereCondition);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(whereCondition) != IS_ARRAY)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid WHERE clause conditions", "phalcon/Db/Adapter/AbstractAdapter.zep", 1243);
+ return;
}
-vv357:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'C':
- case 'c': goto vv362;
- default: goto vv54;
+ ZEPHIR_OBS_VAR(&conditions);
+ if (zephir_array_isset_string_fetch(&conditions, whereCondition, SL("conditions"), 0)) {
+ zephir_concat_self(&updateSql, &conditions);
}
-vv358:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv359;
+ ZEPHIR_OBS_VAR(&whereBind);
+ if (zephir_array_isset_string_fetch(&whereBind, whereCondition, SL("bind"), 0)) {
+ zephir_merge_append(&updateValues, &whereBind);
}
-vv359:
- {
- token->opcode = PHVOLT_T_ENDSWITCH;
- return 0;
- }
-vv360:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv361;
+ ZEPHIR_OBS_VAR(&whereTypes);
+ if (zephir_array_isset_string_fetch(&whereTypes, whereCondition, SL("bindTypes"), 0)) {
+ zephir_merge_append(&bindDataTypes, &whereTypes);
}
-vv361:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_AUTOESCAPE;
- return 0;
}
-vv362:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'A':
- case 'a': goto vv363;
- default: goto vv54;
- }
-vv363:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'P':
- case 'p': goto vv364;
- default: goto vv54;
- }
-vv364:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case 'E':
- case 'e': goto vv365;
- default: goto vv54;
+ } else {
+ ZEPHIR_CONCAT_SVSV(&updateSql, "UPDATE ", &escapedTable, " SET ", &setClause);
+ }
+ if (!(zephir_fast_count_int(&bindDataTypes))) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &updateSql, &updateValues);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &updateSql, &updateValues, &bindDataTypes);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, updateAsDict)
+{
+ zend_string *_4;
+ zend_ulong _3;
+ zend_bool _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *table_param = NULL, *data, data_sub, *whereCondition = NULL, whereCondition_sub, *dataTypes = NULL, dataTypes_sub, __$null, values, fields, field, value, *_1, _2;
+ zval table;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&whereCondition_sub);
+ ZVAL_UNDEF(&dataTypes_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&values);
+ ZVAL_UNDEF(&fields);
+ ZVAL_UNDEF(&field);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 4)
+ Z_PARAM_STR(table)
+ Z_PARAM_ZVAL(data)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(whereCondition)
+ Z_PARAM_ZVAL_OR_NULL(dataTypes)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 2, &table_param, &data, &whereCondition, &dataTypes);
+ zephir_get_strval(&table, table_param);
+ if (!whereCondition) {
+ whereCondition = &whereCondition_sub;
+ whereCondition = &__$null;
+ }
+ if (!dataTypes) {
+ dataTypes = &dataTypes_sub;
+ dataTypes = &__$null;
+ }
+
+
+ ZEPHIR_INIT_VAR(&values);
+ array_init(&values);
+ ZEPHIR_INIT_VAR(&fields);
+ array_init(&fields);
+ _0 = Z_TYPE_P(data) != IS_ARRAY;
+ if (!(_0)) {
+ _0 = ZEPHIR_IS_EMPTY(data);
+ }
+ if (_0) {
+ RETURN_MM_BOOL(0);
+ }
+ zephir_is_iterable(data, 0, "phalcon/Db/Adapter/AbstractAdapter.zep", 1316);
+ if (Z_TYPE_P(data) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(data), _3, _4, _1)
+ {
+ ZEPHIR_INIT_NVAR(&field);
+ if (_4 != NULL) {
+ ZVAL_STR_COPY(&field, _4);
+ } else {
+ ZVAL_LONG(&field, _3);
}
-vv365:
- vvch = *++VVCURSOR;
- switch (vvch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '\\':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto vv53;
- default: goto vv366;
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _1);
+ zephir_array_append(&fields, &field, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 1312);
+ zephir_array_append(&values, &value, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 1313);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, data, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, data, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
}
-vv366:
- {
- s->statement_position++;
- token->opcode = PHVOLT_T_ENDAUTOESCAPE;
- return 0;
- }
+ ZEPHIR_CALL_METHOD(&field, data, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, data, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_append(&fields, &field, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 1312);
+ zephir_array_append(&values, &value, PH_SEPARATE, "phalcon/Db/Adapter/AbstractAdapter.zep", 1313);
+ ZEPHIR_CALL_METHOD(NULL, data, "next", NULL, 0);
+ zephir_check_call_status();
}
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&field);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "update", NULL, 0, &table, &fields, &values, whereCondition, dataTypes);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, useExplicitIdValue)
+{
+ zval *this_ptr = getThis();
- }
+
+ RETURN_BOOL(0);
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, supportsDefaultValue)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_BOOL(1);
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, viewExists)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *viewName_param = NULL, *schemaName_param = NULL, _0, _1, _2, _3, _4;
+ zval viewName, schemaName;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&viewName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(viewName)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &viewName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) {
+ zephir_get_strval(&viewName, viewName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&viewName);
+ }
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
}
- return status;
+
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_2, &_1, "viewexists", NULL, 0, &viewName, &schemaName);
+ zephir_check_call_status();
+ ZVAL_LONG(&_3, 3);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchone", NULL, 0, &_2, &_3);
+ zephir_check_call_status();
+ zephir_array_fetch_long(&_4, &_0, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/AbstractAdapter.zep", 1349);
+ RETURN_MM_BOOL(ZEPHIR_GT_LONG(&_4, 0));
+}
+
+zend_object *zephir_init_properties_Phalcon_Db_Adapter_AbstractAdapter(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_MM_GROW();
+
+ {
+ 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("sqlBindTypes"), 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("sqlBindTypes"), &_1$$3);
+ }
+ zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("descriptor"), 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("descriptor"), &_3$$4);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
+ }
}
+
#ifdef HAVE_CONFIG_H
#endif
@@ -192355,13 +187229,80 @@ static int phvolt_get_token(phvolt_scanner_state *s, phvolt_scanner_token *token
-ZEPHIR_INIT_CLASS(Phalcon_Paginator_Exception)
+ZEPHIR_INIT_CLASS(Phalcon_Db_Adapter_AdapterInterface)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Paginator, Exception, phalcon, paginator_exception, phalcon_exception_ce, NULL, 0);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Db\\Adapter, AdapterInterface, phalcon, db_adapter_adapterinterface, phalcon_db_adapter_adapterinterface_method_entry);
return SUCCESS;
}
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, addColumn);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, addIndex);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, addForeignKey);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, addPrimaryKey);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, affectedRows);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, begin);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, close);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, commit);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, connect);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, createSavepoint);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, createTable);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, createView);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, delete);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, describeColumns);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, describeIndexes);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, describeReferences);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, dropColumn);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, dropForeignKey);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, dropIndex);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, dropPrimaryKey);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, dropTable);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, dropView);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, escapeIdentifier);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, escapeString);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, execute);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, fetchAll);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, fetchColumn);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, fetchOne);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, forUpdate);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getColumnDefinition);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getColumnList);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getConnectionId);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getDescriptor);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getDialect);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getDialectType);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getDefaultIdValue);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getDefaultValue);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getInternalHandler);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getNestedTransactionSavepointName);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getRealSQLStatement);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getSQLStatement);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getSQLBindTypes);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getSQLVariables);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, getType);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, insert);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, insertAsDict);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, isNestedTransactionsWithSavepoints);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, isUnderTransaction);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, lastInsertId);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, limit);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, listTables);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, listViews);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, modifyColumn);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, query);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, releaseSavepoint);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, rollback);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, rollbackSavepoint);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, sharedLock);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, setNestedTransactionsWithSavepoints);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, supportSequences);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, tableExists);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, tableOptions);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, update);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, updateAsDict);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, useExplicitIdValue);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, supportsDefaultValue);
+ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, viewExists);
@@ -192372,15 +187313,15 @@ ZEPHIR_INIT_CLASS(Phalcon_Paginator_Exception)
-ZEPHIR_INIT_CLASS(Phalcon_Paginator_PaginatorFactory)
+ZEPHIR_INIT_CLASS(Phalcon_Db_Adapter_PdoFactory)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Paginator, PaginatorFactory, phalcon, paginator_paginatorfactory, phalcon_factory_abstractfactory_ce, phalcon_paginator_paginatorfactory_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Db\\Adapter, PdoFactory, phalcon, db_adapter_pdofactory, phalcon_factory_abstractfactory_ce, phalcon_db_adapter_pdofactory_method_entry, 0);
- zend_declare_property_string(phalcon_paginator_paginatorfactory_ce, SL("exception"), "Phalcon\\Annotations\\Exception", ZEND_ACC_PROTECTED);
+ zend_declare_property_string(phalcon_db_adapter_pdofactory_ce, SL("exception"), "Phalcon\\Db\\Exception", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Paginator_PaginatorFactory, __construct)
+static PHP_METHOD(Phalcon_Db_Adapter_PdoFactory, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
@@ -192413,7 +187354,7 @@ static PHP_METHOD(Phalcon_Paginator_PaginatorFactory, __construct)
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Paginator_PaginatorFactory, load)
+static PHP_METHOD(Phalcon_Db_Adapter_PdoFactory, load)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zephir_fcall_cache_entry *_1 = NULL;
@@ -192444,7 +187385,8 @@ static PHP_METHOD(Phalcon_Paginator_PaginatorFactory, load)
zephir_check_call_status();
ZEPHIR_CPY_WRT(config, &_0);
ZEPHIR_OBS_VAR(&name);
- zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Paginator/PaginatorFactory.zep", 64);
+ zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Db/Adapter/PdoFactory.zep", 51);
+ zephir_array_unset_string(config, SL("adapter"), PH_SEPARATE);
ZEPHIR_INIT_VAR(&_2);
array_init(&_2);
ZEPHIR_INIT_VAR(&_3);
@@ -192456,7 +187398,7 @@ static PHP_METHOD(Phalcon_Paginator_PaginatorFactory, load)
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Paginator_PaginatorFactory, newInstance)
+static PHP_METHOD(Phalcon_Db_Adapter_PdoFactory, newInstance)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
@@ -192508,16 +187450,16 @@ static PHP_METHOD(Phalcon_Paginator_PaginatorFactory, newInstance)
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Paginator_PaginatorFactory, getAdapters)
+static PHP_METHOD(Phalcon_Db_Adapter_PdoFactory, getAdapters)
{
zval *this_ptr = getThis();
zephir_create_array(return_value, 3, 0);
- add_assoc_stringl_ex(return_value, SL("model"), SL("Phalcon\\Paginator\\Adapter\\Model"));
- add_assoc_stringl_ex(return_value, SL("nativeArray"), SL("Phalcon\\Paginator\\Adapter\\NativeArray"));
- add_assoc_stringl_ex(return_value, SL("queryBuilder"), SL("Phalcon\\Paginator\\Adapter\\QueryBuilder"));
+ add_assoc_stringl_ex(return_value, SL("mysql"), SL("Phalcon\\Db\\Adapter\\Pdo\\Mysql"));
+ add_assoc_stringl_ex(return_value, SL("postgresql"), SL("Phalcon\\Db\\Adapter\\Pdo\\Postgresql"));
+ add_assoc_stringl_ex(return_value, SL("sqlite"), SL("Phalcon\\Db\\Adapter\\Pdo\\Sqlite"));
return;
}
@@ -192531,808 +187473,1553 @@ static PHP_METHOD(Phalcon_Paginator_PaginatorFactory, getAdapters)
-ZEPHIR_INIT_CLASS(Phalcon_Paginator_Repository)
+ZEPHIR_INIT_CLASS(Phalcon_Db_Adapter_Pdo_AbstractPdo)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Paginator, Repository, phalcon, paginator_repository, phalcon_paginator_repository_method_entry, 0);
-
- zend_declare_property_null(phalcon_paginator_repository_ce, SL("aliases"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_paginator_repository_ce, SL("properties"), ZEND_ACC_PROTECTED);
- phalcon_paginator_repository_ce->create_object = zephir_init_properties_Phalcon_Paginator_Repository;
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Db\\Adapter\\Pdo, AbstractPdo, phalcon, db_adapter_pdo_abstractpdo, phalcon_db_adapter_abstractadapter_ce, phalcon_db_adapter_pdo_abstractpdo_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
- zend_class_implements(phalcon_paginator_repository_ce, 1, phalcon_paginator_repositoryinterface_ce);
- zend_class_implements(phalcon_paginator_repository_ce, 1, zephir_get_internal_ce(SL("jsonserializable")));
+ zend_declare_property_long(phalcon_db_adapter_pdo_abstractpdo_ce, SL("affectedRows"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_adapter_pdo_abstractpdo_ce, SL("pdo"), ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Paginator_Repository, __get)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_0 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *property_param = NULL, method, _0, _1, _2, _3;
- zval property;
+ zval *descriptor_param = NULL;
+ zval descriptor;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&property);
- ZVAL_UNDEF(&method);
+ ZVAL_UNDEF(&descriptor);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(descriptor)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &descriptor_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&descriptor, descriptor_param);
+
+
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "connect", NULL, 0, &descriptor);
+ zephir_check_call_status();
+ ZEPHIR_CALL_PARENT(NULL, phalcon_db_adapter_pdo_abstractpdo_ce, getThis(), "__construct", &_0, 0, &descriptor);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, affectedRows)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "affectedRows");
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, begin)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS, transactionLevel = 0;
+ zval *nesting_param = NULL, eventsManager, savepointName, _0, _5, _6, _1$$3, _2$$4, _7$$6;
+ zend_bool nesting, _3, _4;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&eventsManager);
+ ZVAL_UNDEF(&savepointName);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_7$$6);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(nesting)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &nesting_param);
+ if (!nesting_param) {
+ nesting = 1;
+ } else {
+ nesting = zephir_get_boolval(nesting_param);
+ }
+
+
+ RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("transactionLevel")));
+ ZEPHIR_OBS_VAR(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("transactionLevel"), PH_NOISY_CC);
+ transactionLevel = zephir_get_intval(&_0);
+ if (transactionLevel == 1) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&eventsManager, &_1$$3);
+ if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_2$$4);
+ ZVAL_STRING(&_2$$4, "db:beginTransaction");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_2$$4, this_ptr);
+ zephir_check_call_status();
+ }
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_1$$3, "begintransaction", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ _3 = !transactionLevel;
+ if (!(_3)) {
+ _3 = !nesting;
+ }
+ _4 = _3;
+ if (!(_4)) {
+ ZEPHIR_CALL_METHOD(&_5, this_ptr, "isnestedtransactionswithsavepoints", NULL, 0);
+ zephir_check_call_status();
+ _4 = !zephir_is_true(&_5);
+ }
+ if (_4) {
+ RETURN_MM_BOOL(0);
+ }
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&eventsManager, &_6);
+ ZEPHIR_CALL_METHOD(&savepointName, this_ptr, "getnestedtransactionsavepointname", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_7$$6);
+ ZVAL_STRING(&_7$$6, "db:createSavepoint");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_7$$6, this_ptr, &savepointName);
+ zephir_check_call_status();
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "createsavepoint", NULL, 0, &savepointName);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, commit)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS, transactionLevel = 0;
+ zval *nesting_param = NULL, eventsManager, savepointName, _0, _5, _6, _1$$4, _2$$5, _7$$8;
+ zend_bool nesting, _3, _4;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&eventsManager);
+ ZVAL_UNDEF(&savepointName);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&_7$$8);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(nesting)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &nesting_param);
+ if (!nesting_param) {
+ nesting = 1;
+ } else {
+ nesting = zephir_get_boolval(nesting_param);
+ }
+
+
+ ZEPHIR_OBS_VAR(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("transactionLevel"), PH_NOISY_CC);
+ transactionLevel = zephir_get_intval(&_0);
+ if (UNEXPECTED(!transactionLevel)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "There is no active transaction", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 154);
+ return;
+ }
+ if (transactionLevel == 1) {
+ zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&eventsManager, &_1$$4);
+ if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_2$$5);
+ ZVAL_STRING(&_2$$5, "db:commitTransaction");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_2$$5, this_ptr);
+ zephir_check_call_status();
+ }
+ RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel")));
+ zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_1$$4, "commit", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ _3 = !transactionLevel;
+ if (!(_3)) {
+ _3 = !nesting;
+ }
+ _4 = _3;
+ if (!(_4)) {
+ ZEPHIR_CALL_METHOD(&_5, this_ptr, "isnestedtransactionswithsavepoints", NULL, 0);
+ zephir_check_call_status();
+ _4 = !zephir_is_true(&_5);
+ }
+ if (_4) {
+ if (transactionLevel > 0) {
+ RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel")));
+ }
+ RETURN_MM_BOOL(0);
+ }
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&eventsManager, &_6);
+ ZEPHIR_CALL_METHOD(&savepointName, this_ptr, "getnestedtransactionsavepointname", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_7$$8);
+ ZVAL_STRING(&_7$$8, "db:releaseSavepoint");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_7$$8, this_ptr, &savepointName);
+ zephir_check_call_status();
+ }
+ RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel")));
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "releasesavepoint", NULL, 0, &savepointName);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, close)
+{
+ zval __$null;
+ zval *this_ptr = getThis();
+
+ ZVAL_NULL(&__$null);
+
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("pdo"), &__$null);
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, connect)
+{
+ zend_string *_9;
+ zend_ulong _8;
+ zend_bool _1;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *descriptor_param = NULL, username, password, dsnAttributes, dsnAttributesCustomRaw, dsnAttributesMap, key, options, persistent, value, _2, _4, _5, *_6, _7, _12, _13, _14, _0$$3, _3$$9, _10$$11, _11$$12;
+ zval descriptor, dsnParts;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&descriptor);
+ ZVAL_UNDEF(&dsnParts);
+ ZVAL_UNDEF(&username);
+ ZVAL_UNDEF(&password);
+ ZVAL_UNDEF(&dsnAttributes);
+ ZVAL_UNDEF(&dsnAttributesCustomRaw);
+ ZVAL_UNDEF(&dsnAttributesMap);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&persistent);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_13);
+ ZVAL_UNDEF(&_14);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_3$$9);
+ ZVAL_UNDEF(&_10$$11);
+ ZVAL_UNDEF(&_11$$12);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(descriptor)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &descriptor_param);
+ if (!descriptor_param) {
+ ZEPHIR_INIT_VAR(&descriptor);
+ array_init(&descriptor);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&descriptor, descriptor_param);
+ }
+
+
+ ZEPHIR_INIT_VAR(&dsnParts);
+ array_init(&dsnParts);
+ if (ZEPHIR_IS_EMPTY(&descriptor)) {
+ zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("descriptor"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&descriptor, &_0$$3);
+ }
+ ZEPHIR_OBS_VAR(&username);
+ if (zephir_array_isset_string_fetch(&username, &descriptor, SL("username"), 0)) {
+ zephir_array_unset_string(&descriptor, SL("username"), PH_SEPARATE);
+ }
+ ZEPHIR_OBS_VAR(&password);
+ if (zephir_array_isset_string_fetch(&password, &descriptor, SL("password"), 0)) {
+ zephir_array_unset_string(&descriptor, SL("password"), PH_SEPARATE);
+ }
+ if (zephir_array_isset_string(&descriptor, SL("dialectClass"))) {
+ zephir_array_unset_string(&descriptor, SL("dialectClass"), PH_SEPARATE);
+ }
+ _1 = zephir_array_isset_string(&descriptor, SL("options"));
+ if (_1) {
+ zephir_array_fetch_string(&_2, &descriptor, SL("options"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 268);
+ _1 = Z_TYPE_P(&_2) == IS_ARRAY;
+ }
+ if (_1) {
+ ZEPHIR_OBS_VAR(&options);
+ zephir_array_fetch_string(&options, &descriptor, SL("options"), PH_NOISY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 269);
+ zephir_array_unset_string(&descriptor, SL("options"), PH_SEPARATE);
+ } else {
+ ZEPHIR_INIT_NVAR(&options);
+ array_init(&options);
+ }
+ ZEPHIR_OBS_VAR(&persistent);
+ if (zephir_array_isset_string_fetch(&persistent, &descriptor, SL("persistent"), 0)) {
+ ZEPHIR_INIT_VAR(&_3$$9);
+ ZVAL_BOOL(&_3$$9, zephir_get_boolval(&persistent));
+ zephir_array_update_long(&options, 12, &_3$$9, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
+ }
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_LONG(&_4, 2);
+ zephir_array_update_long(&options, 3, &_4, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
+ ZEPHIR_OBS_VAR(&dsnAttributesCustomRaw);
+ if (zephir_array_isset_string_fetch(&dsnAttributesCustomRaw, &descriptor, SL("dsn"), 0)) {
+ zephir_array_append(&dsnParts, &dsnAttributesCustomRaw, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 285);
+ zephir_array_unset_string(&descriptor, SL("dsn"), PH_SEPARATE);
+ }
+ ZEPHIR_CALL_METHOD(&_5, this_ptr, "getdsndefaults", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&dsnAttributesMap);
+ zephir_fast_array_merge(&dsnAttributesMap, &_5, &descriptor);
+ zephir_is_iterable(&dsnAttributesMap, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 305);
+ if (Z_TYPE_P(&dsnAttributesMap) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&dsnAttributesMap), _8, _9, _6)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ if (_9 != NULL) {
+ ZVAL_STR_COPY(&key, _9);
+ } else {
+ ZVAL_LONG(&key, _8);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _6);
+ ZEPHIR_INIT_NVAR(&_10$$11);
+ ZEPHIR_CONCAT_VSV(&_10$$11, &key, "=", &value);
+ zephir_array_append(&dsnParts, &_10$$11, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 301);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &dsnAttributesMap, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_7, &dsnAttributesMap, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_7)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&key, &dsnAttributesMap, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &dsnAttributesMap, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_11$$12);
+ ZEPHIR_CONCAT_VSV(&_11$$12, &key, "=", &value);
+ zephir_array_append(&dsnParts, &_11$$12, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 301);
+ ZEPHIR_CALL_METHOD(NULL, &dsnAttributesMap, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&key);
+ ZEPHIR_INIT_VAR(&dsnAttributes);
+ zephir_fast_join_str(&dsnAttributes, SL(";"), &dsnParts);
+ ZEPHIR_INIT_VAR(&_12);
+ object_init_ex(&_12, php_pdo_get_dbh_ce());
+ zephir_read_property(&_13, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_14);
+ ZEPHIR_CONCAT_VSV(&_14, &_13, ":", &dsnAttributes);
+ ZEPHIR_CALL_METHOD(NULL, &_12, "__construct", NULL, 0, &_14, &username, &password, &options);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("pdo"), &_12);
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, convertBoundParams)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS, setOrder = 0;
+ zval params;
+ zval *sql_param = NULL, *params_param = NULL, boundSql, placeHolders, bindPattern, matches, placeMatch, value, _0, _1, _2, *_3$$3, _4$$3, _9$$3, _5$$4, _6$$5, _7$$8, _8$$9;
+ zval sql;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&boundSql);
+ ZVAL_UNDEF(&placeHolders);
+ ZVAL_UNDEF(&bindPattern);
+ ZVAL_UNDEF(&matches);
+ ZVAL_UNDEF(&placeMatch);
+ ZVAL_UNDEF(&value);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_9$$3);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$8);
+ ZVAL_UNDEF(&_8$$9);
+ ZVAL_UNDEF(¶ms);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(sql)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(params)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &sql_param, ¶ms_param);
+ if (UNEXPECTED(Z_TYPE_P(sql_param) != IS_STRING && Z_TYPE_P(sql_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sql' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(sql_param) == IS_STRING)) {
+ zephir_get_strval(&sql, sql_param);
+ } else {
+ ZEPHIR_INIT_VAR(&sql);
+ }
+ if (!params_param) {
+ ZEPHIR_INIT_VAR(¶ms);
+ array_init(¶ms);
+ } else {
+ zephir_get_arrval(¶ms, params_param);
+ }
+
+
+ ZEPHIR_INIT_VAR(&placeHolders);
+ array_init(&placeHolders);
+ ZEPHIR_INIT_VAR(&bindPattern);
+ ZVAL_STRING(&bindPattern, "/\\?([0-9]+)|:([a-zA-Z0-9_]+):/");
+ ZEPHIR_INIT_VAR(&matches);
+ ZVAL_NULL(&matches);
+ setOrder = 2;
+ ZVAL_LONG(&_0, setOrder);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_LONG(&_2, setOrder);
+ zephir_preg_match(&_1, &bindPattern, &sql, &matches, 1, zephir_get_intval(&_0) , 0 );
+ if (zephir_is_true(&_1)) {
+ zephir_is_iterable(&matches, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 359);
+ if (Z_TYPE_P(&matches) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&matches), _3$$3)
+ {
+ ZEPHIR_INIT_NVAR(&placeMatch);
+ ZVAL_COPY(&placeMatch, _3$$3);
+ ZEPHIR_OBS_NVAR(&value);
+ zephir_array_fetch_long(&_5$$4, &placeMatch, 1, PH_READONLY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 342);
+ if (!(zephir_array_isset_fetch(&value, ¶ms, &_5$$4, 0))) {
+ if (UNEXPECTED(!(zephir_array_isset_long(&placeMatch, 2)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Matched parameter wasn't found in parameters list", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 346);
+ return;
+ }
+ ZEPHIR_OBS_NVAR(&value);
+ zephir_array_fetch_long(&_6$$5, &placeMatch, 2, PH_READONLY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 349);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&value, ¶ms, &_6$$5, 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Matched parameter wasn't found in parameters list", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 352);
+ return;
+ }
+ }
+ zephir_array_append(&placeHolders, &value, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 356);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &matches, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_4$$3, &matches, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_4$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&placeMatch, &matches, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&value);
+ zephir_array_fetch_long(&_7$$8, &placeMatch, 1, PH_READONLY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 342);
+ if (!(zephir_array_isset_fetch(&value, ¶ms, &_7$$8, 0))) {
+ if (UNEXPECTED(!(zephir_array_isset_long(&placeMatch, 2)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Matched parameter wasn't found in parameters list", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 346);
+ return;
+ }
+ ZEPHIR_OBS_NVAR(&value);
+ zephir_array_fetch_long(&_8$$9, &placeMatch, 2, PH_READONLY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 349);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&value, ¶ms, &_8$$9, 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Matched parameter wasn't found in parameters list", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 352);
+ return;
+ }
+ }
+ zephir_array_append(&placeHolders, &value, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 356);
+ ZEPHIR_CALL_METHOD(NULL, &matches, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&placeMatch);
+ ZEPHIR_INIT_VAR(&_9$$3);
+ ZVAL_STRING(&_9$$3, "?");
+ ZEPHIR_CALL_FUNCTION(&boundSql, "preg_replace", NULL, 50, &bindPattern, &_9$$3, &sql);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CPY_WRT(&boundSql, &sql);
+ }
+ zephir_create_array(return_value, 2, 0);
+ zephir_array_update_string(return_value, SL("sql"), &boundSql, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(return_value, SL("params"), &placeHolders, PH_COPY | PH_SEPARATE);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, escapeString)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *str_param = NULL, _0;
+ zval str;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&str);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(property)
+ Z_PARAM_STR(str)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &property_param);
- zephir_get_strval(&property, property_param);
+ zephir_fetch_params(1, 1, 0, &str_param);
+ zephir_get_strval(&str, str_param);
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getrealnameproperty", NULL, 0, &property);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "quote", NULL, 0, &str);
zephir_check_call_status();
- zephir_camelize(&_0, &_1, NULL );
- ZEPHIR_INIT_VAR(&method);
- ZEPHIR_CONCAT_SV(&method, "get", &_0);
- if ((zephir_method_exists(this_ptr, &method) == SUCCESS)) {
- ZEPHIR_RETURN_CALL_METHOD_ZVAL(this_ptr, &method, NULL, 0);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, execute)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval bindParams, bindTypes;
+ zval *sqlStatement_param = NULL, *bindParams_param = NULL, *bindTypes_param = NULL, eventsManager, affectedRows, newStatement, statement, _0, _1$$3, _2$$3, _3$$5, _4$$7, _5$$9;
+ zval sqlStatement;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&sqlStatement);
+ ZVAL_UNDEF(&eventsManager);
+ ZVAL_UNDEF(&affectedRows);
+ ZVAL_UNDEF(&newStatement);
+ ZVAL_UNDEF(&statement);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&_4$$7);
+ ZVAL_UNDEF(&_5$$9);
+ ZVAL_UNDEF(&bindParams);
+ ZVAL_UNDEF(&bindTypes);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(sqlStatement)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(bindParams)
+ Z_PARAM_ARRAY(bindTypes)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &sqlStatement_param, &bindParams_param, &bindTypes_param);
+ if (UNEXPECTED(Z_TYPE_P(sqlStatement_param) != IS_STRING && Z_TYPE_P(sqlStatement_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlStatement' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(sqlStatement_param) == IS_STRING)) {
+ zephir_get_strval(&sqlStatement, sqlStatement_param);
+ } else {
+ ZEPHIR_INIT_VAR(&sqlStatement);
+ }
+ if (!bindParams_param) {
+ ZEPHIR_INIT_VAR(&bindParams);
+ array_init(&bindParams);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindParams, bindParams_param);
+ }
+ if (!bindTypes_param) {
+ ZEPHIR_INIT_VAR(&bindTypes);
+ array_init(&bindTypes);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindTypes, bindTypes_param);
+ }
+
+
+ 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_update_property_zval(this_ptr, ZEND_STRL("sqlStatement"), &sqlStatement);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("sqlVariables"), &bindParams);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("sqlBindTypes"), &bindTypes);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZVAL_STRING(&_2$$3, "db:beforeQuery");
+ 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_INIT_VAR(&affectedRows);
+ ZVAL_LONG(&affectedRows, 0);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "preparerealsql", NULL, 0, &sqlStatement, &bindParams);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&bindParams))) {
+ zephir_read_property(&_3$$5, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&statement, &_3$$5, "prepare", NULL, 0, &sqlStatement);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&statement) == IS_OBJECT) {
+ ZEPHIR_CALL_METHOD(&newStatement, this_ptr, "executeprepared", NULL, 0, &statement, &bindParams, &bindTypes);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&affectedRows, &newStatement, "rowcount", NULL, 0);
+ zephir_check_call_status();
+ }
+ } else {
+ zephir_read_property(&_4$$7, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&affectedRows, &_4$$7, "exec", NULL, 0, &sqlStatement);
+ zephir_check_call_status();
+ }
+ if (Z_TYPE_P(&affectedRows) == IS_LONG) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("affectedRows"), &affectedRows);
+ if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_5$$9);
+ ZVAL_STRING(&_5$$9, "db:afterQuery");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_5$$9, this_ptr);
+ zephir_check_call_status();
+ }
+ }
+ RETURN_MM_BOOL(1);
+}
+
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, executePrepared)
+{
+ zval _5$$8, _8$$13, _25$$39, _27$$44;
+ zend_bool _4$$3, _24$$34;
+ zend_string *_3, *_13$$22, *_21$$31, *_31$$53, *_39$$62;
+ zend_ulong _2, _12$$22, _20$$31, _30$$53, _38$$62;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_7 = NULL, *_9 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval placeholders;
+ zval *statement, statement_sub, *placeholders_param = NULL, *dataTypes, dataTypes_sub, wildcard, value, type, castValue, parameter, position, itemValue, *_0, _1, _6$$12, *_10$$22, _11$$22, _14$$24, _15$$25, _16$$27, _17$$28, *_18$$31, _19$$31, _22$$32, _23$$33, _26$$43, *_28$$53, _29$$53, _32$$55, _33$$56, _34$$58, _35$$59, *_36$$62, _37$$62, _40$$63, _41$$64;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&statement_sub);
+ ZVAL_UNDEF(&dataTypes_sub);
+ ZVAL_UNDEF(&wildcard);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&castValue);
+ ZVAL_UNDEF(¶meter);
+ ZVAL_UNDEF(&position);
+ ZVAL_UNDEF(&itemValue);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_6$$12);
+ ZVAL_UNDEF(&_11$$22);
+ ZVAL_UNDEF(&_14$$24);
+ ZVAL_UNDEF(&_15$$25);
+ ZVAL_UNDEF(&_16$$27);
+ ZVAL_UNDEF(&_17$$28);
+ ZVAL_UNDEF(&_19$$31);
+ ZVAL_UNDEF(&_22$$32);
+ ZVAL_UNDEF(&_23$$33);
+ ZVAL_UNDEF(&_26$$43);
+ ZVAL_UNDEF(&_29$$53);
+ ZVAL_UNDEF(&_32$$55);
+ ZVAL_UNDEF(&_33$$56);
+ ZVAL_UNDEF(&_34$$58);
+ ZVAL_UNDEF(&_35$$59);
+ ZVAL_UNDEF(&_37$$62);
+ ZVAL_UNDEF(&_40$$63);
+ ZVAL_UNDEF(&_41$$64);
+ ZVAL_UNDEF(&placeholders);
+ ZVAL_UNDEF(&_5$$8);
+ ZVAL_UNDEF(&_8$$13);
+ ZVAL_UNDEF(&_25$$39);
+ ZVAL_UNDEF(&_27$$44);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_OBJECT_OF_CLASS(statement, zephir_get_internal_ce(SL("pdostatement")))
+ Z_PARAM_ARRAY(placeholders)
+ Z_PARAM_ZVAL(dataTypes)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 0, &statement, &placeholders_param, &dataTypes);
+ ZEPHIR_OBS_COPY_OR_DUP(&placeholders, placeholders_param);
+
+
+ zephir_is_iterable(&placeholders, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 570);
+ if (Z_TYPE_P(&placeholders) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&placeholders), _2, _3, _0)
+ {
+ ZEPHIR_INIT_NVAR(&wildcard);
+ if (_3 != NULL) {
+ ZVAL_STR_COPY(&wildcard, _3);
+ } else {
+ ZVAL_LONG(&wildcard, _2);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _0);
+ if (Z_TYPE_P(&wildcard) == IS_LONG) {
+ ZEPHIR_INIT_NVAR(¶meter);
+ ZVAL_LONG(¶meter, (zephir_get_numberval(&wildcard) + 1));
+ } else if (Z_TYPE_P(&wildcard) == IS_STRING) {
+ ZEPHIR_CPY_WRT(¶meter, &wildcard);
+ } else {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid bind parameter (1)", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 490);
+ return;
+ }
+ _4$$3 = Z_TYPE_P(dataTypes) == IS_ARRAY;
+ if (_4$$3) {
+ ZEPHIR_OBS_NVAR(&type);
+ _4$$3 = zephir_array_isset_fetch(&type, dataTypes, &wildcard, 0);
+ }
+ if (_4$$3) {
+ if (ZEPHIR_IS_LONG(&type, 32)) {
+ zephir_cast_to_string(&_5$$8, &value);
+ ZEPHIR_CPY_WRT(&castValue, &_5$$8);
+ ZEPHIR_INIT_NVAR(&type);
+ ZVAL_LONG(&type, 1024);
+ } else {
+ if (ZEPHIR_GLOBAL(db).force_casting) {
+ if (Z_TYPE_P(&value) != IS_ARRAY) {
+ do {
+ if (ZEPHIR_IS_LONG(&type, 1)) {
+ ZVAL_LONG(&_6$$12, 10);
+ ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_7, 51, &value, &_6$$12);
+ zephir_check_call_status();
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&type, 2)) {
+ zephir_cast_to_string(&_8$$13, &value);
+ ZEPHIR_CPY_WRT(&castValue, &_8$$13);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&type, 0)) {
+ ZEPHIR_INIT_NVAR(&castValue);
+ ZVAL_NULL(&castValue);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&type, 5)) {
+ ZEPHIR_INIT_NVAR(&castValue);
+ ZVAL_BOOL(&castValue, zephir_get_boolval(&value));
+ break;
+ }
+ ZEPHIR_CPY_WRT(&castValue, &value);
+ break;
+ } while(0);
+
+ } else {
+ ZEPHIR_CPY_WRT(&castValue, &value);
+ }
+ } else {
+ ZEPHIR_CPY_WRT(&castValue, &value);
+ }
+ }
+ if (Z_TYPE_P(&castValue) != IS_ARRAY) {
+ if (ZEPHIR_IS_LONG(&type, 1024)) {
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, ¶meter, &castValue);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, ¶meter, &castValue, &type);
+ zephir_check_call_status();
+ }
+ } else {
+ zephir_is_iterable(&castValue, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 558);
+ if (Z_TYPE_P(&castValue) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&castValue), _12$$22, _13$$22, _10$$22)
+ {
+ ZEPHIR_INIT_NVAR(&position);
+ if (_13$$22 != NULL) {
+ ZVAL_STR_COPY(&position, _13$$22);
+ } else {
+ ZVAL_LONG(&position, _12$$22);
+ }
+ ZEPHIR_INIT_NVAR(&itemValue);
+ ZVAL_COPY(&itemValue, _10$$22);
+ if (ZEPHIR_IS_LONG(&type, 1024)) {
+ ZEPHIR_INIT_NVAR(&_14$$24);
+ ZEPHIR_CONCAT_VV(&_14$$24, ¶meter, &position);
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, &_14$$24, &itemValue);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_NVAR(&_15$$25);
+ ZEPHIR_CONCAT_VV(&_15$$25, ¶meter, &position);
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, &_15$$25, &itemValue, &type);
+ zephir_check_call_status();
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &castValue, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_11$$22, &castValue, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_11$$22)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&position, &castValue, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&itemValue, &castValue, "current", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_LONG(&type, 1024)) {
+ ZEPHIR_INIT_NVAR(&_16$$27);
+ ZEPHIR_CONCAT_VV(&_16$$27, ¶meter, &position);
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, &_16$$27, &itemValue);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_NVAR(&_17$$28);
+ ZEPHIR_CONCAT_VV(&_17$$28, ¶meter, &position);
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, &_17$$28, &itemValue, &type);
+ zephir_check_call_status();
+ }
+ ZEPHIR_CALL_METHOD(NULL, &castValue, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&itemValue);
+ ZEPHIR_INIT_NVAR(&position);
+ }
+ } else {
+ if (Z_TYPE_P(&value) != IS_ARRAY) {
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, ¶meter, &value);
+ zephir_check_call_status();
+ } else {
+ zephir_is_iterable(&value, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 566);
+ if (Z_TYPE_P(&value) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&value), _20$$31, _21$$31, _18$$31)
+ {
+ ZEPHIR_INIT_NVAR(&position);
+ if (_21$$31 != NULL) {
+ ZVAL_STR_COPY(&position, _21$$31);
+ } else {
+ ZVAL_LONG(&position, _20$$31);
+ }
+ ZEPHIR_INIT_NVAR(&itemValue);
+ ZVAL_COPY(&itemValue, _18$$31);
+ ZEPHIR_INIT_NVAR(&_22$$32);
+ ZEPHIR_CONCAT_VV(&_22$$32, ¶meter, &position);
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, &_22$$32, &itemValue);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &value, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_19$$31, &value, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_19$$31)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&position, &value, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&itemValue, &value, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_23$$33);
+ ZEPHIR_CONCAT_VV(&_23$$33, ¶meter, &position);
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, &_23$$33, &itemValue);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &value, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&itemValue);
+ ZEPHIR_INIT_NVAR(&position);
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &placeholders, "rewind", NULL, 0);
zephir_check_call_status();
- RETURN_MM();
- }
- ZEPHIR_INIT_VAR(&_2);
- zephir_get_class(&_2, this_ptr, 0);
- ZEPHIR_INIT_VAR(&_3);
- ZEPHIR_CONCAT_SVSV(&_3, "Access to undefined property ", &_2, "::", &property);
- ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 7, &_3);
- zephir_check_call_status();
- RETURN_MM_NULL();
-}
-
-static PHP_METHOD(Phalcon_Paginator_Repository, getAliases)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "aliases");
-}
-
-static PHP_METHOD(Phalcon_Paginator_Repository, getCurrent)
-{
- 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_MM_GROW();
-
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "current");
- ZVAL_LONG(&_1, 0);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getproperty", NULL, 0, &_0, &_1);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Paginator_Repository, getFirst)
-{
- 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_MM_GROW();
-
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "first");
- ZVAL_LONG(&_1, 0);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getproperty", NULL, 0, &_0, &_1);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Paginator_Repository, getItems)
-{
- 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_MM_GROW();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &placeholders, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&wildcard, &placeholders, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &placeholders, "current", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&wildcard) == IS_LONG) {
+ ZEPHIR_INIT_NVAR(¶meter);
+ ZVAL_LONG(¶meter, (zephir_get_numberval(&wildcard) + 1));
+ } else if (Z_TYPE_P(&wildcard) == IS_STRING) {
+ ZEPHIR_CPY_WRT(¶meter, &wildcard);
+ } else {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid bind parameter (1)", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 490);
+ return;
+ }
+ _24$$34 = Z_TYPE_P(dataTypes) == IS_ARRAY;
+ if (_24$$34) {
+ ZEPHIR_OBS_NVAR(&type);
+ _24$$34 = zephir_array_isset_fetch(&type, dataTypes, &wildcard, 0);
+ }
+ if (_24$$34) {
+ if (ZEPHIR_IS_LONG(&type, 32)) {
+ zephir_cast_to_string(&_25$$39, &value);
+ ZEPHIR_CPY_WRT(&castValue, &_25$$39);
+ ZEPHIR_INIT_NVAR(&type);
+ ZVAL_LONG(&type, 1024);
+ } else {
+ if (ZEPHIR_GLOBAL(db).force_casting) {
+ if (Z_TYPE_P(&value) != IS_ARRAY) {
+ do {
+ if (ZEPHIR_IS_LONG(&type, 1)) {
+ ZVAL_LONG(&_26$$43, 10);
+ ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_7, 51, &value, &_26$$43);
+ zephir_check_call_status();
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&type, 2)) {
+ zephir_cast_to_string(&_27$$44, &value);
+ ZEPHIR_CPY_WRT(&castValue, &_27$$44);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&type, 0)) {
+ ZEPHIR_INIT_NVAR(&castValue);
+ ZVAL_NULL(&castValue);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&type, 5)) {
+ ZEPHIR_INIT_NVAR(&castValue);
+ ZVAL_BOOL(&castValue, zephir_get_boolval(&value));
+ break;
+ }
+ ZEPHIR_CPY_WRT(&castValue, &value);
+ break;
+ } while(0);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "items");
- ZVAL_NULL(&_1);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getproperty", NULL, 0, &_0, &_1);
+ } else {
+ ZEPHIR_CPY_WRT(&castValue, &value);
+ }
+ } else {
+ ZEPHIR_CPY_WRT(&castValue, &value);
+ }
+ }
+ if (Z_TYPE_P(&castValue) != IS_ARRAY) {
+ if (ZEPHIR_IS_LONG(&type, 1024)) {
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, ¶meter, &castValue);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, ¶meter, &castValue, &type);
+ zephir_check_call_status();
+ }
+ } else {
+ zephir_is_iterable(&castValue, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 558);
+ if (Z_TYPE_P(&castValue) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&castValue), _30$$53, _31$$53, _28$$53)
+ {
+ ZEPHIR_INIT_NVAR(&position);
+ if (_31$$53 != NULL) {
+ ZVAL_STR_COPY(&position, _31$$53);
+ } else {
+ ZVAL_LONG(&position, _30$$53);
+ }
+ ZEPHIR_INIT_NVAR(&itemValue);
+ ZVAL_COPY(&itemValue, _28$$53);
+ if (ZEPHIR_IS_LONG(&type, 1024)) {
+ ZEPHIR_INIT_NVAR(&_32$$55);
+ ZEPHIR_CONCAT_VV(&_32$$55, ¶meter, &position);
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, &_32$$55, &itemValue);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_NVAR(&_33$$56);
+ ZEPHIR_CONCAT_VV(&_33$$56, ¶meter, &position);
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, &_33$$56, &itemValue, &type);
+ zephir_check_call_status();
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &castValue, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_29$$53, &castValue, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_29$$53)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&position, &castValue, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&itemValue, &castValue, "current", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_LONG(&type, 1024)) {
+ ZEPHIR_INIT_NVAR(&_34$$58);
+ ZEPHIR_CONCAT_VV(&_34$$58, ¶meter, &position);
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, &_34$$58, &itemValue);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_NVAR(&_35$$59);
+ ZEPHIR_CONCAT_VV(&_35$$59, ¶meter, &position);
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, &_35$$59, &itemValue, &type);
+ zephir_check_call_status();
+ }
+ ZEPHIR_CALL_METHOD(NULL, &castValue, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&itemValue);
+ ZEPHIR_INIT_NVAR(&position);
+ }
+ } else {
+ if (Z_TYPE_P(&value) != IS_ARRAY) {
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, ¶meter, &value);
+ zephir_check_call_status();
+ } else {
+ zephir_is_iterable(&value, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 566);
+ if (Z_TYPE_P(&value) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&value), _38$$62, _39$$62, _36$$62)
+ {
+ ZEPHIR_INIT_NVAR(&position);
+ if (_39$$62 != NULL) {
+ ZVAL_STR_COPY(&position, _39$$62);
+ } else {
+ ZVAL_LONG(&position, _38$$62);
+ }
+ ZEPHIR_INIT_NVAR(&itemValue);
+ ZVAL_COPY(&itemValue, _36$$62);
+ ZEPHIR_INIT_NVAR(&_40$$63);
+ ZEPHIR_CONCAT_VV(&_40$$63, ¶meter, &position);
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, &_40$$63, &itemValue);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &value, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_37$$62, &value, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_37$$62)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&position, &value, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&itemValue, &value, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_41$$64);
+ ZEPHIR_CONCAT_VV(&_41$$64, ¶meter, &position);
+ ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, &_41$$64, &itemValue);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &value, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&itemValue);
+ ZEPHIR_INIT_NVAR(&position);
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &placeholders, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&wildcard);
+ ZEPHIR_CALL_METHOD(NULL, statement, "execute", NULL, 0);
zephir_check_call_status();
+ RETVAL_ZVAL(statement, 1, 0);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Paginator_Repository, getLast)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, getErrorInfo)
{
- zval _0, _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_MM_GROW();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "last");
- ZVAL_LONG(&_1, 0);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getproperty", NULL, 0, &_0, &_1);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "errorinfo", NULL, 0);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Paginator_Repository, getLimit)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, getInternalHandler)
{
- 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_MM_GROW();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "limit");
- ZVAL_LONG(&_1, 0);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getproperty", NULL, 0, &_0, &_1);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_MEMBER(getThis(), "pdo");
}
-static PHP_METHOD(Phalcon_Paginator_Repository, getNext)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, getTransactionLevel)
{
- 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_MM_GROW();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "next");
- ZVAL_LONG(&_1, 0);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getproperty", NULL, 0, &_0, &_1);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_MEMBER(getThis(), "transactionLevel");
}
-static PHP_METHOD(Phalcon_Paginator_Repository, getPrevious)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, isUnderTransaction)
{
- zval _0, _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_MM_GROW();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "previous");
- ZVAL_LONG(&_1, 0);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getproperty", NULL, 0, &_0, &_1);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "intransaction", NULL, 0);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Paginator_Repository, getTotalItems)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, lastInsertId)
{
- zval _0, _1;
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();
+ ZVAL_UNDEF(&name);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
-
-
- ZEPHIR_MM_GROW();
-
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "total_items");
- ZVAL_LONG(&_1, 0);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getproperty", NULL, 0, &_0, &_1);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Paginator_Repository, jsonSerialize)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "properties");
-}
-
-static PHP_METHOD(Phalcon_Paginator_Repository, setAliases)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *aliases_param = NULL;
- zval aliases;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&aliases);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(aliases)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &aliases_param);
- zephir_get_arrval(&aliases, aliases_param);
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("aliases"), &aliases);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Paginator_Repository, setProperties)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *properties_param = NULL;
- zval properties;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&properties);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(properties)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &properties_param);
- zephir_get_arrval(&properties, properties_param);
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("properties"), &properties);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Paginator_Repository, getProperty)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *property_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, _1;
- zval property;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&property);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(property)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_STR_OR_NULL(name)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &property_param, &defaultValue);
- zephir_get_strval(&property, property_param);
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
+ zephir_fetch_params(1, 0, 1, &name_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);
+ }
}
- zephir_read_property(&_1, this_ptr, ZEND_STRL("properties"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_helper_arr_ce, "get", &_0, 16, &_1, &property, defaultValue);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "lastinsertid", NULL, 0, &name);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Paginator_Repository, getRealNameProperty)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, prepare)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *property_param = NULL, aliases, _0$$3;
- zval property;
+ zval *sqlStatement_param = NULL, _0;
+ zval sqlStatement;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&property);
- ZVAL_UNDEF(&aliases);
- ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&sqlStatement);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(property)
+ Z_PARAM_STR(sqlStatement)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &property_param);
- zephir_get_strval(&property, property_param);
-
-
- ZEPHIR_CALL_METHOD(&aliases, this_ptr, "getaliases", NULL, 0);
- zephir_check_call_status();
- if (zephir_array_isset(&aliases, &property)) {
- zephir_array_fetch(&_0$$3, &aliases, &property, PH_NOISY | PH_READONLY, "phalcon/Paginator/Repository.zep", 180);
- RETURN_CTOR(&_0$$3);
+ zephir_fetch_params(1, 1, 0, &sqlStatement_param);
+ if (UNEXPECTED(Z_TYPE_P(sqlStatement_param) != IS_STRING && Z_TYPE_P(sqlStatement_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlStatement' must be of the type string"));
+ RETURN_MM_NULL();
}
- RETURN_CTOR(&property);
-}
-
-zend_object *zephir_init_properties_Phalcon_Paginator_Repository(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_MM_GROW();
-
- {
- 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("properties"), 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("properties"), &_1$$3);
- }
- zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("aliases"), 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("aliases"), &_3$$4);
- }
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
+ if (EXPECTED(Z_TYPE_P(sqlStatement_param) == IS_STRING)) {
+ zephir_get_strval(&sqlStatement, sqlStatement_param);
+ } else {
+ ZEPHIR_INIT_VAR(&sqlStatement);
}
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Paginator_RepositoryInterface)
-{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Paginator, RepositoryInterface, phalcon, paginator_repositoryinterface, phalcon_paginator_repositoryinterface_method_entry);
-
- zephir_declare_class_constant_string(phalcon_paginator_repositoryinterface_ce, SL("PROPERTY_CURRENT_PAGE"), "current");
-
- zephir_declare_class_constant_string(phalcon_paginator_repositoryinterface_ce, SL("PROPERTY_FIRST_PAGE"), "first");
-
- zephir_declare_class_constant_string(phalcon_paginator_repositoryinterface_ce, SL("PROPERTY_ITEMS"), "items");
-
- zephir_declare_class_constant_string(phalcon_paginator_repositoryinterface_ce, SL("PROPERTY_LAST_PAGE"), "last");
-
- zephir_declare_class_constant_string(phalcon_paginator_repositoryinterface_ce, SL("PROPERTY_LIMIT"), "limit");
-
- zephir_declare_class_constant_string(phalcon_paginator_repositoryinterface_ce, SL("PROPERTY_NEXT_PAGE"), "next");
-
- zephir_declare_class_constant_string(phalcon_paginator_repositoryinterface_ce, SL("PROPERTY_PREVIOUS_PAGE"), "previous");
-
- zephir_declare_class_constant_string(phalcon_paginator_repositoryinterface_ce, SL("PROPERTY_TOTAL_ITEMS"), "total_items");
-
- return SUCCESS;
-}
-
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_RepositoryInterface, getAliases);
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_RepositoryInterface, getCurrent);
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_RepositoryInterface, getFirst);
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_RepositoryInterface, getItems);
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_RepositoryInterface, getLast);
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_RepositoryInterface, getLimit);
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_RepositoryInterface, getNext);
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_RepositoryInterface, getPrevious);
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_RepositoryInterface, getTotalItems);
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_RepositoryInterface, setAliases);
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_RepositoryInterface, setProperties);
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Paginator_Adapter_AbstractAdapter)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Paginator\\Adapter, AbstractAdapter, phalcon, paginator_adapter_abstractadapter, phalcon_paginator_adapter_abstractadapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
-
- zend_declare_property_null(phalcon_paginator_adapter_abstractadapter_ce, SL("config"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_paginator_adapter_abstractadapter_ce, SL("limitRows"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_paginator_adapter_abstractadapter_ce, SL("page"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_paginator_adapter_abstractadapter_ce, SL("repository"), ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_paginator_adapter_abstractadapter_ce, 1, phalcon_paginator_adapter_adapterinterface_ce);
- return SUCCESS;
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "prepare", NULL, 0, &sqlStatement);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Paginator_Adapter_AbstractAdapter, __construct)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, query)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *config_param = NULL, _0$$3, _1$$4, _2$$5;
- zval config;
+ zval bindParams, bindTypes;
+ zval *sqlStatement_param = NULL, *bindParams_param = NULL, *bindTypes_param = NULL, eventsManager, statement, params, types, _0, _3, _1$$3, _2$$3, _4$$9;
+ zval sqlStatement;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&config);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&sqlStatement);
+ ZVAL_UNDEF(&eventsManager);
+ ZVAL_UNDEF(&statement);
+ ZVAL_UNDEF(¶ms);
+ ZVAL_UNDEF(&types);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_4$$9);
+ ZVAL_UNDEF(&bindParams);
+ ZVAL_UNDEF(&bindTypes);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(config)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(sqlStatement)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(bindParams)
+ Z_PARAM_ARRAY(bindTypes)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &config_param);
- ZEPHIR_OBS_COPY_OR_DUP(&config, config_param);
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("config"), &config);
- if (zephir_array_isset_string(&config, SL("limit"))) {
- zephir_array_fetch_string(&_0$$3, &config, SL("limit"), PH_NOISY | PH_READONLY, "phalcon/Paginator/Adapter/AbstractAdapter.zep", 62);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setlimit", NULL, 0, &_0$$3);
- zephir_check_call_status();
+ zephir_fetch_params(1, 1, 2, &sqlStatement_param, &bindParams_param, &bindTypes_param);
+ if (UNEXPECTED(Z_TYPE_P(sqlStatement_param) != IS_STRING && Z_TYPE_P(sqlStatement_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlStatement' must be of the type string"));
+ RETURN_MM_NULL();
}
- if (zephir_array_isset_string(&config, SL("page"))) {
- zephir_array_fetch_string(&_1$$4, &config, SL("page"), PH_NOISY | PH_READONLY, "phalcon/Paginator/Adapter/AbstractAdapter.zep", 68);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcurrentpage", NULL, 0, &_1$$4);
- zephir_check_call_status();
+ if (EXPECTED(Z_TYPE_P(sqlStatement_param) == IS_STRING)) {
+ zephir_get_strval(&sqlStatement, sqlStatement_param);
+ } else {
+ ZEPHIR_INIT_VAR(&sqlStatement);
}
- if (zephir_array_isset_string(&config, SL("repository"))) {
- zephir_array_fetch_string(&_2$$5, &config, SL("repository"), PH_NOISY | PH_READONLY, "phalcon/Paginator/Adapter/AbstractAdapter.zep", 74);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrepository", NULL, 0, &_2$$5);
- zephir_check_call_status();
+ if (!bindParams_param) {
+ ZEPHIR_INIT_VAR(&bindParams);
+ array_init(&bindParams);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindParams, bindParams_param);
+ }
+ if (!bindTypes_param) {
+ ZEPHIR_INIT_VAR(&bindTypes);
+ array_init(&bindTypes);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&bindTypes, bindTypes_param);
}
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Paginator_Adapter_AbstractAdapter, getLimit)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "limitRows");
-}
-
-static PHP_METHOD(Phalcon_Paginator_Adapter_AbstractAdapter, setCurrentPage)
-{
- zval *page_param = NULL, _0;
- zend_long page;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(page)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &page_param);
- page = zephir_get_intval(page_param);
-
-
- ZEPHIR_INIT_ZVAL_NREF(_0);
- ZVAL_LONG(&_0, page);
- zephir_update_property_zval(this_ptr, ZEND_STRL("page"), &_0);
- RETURN_THISW();
-}
-
-static PHP_METHOD(Phalcon_Paginator_Adapter_AbstractAdapter, setLimit)
-{
- zval *limit_param = NULL, _0;
- zend_long limit;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(limit)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &limit_param);
- limit = zephir_get_intval(limit_param);
- if (limit <= 0) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_paginator_exception_ce, "Limit must be greater than zero", "phalcon/Paginator/Adapter/AbstractAdapter.zep", 102);
+ 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_update_property_zval(this_ptr, ZEND_STRL("sqlStatement"), &sqlStatement);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("sqlVariables"), &bindParams);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("sqlBindTypes"), &bindTypes);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZVAL_STRING(&_2$$3, "db:beforeQuery");
+ 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);
+ }
+ }
+ if (!(ZEPHIR_IS_EMPTY(&bindParams))) {
+ ZEPHIR_CPY_WRT(¶ms, &bindParams);
+ ZEPHIR_CPY_WRT(&types, &bindTypes);
+ } else {
+ ZEPHIR_INIT_NVAR(¶ms);
+ array_init(¶ms);
+ ZEPHIR_INIT_NVAR(&types);
+ array_init(&types);
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&statement, &_0, "prepare", NULL, 0, &sqlStatement);
+ zephir_check_call_status();
+ if (UNEXPECTED(Z_TYPE_P(&statement) != IS_OBJECT)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Cannot prepare statement", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 720);
return;
}
- ZEPHIR_INIT_ZVAL_NREF(_0);
- ZVAL_LONG(&_0, limit);
- zephir_update_property_zval(this_ptr, ZEND_STRL("limitRows"), &_0);
- RETURN_THISW();
-}
-
-static PHP_METHOD(Phalcon_Paginator_Adapter_AbstractAdapter, setRepository)
-{
- zval *repository, repository_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&repository_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(repository, phalcon_paginator_repositoryinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &repository);
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("repository"), repository);
- RETURN_THISW();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "preparerealsql", NULL, 0, &sqlStatement, &bindParams);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_3, this_ptr, "executeprepared", NULL, 0, &statement, ¶ms, &types);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&statement, &_3);
+ if (Z_TYPE_P(&statement) == IS_OBJECT) {
+ if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_4$$9);
+ ZVAL_STRING(&_4$$9, "db:afterQuery");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_4$$9, this_ptr);
+ zephir_check_call_status();
+ }
+ object_init_ex(return_value, phalcon_db_result_pdo_ce);
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 52, this_ptr, &statement, &sqlStatement, &bindParams, &bindTypes);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ RETURN_CCTOR(&statement);
}
-static PHP_METHOD(Phalcon_Paginator_Adapter_AbstractAdapter, getRepository)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, rollback)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *properties_param = NULL, _0, _1$$3, _2$$4;
- zval properties;
+ zend_long ZEPHIR_LAST_CALL_STATUS, transactionLevel = 0;
+ zval *nesting_param = NULL, eventsManager, savepointName, _0, _5, _6, _1$$4, _2$$5, _7$$8;
+ zend_bool nesting, _3, _4;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&properties);
+ ZVAL_UNDEF(&eventsManager);
+ ZVAL_UNDEF(&savepointName);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&_7$$8);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY_OR_NULL(properties)
+ Z_PARAM_BOOL(nesting)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &properties_param);
- if (!properties_param) {
- ZEPHIR_INIT_VAR(&properties);
+ zephir_fetch_params(1, 0, 1, &nesting_param);
+ if (!nesting_param) {
+ nesting = 1;
} else {
- zephir_get_arrval(&properties, properties_param);
+ nesting = zephir_get_boolval(nesting_param);
}
ZEPHIR_OBS_VAR(&_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("repository"), PH_NOISY_CC);
- if (Z_TYPE_P(&_0) != IS_OBJECT) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_paginator_repository_ce);
- if (zephir_has_constructor(&_1$$3)) {
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("transactionLevel"), PH_NOISY_CC);
+ transactionLevel = zephir_get_intval(&_0);
+ if (UNEXPECTED(!transactionLevel)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "There is no active transaction", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 759);
+ return;
+ }
+ if (transactionLevel == 1) {
+ zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&eventsManager, &_1$$4);
+ if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_2$$5);
+ ZVAL_STRING(&_2$$5, "db:rollbackTransaction");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_2$$5, this_ptr);
zephir_check_call_status();
}
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("repository"), &_1$$3);
+ RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel")));
+ zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_1$$4, "rollback", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
}
- if (!ZEPHIR_IS_NULL(&properties)) {
- zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("repository"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_2$$4, "setproperties", NULL, 0, &properties);
+ _3 = !transactionLevel;
+ if (!(_3)) {
+ _3 = !nesting;
+ }
+ _4 = _3;
+ if (!(_4)) {
+ ZEPHIR_CALL_METHOD(&_5, this_ptr, "isnestedtransactionswithsavepoints", NULL, 0);
zephir_check_call_status();
+ _4 = !zephir_is_true(&_5);
}
- RETURN_MM_MEMBER(getThis(), "repository");
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Paginator_Adapter_AdapterInterface)
-{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Paginator\\Adapter, AdapterInterface, phalcon, paginator_adapter_adapterinterface, phalcon_paginator_adapter_adapterinterface_method_entry);
-
- return SUCCESS;
+ if (_4) {
+ if (transactionLevel > 0) {
+ RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel")));
+ }
+ RETURN_MM_BOOL(0);
+ }
+ ZEPHIR_CALL_METHOD(&savepointName, this_ptr, "getnestedtransactionsavepointname", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&eventsManager, &_6);
+ if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_7$$8);
+ ZVAL_STRING(&_7$$8, "db:rollbackSavepoint");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_7$$8, this_ptr, &savepointName);
+ zephir_check_call_status();
+ }
+ RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel")));
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "rollbacksavepoint", NULL, 0, &savepointName);
+ zephir_check_call_status();
+ RETURN_MM();
}
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_Adapter_AdapterInterface, getLimit);
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_Adapter_AdapterInterface, paginate);
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_Adapter_AdapterInterface, setCurrentPage);
-ZEPHIR_DOC_METHOD(Phalcon_Paginator_Adapter_AdapterInterface, setLimit);
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Paginator_Adapter_Model)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, getDsnDefaults)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Paginator\\Adapter, Model, phalcon, paginator_adapter_model, phalcon_paginator_adapter_abstractadapter_ce, phalcon_paginator_adapter_model_method_entry, 0);
-
- return SUCCESS;
}
-static PHP_METHOD(Phalcon_Paginator_Adapter_Model, paginate)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, prepareRealSql)
{
- zval _8, _15, _12$$6;
- zval config, modelClass, parameters, pageItems, _0, _1, _2, _3, _5, _6, _7, _9, _16, _10$$6, _11$$6, _13$$6, _14$$6;
+ zend_string *_3$$3;
+ zend_ulong _2$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS, pageNumber = 0, limit = 0, rowcount = 0, next = 0, totalPages = 0, previous = 0;
- zephir_fcall_cache_entry *_4 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval parameters, keys, values;
+ zval *statement_param = NULL, *parameters_param = NULL, key, result, value, *_0$$3, _1$$3, _16$$3, _4$$5, _5$$6, _6$$7, _7$$8, _8$$8, _9$$9, _10$$11, _11$$12, _12$$13, _13$$14, _14$$14, _15$$15;
+ zval statement;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&config);
- ZVAL_UNDEF(&modelClass);
+ ZVAL_UNDEF(&statement);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_16$$3);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&_7$$8);
+ ZVAL_UNDEF(&_8$$8);
+ ZVAL_UNDEF(&_9$$9);
+ ZVAL_UNDEF(&_10$$11);
+ ZVAL_UNDEF(&_11$$12);
+ ZVAL_UNDEF(&_12$$13);
+ ZVAL_UNDEF(&_13$$14);
+ ZVAL_UNDEF(&_14$$14);
+ ZVAL_UNDEF(&_15$$15);
ZVAL_UNDEF(¶meters);
- ZVAL_UNDEF(&pageItems);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_9);
- ZVAL_UNDEF(&_16);
- ZVAL_UNDEF(&_10$$6);
- ZVAL_UNDEF(&_11$$6);
- ZVAL_UNDEF(&_13$$6);
- ZVAL_UNDEF(&_14$$6);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_15);
- ZVAL_UNDEF(&_12$$6);
+ ZVAL_UNDEF(&keys);
+ ZVAL_UNDEF(&values);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(statement)
+ Z_PARAM_ARRAY(parameters)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &statement_param, ¶meters_param);
+ zephir_get_strval(&statement, statement_param);
+ zephir_get_arrval(¶meters, parameters_param);
- ZEPHIR_INIT_VAR(&pageItems);
- array_init(&pageItems);
- ZEPHIR_OBS_VAR(&_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("limitRows"), PH_NOISY_CC);
- limit = zephir_get_intval(&_0);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("config"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&config, &_1);
- ZEPHIR_OBS_VAR(&_2);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("page"), PH_NOISY_CC);
- pageNumber = zephir_get_intval(&_2);
- zephir_array_fetch_string(&_3, &config, SL("model"), PH_NOISY | PH_READONLY, "phalcon/Paginator/Adapter/Model.zep", 100);
- ZEPHIR_CPY_WRT(&modelClass, &_3);
- ZEPHIR_INIT_VAR(&_5);
- array_init(&_5);
- ZEPHIR_INIT_VAR(&_6);
- ZVAL_STRING(&_6, "parameters");
- ZEPHIR_INIT_VAR(&_7);
- ZVAL_STRING(&_7, "array");
- ZEPHIR_CALL_CE_STATIC(¶meters, phalcon_helper_arr_ce, "get", &_4, 16, &config, &_6, &_5, &_7);
- zephir_check_call_status();
- if (pageNumber <= 0) {
- pageNumber = 1;
- }
- ZEPHIR_INIT_VAR(&_8);
- zephir_create_array(&_8, 2, 0);
- zephir_array_fast_append(&_8, &modelClass);
- ZEPHIR_INIT_NVAR(&_6);
- ZVAL_STRING(&_6, "count");
- zephir_array_fast_append(&_8, &_6);
- ZEPHIR_CALL_FUNCTION(&_9, "call_user_func", NULL, 255, &_8, ¶meters);
- zephir_check_call_status();
- rowcount = zephir_get_intval(&_9);
- if (zephir_safe_mod_long_long(rowcount, limit) != 0) {
- totalPages = (int) ((zephir_safe_div_long_long(rowcount, limit) + (double) (1)));
- } else {
- totalPages = (int) (zephir_safe_div_long_long(rowcount, limit));
- }
- if (rowcount > 0) {
- ZEPHIR_INIT_VAR(&_10$$6);
- ZVAL_LONG(&_10$$6, limit);
- zephir_array_update_string(¶meters, SL("limit"), &_10$$6, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_VAR(&_11$$6);
- ZVAL_LONG(&_11$$6, (limit * ((pageNumber - 1))));
- zephir_array_update_string(¶meters, SL("offset"), &_11$$6, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_VAR(&_12$$6);
- zephir_create_array(&_12$$6, 2, 0);
- zephir_array_fast_append(&_12$$6, &modelClass);
- ZEPHIR_INIT_VAR(&_13$$6);
- ZVAL_STRING(&_13$$6, "find");
- zephir_array_fast_append(&_12$$6, &_13$$6);
- ZEPHIR_CALL_FUNCTION(&_14$$6, "call_user_func", NULL, 255, &_12$$6, ¶meters);
+
+ ZEPHIR_CPY_WRT(&result, &statement);
+ ZEPHIR_CPY_WRT(&values, ¶meters);
+ if (!(ZEPHIR_IS_EMPTY(¶meters))) {
+ ZEPHIR_INIT_VAR(&keys);
+ array_init(&keys);
+ zephir_is_iterable(¶meters, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 848);
+ if (Z_TYPE_P(¶meters) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(¶meters), _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);
+ if (Z_TYPE_P(&key) == IS_STRING) {
+ ZEPHIR_INIT_NVAR(&_4$$5);
+ ZEPHIR_CONCAT_SVS(&_4$$5, "/:", &key, "/");
+ zephir_array_append(&keys, &_4$$5, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 834);
+ } else {
+ ZEPHIR_INIT_NVAR(&_5$$6);
+ ZVAL_STRING(&_5$$6, "/[?]/");
+ zephir_array_append(&keys, &_5$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 836);
+ }
+ if (Z_TYPE_P(&value) == IS_STRING) {
+ ZEPHIR_INIT_NVAR(&_6$$7);
+ ZEPHIR_CONCAT_SVS(&_6$$7, "'", &value, "'");
+ zephir_array_update_zval(&values, &key, &_6$$7, PH_COPY | PH_SEPARATE);
+ } else if (Z_TYPE_P(&value) == IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(&_7$$8);
+ zephir_fast_join_str(&_7$$8, SL("','"), &value);
+ ZEPHIR_INIT_NVAR(&_8$$8);
+ ZEPHIR_CONCAT_SVS(&_8$$8, "'", &_7$$8, "'");
+ zephir_array_update_zval(&values, &key, &_8$$8, PH_COPY | PH_SEPARATE);
+ } else if (Z_TYPE_P(&value) == IS_NULL) {
+ ZEPHIR_INIT_NVAR(&_9$$9);
+ ZVAL_STRING(&_9$$9, "NULL");
+ zephir_array_update_zval(&values, &key, &_9$$9, PH_COPY | PH_SEPARATE);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, ¶meters, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1$$3, ¶meters, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&key, ¶meters, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, ¶meters, "current", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&key) == IS_STRING) {
+ ZEPHIR_INIT_NVAR(&_10$$11);
+ ZEPHIR_CONCAT_SVS(&_10$$11, "/:", &key, "/");
+ zephir_array_append(&keys, &_10$$11, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 834);
+ } else {
+ ZEPHIR_INIT_NVAR(&_11$$12);
+ ZVAL_STRING(&_11$$12, "/[?]/");
+ zephir_array_append(&keys, &_11$$12, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 836);
+ }
+ if (Z_TYPE_P(&value) == IS_STRING) {
+ ZEPHIR_INIT_NVAR(&_12$$13);
+ ZEPHIR_CONCAT_SVS(&_12$$13, "'", &value, "'");
+ zephir_array_update_zval(&values, &key, &_12$$13, PH_COPY | PH_SEPARATE);
+ } else if (Z_TYPE_P(&value) == IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(&_13$$14);
+ zephir_fast_join_str(&_13$$14, SL("','"), &value);
+ ZEPHIR_INIT_NVAR(&_14$$14);
+ ZEPHIR_CONCAT_SVS(&_14$$14, "'", &_13$$14, "'");
+ zephir_array_update_zval(&values, &key, &_14$$14, PH_COPY | PH_SEPARATE);
+ } else if (Z_TYPE_P(&value) == IS_NULL) {
+ ZEPHIR_INIT_NVAR(&_15$$15);
+ ZVAL_STRING(&_15$$15, "NULL");
+ zephir_array_update_zval(&values, &key, &_15$$15, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_CALL_METHOD(NULL, ¶meters, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&key);
+ ZVAL_LONG(&_16$$3, 1);
+ ZEPHIR_CALL_FUNCTION(&result, "preg_replace", NULL, 50, &keys, &values, &statement, &_16$$3);
zephir_check_call_status();
- ZEPHIR_CPY_WRT(&pageItems, &_14$$6);
}
- next = (pageNumber + 1);
- if (next > totalPages) {
- next = totalPages;
- }
- if (pageNumber > 1) {
- previous = (pageNumber - 1);
- } else {
- previous = 1;
- }
- ZEPHIR_INIT_VAR(&_15);
- zephir_create_array(&_15, 8, 0);
- zephir_array_update_string(&_15, SL("items"), &pageItems, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_6);
- ZVAL_LONG(&_6, rowcount);
- zephir_array_update_string(&_15, SL("total_items"), &_6, PH_COPY | PH_SEPARATE);
- ZEPHIR_OBS_VAR(&_16);
- zephir_read_property(&_16, this_ptr, ZEND_STRL("limitRows"), PH_NOISY_CC);
- zephir_array_update_string(&_15, SL("limit"), &_16, PH_COPY | PH_SEPARATE);
- add_assoc_long_ex(&_15, SL("first"), 1);
- ZEPHIR_INIT_NVAR(&_6);
- ZVAL_LONG(&_6, previous);
- zephir_array_update_string(&_15, SL("previous"), &_6, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_6);
- ZVAL_LONG(&_6, pageNumber);
- zephir_array_update_string(&_15, SL("current"), &_6, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_6);
- ZVAL_LONG(&_6, next);
- zephir_array_update_string(&_15, SL("next"), &_6, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_6);
- ZVAL_LONG(&_6, totalPages);
- zephir_array_update_string(&_15, SL("last"), &_6, PH_COPY | PH_SEPARATE);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getrepository", NULL, 0, &_15);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("realSqlStatement"), &result);
+ ZEPHIR_MM_RESTORE();
}
@@ -193345,479 +189032,1419 @@ static PHP_METHOD(Phalcon_Paginator_Adapter_Model, paginate)
-ZEPHIR_INIT_CLASS(Phalcon_Paginator_Adapter_NativeArray)
+ZEPHIR_INIT_CLASS(Phalcon_Db_Adapter_Pdo_Mysql)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Paginator\\Adapter, NativeArray, phalcon, paginator_adapter_nativearray, phalcon_paginator_adapter_abstractadapter_ce, phalcon_paginator_adapter_nativearray_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Db\\Adapter\\Pdo, Mysql, phalcon, db_adapter_pdo_mysql, phalcon_db_adapter_pdo_abstractpdo_ce, phalcon_db_adapter_pdo_mysql_method_entry, 0);
+ zend_declare_property_string(phalcon_db_adapter_pdo_mysql_ce, SL("dialectType"), "mysql", ZEND_ACC_PROTECTED);
+ zend_declare_property_string(phalcon_db_adapter_pdo_mysql_ce, SL("type"), "mysql", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Paginator_Adapter_NativeArray, paginate)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, addForeignKey)
{
- zval _6;
- double roundedTotal = 0;
- zval config, items, _0, _1, _2, _3, _4, _5, _7, _8;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS, show = 0, pageNumber = 0, totalPages = 0, number = 0, previous = 0, next = 0;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *reference, reference_sub, foreignKeyCheck, _0, _1, _2, _3, _4;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&config);
- ZVAL_UNDEF(&items);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&reference_sub);
+ ZVAL_UNDEF(&foreignKeyCheck);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_6);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(reference, phalcon_db_referenceinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("config"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&config, &_0);
- ZEPHIR_OBS_VAR(&items);
- zephir_array_fetch_string(&items, &config, SL("data"), PH_NOISY, "phalcon/Paginator/Adapter/NativeArray.zep", 54);
- if (UNEXPECTED(Z_TYPE_P(&items) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "Invalid data for paginator", "phalcon/Paginator/Adapter/NativeArray.zep", 57);
- return;
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &reference);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
}
- ZEPHIR_OBS_VAR(&_1);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("limitRows"), PH_NOISY_CC);
- show = zephir_get_intval(&_1);
- ZEPHIR_OBS_VAR(&_2);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("page"), PH_NOISY_CC);
- pageNumber = zephir_get_intval(&_2);
- if (pageNumber <= 0) {
- pageNumber = 1;
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
}
- number = zephir_fast_count_int(&items);
- ZVAL_LONG(&_0, show);
- ZEPHIR_CALL_FUNCTION(&_3, "floatval", NULL, 18, &_0);
- zephir_check_call_status();
- roundedTotal = zephir_safe_div_long_zval(number, &_3);
- totalPages = (int) (roundedTotal);
- if (totalPages != roundedTotal) {
- totalPages++;
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
}
- ZVAL_LONG(&_0, (show * ((pageNumber - 1))));
- ZVAL_LONG(&_4, show);
- ZEPHIR_CALL_FUNCTION(&_5, "array_slice", NULL, 260, &items, &_0, &_4);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&items, &_5);
- if (pageNumber < totalPages) {
- next = (pageNumber + 1);
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
} else {
- next = totalPages;
+ ZEPHIR_INIT_VAR(&schemaName);
}
- if (pageNumber > 1) {
- previous = (pageNumber - 1);
- } else {
- previous = 1;
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "getforeignkeychecks", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&foreignKeyCheck, this_ptr, "prepare", NULL, 0, &_1);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_2, &foreignKeyCheck, "execute", NULL, 0);
+ zephir_check_call_status();
+ if (UNEXPECTED(!zephir_is_true(&_2))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "DATABASE PARAMETER 'FOREIGN_KEY_CHECKS' HAS TO BE 1", "phalcon/Db/Adapter/Pdo/Mysql.zep", 66);
+ return;
}
- ZEPHIR_INIT_VAR(&_6);
- zephir_create_array(&_6, 8, 0);
- zephir_array_update_string(&_6, SL("items"), &items, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_VAR(&_7);
- ZVAL_LONG(&_7, number);
- zephir_array_update_string(&_6, SL("total_items"), &_7, PH_COPY | PH_SEPARATE);
- ZEPHIR_OBS_VAR(&_8);
- zephir_read_property(&_8, this_ptr, ZEND_STRL("limitRows"), PH_NOISY_CC);
- zephir_array_update_string(&_6, SL("limit"), &_8, PH_COPY | PH_SEPARATE);
- add_assoc_long_ex(&_6, SL("first"), 1);
- ZEPHIR_INIT_NVAR(&_7);
- ZVAL_LONG(&_7, previous);
- zephir_array_update_string(&_6, SL("previous"), &_7, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_7);
- ZVAL_LONG(&_7, pageNumber);
- zephir_array_update_string(&_6, SL("current"), &_7, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_7);
- ZVAL_LONG(&_7, next);
- zephir_array_update_string(&_6, SL("next"), &_7, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_7);
- ZVAL_LONG(&_7, totalPages);
- zephir_array_update_string(&_6, SL("last"), &_7, PH_COPY | PH_SEPARATE);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getrepository", NULL, 0, &_6);
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_4, &_3, "addforeignkey", NULL, 0, &tableName, &schemaName, reference);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_4);
zephir_check_call_status();
RETURN_MM();
}
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeColumns)
+{
+ zend_bool _5$$3, _66$$49;
+ zval definition;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_64 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *table_param = NULL, *schema_param = NULL, __$true, __$false, columns, columnType, fields, field, oldColumn, sizePattern, matches, matchOne, matchTwo, columnName, _0, _1, _2, *_3, _4, _49$$3, _50$$3, _51$$3, _52$$3, _61$$3, _63$$3, _6$$4, _7$$4, _8$$5, _9$$5, _10$$6, _11$$6, _12$$7, _13$$7, _14$$8, _15$$8, _16$$9, _17$$9, _18$$10, _19$$11, _20$$12, _21$$13, _22$$14, _23$$14, _24$$15, _25$$15, _26$$16, _27$$17, _28$$18, _29$$19, _30$$20, _31$$21, _32$$22, _33$$23, _34$$24, _35$$25, _36$$26, _37$$27, _38$$28, _39$$29, _40$$30, _41$$31, _42$$32, _43$$32, _44$$33, _45$$33, _46$$33, _47$$35, _48$$36, _53$$43, _54$$44, _55$$44, _56$$44, _57$$45, _58$$46, _59$$47, _60$$47, _62$$48, _65$$49, _110$$49, _111$$49, _112$$49, _113$$49, _122$$49, _124$$49, _67$$50, _68$$50, _69$$51, _70$$51, _71$$52, _72$$52, _73$$53, _74$$53, _75$$54, _76$$54, _77$$55, _78$$55, _79$$56, _80$$57, _81$$58, _82$$59, _83$$60, _84$$60, _85$$61, _86$$61, _87$$62, _88$$63, _89$$64, _90$$65, _91$$66, _92$$67, _93$$68, _94$$69, _95$$70, _96$$71, _97$$72, _98$$73, _99$$74, _100$$75, _101$$76, _102$$77, _103$$78, _104$$78, _105$$79, _106$$79, _107$$79, _108$$81, _109$$82, _114$$89, _115$$90, _116$$90, _117$$90, _118$$91, _119$$92, _120$$93, _121$$93, _123$$94;
+ zval table, schema;
+ zval *this_ptr = getThis();
-
-
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&columnType);
+ ZVAL_UNDEF(&fields);
+ ZVAL_UNDEF(&field);
+ ZVAL_UNDEF(&oldColumn);
+ ZVAL_UNDEF(&sizePattern);
+ ZVAL_UNDEF(&matches);
+ ZVAL_UNDEF(&matchOne);
+ ZVAL_UNDEF(&matchTwo);
+ ZVAL_UNDEF(&columnName);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_49$$3);
+ ZVAL_UNDEF(&_50$$3);
+ ZVAL_UNDEF(&_51$$3);
+ ZVAL_UNDEF(&_52$$3);
+ ZVAL_UNDEF(&_61$$3);
+ ZVAL_UNDEF(&_63$$3);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$6);
+ ZVAL_UNDEF(&_11$$6);
+ ZVAL_UNDEF(&_12$$7);
+ ZVAL_UNDEF(&_13$$7);
+ ZVAL_UNDEF(&_14$$8);
+ ZVAL_UNDEF(&_15$$8);
+ ZVAL_UNDEF(&_16$$9);
+ ZVAL_UNDEF(&_17$$9);
+ ZVAL_UNDEF(&_18$$10);
+ ZVAL_UNDEF(&_19$$11);
+ ZVAL_UNDEF(&_20$$12);
+ ZVAL_UNDEF(&_21$$13);
+ ZVAL_UNDEF(&_22$$14);
+ ZVAL_UNDEF(&_23$$14);
+ ZVAL_UNDEF(&_24$$15);
+ ZVAL_UNDEF(&_25$$15);
+ ZVAL_UNDEF(&_26$$16);
+ ZVAL_UNDEF(&_27$$17);
+ ZVAL_UNDEF(&_28$$18);
+ ZVAL_UNDEF(&_29$$19);
+ ZVAL_UNDEF(&_30$$20);
+ ZVAL_UNDEF(&_31$$21);
+ ZVAL_UNDEF(&_32$$22);
+ ZVAL_UNDEF(&_33$$23);
+ ZVAL_UNDEF(&_34$$24);
+ ZVAL_UNDEF(&_35$$25);
+ ZVAL_UNDEF(&_36$$26);
+ ZVAL_UNDEF(&_37$$27);
+ ZVAL_UNDEF(&_38$$28);
+ ZVAL_UNDEF(&_39$$29);
+ ZVAL_UNDEF(&_40$$30);
+ ZVAL_UNDEF(&_41$$31);
+ ZVAL_UNDEF(&_42$$32);
+ ZVAL_UNDEF(&_43$$32);
+ ZVAL_UNDEF(&_44$$33);
+ ZVAL_UNDEF(&_45$$33);
+ ZVAL_UNDEF(&_46$$33);
+ ZVAL_UNDEF(&_47$$35);
+ ZVAL_UNDEF(&_48$$36);
+ ZVAL_UNDEF(&_53$$43);
+ ZVAL_UNDEF(&_54$$44);
+ ZVAL_UNDEF(&_55$$44);
+ ZVAL_UNDEF(&_56$$44);
+ ZVAL_UNDEF(&_57$$45);
+ ZVAL_UNDEF(&_58$$46);
+ ZVAL_UNDEF(&_59$$47);
+ ZVAL_UNDEF(&_60$$47);
+ ZVAL_UNDEF(&_62$$48);
+ ZVAL_UNDEF(&_65$$49);
+ ZVAL_UNDEF(&_110$$49);
+ ZVAL_UNDEF(&_111$$49);
+ ZVAL_UNDEF(&_112$$49);
+ ZVAL_UNDEF(&_113$$49);
+ ZVAL_UNDEF(&_122$$49);
+ ZVAL_UNDEF(&_124$$49);
+ ZVAL_UNDEF(&_67$$50);
+ ZVAL_UNDEF(&_68$$50);
+ ZVAL_UNDEF(&_69$$51);
+ ZVAL_UNDEF(&_70$$51);
+ ZVAL_UNDEF(&_71$$52);
+ ZVAL_UNDEF(&_72$$52);
+ ZVAL_UNDEF(&_73$$53);
+ ZVAL_UNDEF(&_74$$53);
+ ZVAL_UNDEF(&_75$$54);
+ ZVAL_UNDEF(&_76$$54);
+ ZVAL_UNDEF(&_77$$55);
+ ZVAL_UNDEF(&_78$$55);
+ ZVAL_UNDEF(&_79$$56);
+ ZVAL_UNDEF(&_80$$57);
+ ZVAL_UNDEF(&_81$$58);
+ ZVAL_UNDEF(&_82$$59);
+ ZVAL_UNDEF(&_83$$60);
+ ZVAL_UNDEF(&_84$$60);
+ ZVAL_UNDEF(&_85$$61);
+ ZVAL_UNDEF(&_86$$61);
+ ZVAL_UNDEF(&_87$$62);
+ ZVAL_UNDEF(&_88$$63);
+ ZVAL_UNDEF(&_89$$64);
+ ZVAL_UNDEF(&_90$$65);
+ ZVAL_UNDEF(&_91$$66);
+ ZVAL_UNDEF(&_92$$67);
+ ZVAL_UNDEF(&_93$$68);
+ ZVAL_UNDEF(&_94$$69);
+ ZVAL_UNDEF(&_95$$70);
+ ZVAL_UNDEF(&_96$$71);
+ ZVAL_UNDEF(&_97$$72);
+ ZVAL_UNDEF(&_98$$73);
+ ZVAL_UNDEF(&_99$$74);
+ ZVAL_UNDEF(&_100$$75);
+ ZVAL_UNDEF(&_101$$76);
+ ZVAL_UNDEF(&_102$$77);
+ ZVAL_UNDEF(&_103$$78);
+ ZVAL_UNDEF(&_104$$78);
+ ZVAL_UNDEF(&_105$$79);
+ ZVAL_UNDEF(&_106$$79);
+ ZVAL_UNDEF(&_107$$79);
+ ZVAL_UNDEF(&_108$$81);
+ ZVAL_UNDEF(&_109$$82);
+ ZVAL_UNDEF(&_114$$89);
+ ZVAL_UNDEF(&_115$$90);
+ ZVAL_UNDEF(&_116$$90);
+ ZVAL_UNDEF(&_117$$90);
+ ZVAL_UNDEF(&_118$$91);
+ ZVAL_UNDEF(&_119$$92);
+ ZVAL_UNDEF(&_120$$93);
+ ZVAL_UNDEF(&_121$$93);
+ ZVAL_UNDEF(&_123$$94);
+ ZVAL_UNDEF(&definition);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ zephir_get_strval(&table, table_param);
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
+ }
+ ZEPHIR_INIT_VAR(&oldColumn);
+ ZVAL_NULL(&oldColumn);
+ ZEPHIR_INIT_VAR(&sizePattern);
+ ZVAL_STRING(&sizePattern, "#\\(([0-9]+)(?:,\\s*([0-9]+))*\\)#");
+ ZEPHIR_INIT_VAR(&columns);
+ array_init(&columns);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "describecolumns", NULL, 0, &table, &schema);
+ zephir_check_call_status();
+ ZVAL_LONG(&_2, 3);
+ ZEPHIR_CALL_METHOD(&fields, this_ptr, "fetchall", NULL, 0, &_1, &_2);
+ zephir_check_call_status();
+ zephir_is_iterable(&fields, 0, "phalcon/Db/Adapter/Pdo/Mysql.zep", 468);
+ if (Z_TYPE_P(&fields) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&fields), _3)
+ {
+ ZEPHIR_INIT_NVAR(&field);
+ ZVAL_COPY(&field, _3);
+ ZEPHIR_INIT_NVAR(&definition);
+ zephir_create_array(&definition, 1, 0);
+ add_assoc_long_ex(&definition, SL("bindType"), 2);
+ ZEPHIR_OBS_NVAR(&columnType);
+ zephir_array_fetch_long(&columnType, &field, 1, PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 121);
+ do {
+ _5$$3 = 1;
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("bigint"))) {
+ ZEPHIR_INIT_NVAR(&_6$$4);
+ ZVAL_LONG(&_6$$4, 14);
+ zephir_array_update_string(&definition, SL("type"), &_6$$4, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_7$$4);
+ ZVAL_LONG(&_7$$4, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_7$$4, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("mediumint"))) {
+ ZEPHIR_INIT_NVAR(&_8$$5);
+ ZVAL_LONG(&_8$$5, 21);
+ zephir_array_update_string(&definition, SL("type"), &_8$$5, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_9$$5);
+ ZVAL_LONG(&_9$$5, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_9$$5, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("smallint"))) {
+ ZEPHIR_INIT_NVAR(&_10$$6);
+ ZVAL_LONG(&_10$$6, 22);
+ zephir_array_update_string(&definition, SL("type"), &_10$$6, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_11$$6);
+ ZVAL_LONG(&_11$$6, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_11$$6, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("tinyint"))) {
+ ZEPHIR_INIT_NVAR(&_12$$7);
+ ZVAL_LONG(&_12$$7, 26);
+ zephir_array_update_string(&definition, SL("type"), &_12$$7, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_13$$7);
+ ZVAL_LONG(&_13$$7, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_13$$7, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("int"))) {
+ ZEPHIR_INIT_NVAR(&_14$$8);
+ ZVAL_LONG(&_14$$8, 0);
+ zephir_array_update_string(&definition, SL("type"), &_14$$8, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_15$$8);
+ ZVAL_LONG(&_15$$8, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_15$$8, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("bit"))) {
+ ZEPHIR_INIT_NVAR(&_16$$9);
+ ZVAL_LONG(&_16$$9, 19);
+ zephir_array_update_string(&definition, SL("type"), &_16$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_17$$9);
+ ZVAL_LONG(&_17$$9, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_17$$9, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("enum"))) {
+ ZEPHIR_INIT_NVAR(&_18$$10);
+ ZVAL_LONG(&_18$$10, 18);
+ zephir_array_update_string(&definition, SL("type"), &_18$$10, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("datetime"))) {
+ ZEPHIR_INIT_NVAR(&_19$$11);
+ ZVAL_LONG(&_19$$11, 4);
+ zephir_array_update_string(&definition, SL("type"), &_19$$11, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("date"))) {
+ ZEPHIR_INIT_NVAR(&_20$$12);
+ ZVAL_LONG(&_20$$12, 1);
+ zephir_array_update_string(&definition, SL("type"), &_20$$12, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("decimal"))) {
+ ZEPHIR_INIT_NVAR(&_21$$13);
+ ZVAL_LONG(&_21$$13, 3);
+ zephir_array_update_string(&definition, SL("type"), &_21$$13, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("double"))) {
+ ZEPHIR_INIT_NVAR(&_22$$14);
+ ZVAL_LONG(&_22$$14, 9);
+ zephir_array_update_string(&definition, SL("type"), &_22$$14, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_23$$14);
+ ZVAL_LONG(&_23$$14, 32);
+ zephir_array_update_string(&definition, SL("bindType"), &_23$$14, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("float"))) {
+ ZEPHIR_INIT_NVAR(&_24$$15);
+ ZVAL_LONG(&_24$$15, 7);
+ zephir_array_update_string(&definition, SL("type"), &_24$$15, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_25$$15);
+ ZVAL_LONG(&_25$$15, 32);
+ zephir_array_update_string(&definition, SL("bindType"), &_25$$15, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("mediumblob"))) {
+ ZEPHIR_INIT_NVAR(&_26$$16);
+ ZVAL_LONG(&_26$$16, 12);
+ zephir_array_update_string(&definition, SL("type"), &_26$$16, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("longblob"))) {
+ ZEPHIR_INIT_NVAR(&_27$$17);
+ ZVAL_LONG(&_27$$17, 13);
+ zephir_array_update_string(&definition, SL("type"), &_27$$17, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("tinyblob"))) {
+ ZEPHIR_INIT_NVAR(&_28$$18);
+ ZVAL_LONG(&_28$$18, 10);
+ zephir_array_update_string(&definition, SL("type"), &_28$$18, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("blob"))) {
+ ZEPHIR_INIT_NVAR(&_29$$19);
+ ZVAL_LONG(&_29$$19, 11);
+ zephir_array_update_string(&definition, SL("type"), &_29$$19, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("timestamp"))) {
+ ZEPHIR_INIT_NVAR(&_30$$20);
+ ZVAL_LONG(&_30$$20, 17);
+ zephir_array_update_string(&definition, SL("type"), &_30$$20, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("time"))) {
+ ZEPHIR_INIT_NVAR(&_31$$21);
+ ZVAL_LONG(&_31$$21, 20);
+ zephir_array_update_string(&definition, SL("type"), &_31$$21, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("json"))) {
+ ZEPHIR_INIT_NVAR(&_32$$22);
+ ZVAL_LONG(&_32$$22, 15);
+ zephir_array_update_string(&definition, SL("type"), &_32$$22, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("longtext"))) {
+ ZEPHIR_INIT_NVAR(&_33$$23);
+ ZVAL_LONG(&_33$$23, 24);
+ zephir_array_update_string(&definition, SL("type"), &_33$$23, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("mediumtext"))) {
+ ZEPHIR_INIT_NVAR(&_34$$24);
+ ZVAL_LONG(&_34$$24, 23);
+ zephir_array_update_string(&definition, SL("type"), &_34$$24, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("tinytext"))) {
+ ZEPHIR_INIT_NVAR(&_35$$25);
+ ZVAL_LONG(&_35$$25, 25);
+ zephir_array_update_string(&definition, SL("type"), &_35$$25, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("text"))) {
+ ZEPHIR_INIT_NVAR(&_36$$26);
+ ZVAL_LONG(&_36$$26, 6);
+ zephir_array_update_string(&definition, SL("type"), &_36$$26, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("varchar"))) {
+ ZEPHIR_INIT_NVAR(&_37$$27);
+ ZVAL_LONG(&_37$$27, 2);
+ zephir_array_update_string(&definition, SL("type"), &_37$$27, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("char"))) {
+ ZEPHIR_INIT_NVAR(&_38$$28);
+ ZVAL_LONG(&_38$$28, 5);
+ zephir_array_update_string(&definition, SL("type"), &_38$$28, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("varbinary"))) {
+ ZEPHIR_INIT_NVAR(&_39$$29);
+ ZVAL_LONG(&_39$$29, 26);
+ zephir_array_update_string(&definition, SL("type"), &_39$$29, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_start_with_str(&columnType, SL("binary"))) {
+ ZEPHIR_INIT_NVAR(&_40$$30);
+ ZVAL_LONG(&_40$$30, 26);
+ zephir_array_update_string(&definition, SL("type"), &_40$$30, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ ZEPHIR_INIT_NVAR(&_41$$31);
+ ZVAL_LONG(&_41$$31, 2);
+ zephir_array_update_string(&definition, SL("type"), &_41$$31, PH_COPY | PH_SEPARATE);
+ break;
+ } while(0);
-ZEPHIR_INIT_CLASS(Phalcon_Paginator_Adapter_QueryBuilder)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Paginator\\Adapter, QueryBuilder, phalcon, paginator_adapter_querybuilder, phalcon_paginator_adapter_abstractadapter_ce, phalcon_paginator_adapter_querybuilder_method_entry, 0);
+ if (zephir_memnstr_str(&columnType, SL("("), "phalcon/Db/Adapter/Pdo/Mysql.zep", 385)) {
+ ZEPHIR_INIT_NVAR(&matches);
+ ZVAL_NULL(&matches);
+ zephir_array_fetch_string(&_42$$32, &definition, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 388);
+ ZEPHIR_INIT_NVAR(&_43$$32);
+ zephir_preg_match(&_43$$32, &sizePattern, &columnType, &matches, 0, 0 , 0 );
+ if (ZEPHIR_IS_LONG(&_42$$32, 18)) {
+ ZVAL_LONG(&_44$$33, 5);
+ ZVAL_LONG(&_45$$33, -1);
+ ZEPHIR_INIT_NVAR(&_46$$33);
+ zephir_substr(&_46$$33, &columnType, 5 , -1 , 0);
+ zephir_array_update_string(&definition, SL("size"), &_46$$33, PH_COPY | PH_SEPARATE);
+ } else if (zephir_is_true(&_43$$32)) {
+ ZEPHIR_OBS_NVAR(&matchOne);
+ if (zephir_array_isset_long_fetch(&matchOne, &matches, 1, 0)) {
+ ZEPHIR_INIT_NVAR(&_47$$35);
+ ZVAL_LONG(&_47$$35, zephir_get_intval(&matchOne));
+ zephir_array_update_string(&definition, SL("size"), &_47$$35, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_OBS_NVAR(&matchTwo);
+ if (zephir_array_isset_long_fetch(&matchTwo, &matches, 2, 0)) {
+ ZEPHIR_INIT_NVAR(&_48$$36);
+ ZVAL_LONG(&_48$$36, zephir_get_intval(&matchTwo));
+ zephir_array_update_string(&definition, SL("scale"), &_48$$36, PH_COPY | PH_SEPARATE);
+ }
+ }
+ }
+ if (zephir_memnstr_str(&columnType, SL("unsigned"), "phalcon/Db/Adapter/Pdo/Mysql.zep", 404)) {
+ zephir_array_update_string(&definition, SL("unsigned"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ if (Z_TYPE_P(&oldColumn) == IS_NULL) {
+ zephir_array_update_string(&definition, SL("first"), &__$true, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_49$$3, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 420);
+ if (ZEPHIR_IS_STRING(&_49$$3, "PRI")) {
+ zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_50$$3, &field, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 427);
+ if (ZEPHIR_IS_STRING(&_50$$3, "YES")) {
+ zephir_array_update_string(&definition, SL("notNull"), &__$false, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_51$$3, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 434);
+ if (ZEPHIR_IS_STRING(&_51$$3, "auto_increment")) {
+ zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_52$$3, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 441);
+ if (Z_TYPE_P(&_52$$3) != IS_NULL) {
+ zephir_array_fetch_long(&_53$$43, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 442);
+ if (zephir_memnstr_str(&_53$$43, SL("on update"), "phalcon/Db/Adapter/Pdo/Mysql.zep", 442)) {
+ zephir_array_fetch_long(&_54$$44, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 443);
+ zephir_array_fetch_long(&_55$$44, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 443);
+ ZEPHIR_INIT_NVAR(&_56$$44);
+ ZEPHIR_CONCAT_VSV(&_56$$44, &_54$$44, " ", &_55$$44);
+ zephir_array_update_string(&definition, SL("default"), &_56$$44, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_fetch_long(&_57$$45, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 445);
+ zephir_array_update_string(&definition, SL("default"), &_57$$45, PH_COPY | PH_SEPARATE);
+ }
+ } else {
+ zephir_array_fetch_long(&_58$$46, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 448);
+ if (zephir_memnstr_str(&_58$$46, SL("on update"), "phalcon/Db/Adapter/Pdo/Mysql.zep", 448)) {
+ zephir_array_fetch_long(&_59$$47, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 449);
+ ZEPHIR_INIT_NVAR(&_60$$47);
+ ZEPHIR_CONCAT_SV(&_60$$47, "NULL ", &_59$$47);
+ zephir_array_update_string(&definition, SL("default"), &_60$$47, PH_COPY | PH_SEPARATE);
+ }
+ }
+ zephir_array_fetch_long(&_61$$3, &field, 8, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 456);
+ if (Z_TYPE_P(&_61$$3) != IS_NULL) {
+ zephir_array_fetch_long(&_62$$48, &field, 8, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 457);
+ zephir_array_update_string(&definition, SL("comment"), &_62$$48, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 463);
+ ZEPHIR_INIT_NVAR(&_63$$3);
+ object_init_ex(&_63$$3, phalcon_db_column_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_63$$3, "__construct", &_64, 212, &columnName, &definition);
+ zephir_check_call_status();
+ zephir_array_append(&columns, &_63$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Mysql.zep", 464);
+ ZEPHIR_CPY_WRT(&oldColumn, &columnName);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &fields, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_4, &fields, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_4)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&field, &fields, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_65$$49);
+ zephir_create_array(&_65$$49, 1, 0);
+ add_assoc_long_ex(&_65$$49, SL("bindType"), 2);
+ ZEPHIR_CPY_WRT(&definition, &_65$$49);
+ ZEPHIR_OBS_NVAR(&columnType);
+ zephir_array_fetch_long(&columnType, &field, 1, PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 121);
+ do {
+ _66$$49 = 1;
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("bigint"))) {
+ ZEPHIR_INIT_NVAR(&_67$$50);
+ ZVAL_LONG(&_67$$50, 14);
+ zephir_array_update_string(&definition, SL("type"), &_67$$50, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_68$$50);
+ ZVAL_LONG(&_68$$50, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_68$$50, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("mediumint"))) {
+ ZEPHIR_INIT_NVAR(&_69$$51);
+ ZVAL_LONG(&_69$$51, 21);
+ zephir_array_update_string(&definition, SL("type"), &_69$$51, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_70$$51);
+ ZVAL_LONG(&_70$$51, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_70$$51, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("smallint"))) {
+ ZEPHIR_INIT_NVAR(&_71$$52);
+ ZVAL_LONG(&_71$$52, 22);
+ zephir_array_update_string(&definition, SL("type"), &_71$$52, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_72$$52);
+ ZVAL_LONG(&_72$$52, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_72$$52, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("tinyint"))) {
+ ZEPHIR_INIT_NVAR(&_73$$53);
+ ZVAL_LONG(&_73$$53, 26);
+ zephir_array_update_string(&definition, SL("type"), &_73$$53, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_74$$53);
+ ZVAL_LONG(&_74$$53, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_74$$53, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("int"))) {
+ ZEPHIR_INIT_NVAR(&_75$$54);
+ ZVAL_LONG(&_75$$54, 0);
+ zephir_array_update_string(&definition, SL("type"), &_75$$54, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_76$$54);
+ ZVAL_LONG(&_76$$54, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_76$$54, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("bit"))) {
+ ZEPHIR_INIT_NVAR(&_77$$55);
+ ZVAL_LONG(&_77$$55, 19);
+ zephir_array_update_string(&definition, SL("type"), &_77$$55, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_78$$55);
+ ZVAL_LONG(&_78$$55, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_78$$55, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("enum"))) {
+ ZEPHIR_INIT_NVAR(&_79$$56);
+ ZVAL_LONG(&_79$$56, 18);
+ zephir_array_update_string(&definition, SL("type"), &_79$$56, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("datetime"))) {
+ ZEPHIR_INIT_NVAR(&_80$$57);
+ ZVAL_LONG(&_80$$57, 4);
+ zephir_array_update_string(&definition, SL("type"), &_80$$57, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("date"))) {
+ ZEPHIR_INIT_NVAR(&_81$$58);
+ ZVAL_LONG(&_81$$58, 1);
+ zephir_array_update_string(&definition, SL("type"), &_81$$58, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("decimal"))) {
+ ZEPHIR_INIT_NVAR(&_82$$59);
+ ZVAL_LONG(&_82$$59, 3);
+ zephir_array_update_string(&definition, SL("type"), &_82$$59, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("double"))) {
+ ZEPHIR_INIT_NVAR(&_83$$60);
+ ZVAL_LONG(&_83$$60, 9);
+ zephir_array_update_string(&definition, SL("type"), &_83$$60, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_84$$60);
+ ZVAL_LONG(&_84$$60, 32);
+ zephir_array_update_string(&definition, SL("bindType"), &_84$$60, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("float"))) {
+ ZEPHIR_INIT_NVAR(&_85$$61);
+ ZVAL_LONG(&_85$$61, 7);
+ zephir_array_update_string(&definition, SL("type"), &_85$$61, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_86$$61);
+ ZVAL_LONG(&_86$$61, 32);
+ zephir_array_update_string(&definition, SL("bindType"), &_86$$61, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("mediumblob"))) {
+ ZEPHIR_INIT_NVAR(&_87$$62);
+ ZVAL_LONG(&_87$$62, 12);
+ zephir_array_update_string(&definition, SL("type"), &_87$$62, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("longblob"))) {
+ ZEPHIR_INIT_NVAR(&_88$$63);
+ ZVAL_LONG(&_88$$63, 13);
+ zephir_array_update_string(&definition, SL("type"), &_88$$63, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("tinyblob"))) {
+ ZEPHIR_INIT_NVAR(&_89$$64);
+ ZVAL_LONG(&_89$$64, 10);
+ zephir_array_update_string(&definition, SL("type"), &_89$$64, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("blob"))) {
+ ZEPHIR_INIT_NVAR(&_90$$65);
+ ZVAL_LONG(&_90$$65, 11);
+ zephir_array_update_string(&definition, SL("type"), &_90$$65, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("timestamp"))) {
+ ZEPHIR_INIT_NVAR(&_91$$66);
+ ZVAL_LONG(&_91$$66, 17);
+ zephir_array_update_string(&definition, SL("type"), &_91$$66, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("time"))) {
+ ZEPHIR_INIT_NVAR(&_92$$67);
+ ZVAL_LONG(&_92$$67, 20);
+ zephir_array_update_string(&definition, SL("type"), &_92$$67, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("json"))) {
+ ZEPHIR_INIT_NVAR(&_93$$68);
+ ZVAL_LONG(&_93$$68, 15);
+ zephir_array_update_string(&definition, SL("type"), &_93$$68, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("longtext"))) {
+ ZEPHIR_INIT_NVAR(&_94$$69);
+ ZVAL_LONG(&_94$$69, 24);
+ zephir_array_update_string(&definition, SL("type"), &_94$$69, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("mediumtext"))) {
+ ZEPHIR_INIT_NVAR(&_95$$70);
+ ZVAL_LONG(&_95$$70, 23);
+ zephir_array_update_string(&definition, SL("type"), &_95$$70, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("tinytext"))) {
+ ZEPHIR_INIT_NVAR(&_96$$71);
+ ZVAL_LONG(&_96$$71, 25);
+ zephir_array_update_string(&definition, SL("type"), &_96$$71, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("text"))) {
+ ZEPHIR_INIT_NVAR(&_97$$72);
+ ZVAL_LONG(&_97$$72, 6);
+ zephir_array_update_string(&definition, SL("type"), &_97$$72, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("varchar"))) {
+ ZEPHIR_INIT_NVAR(&_98$$73);
+ ZVAL_LONG(&_98$$73, 2);
+ zephir_array_update_string(&definition, SL("type"), &_98$$73, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("char"))) {
+ ZEPHIR_INIT_NVAR(&_99$$74);
+ ZVAL_LONG(&_99$$74, 5);
+ zephir_array_update_string(&definition, SL("type"), &_99$$74, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("varbinary"))) {
+ ZEPHIR_INIT_NVAR(&_100$$75);
+ ZVAL_LONG(&_100$$75, 26);
+ zephir_array_update_string(&definition, SL("type"), &_100$$75, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_66$$49 == zephir_start_with_str(&columnType, SL("binary"))) {
+ ZEPHIR_INIT_NVAR(&_101$$76);
+ ZVAL_LONG(&_101$$76, 26);
+ zephir_array_update_string(&definition, SL("type"), &_101$$76, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ ZEPHIR_INIT_NVAR(&_102$$77);
+ ZVAL_LONG(&_102$$77, 2);
+ zephir_array_update_string(&definition, SL("type"), &_102$$77, PH_COPY | PH_SEPARATE);
+ break;
+ } while(0);
- zend_declare_property_null(phalcon_paginator_adapter_querybuilder_ce, SL("builder"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_paginator_adapter_querybuilder_ce, SL("columns"), ZEND_ACC_PROTECTED);
- return SUCCESS;
+ if (zephir_memnstr_str(&columnType, SL("("), "phalcon/Db/Adapter/Pdo/Mysql.zep", 385)) {
+ ZEPHIR_INIT_NVAR(&matches);
+ ZVAL_NULL(&matches);
+ zephir_array_fetch_string(&_103$$78, &definition, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 388);
+ ZEPHIR_INIT_NVAR(&_104$$78);
+ zephir_preg_match(&_104$$78, &sizePattern, &columnType, &matches, 0, 0 , 0 );
+ if (ZEPHIR_IS_LONG(&_103$$78, 18)) {
+ ZVAL_LONG(&_105$$79, 5);
+ ZVAL_LONG(&_106$$79, -1);
+ ZEPHIR_INIT_NVAR(&_107$$79);
+ zephir_substr(&_107$$79, &columnType, 5 , -1 , 0);
+ zephir_array_update_string(&definition, SL("size"), &_107$$79, PH_COPY | PH_SEPARATE);
+ } else if (zephir_is_true(&_104$$78)) {
+ ZEPHIR_OBS_NVAR(&matchOne);
+ if (zephir_array_isset_long_fetch(&matchOne, &matches, 1, 0)) {
+ ZEPHIR_INIT_NVAR(&_108$$81);
+ ZVAL_LONG(&_108$$81, zephir_get_intval(&matchOne));
+ zephir_array_update_string(&definition, SL("size"), &_108$$81, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_OBS_NVAR(&matchTwo);
+ if (zephir_array_isset_long_fetch(&matchTwo, &matches, 2, 0)) {
+ ZEPHIR_INIT_NVAR(&_109$$82);
+ ZVAL_LONG(&_109$$82, zephir_get_intval(&matchTwo));
+ zephir_array_update_string(&definition, SL("scale"), &_109$$82, PH_COPY | PH_SEPARATE);
+ }
+ }
+ }
+ if (zephir_memnstr_str(&columnType, SL("unsigned"), "phalcon/Db/Adapter/Pdo/Mysql.zep", 404)) {
+ zephir_array_update_string(&definition, SL("unsigned"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ if (Z_TYPE_P(&oldColumn) == IS_NULL) {
+ zephir_array_update_string(&definition, SL("first"), &__$true, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_110$$49, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 420);
+ if (ZEPHIR_IS_STRING(&_110$$49, "PRI")) {
+ zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_111$$49, &field, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 427);
+ if (ZEPHIR_IS_STRING(&_111$$49, "YES")) {
+ zephir_array_update_string(&definition, SL("notNull"), &__$false, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_112$$49, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 434);
+ if (ZEPHIR_IS_STRING(&_112$$49, "auto_increment")) {
+ zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_113$$49, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 441);
+ if (Z_TYPE_P(&_113$$49) != IS_NULL) {
+ zephir_array_fetch_long(&_114$$89, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 442);
+ if (zephir_memnstr_str(&_114$$89, SL("on update"), "phalcon/Db/Adapter/Pdo/Mysql.zep", 442)) {
+ zephir_array_fetch_long(&_115$$90, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 443);
+ zephir_array_fetch_long(&_116$$90, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 443);
+ ZEPHIR_INIT_NVAR(&_117$$90);
+ ZEPHIR_CONCAT_VSV(&_117$$90, &_115$$90, " ", &_116$$90);
+ zephir_array_update_string(&definition, SL("default"), &_117$$90, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_fetch_long(&_118$$91, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 445);
+ zephir_array_update_string(&definition, SL("default"), &_118$$91, PH_COPY | PH_SEPARATE);
+ }
+ } else {
+ zephir_array_fetch_long(&_119$$92, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 448);
+ if (zephir_memnstr_str(&_119$$92, SL("on update"), "phalcon/Db/Adapter/Pdo/Mysql.zep", 448)) {
+ zephir_array_fetch_long(&_120$$93, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 449);
+ ZEPHIR_INIT_NVAR(&_121$$93);
+ ZEPHIR_CONCAT_SV(&_121$$93, "NULL ", &_120$$93);
+ zephir_array_update_string(&definition, SL("default"), &_121$$93, PH_COPY | PH_SEPARATE);
+ }
+ }
+ zephir_array_fetch_long(&_122$$49, &field, 8, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 456);
+ if (Z_TYPE_P(&_122$$49) != IS_NULL) {
+ zephir_array_fetch_long(&_123$$94, &field, 8, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 457);
+ zephir_array_update_string(&definition, SL("comment"), &_123$$94, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_OBS_NVAR(&columnName);
+ zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 463);
+ ZEPHIR_INIT_NVAR(&_124$$49);
+ object_init_ex(&_124$$49, phalcon_db_column_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_124$$49, "__construct", &_64, 212, &columnName, &definition);
+ zephir_check_call_status();
+ zephir_array_append(&columns, &_124$$49, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Mysql.zep", 464);
+ ZEPHIR_CPY_WRT(&oldColumn, &columnName);
+ ZEPHIR_CALL_METHOD(NULL, &fields, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&field);
+ RETURN_CCTOR(&columns);
}
-static PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, __construct)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeIndexes)
{
- zval _1$$5;
+ zend_string *_25;
+ zend_ulong _24;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_2 = NULL;
+ zephir_fcall_cache_entry *_29 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *config_param = NULL, builder, columns, _0$$5;
- zval config;
+ zval *table_param = NULL, *schema_param = NULL, __$null, indexes, index, keyName, indexType, indexObjects, columns, name, _0, _1, _2, _3, *_4, _5, *_22, _23, _6$$4, _7$$3, _9$$3, _10$$3, _8$$6, _11$$7, _12$$8, _13$$9, _14$$12, _15$$11, _17$$11, _18$$11, _16$$14, _19$$15, _20$$16, _21$$17, _26$$19, _27$$19, _28$$19, _30$$20, _31$$20, _32$$20;
+ zval table, schema;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&config);
- ZVAL_UNDEF(&builder);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&indexes);
+ ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&keyName);
+ ZVAL_UNDEF(&indexType);
+ ZVAL_UNDEF(&indexObjects);
ZVAL_UNDEF(&columns);
- ZVAL_UNDEF(&_0$$5);
- ZVAL_UNDEF(&_1$$5);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_23);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_9$$3);
+ ZVAL_UNDEF(&_10$$3);
+ ZVAL_UNDEF(&_8$$6);
+ ZVAL_UNDEF(&_11$$7);
+ ZVAL_UNDEF(&_12$$8);
+ ZVAL_UNDEF(&_13$$9);
+ ZVAL_UNDEF(&_14$$12);
+ ZVAL_UNDEF(&_15$$11);
+ ZVAL_UNDEF(&_17$$11);
+ ZVAL_UNDEF(&_18$$11);
+ ZVAL_UNDEF(&_16$$14);
+ ZVAL_UNDEF(&_19$$15);
+ ZVAL_UNDEF(&_20$$16);
+ ZVAL_UNDEF(&_21$$17);
+ ZVAL_UNDEF(&_26$$19);
+ ZVAL_UNDEF(&_27$$19);
+ ZVAL_UNDEF(&_28$$19);
+ ZVAL_UNDEF(&_30$$20);
+ ZVAL_UNDEF(&_31$$20);
+ ZVAL_UNDEF(&_32$$20);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(config)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &config_param);
- zephir_get_arrval(&config, config_param);
-
-
- if (UNEXPECTED(!(zephir_array_isset_string(&config, SL("limit"))))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "Parameter 'limit' is required", "phalcon/Paginator/Adapter/QueryBuilder.zep", 70);
- return;
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
}
- ZEPHIR_OBS_VAR(&builder);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&builder, &config, SL("builder"), 0)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "Parameter 'builder' is required", "phalcon/Paginator/Adapter/QueryBuilder.zep", 74);
- return;
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
}
- if (UNEXPECTED(!((zephir_instance_of_ev(&builder, phalcon_mvc_model_query_builder_ce))))) {
- ZEPHIR_INIT_VAR(&_0$$5);
- object_init_ex(&_0$$5, phalcon_paginator_exception_ce);
- ZEPHIR_INIT_VAR(&_1$$5);
- ZEPHIR_CONCAT_SS(&_1$$5, "Parameter 'builder' must be an instance ", "of Phalcon\\Mvc\\Model\\Query\\Builder");
- ZEPHIR_CALL_METHOD(NULL, &_0$$5, "__construct", NULL, 8, &_1$$5);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_0$$5, "phalcon/Paginator/Adapter/QueryBuilder.zep", 80);
- ZEPHIR_MM_RESTORE();
- return;
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(schema_param) != IS_STRING && Z_TYPE_P(schema_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schema' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schema_param) == IS_STRING)) {
+ zephir_get_strval(&schema, schema_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schema);
}
- ZEPHIR_OBS_VAR(&columns);
- if (zephir_array_isset_string_fetch(&columns, &config, SL("columns"), 0)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("columns"), &columns);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_paginator_adapter_querybuilder_ce, getThis(), "__construct", &_2, 0, &config);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setquerybuilder", NULL, 0, &builder);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, getCurrentPage)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "page");
-}
-
-static PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, getQueryBuilder)
-{
- zval *this_ptr = getThis();
-
- RETURN_MEMBER(getThis(), "builder");
+ ZEPHIR_INIT_VAR(&indexes);
+ array_init(&indexes);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_2, &_1, "describeindexes", NULL, 0, &table, &schema);
+ zephir_check_call_status();
+ ZVAL_LONG(&_3, 2);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3);
+ zephir_check_call_status();
+ zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Mysql.zep", 514);
+ if (Z_TYPE_P(&_0) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4)
+ {
+ ZEPHIR_INIT_NVAR(&index);
+ ZVAL_COPY(&index, _4);
+ zephir_array_fetch_string(&keyName, &index, SL("Key_name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 487);
+ zephir_array_fetch_string(&indexType, &index, SL("Index_type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 488);
+ if (!(zephir_array_isset(&indexes, &keyName))) {
+ ZEPHIR_INIT_NVAR(&_6$$4);
+ array_init(&_6$$4);
+ zephir_array_update_zval(&indexes, &keyName, &_6$$4, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch(&_7$$3, &indexes, &keyName, PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 494);
+ if (!(zephir_array_isset_string(&_7$$3, SL("columns")))) {
+ ZEPHIR_INIT_NVAR(&columns);
+ array_init(&columns);
+ } else {
+ zephir_array_fetch(&_8$$6, &indexes, &keyName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 497);
+ ZEPHIR_OBS_NVAR(&columns);
+ zephir_array_fetch_string(&columns, &_8$$6, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 497);
+ }
+ zephir_array_fetch_string(&_9$$3, &index, SL("Column_name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 500);
+ zephir_array_append(&columns, &_9$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Mysql.zep", 500);
+ zephir_array_update_multi(&indexes, &columns, SL("zs"), 3, &keyName, SL("columns"));
+ zephir_array_fetch_string(&_10$$3, &index, SL("Non_unique"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 507);
+ if (ZEPHIR_IS_STRING(&keyName, "PRIMARY")) {
+ ZEPHIR_INIT_NVAR(&_11$$7);
+ ZVAL_STRING(&_11$$7, "PRIMARY");
+ zephir_array_update_multi(&indexes, &_11$$7, SL("zs"), 3, &keyName, SL("type"));
+ } else if (ZEPHIR_IS_STRING(&indexType, "FULLTEXT")) {
+ ZEPHIR_INIT_NVAR(&_12$$8);
+ ZVAL_STRING(&_12$$8, "FULLTEXT");
+ zephir_array_update_multi(&indexes, &_12$$8, SL("zs"), 3, &keyName, SL("type"));
+ } else if (ZEPHIR_IS_LONG(&_10$$3, 0)) {
+ ZEPHIR_INIT_NVAR(&_13$$9);
+ ZVAL_STRING(&_13$$9, "UNIQUE");
+ zephir_array_update_multi(&indexes, &_13$$9, SL("zs"), 3, &keyName, SL("type"));
+ } else {
+ zephir_array_update_multi(&indexes, &__$null, SL("zs"), 3, &keyName, SL("type"));
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5, &_0, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&index, &_0, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&keyName);
+ zephir_array_fetch_string(&keyName, &index, SL("Key_name"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 487);
+ ZEPHIR_OBS_NVAR(&indexType);
+ zephir_array_fetch_string(&indexType, &index, SL("Index_type"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 488);
+ if (!(zephir_array_isset(&indexes, &keyName))) {
+ ZEPHIR_INIT_NVAR(&_14$$12);
+ array_init(&_14$$12);
+ zephir_array_update_zval(&indexes, &keyName, &_14$$12, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch(&_15$$11, &indexes, &keyName, PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 494);
+ if (!(zephir_array_isset_string(&_15$$11, SL("columns")))) {
+ ZEPHIR_INIT_NVAR(&columns);
+ array_init(&columns);
+ } else {
+ zephir_array_fetch(&_16$$14, &indexes, &keyName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 497);
+ ZEPHIR_OBS_NVAR(&columns);
+ zephir_array_fetch_string(&columns, &_16$$14, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 497);
+ }
+ zephir_array_fetch_string(&_17$$11, &index, SL("Column_name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 500);
+ zephir_array_append(&columns, &_17$$11, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Mysql.zep", 500);
+ zephir_array_update_multi(&indexes, &columns, SL("zs"), 3, &keyName, SL("columns"));
+ zephir_array_fetch_string(&_18$$11, &index, SL("Non_unique"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 507);
+ if (ZEPHIR_IS_STRING(&keyName, "PRIMARY")) {
+ ZEPHIR_INIT_NVAR(&_19$$15);
+ ZVAL_STRING(&_19$$15, "PRIMARY");
+ zephir_array_update_multi(&indexes, &_19$$15, SL("zs"), 3, &keyName, SL("type"));
+ } else if (ZEPHIR_IS_STRING(&indexType, "FULLTEXT")) {
+ ZEPHIR_INIT_NVAR(&_20$$16);
+ ZVAL_STRING(&_20$$16, "FULLTEXT");
+ zephir_array_update_multi(&indexes, &_20$$16, SL("zs"), 3, &keyName, SL("type"));
+ } else if (ZEPHIR_IS_LONG(&_18$$11, 0)) {
+ ZEPHIR_INIT_NVAR(&_21$$17);
+ ZVAL_STRING(&_21$$17, "UNIQUE");
+ zephir_array_update_multi(&indexes, &_21$$17, SL("zs"), 3, &keyName, SL("type"));
+ } else {
+ zephir_array_update_multi(&indexes, &__$null, SL("zs"), 3, &keyName, SL("type"));
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&index);
+ ZEPHIR_INIT_VAR(&indexObjects);
+ array_init(&indexObjects);
+ zephir_is_iterable(&indexes, 0, "phalcon/Db/Adapter/Pdo/Mysql.zep", 524);
+ if (Z_TYPE_P(&indexes) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&indexes), _24, _25, _22)
+ {
+ ZEPHIR_INIT_NVAR(&name);
+ if (_25 != NULL) {
+ ZVAL_STR_COPY(&name, _25);
+ } else {
+ ZVAL_LONG(&name, _24);
+ }
+ ZEPHIR_INIT_NVAR(&index);
+ ZVAL_COPY(&index, _22);
+ ZEPHIR_INIT_NVAR(&_26$$19);
+ object_init_ex(&_26$$19, phalcon_db_index_ce);
+ zephir_array_fetch_string(&_27$$19, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 519);
+ zephir_array_fetch_string(&_28$$19, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 521);
+ ZEPHIR_CALL_METHOD(NULL, &_26$$19, "__construct", &_29, 32, &name, &_27$$19, &_28$$19);
+ zephir_check_call_status();
+ zephir_array_update_zval(&indexObjects, &name, &_26$$19, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &indexes, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_23, &indexes, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_23)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&name, &indexes, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&index, &indexes, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_30$$20);
+ object_init_ex(&_30$$20, phalcon_db_index_ce);
+ zephir_array_fetch_string(&_31$$20, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 519);
+ zephir_array_fetch_string(&_32$$20, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 521);
+ ZEPHIR_CALL_METHOD(NULL, &_30$$20, "__construct", &_29, 32, &name, &_31$$20, &_32$$20);
+ zephir_check_call_status();
+ zephir_array_update_zval(&indexObjects, &name, &_30$$20, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &indexes, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&index);
+ ZEPHIR_INIT_NVAR(&name);
+ RETURN_CCTOR(&indexObjects);
}
-static PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, paginate)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeReferences)
{
- zval _23, _7$$14, _9$$15;
- zend_bool hasHaving = 0, hasGroup = 0, _3;
- zval originalBuilder, builder, totalBuilder, totalPages, limit, number, query, items, totalQuery, result, row, rowcount, next, sql, columns, db, model, modelClass, dbService, groups, groupColumn, _0, _1, _2, _24, _25, _4$$10, _5$$14, _6$$14, _8$$14, _10$$15, _11$$18, _12$$18, _13$$16, _14$$16, _15$$16, _16$$16, _17$$16, _18$$16, _19$$16, _20$$19, _21$$19, _22$$19;
+ zval _14$$3, _23$$6, _29$$9, _33$$10;
+ zend_string *_27;
+ zend_ulong _26;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS, previous = 0, numberPage = 0;
+ zephir_fcall_cache_entry *_31 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *table_param = NULL, *schema_param = NULL, references, reference, arrayReference, constraintName, referenceObjects, name, referencedSchema, referencedTable, columns, referencedColumns, referenceUpdate, referenceDelete, _0, _1, _2, _3, *_4, _5, *_24, _25, _6$$5, _7$$5, _8$$5, _9$$5, _10$$5, _11$$5, _12$$3, _13$$3, _15$$8, _16$$8, _17$$8, _18$$8, _19$$8, _20$$8, _21$$6, _22$$6, _28$$9, _30$$9, _32$$10, _34$$10;
+ zval table, schema;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&originalBuilder);
- ZVAL_UNDEF(&builder);
- ZVAL_UNDEF(&totalBuilder);
- ZVAL_UNDEF(&totalPages);
- ZVAL_UNDEF(&limit);
- ZVAL_UNDEF(&number);
- ZVAL_UNDEF(&query);
- ZVAL_UNDEF(&items);
- ZVAL_UNDEF(&totalQuery);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&row);
- ZVAL_UNDEF(&rowcount);
- ZVAL_UNDEF(&next);
- ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+ ZVAL_UNDEF(&references);
+ ZVAL_UNDEF(&reference);
+ ZVAL_UNDEF(&arrayReference);
+ ZVAL_UNDEF(&constraintName);
+ ZVAL_UNDEF(&referenceObjects);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&referencedSchema);
+ ZVAL_UNDEF(&referencedTable);
ZVAL_UNDEF(&columns);
- ZVAL_UNDEF(&db);
- ZVAL_UNDEF(&model);
- ZVAL_UNDEF(&modelClass);
- ZVAL_UNDEF(&dbService);
- ZVAL_UNDEF(&groups);
- ZVAL_UNDEF(&groupColumn);
+ ZVAL_UNDEF(&referencedColumns);
+ ZVAL_UNDEF(&referenceUpdate);
+ ZVAL_UNDEF(&referenceDelete);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_24);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_5);
ZVAL_UNDEF(&_25);
- ZVAL_UNDEF(&_4$$10);
- ZVAL_UNDEF(&_5$$14);
- ZVAL_UNDEF(&_6$$14);
- ZVAL_UNDEF(&_8$$14);
- ZVAL_UNDEF(&_10$$15);
- ZVAL_UNDEF(&_11$$18);
- ZVAL_UNDEF(&_12$$18);
- ZVAL_UNDEF(&_13$$16);
- ZVAL_UNDEF(&_14$$16);
- ZVAL_UNDEF(&_15$$16);
- ZVAL_UNDEF(&_16$$16);
- ZVAL_UNDEF(&_17$$16);
- ZVAL_UNDEF(&_18$$16);
- ZVAL_UNDEF(&_19$$16);
- ZVAL_UNDEF(&_20$$19);
- ZVAL_UNDEF(&_21$$19);
- ZVAL_UNDEF(&_22$$19);
- ZVAL_UNDEF(&_23);
- ZVAL_UNDEF(&_7$$14);
- ZVAL_UNDEF(&_9$$15);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_11$$5);
+ ZVAL_UNDEF(&_12$$3);
+ ZVAL_UNDEF(&_13$$3);
+ ZVAL_UNDEF(&_15$$8);
+ ZVAL_UNDEF(&_16$$8);
+ ZVAL_UNDEF(&_17$$8);
+ ZVAL_UNDEF(&_18$$8);
+ ZVAL_UNDEF(&_19$$8);
+ ZVAL_UNDEF(&_20$$8);
+ ZVAL_UNDEF(&_21$$6);
+ ZVAL_UNDEF(&_22$$6);
+ ZVAL_UNDEF(&_28$$9);
+ ZVAL_UNDEF(&_30$$9);
+ ZVAL_UNDEF(&_32$$10);
+ ZVAL_UNDEF(&_34$$10);
+ ZVAL_UNDEF(&_14$$3);
+ ZVAL_UNDEF(&_23$$6);
+ ZVAL_UNDEF(&_29$$9);
+ ZVAL_UNDEF(&_33$$10);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
-
- ZEPHIR_OBS_VAR(&originalBuilder);
- zephir_read_property(&originalBuilder, this_ptr, ZEND_STRL("builder"), PH_NOISY_CC);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("columns"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&columns, &_0);
- ZEPHIR_INIT_VAR(&builder);
- if (zephir_clone(&builder, &originalBuilder) == FAILURE) {
- RETURN_MM();
- }
- ZEPHIR_INIT_VAR(&totalBuilder);
- if (zephir_clone(&totalBuilder, &builder) == FAILURE) {
- RETURN_MM();
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
}
- ZEPHIR_OBS_VAR(&limit);
- zephir_read_property(&limit, this_ptr, ZEND_STRL("limitRows"), PH_NOISY_CC);
- ZEPHIR_OBS_VAR(&_1);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("page"), PH_NOISY_CC);
- numberPage = zephir_get_intval(&_1);
- if (!(numberPage)) {
- numberPage = 1;
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
}
- ZEPHIR_INIT_VAR(&number);
- ZVAL_LONG(&number, (zephir_get_numberval(&limit) * ((numberPage - 1))));
- if (ZEPHIR_LT(&number, &limit)) {
- ZEPHIR_CALL_METHOD(NULL, &builder, "limit", NULL, 0, &limit);
- zephir_check_call_status();
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
} else {
- ZEPHIR_CALL_METHOD(NULL, &builder, "limit", NULL, 0, &limit, &number);
- zephir_check_call_status();
+ if (UNEXPECTED(Z_TYPE_P(schema_param) != IS_STRING && Z_TYPE_P(schema_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schema' must be of the type string"));
+ RETURN_MM_NULL();
}
- ZEPHIR_CALL_METHOD(&query, &builder, "getquery", NULL, 0);
- zephir_check_call_status();
- if (numberPage == 1) {
- previous = 1;
+ if (EXPECTED(Z_TYPE_P(schema_param) == IS_STRING)) {
+ zephir_get_strval(&schema, schema_param);
} else {
- previous = (numberPage - 1);
+ ZEPHIR_INIT_VAR(&schema);
}
- ZEPHIR_CALL_METHOD(&items, &query, "execute", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_2, &totalBuilder, "gethaving", NULL, 0);
+ }
+
+
+ ZEPHIR_INIT_VAR(&references);
+ array_init(&references);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_2, &_1, "describereferences", NULL, 0, &table, &schema);
zephir_check_call_status();
- hasHaving = !(ZEPHIR_IS_EMPTY(&_2));
- ZEPHIR_CALL_METHOD(&groups, &totalBuilder, "getgroupby", NULL, 0);
+ ZVAL_LONG(&_3, 3);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3);
zephir_check_call_status();
- hasGroup = !(ZEPHIR_IS_EMPTY(&groups));
- _3 = hasHaving;
- if (_3) {
- _3 = !hasGroup;
- }
- if (_3) {
- if (UNEXPECTED(ZEPHIR_IS_EMPTY(&columns))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "When having is set there should be columns option provided for which calculate row count", "phalcon/Paginator/Adapter/QueryBuilder.zep", 177);
- return;
- }
- ZEPHIR_CALL_METHOD(NULL, &totalBuilder, "columns", NULL, 0, &columns);
- zephir_check_call_status();
+ zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Mysql.zep", 577);
+ if (Z_TYPE_P(&_0) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4)
+ {
+ ZEPHIR_INIT_NVAR(&reference);
+ ZVAL_COPY(&reference, _4);
+ zephir_array_fetch_long(&constraintName, &reference, 2, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 546);
+ if (!(zephir_array_isset(&references, &constraintName))) {
+ ZEPHIR_OBS_NVAR(&referencedSchema);
+ zephir_array_fetch_long(&referencedSchema, &reference, 3, PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 549);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_long(&referencedTable, &reference, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 550);
+ ZEPHIR_OBS_NVAR(&referenceUpdate);
+ zephir_array_fetch_long(&referenceUpdate, &reference, 6, PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 551);
+ ZEPHIR_OBS_NVAR(&referenceDelete);
+ zephir_array_fetch_long(&referenceDelete, &reference, 7, PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 552);
+ ZEPHIR_INIT_NVAR(&columns);
+ array_init(&columns);
+ ZEPHIR_INIT_NVAR(&referencedColumns);
+ array_init(&referencedColumns);
+ } else {
+ zephir_array_fetch(&_6$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 556);
+ ZEPHIR_OBS_NVAR(&referencedSchema);
+ zephir_array_fetch_string(&referencedSchema, &_6$$5, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 556);
+ zephir_array_fetch(&_7$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 557);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_string(&referencedTable, &_7$$5, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 557);
+ zephir_array_fetch(&_8$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 558);
+ ZEPHIR_OBS_NVAR(&columns);
+ zephir_array_fetch_string(&columns, &_8$$5, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 558);
+ zephir_array_fetch(&_9$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 559);
+ ZEPHIR_OBS_NVAR(&referencedColumns);
+ zephir_array_fetch_string(&referencedColumns, &_9$$5, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 559);
+ zephir_array_fetch(&_10$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 560);
+ ZEPHIR_OBS_NVAR(&referenceUpdate);
+ zephir_array_fetch_string(&referenceUpdate, &_10$$5, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 560);
+ zephir_array_fetch(&_11$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 561);
+ ZEPHIR_OBS_NVAR(&referenceDelete);
+ zephir_array_fetch_string(&referenceDelete, &_11$$5, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 561);
+ }
+ zephir_array_fetch_long(&_12$$3, &reference, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 564);
+ zephir_array_append(&columns, &_12$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Mysql.zep", 564);
+ zephir_array_fetch_long(&_13$$3, &reference, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 565);
+ zephir_array_append(&referencedColumns, &_13$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Mysql.zep", 565);
+ ZEPHIR_INIT_NVAR(&_14$$3);
+ zephir_create_array(&_14$$3, 6, 0);
+ zephir_array_update_string(&_14$$3, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_14$$3, SL("referencedTable"), &referencedTable, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_14$$3, SL("columns"), &columns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_14$$3, SL("referencedColumns"), &referencedColumns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_14$$3, SL("onUpdate"), &referenceUpdate, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_14$$3, SL("onDelete"), &referenceDelete, PH_COPY | PH_SEPARATE);
+ zephir_array_update_zval(&references, &constraintName, &_14$$3, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_INIT_VAR(&_4$$10);
- ZVAL_STRING(&_4$$10, "COUNT(*) [rowcount]");
- ZEPHIR_CALL_METHOD(NULL, &totalBuilder, "columns", NULL, 0, &_4$$10);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0);
zephir_check_call_status();
- }
- if (hasGroup) {
- if (Z_TYPE_P(&groups) == IS_ARRAY) {
- ZEPHIR_INIT_VAR(&groupColumn);
- zephir_fast_join_str(&groupColumn, SL(", "), &groups);
- } else {
- ZEPHIR_CPY_WRT(&groupColumn, &groups);
- }
- if (!(hasHaving)) {
- ZVAL_NULL(&_6$$14);
- ZEPHIR_CALL_METHOD(&_5$$14, &totalBuilder, "groupby", NULL, 0, &_6$$14);
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5, &_0, "valid", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_7$$14);
- zephir_create_array(&_7$$14, 1, 0);
- ZEPHIR_INIT_VAR(&_8$$14);
- ZEPHIR_CONCAT_SVS(&_8$$14, "COUNT(DISTINCT ", &groupColumn, ") AS [rowcount]");
- zephir_array_fast_append(&_7$$14, &_8$$14);
- ZEPHIR_CALL_METHOD(NULL, &_5$$14, "columns", NULL, 0, &_7$$14);
+ if (!zend_is_true(&_5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&reference, &_0, "current", NULL, 0);
zephir_check_call_status();
- } else {
- ZEPHIR_INIT_VAR(&_9$$15);
- zephir_create_array(&_9$$15, 1, 0);
- ZEPHIR_INIT_VAR(&_10$$15);
- ZEPHIR_CONCAT_SV(&_10$$15, "DISTINCT ", &groupColumn);
- zephir_array_fast_append(&_9$$15, &_10$$15);
- ZEPHIR_CALL_METHOD(NULL, &totalBuilder, "columns", NULL, 0, &_9$$15);
+ ZEPHIR_OBS_NVAR(&constraintName);
+ zephir_array_fetch_long(&constraintName, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 546);
+ if (!(zephir_array_isset(&references, &constraintName))) {
+ ZEPHIR_OBS_NVAR(&referencedSchema);
+ zephir_array_fetch_long(&referencedSchema, &reference, 3, PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 549);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_long(&referencedTable, &reference, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 550);
+ ZEPHIR_OBS_NVAR(&referenceUpdate);
+ zephir_array_fetch_long(&referenceUpdate, &reference, 6, PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 551);
+ ZEPHIR_OBS_NVAR(&referenceDelete);
+ zephir_array_fetch_long(&referenceDelete, &reference, 7, PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 552);
+ ZEPHIR_INIT_NVAR(&columns);
+ array_init(&columns);
+ ZEPHIR_INIT_NVAR(&referencedColumns);
+ array_init(&referencedColumns);
+ } else {
+ zephir_array_fetch(&_15$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 556);
+ ZEPHIR_OBS_NVAR(&referencedSchema);
+ zephir_array_fetch_string(&referencedSchema, &_15$$8, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 556);
+ zephir_array_fetch(&_16$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 557);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_string(&referencedTable, &_16$$8, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 557);
+ zephir_array_fetch(&_17$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 558);
+ ZEPHIR_OBS_NVAR(&columns);
+ zephir_array_fetch_string(&columns, &_17$$8, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 558);
+ zephir_array_fetch(&_18$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 559);
+ ZEPHIR_OBS_NVAR(&referencedColumns);
+ zephir_array_fetch_string(&referencedColumns, &_18$$8, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 559);
+ zephir_array_fetch(&_19$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 560);
+ ZEPHIR_OBS_NVAR(&referenceUpdate);
+ zephir_array_fetch_string(&referenceUpdate, &_19$$8, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 560);
+ zephir_array_fetch(&_20$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 561);
+ ZEPHIR_OBS_NVAR(&referenceDelete);
+ zephir_array_fetch_string(&referenceDelete, &_20$$8, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 561);
+ }
+ zephir_array_fetch_long(&_21$$6, &reference, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 564);
+ zephir_array_append(&columns, &_21$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Mysql.zep", 564);
+ zephir_array_fetch_long(&_22$$6, &reference, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 565);
+ zephir_array_append(&referencedColumns, &_22$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Mysql.zep", 565);
+ ZEPHIR_INIT_NVAR(&_23$$6);
+ zephir_create_array(&_23$$6, 6, 0);
+ zephir_array_update_string(&_23$$6, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_23$$6, SL("referencedTable"), &referencedTable, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_23$$6, SL("columns"), &columns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_23$$6, SL("referencedColumns"), &referencedColumns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_23$$6, SL("onUpdate"), &referenceUpdate, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_23$$6, SL("onDelete"), &referenceDelete, PH_COPY | PH_SEPARATE);
+ zephir_array_update_zval(&references, &constraintName, &_23$$6, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0);
zephir_check_call_status();
}
}
- ZVAL_NULL(&_0);
- ZEPHIR_CALL_METHOD(NULL, &totalBuilder, "orderby", NULL, 0, &_0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&totalQuery, &totalBuilder, "getquery", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&rowcount);
- if (hasHaving) {
- ZEPHIR_CALL_METHOD(&sql, &totalQuery, "getsql", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&modelClass, &builder, "getmodels", NULL, 0);
- zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&modelClass) == IS_NULL)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "Model not defined in builder", "phalcon/Paginator/Adapter/QueryBuilder.zep", 229);
- return;
- }
- if (Z_TYPE_P(&modelClass) == IS_ARRAY) {
- ZEPHIR_CALL_FUNCTION(&_11$$18, "array_values", NULL, 12, &modelClass);
+ ZEPHIR_INIT_NVAR(&reference);
+ ZEPHIR_INIT_VAR(&referenceObjects);
+ array_init(&referenceObjects);
+ zephir_is_iterable(&references, 0, "phalcon/Db/Adapter/Pdo/Mysql.zep", 592);
+ if (Z_TYPE_P(&references) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&references), _26, _27, _24)
+ {
+ ZEPHIR_INIT_NVAR(&name);
+ if (_27 != NULL) {
+ ZVAL_STR_COPY(&name, _27);
+ } else {
+ ZVAL_LONG(&name, _26);
+ }
+ ZEPHIR_INIT_NVAR(&arrayReference);
+ ZVAL_COPY(&arrayReference, _24);
+ ZEPHIR_INIT_NVAR(&_28$$9);
+ object_init_ex(&_28$$9, phalcon_db_reference_ce);
+ ZEPHIR_INIT_NVAR(&_29$$9);
+ zephir_create_array(&_29$$9, 6, 0);
+ ZEPHIR_OBS_NVAR(&_30$$9);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 582);
+ zephir_array_update_string(&_29$$9, SL("referencedSchema"), &_30$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_30$$9);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 583);
+ zephir_array_update_string(&_29$$9, SL("referencedTable"), &_30$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_30$$9);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 584);
+ zephir_array_update_string(&_29$$9, SL("columns"), &_30$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_30$$9);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 585);
+ zephir_array_update_string(&_29$$9, SL("referencedColumns"), &_30$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_30$$9);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 586);
+ zephir_array_update_string(&_29$$9, SL("onUpdate"), &_30$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_30$$9);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 588);
+ zephir_array_update_string(&_29$$9, SL("onDelete"), &_30$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &_28$$9, "__construct", &_31, 33, &name, &_29$$9);
zephir_check_call_status();
- zephir_array_fetch_long(&_12$$18, &_11$$18, 0, PH_NOISY | PH_READONLY, "phalcon/Paginator/Adapter/QueryBuilder.zep", 233);
- ZEPHIR_CPY_WRT(&modelClass, &_12$$18);
- }
- ZEPHIR_INIT_VAR(&model);
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&model, &modelClass);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&dbService, &model, "getreadconnectionservice", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_13$$16, &totalBuilder, "getdi", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&db, &_13$$16, "get", NULL, 0, &dbService);
- zephir_check_call_status();
- zephir_array_fetch_string(&_14$$16, &sql, SL("sql"), PH_NOISY | PH_READONLY, "phalcon/Paginator/Adapter/QueryBuilder.zep", 241);
- ZEPHIR_INIT_VAR(&_15$$16);
- ZEPHIR_CONCAT_SVS(&_15$$16, "SELECT COUNT(*) as \"rowcount\" FROM (", &_14$$16, ") as T1");
- zephir_array_fetch_string(&_16$$16, &sql, SL("bind"), PH_NOISY | PH_READONLY, "phalcon/Paginator/Adapter/QueryBuilder.zep", 244);
- ZVAL_LONG(&_17$$16, 2);
- ZEPHIR_CALL_METHOD(&row, &db, "fetchone", NULL, 0, &_15$$16, &_17$$16, &_16$$16);
- zephir_check_call_status();
- if (zephir_is_true(&row)) {
- zephir_array_fetch_string(&_18$$16, &row, SL("rowcount"), PH_NOISY | PH_READONLY, "phalcon/Paginator/Adapter/QueryBuilder.zep", 246);
- ZVAL_LONG(&rowcount, zephir_get_intval(&_18$$16));
- } else {
- ZVAL_LONG(&rowcount, 0);
- }
- ZEPHIR_INIT_VAR(&_19$$16);
- div_function(&_19$$16, &rowcount, &limit);
- ZVAL_DOUBLE(&_17$$16, zephir_ceil(&_19$$16));
- ZEPHIR_INIT_VAR(&totalPages);
- ZVAL_LONG(&totalPages, zephir_get_intval(&_17$$16));
+ zephir_array_update_zval(&referenceObjects, &name, &_28$$9, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_CALL_METHOD(&result, &totalQuery, "execute", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&row, &result, "getfirst", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &references, "rewind", NULL, 0);
zephir_check_call_status();
- if (zephir_is_true(&row)) {
- zephir_read_property(&_20$$19, &row, ZEND_STRL("rowcount"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_NVAR(&rowcount);
- ZVAL_LONG(&rowcount, zephir_get_intval(&_20$$19));
- } else {
- ZEPHIR_INIT_NVAR(&rowcount);
- ZVAL_LONG(&rowcount, 0);
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_25, &references, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_25)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&name, &references, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&arrayReference, &references, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_32$$10);
+ object_init_ex(&_32$$10, phalcon_db_reference_ce);
+ ZEPHIR_INIT_NVAR(&_33$$10);
+ zephir_create_array(&_33$$10, 6, 0);
+ ZEPHIR_OBS_NVAR(&_34$$10);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 582);
+ zephir_array_update_string(&_33$$10, SL("referencedSchema"), &_34$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_34$$10);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 583);
+ zephir_array_update_string(&_33$$10, SL("referencedTable"), &_34$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_34$$10);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 584);
+ zephir_array_update_string(&_33$$10, SL("columns"), &_34$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_34$$10);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 585);
+ zephir_array_update_string(&_33$$10, SL("referencedColumns"), &_34$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_34$$10);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 586);
+ zephir_array_update_string(&_33$$10, SL("onUpdate"), &_34$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_34$$10);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 588);
+ zephir_array_update_string(&_33$$10, SL("onDelete"), &_34$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &_32$$10, "__construct", &_31, 33, &name, &_33$$10);
+ zephir_check_call_status();
+ zephir_array_update_zval(&referenceObjects, &name, &_32$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0);
+ zephir_check_call_status();
}
- ZEPHIR_INIT_VAR(&_21$$19);
- div_function(&_21$$19, &rowcount, &limit);
- ZVAL_DOUBLE(&_22$$19, zephir_ceil(&_21$$19));
- ZEPHIR_INIT_NVAR(&totalPages);
- ZVAL_LONG(&totalPages, zephir_get_intval(&_22$$19));
- }
- if (ZEPHIR_GT_LONG(&totalPages, numberPage)) {
- ZEPHIR_INIT_VAR(&next);
- ZVAL_LONG(&next, (numberPage + 1));
- } else {
- ZEPHIR_CPY_WRT(&next, &totalPages);
}
- ZEPHIR_INIT_VAR(&_23);
- zephir_create_array(&_23, 8, 0);
- zephir_array_update_string(&_23, SL("items"), &items, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_23, SL("total_items"), &rowcount, PH_COPY | PH_SEPARATE);
- ZEPHIR_OBS_VAR(&_24);
- zephir_read_property(&_24, this_ptr, ZEND_STRL("limitRows"), PH_NOISY_CC);
- zephir_array_update_string(&_23, SL("limit"), &_24, PH_COPY | PH_SEPARATE);
- add_assoc_long_ex(&_23, SL("first"), 1);
- ZEPHIR_INIT_VAR(&_25);
- ZVAL_LONG(&_25, previous);
- zephir_array_update_string(&_23, SL("previous"), &_25, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_25);
- ZVAL_LONG(&_25, numberPage);
- zephir_array_update_string(&_23, SL("current"), &_25, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_23, SL("next"), &next, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_23, SL("last"), &totalPages, PH_COPY | PH_SEPARATE);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getrepository", NULL, 0, &_23);
- zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_INIT_NVAR(&arrayReference);
+ ZEPHIR_INIT_NVAR(&name);
+ RETURN_CCTOR(&referenceObjects);
}
-static PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, setQueryBuilder)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, getDsnDefaults)
{
- zval *builder, builder_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&builder_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(builder, phalcon_mvc_model_query_builder_ce)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &builder);
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("builder"), builder);
- RETURN_THISW();
-}
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Security_Exception)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Security, Exception, phalcon, security_exception, phalcon_exception_ce, NULL, 0);
-
- return SUCCESS;
+ zephir_create_array(return_value, 1, 0);
+ add_assoc_stringl_ex(return_value, SL("charset"), SL("utf8mb4"));
+ return;
}
@@ -193830,1253 +190457,2764 @@ ZEPHIR_INIT_CLASS(Phalcon_Security_Exception)
-ZEPHIR_INIT_CLASS(Phalcon_Security_Random)
+ZEPHIR_INIT_CLASS(Phalcon_Db_Adapter_Pdo_Postgresql)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Security, Random, phalcon, security_random, phalcon_security_random_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Db\\Adapter\\Pdo, Postgresql, phalcon, db_adapter_pdo_postgresql, phalcon_db_adapter_pdo_abstractpdo_ce, phalcon_db_adapter_pdo_postgresql_method_entry, 0);
+ zend_declare_property_string(phalcon_db_adapter_pdo_postgresql_ce, SL("dialectType"), "postgresql", ZEND_ACC_PROTECTED);
+ zend_declare_property_string(phalcon_db_adapter_pdo_postgresql_ce, SL("type"), "pgsql", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Security_Random, base58)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *len_param = NULL, _0, _1, _2;
- zend_long len, ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_1 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *descriptor_param = NULL, _0$$3;
+ zval descriptor;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&descriptor);
+ ZVAL_UNDEF(&_0$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG_OR_NULL(len, is_null_true)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(descriptor)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &len_param);
- if (!len_param) {
- len = 0;
- } else {
- len = zephir_get_intval(len_param);
- }
+ zephir_fetch_params(1, 1, 0, &descriptor_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&descriptor, descriptor_param);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");
- ZVAL_LONG(&_1, 58);
- ZVAL_LONG(&_2, len);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "base", NULL, 0, &_0, &_1, &_2);
+ if (zephir_array_isset_string(&descriptor, SL("charset"))) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZVAL_STRING(&_0$$3, "Postgres does not allow the charset to be changed in the DSN.");
+ ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 7, &_0$$3);
+ zephir_check_call_status();
+ }
+ ZEPHIR_CALL_PARENT(NULL, phalcon_db_adapter_pdo_postgresql_ce, getThis(), "__construct", &_1, 0, &descriptor);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Security_Random, base62)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, connect)
{
+ zend_bool _2$$6;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *len_param = NULL, _0, _1, _2;
- zend_long len, ZEPHIR_LAST_CALL_STATUS;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_4 = NULL;
+ zval *descriptor_param = NULL, __$null, schema, sql, _0$$3, _1$$6, _3$$6;
+ zval descriptor;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&descriptor);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&schema);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$6);
+ ZVAL_UNDEF(&_3$$6);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_LONG_OR_NULL(len, is_null_true)
+ Z_PARAM_ARRAY(descriptor)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &len_param);
- if (!len_param) {
- len = 0;
+ zephir_fetch_params(1, 0, 1, &descriptor_param);
+ if (!descriptor_param) {
+ ZEPHIR_INIT_VAR(&descriptor);
+ array_init(&descriptor);
} else {
- len = zephir_get_intval(len_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&descriptor, descriptor_param);
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
- ZVAL_LONG(&_1, 62);
- ZVAL_LONG(&_2, len);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "base", NULL, 0, &_0, &_1, &_2);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Security_Random, base64)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *len_param = NULL, _0, _1;
- zend_long len, ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG_OR_NULL(len, is_null_true)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &len_param);
- if (!len_param) {
- len = 0;
+ if (ZEPHIR_IS_EMPTY(&descriptor)) {
+ zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("descriptor"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&descriptor, &_0$$3);
+ }
+ ZEPHIR_OBS_VAR(&schema);
+ if (zephir_array_isset_string_fetch(&schema, &descriptor, SL("schema"), 0)) {
+ zephir_array_unset_string(&descriptor, SL("schema"), PH_SEPARATE);
} else {
- len = zephir_get_intval(len_param);
+ ZEPHIR_INIT_NVAR(&schema);
+ ZVAL_NULL(&schema);
}
-
-
- ZVAL_LONG(&_1, len);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "bytes", NULL, 0, &_1);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 191, &_0);
+ if (zephir_array_isset_string(&descriptor, SL("password"))) {
+ ZEPHIR_OBS_VAR(&_1$$6);
+ zephir_array_fetch_string(&_1$$6, &descriptor, SL("password"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 85);
+ _2$$6 = Z_TYPE_P(&_1$$6) == IS_STRING;
+ if (_2$$6) {
+ zephir_array_fetch_string(&_3$$6, &descriptor, SL("password"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 85);
+ _2$$6 = zephir_fast_strlen_ev(&_3$$6) == 0;
+ }
+ if (_2$$6) {
+ zephir_array_update_string(&descriptor, SL("password"), &__$null, PH_COPY | PH_SEPARATE);
+ }
+ }
+ ZEPHIR_CALL_PARENT(NULL, phalcon_db_adapter_pdo_postgresql_ce, getThis(), "connect", &_4, 0, &descriptor);
zephir_check_call_status();
- RETURN_MM();
+ if (!(ZEPHIR_IS_EMPTY(&schema))) {
+ ZEPHIR_INIT_VAR(&sql);
+ ZEPHIR_CONCAT_SVS(&sql, "SET search_path TO '", &schema, "'");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "execute", NULL, 0, &sql);
+ zephir_check_call_status();
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Security_Random, base64Safe)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, createTable)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_bool padding;
- zval *len_param = NULL, *padding_param = NULL, s, _0, _1, _2, _3, _4, _5, _6$$3;
- zend_long len, ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_4 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval definition;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, sql, queries, query, exception, columns, _0, *_1$$6, _2$$6, _3$$7, _5$$9, _6$$5, _7$$12, _8$$12;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&s);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&queries);
+ ZVAL_UNDEF(&query);
+ ZVAL_UNDEF(&exception);
+ ZVAL_UNDEF(&columns);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_2$$6);
+ ZVAL_UNDEF(&_3$$7);
+ ZVAL_UNDEF(&_5$$9);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$12);
+ ZVAL_UNDEF(&_8$$12);
+ ZVAL_UNDEF(&definition);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 2)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG_OR_NULL(len, is_null_true)
- Z_PARAM_BOOL(padding)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_ARRAY(definition)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 2, &len_param, &padding_param);
- if (!len_param) {
- len = 0;
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &definition_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- len = zephir_get_intval(len_param);
+ ZEPHIR_INIT_VAR(&tableName);
}
- if (!padding_param) {
- padding = 0;
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
} else {
- padding = zephir_get_boolval(padding_param);
+ ZEPHIR_INIT_VAR(&schemaName);
}
+ ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param);
- ZVAL_LONG(&_1, len);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "base64", NULL, 0, &_1);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&_2, "base64_encode", NULL, 191, &_0);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "+/");
- ZEPHIR_INIT_VAR(&_4);
- ZVAL_STRING(&_4, "-_");
- ZEPHIR_CALL_FUNCTION(&s, "strtr", NULL, 5, &_2, &_3, &_4);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_3);
- ZVAL_STRING(&_3, "#[^a-z0-9_=-]+#i");
- ZEPHIR_INIT_NVAR(&_4);
- ZVAL_STRING(&_4, "");
- ZEPHIR_CALL_FUNCTION(&_5, "preg_replace", NULL, 50, &_3, &_4, &s);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&s, &_5);
- if (!(padding)) {
- ZEPHIR_INIT_VAR(&_6$$3);
- ZVAL_STRING(&_6$$3, "=");
- zephir_fast_trim(return_value, &s, &_6$$3, ZEPHIR_TRIM_RIGHT);
- RETURN_MM();
+ ZEPHIR_OBS_VAR(&columns);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The table must contain at least one column", "phalcon/Db/Adapter/Pdo/Postgresql.zep", 107);
+ return;
}
- RETURN_CCTOR(&s);
-}
-
-static PHP_METHOD(Phalcon_Security_Random, bytes)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *len_param = NULL, _0;
- zend_long len, ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(len)
- ZEND_PARSE_PARAMETERS_END();
-#endif
+ if (UNEXPECTED(!(zephir_fast_count_int(&columns)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The table must contain at least one column", "phalcon/Db/Adapter/Pdo/Postgresql.zep", 111);
+ return;
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&sql, &_0, "createtable", NULL, 0, &tableName, &schemaName, &definition);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&queries);
+ zephir_fast_explode_str(&queries, SL(";"), &sql, LONG_MAX);
+ if (zephir_fast_count_int(&queries) > 1) {
+ /* try_start_1: */
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &len_param);
- if (!len_param) {
- len = 16;
- } else {
- len = zephir_get_intval(len_param);
- }
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "begin", NULL, 0);
+ zephir_check_call_status_or_jump(try_end_1);
+ zephir_is_iterable(&queries, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 130);
+ if (Z_TYPE_P(&queries) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&queries), _1$$6)
+ {
+ ZEPHIR_INIT_NVAR(&query);
+ ZVAL_COPY(&query, _1$$6);
+ if (ZEPHIR_IS_EMPTY(&query)) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&_3$$7);
+ ZEPHIR_CONCAT_VS(&_3$$7, &query, ";");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "query", &_4, 0, &_3$$7);
+ zephir_check_call_status_or_jump(try_end_1);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &queries, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2$$6, &queries, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2$$6)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&query, &queries, "current", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EMPTY(&query)) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&_5$$9);
+ ZEPHIR_CONCAT_VS(&_5$$9, &query, ";");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "query", &_4, 0, &_5$$9);
+ zephir_check_call_status_or_jump(try_end_1);
+ ZEPHIR_CALL_METHOD(NULL, &queries, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&query);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "commit", NULL, 0);
+ zephir_check_call_status_or_jump(try_end_1);
+ RETURN_MM();
+ try_end_1:
- if (len <= 0) {
- len = 16;
+ if (EG(exception)) {
+ ZEPHIR_INIT_VAR(&_6$$5);
+ ZVAL_OBJ(&_6$$5, EG(exception));
+ Z_ADDREF_P(&_6$$5);
+ if (zephir_is_instance_of(&_6$$5, SL("Throwable"))) {
+ zend_clear_exception();
+ ZEPHIR_CPY_WRT(&exception, &_6$$5);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "rollback", NULL, 0);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&exception, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 134);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ }
+ } else {
+ zephir_array_fetch_long(&_7$$12, &queries, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 137);
+ ZEPHIR_INIT_VAR(&_8$$12);
+ ZEPHIR_CONCAT_VS(&_8$$12, &_7$$12, ";");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_8$$12);
+ zephir_check_call_status();
+ RETURN_MM();
}
- ZVAL_LONG(&_0, len);
- ZEPHIR_RETURN_CALL_FUNCTION("random_bytes", NULL, 0, &_0);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_MM_BOOL(1);
}
-static PHP_METHOD(Phalcon_Security_Random, hex)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
{
+ zend_bool _5$$3, _64$$41;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *len_param = NULL, _0, _1, _2, _3;
- zend_long len, ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_55 = NULL, *_58 = NULL, *_62 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *table_param = NULL, *schema_param = NULL, __$true, __$false, __$null, columns, columnType, fields, field, definition, oldColumn, columnName, charSize, numericSize, numericScale, _0, _1, _2, *_3, _4, _47$$3, _48$$3, _49$$3, _50$$3, _59$$3, _61$$3, _6$$4, _7$$4, _8$$5, _9$$5, _10$$6, _11$$6, _12$$7, _13$$7, _14$$8, _15$$8, _16$$9, _17$$9, _18$$10, _19$$11, _20$$12, _21$$12, _22$$13, _23$$13, _24$$14, _25$$14, _26$$15, _27$$15, _28$$16, _29$$16, _30$$17, _31$$18, _32$$19, _33$$20, _34$$21, _35$$22, _36$$23, _37$$24, _38$$25, _39$$26, _40$$27, _41$$28, _42$$29, _43$$30, _44$$31, _45$$31, _46$$32, _51$$38, _52$$38, _53$$38, _54$$38, _56$$38, _57$$38, _60$$40, _63$$41, _106$$41, _107$$41, _108$$41, _109$$41, _116$$41, _118$$41, _65$$42, _66$$42, _67$$43, _68$$43, _69$$44, _70$$44, _71$$45, _72$$45, _73$$46, _74$$46, _75$$47, _76$$47, _77$$48, _78$$49, _79$$50, _80$$50, _81$$51, _82$$51, _83$$52, _84$$52, _85$$53, _86$$53, _87$$54, _88$$54, _89$$55, _90$$56, _91$$57, _92$$58, _93$$59, _94$$60, _95$$61, _96$$62, _97$$63, _98$$64, _99$$65, _100$$66, _101$$67, _102$$68, _103$$69, _104$$69, _105$$70, _110$$76, _111$$76, _112$$76, _113$$76, _114$$76, _115$$76, _117$$78;
+ zval table, schema;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&columnType);
+ ZVAL_UNDEF(&fields);
+ ZVAL_UNDEF(&field);
+ ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&oldColumn);
+ ZVAL_UNDEF(&columnName);
+ ZVAL_UNDEF(&charSize);
+ ZVAL_UNDEF(&numericSize);
+ ZVAL_UNDEF(&numericScale);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_47$$3);
+ ZVAL_UNDEF(&_48$$3);
+ ZVAL_UNDEF(&_49$$3);
+ ZVAL_UNDEF(&_50$$3);
+ ZVAL_UNDEF(&_59$$3);
+ ZVAL_UNDEF(&_61$$3);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$6);
+ ZVAL_UNDEF(&_11$$6);
+ ZVAL_UNDEF(&_12$$7);
+ ZVAL_UNDEF(&_13$$7);
+ ZVAL_UNDEF(&_14$$8);
+ ZVAL_UNDEF(&_15$$8);
+ ZVAL_UNDEF(&_16$$9);
+ ZVAL_UNDEF(&_17$$9);
+ ZVAL_UNDEF(&_18$$10);
+ ZVAL_UNDEF(&_19$$11);
+ ZVAL_UNDEF(&_20$$12);
+ ZVAL_UNDEF(&_21$$12);
+ ZVAL_UNDEF(&_22$$13);
+ ZVAL_UNDEF(&_23$$13);
+ ZVAL_UNDEF(&_24$$14);
+ ZVAL_UNDEF(&_25$$14);
+ ZVAL_UNDEF(&_26$$15);
+ ZVAL_UNDEF(&_27$$15);
+ ZVAL_UNDEF(&_28$$16);
+ ZVAL_UNDEF(&_29$$16);
+ ZVAL_UNDEF(&_30$$17);
+ ZVAL_UNDEF(&_31$$18);
+ ZVAL_UNDEF(&_32$$19);
+ ZVAL_UNDEF(&_33$$20);
+ ZVAL_UNDEF(&_34$$21);
+ ZVAL_UNDEF(&_35$$22);
+ ZVAL_UNDEF(&_36$$23);
+ ZVAL_UNDEF(&_37$$24);
+ ZVAL_UNDEF(&_38$$25);
+ ZVAL_UNDEF(&_39$$26);
+ ZVAL_UNDEF(&_40$$27);
+ ZVAL_UNDEF(&_41$$28);
+ ZVAL_UNDEF(&_42$$29);
+ ZVAL_UNDEF(&_43$$30);
+ ZVAL_UNDEF(&_44$$31);
+ ZVAL_UNDEF(&_45$$31);
+ ZVAL_UNDEF(&_46$$32);
+ ZVAL_UNDEF(&_51$$38);
+ ZVAL_UNDEF(&_52$$38);
+ ZVAL_UNDEF(&_53$$38);
+ ZVAL_UNDEF(&_54$$38);
+ ZVAL_UNDEF(&_56$$38);
+ ZVAL_UNDEF(&_57$$38);
+ ZVAL_UNDEF(&_60$$40);
+ ZVAL_UNDEF(&_63$$41);
+ ZVAL_UNDEF(&_106$$41);
+ ZVAL_UNDEF(&_107$$41);
+ ZVAL_UNDEF(&_108$$41);
+ ZVAL_UNDEF(&_109$$41);
+ ZVAL_UNDEF(&_116$$41);
+ ZVAL_UNDEF(&_118$$41);
+ ZVAL_UNDEF(&_65$$42);
+ ZVAL_UNDEF(&_66$$42);
+ ZVAL_UNDEF(&_67$$43);
+ ZVAL_UNDEF(&_68$$43);
+ ZVAL_UNDEF(&_69$$44);
+ ZVAL_UNDEF(&_70$$44);
+ ZVAL_UNDEF(&_71$$45);
+ ZVAL_UNDEF(&_72$$45);
+ ZVAL_UNDEF(&_73$$46);
+ ZVAL_UNDEF(&_74$$46);
+ ZVAL_UNDEF(&_75$$47);
+ ZVAL_UNDEF(&_76$$47);
+ ZVAL_UNDEF(&_77$$48);
+ ZVAL_UNDEF(&_78$$49);
+ ZVAL_UNDEF(&_79$$50);
+ ZVAL_UNDEF(&_80$$50);
+ ZVAL_UNDEF(&_81$$51);
+ ZVAL_UNDEF(&_82$$51);
+ ZVAL_UNDEF(&_83$$52);
+ ZVAL_UNDEF(&_84$$52);
+ ZVAL_UNDEF(&_85$$53);
+ ZVAL_UNDEF(&_86$$53);
+ ZVAL_UNDEF(&_87$$54);
+ ZVAL_UNDEF(&_88$$54);
+ ZVAL_UNDEF(&_89$$55);
+ ZVAL_UNDEF(&_90$$56);
+ ZVAL_UNDEF(&_91$$57);
+ ZVAL_UNDEF(&_92$$58);
+ ZVAL_UNDEF(&_93$$59);
+ ZVAL_UNDEF(&_94$$60);
+ ZVAL_UNDEF(&_95$$61);
+ ZVAL_UNDEF(&_96$$62);
+ ZVAL_UNDEF(&_97$$63);
+ ZVAL_UNDEF(&_98$$64);
+ ZVAL_UNDEF(&_99$$65);
+ ZVAL_UNDEF(&_100$$66);
+ ZVAL_UNDEF(&_101$$67);
+ ZVAL_UNDEF(&_102$$68);
+ ZVAL_UNDEF(&_103$$69);
+ ZVAL_UNDEF(&_104$$69);
+ ZVAL_UNDEF(&_105$$70);
+ ZVAL_UNDEF(&_110$$76);
+ ZVAL_UNDEF(&_111$$76);
+ ZVAL_UNDEF(&_112$$76);
+ ZVAL_UNDEF(&_113$$76);
+ ZVAL_UNDEF(&_114$$76);
+ ZVAL_UNDEF(&_115$$76);
+ ZVAL_UNDEF(&_117$$78);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
Z_PARAM_OPTIONAL
- Z_PARAM_LONG_OR_NULL(len, is_null_true)
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &len_param);
- if (!len_param) {
- len = 0;
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ zephir_get_strval(&table, table_param);
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
} else {
- len = zephir_get_intval(len_param);
+ zephir_get_strval(&schema, schema_param);
}
- ZVAL_LONG(&_1, len);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "bytes", NULL, 0, &_1);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "H*");
- ZEPHIR_CALL_FUNCTION(&_3, "unpack", NULL, 0, &_2, &_0);
+ ZEPHIR_INIT_VAR(&oldColumn);
+ ZVAL_NULL(&oldColumn);
+ ZEPHIR_INIT_VAR(&columns);
+ array_init(&columns);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "describecolumns", NULL, 0, &table, &schema);
zephir_check_call_status();
- ZEPHIR_MAKE_REF(&_3);
- ZEPHIR_RETURN_CALL_FUNCTION("array_shift", NULL, 24, &_3);
- ZEPHIR_UNREF(&_3);
+ ZVAL_LONG(&_2, 3);
+ ZEPHIR_CALL_METHOD(&fields, this_ptr, "fetchall", NULL, 0, &_1, &_2);
zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Security_Random, number)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *len_param = NULL, _0, _1;
- zend_long len, ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(len)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &len_param);
- len = zephir_get_intval(len_param);
+ zephir_is_iterable(&fields, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 529);
+ if (Z_TYPE_P(&fields) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&fields), _3)
+ {
+ ZEPHIR_INIT_NVAR(&field);
+ ZVAL_COPY(&field, _3);
+ ZEPHIR_INIT_NVAR(&definition);
+ zephir_create_array(&definition, 1, 0);
+ add_assoc_long_ex(&definition, SL("bindType"), 2);
+ ZEPHIR_OBS_NVAR(&columnType);
+ zephir_array_fetch_long(&columnType, &field, 1, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 182);
+ ZEPHIR_OBS_NVAR(&charSize);
+ zephir_array_fetch_long(&charSize, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 183);
+ ZEPHIR_OBS_NVAR(&numericSize);
+ zephir_array_fetch_long(&numericSize, &field, 3, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 184);
+ ZEPHIR_OBS_NVAR(&numericScale);
+ zephir_array_fetch_long(&numericScale, &field, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 185);
+ do {
+ _5$$3 = 1;
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("boolean"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 203)) {
+ ZEPHIR_INIT_NVAR(&_6$$4);
+ ZVAL_LONG(&_6$$4, 8);
+ zephir_array_update_string(&definition, SL("type"), &_6$$4, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_7$$4);
+ ZVAL_LONG(&_7$$4, 5);
+ zephir_array_update_string(&definition, SL("bindType"), &_7$$4, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 215)) {
+ ZEPHIR_INIT_NVAR(&_8$$5);
+ ZVAL_LONG(&_8$$5, 14);
+ zephir_array_update_string(&definition, SL("type"), &_8$$5, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_9$$5);
+ ZVAL_LONG(&_9$$5, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_9$$5, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("mediumint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 225)) {
+ ZEPHIR_INIT_NVAR(&_10$$6);
+ ZVAL_LONG(&_10$$6, 21);
+ zephir_array_update_string(&definition, SL("type"), &_10$$6, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_11$$6);
+ ZVAL_LONG(&_11$$6, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_11$$6, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("smallint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 235)) {
+ ZEPHIR_INIT_NVAR(&_12$$7);
+ ZVAL_LONG(&_12$$7, 22);
+ zephir_array_update_string(&definition, SL("type"), &_12$$7, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_13$$7);
+ ZVAL_LONG(&_13$$7, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_13$$7, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("tinyint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 245)) {
+ ZEPHIR_INIT_NVAR(&_14$$8);
+ ZVAL_LONG(&_14$$8, 26);
+ zephir_array_update_string(&definition, SL("type"), &_14$$8, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_15$$8);
+ ZVAL_LONG(&_15$$8, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_15$$8, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 258)) {
+ ZEPHIR_INIT_NVAR(&_16$$9);
+ ZVAL_LONG(&_16$$9, 0);
+ zephir_array_update_string(&definition, SL("type"), &_16$$9, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_17$$9);
+ ZVAL_LONG(&_17$$9, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_17$$9, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("bit"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 268)) {
+ ZEPHIR_INIT_NVAR(&_18$$10);
+ ZVAL_LONG(&_18$$10, 19);
+ zephir_array_update_string(&definition, SL("type"), &_18$$10, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 277)) {
+ ZEPHIR_INIT_NVAR(&_19$$11);
+ ZVAL_LONG(&_19$$11, 18);
+ zephir_array_update_string(&definition, SL("type"), &_19$$11, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 285)) {
+ ZEPHIR_INIT_NVAR(&_20$$12);
+ ZVAL_LONG(&_20$$12, 4);
+ zephir_array_update_string(&definition, SL("type"), &_20$$12, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_21$$12);
+ ZVAL_LONG(&_21$$12, 0);
+ zephir_array_update_string(&definition, SL("size"), &_21$$12, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 294)) {
+ ZEPHIR_INIT_NVAR(&_22$$13);
+ ZVAL_LONG(&_22$$13, 1);
+ zephir_array_update_string(&definition, SL("type"), &_22$$13, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_23$$13);
+ ZVAL_LONG(&_23$$13, 0);
+ zephir_array_update_string(&definition, SL("size"), &_23$$13, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 304) || _5$$3 == zephir_memnstr_str(&columnType, SL("numeric"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 305)) {
+ ZEPHIR_INIT_NVAR(&_24$$14);
+ ZVAL_LONG(&_24$$14, 3);
+ zephir_array_update_string(&definition, SL("type"), &_24$$14, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_25$$14);
+ ZVAL_LONG(&_25$$14, 32);
+ zephir_array_update_string(&definition, SL("bindType"), &_25$$14, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("double precision"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 316)) {
+ ZEPHIR_INIT_NVAR(&_26$$15);
+ ZVAL_LONG(&_26$$15, 9);
+ zephir_array_update_string(&definition, SL("type"), &_26$$15, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_27$$15);
+ ZVAL_LONG(&_27$$15, 32);
+ zephir_array_update_string(&definition, SL("bindType"), &_27$$15, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 327) || _5$$3 == zephir_memnstr_str(&columnType, SL("real"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 328)) {
+ ZEPHIR_INIT_NVAR(&_28$$16);
+ ZVAL_LONG(&_28$$16, 7);
+ zephir_array_update_string(&definition, SL("type"), &_28$$16, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_29$$16);
+ ZVAL_LONG(&_29$$16, 32);
+ zephir_array_update_string(&definition, SL("bindType"), &_29$$16, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("mediumblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 339)) {
+ ZEPHIR_INIT_NVAR(&_30$$17);
+ ZVAL_LONG(&_30$$17, 6);
+ zephir_array_update_string(&definition, SL("type"), &_30$$17, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("longblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 347)) {
+ ZEPHIR_INIT_NVAR(&_31$$18);
+ ZVAL_LONG(&_31$$18, 13);
+ zephir_array_update_string(&definition, SL("type"), &_31$$18, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("tinyblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 355)) {
+ ZEPHIR_INIT_NVAR(&_32$$19);
+ ZVAL_LONG(&_32$$19, 10);
+ zephir_array_update_string(&definition, SL("type"), &_32$$19, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("blob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 363)) {
+ ZEPHIR_INIT_NVAR(&_33$$20);
+ ZVAL_LONG(&_33$$20, 11);
+ zephir_array_update_string(&definition, SL("type"), &_33$$20, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 371)) {
+ ZEPHIR_INIT_NVAR(&_34$$21);
+ ZVAL_LONG(&_34$$21, 17);
+ zephir_array_update_string(&definition, SL("type"), &_34$$21, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("time"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 379)) {
+ ZEPHIR_INIT_NVAR(&_35$$22);
+ ZVAL_LONG(&_35$$22, 20);
+ zephir_array_update_string(&definition, SL("type"), &_35$$22, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("jsonb"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 387)) {
+ ZEPHIR_INIT_NVAR(&_36$$23);
+ ZVAL_LONG(&_36$$23, 16);
+ zephir_array_update_string(&definition, SL("type"), &_36$$23, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("json"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 395)) {
+ ZEPHIR_INIT_NVAR(&_37$$24);
+ ZVAL_LONG(&_37$$24, 15);
+ zephir_array_update_string(&definition, SL("type"), &_37$$24, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("longtext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 403)) {
+ ZEPHIR_INIT_NVAR(&_38$$25);
+ ZVAL_LONG(&_38$$25, 24);
+ zephir_array_update_string(&definition, SL("type"), &_38$$25, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("mediumtext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 411)) {
+ ZEPHIR_INIT_NVAR(&_39$$26);
+ ZVAL_LONG(&_39$$26, 23);
+ zephir_array_update_string(&definition, SL("type"), &_39$$26, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("tinytext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 419)) {
+ ZEPHIR_INIT_NVAR(&_40$$27);
+ ZVAL_LONG(&_40$$27, 25);
+ zephir_array_update_string(&definition, SL("type"), &_40$$27, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 427)) {
+ ZEPHIR_INIT_NVAR(&_41$$28);
+ ZVAL_LONG(&_41$$28, 6);
+ zephir_array_update_string(&definition, SL("type"), &_41$$28, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("varying"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 435) || _5$$3 == zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 436)) {
+ ZEPHIR_INIT_NVAR(&_42$$29);
+ ZVAL_LONG(&_42$$29, 2);
+ zephir_array_update_string(&definition, SL("type"), &_42$$29, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("size"), &charSize, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 445)) {
+ ZEPHIR_INIT_NVAR(&_43$$30);
+ ZVAL_LONG(&_43$$30, 5);
+ zephir_array_update_string(&definition, SL("type"), &_43$$30, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("size"), &charSize, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("uuid"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 454)) {
+ ZEPHIR_INIT_NVAR(&_44$$31);
+ ZVAL_LONG(&_44$$31, 5);
+ zephir_array_update_string(&definition, SL("type"), &_44$$31, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_45$$31);
+ ZVAL_LONG(&_45$$31, 36);
+ zephir_array_update_string(&definition, SL("size"), &_45$$31, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ ZEPHIR_INIT_NVAR(&_46$$32);
+ ZVAL_LONG(&_46$$32, 2);
+ zephir_array_update_string(&definition, SL("type"), &_46$$32, PH_COPY | PH_SEPARATE);
+ break;
+ } while(0);
+ if (Z_TYPE_P(&oldColumn) == IS_NULL) {
+ zephir_array_update_string(&definition, SL("first"), &__$true, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_47$$3, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 481);
+ if (ZEPHIR_IS_STRING(&_47$$3, "PRI")) {
+ zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_48$$3, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 488);
+ if (ZEPHIR_IS_STRING(&_48$$3, "YES")) {
+ zephir_array_update_string(&definition, SL("notNull"), &__$false, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_49$$3, &field, 7, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 495);
+ if (ZEPHIR_IS_STRING(&_49$$3, "auto_increment")) {
+ zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_50$$3, &field, 9, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 502);
+ if (Z_TYPE_P(&_50$$3) != IS_NULL) {
+ zephir_array_fetch_long(&_51$$38, &field, 9, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 507);
+ ZEPHIR_INIT_NVAR(&_52$$38);
+ ZVAL_STRING(&_52$$38, "/^'|'?::[[:alnum:][:space:]]+$/");
+ ZEPHIR_INIT_NVAR(&_53$$38);
+ ZVAL_STRING(&_53$$38, "");
+ ZEPHIR_CALL_FUNCTION(&_54$$38, "preg_replace", &_55, 50, &_52$$38, &_53$$38, &_51$$38);
+ zephir_check_call_status();
+ zephir_array_update_string(&definition, SL("default"), &_54$$38, PH_COPY | PH_SEPARATE);
+ zephir_array_fetch_string(&_56$$38, &definition, SL("default"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 509);
+ ZEPHIR_INIT_NVAR(&_52$$38);
+ ZVAL_STRING(&_52$$38, "null");
+ ZEPHIR_CALL_FUNCTION(&_57$$38, "strcasecmp", &_58, 47, &_56$$38, &_52$$38);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_LONG(&_57$$38, 0)) {
+ zephir_array_update_string(&definition, SL("default"), &__$null, PH_COPY | PH_SEPARATE);
+ }
+ }
+ zephir_array_fetch_long(&_59$$3, &field, 10, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 517);
+ if (Z_TYPE_P(&_59$$3) != IS_NULL) {
+ zephir_array_fetch_long(&_60$$40, &field, 10, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 518);
+ zephir_array_update_string(&definition, SL("comment"), &_60$$40, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 524);
+ ZEPHIR_INIT_NVAR(&_61$$3);
+ object_init_ex(&_61$$3, phalcon_db_column_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_61$$3, "__construct", &_62, 212, &columnName, &definition);
+ zephir_check_call_status();
+ zephir_array_append(&columns, &_61$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 525);
+ ZEPHIR_CPY_WRT(&oldColumn, &columnName);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &fields, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_4, &fields, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_4)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&field, &fields, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_63$$41);
+ zephir_create_array(&_63$$41, 1, 0);
+ add_assoc_long_ex(&_63$$41, SL("bindType"), 2);
+ ZEPHIR_CPY_WRT(&definition, &_63$$41);
+ ZEPHIR_OBS_NVAR(&columnType);
+ zephir_array_fetch_long(&columnType, &field, 1, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 182);
+ ZEPHIR_OBS_NVAR(&charSize);
+ zephir_array_fetch_long(&charSize, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 183);
+ ZEPHIR_OBS_NVAR(&numericSize);
+ zephir_array_fetch_long(&numericSize, &field, 3, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 184);
+ ZEPHIR_OBS_NVAR(&numericScale);
+ zephir_array_fetch_long(&numericScale, &field, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 185);
+ do {
+ _64$$41 = 1;
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("boolean"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 203)) {
+ ZEPHIR_INIT_NVAR(&_65$$42);
+ ZVAL_LONG(&_65$$42, 8);
+ zephir_array_update_string(&definition, SL("type"), &_65$$42, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_66$$42);
+ ZVAL_LONG(&_66$$42, 5);
+ zephir_array_update_string(&definition, SL("bindType"), &_66$$42, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 215)) {
+ ZEPHIR_INIT_NVAR(&_67$$43);
+ ZVAL_LONG(&_67$$43, 14);
+ zephir_array_update_string(&definition, SL("type"), &_67$$43, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_68$$43);
+ ZVAL_LONG(&_68$$43, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_68$$43, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("mediumint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 225)) {
+ ZEPHIR_INIT_NVAR(&_69$$44);
+ ZVAL_LONG(&_69$$44, 21);
+ zephir_array_update_string(&definition, SL("type"), &_69$$44, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_70$$44);
+ ZVAL_LONG(&_70$$44, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_70$$44, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("smallint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 235)) {
+ ZEPHIR_INIT_NVAR(&_71$$45);
+ ZVAL_LONG(&_71$$45, 22);
+ zephir_array_update_string(&definition, SL("type"), &_71$$45, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_72$$45);
+ ZVAL_LONG(&_72$$45, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_72$$45, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("tinyint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 245)) {
+ ZEPHIR_INIT_NVAR(&_73$$46);
+ ZVAL_LONG(&_73$$46, 26);
+ zephir_array_update_string(&definition, SL("type"), &_73$$46, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_74$$46);
+ ZVAL_LONG(&_74$$46, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_74$$46, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 258)) {
+ ZEPHIR_INIT_NVAR(&_75$$47);
+ ZVAL_LONG(&_75$$47, 0);
+ zephir_array_update_string(&definition, SL("type"), &_75$$47, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_76$$47);
+ ZVAL_LONG(&_76$$47, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_76$$47, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("bit"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 268)) {
+ ZEPHIR_INIT_NVAR(&_77$$48);
+ ZVAL_LONG(&_77$$48, 19);
+ zephir_array_update_string(&definition, SL("type"), &_77$$48, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 277)) {
+ ZEPHIR_INIT_NVAR(&_78$$49);
+ ZVAL_LONG(&_78$$49, 18);
+ zephir_array_update_string(&definition, SL("type"), &_78$$49, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 285)) {
+ ZEPHIR_INIT_NVAR(&_79$$50);
+ ZVAL_LONG(&_79$$50, 4);
+ zephir_array_update_string(&definition, SL("type"), &_79$$50, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_80$$50);
+ ZVAL_LONG(&_80$$50, 0);
+ zephir_array_update_string(&definition, SL("size"), &_80$$50, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 294)) {
+ ZEPHIR_INIT_NVAR(&_81$$51);
+ ZVAL_LONG(&_81$$51, 1);
+ zephir_array_update_string(&definition, SL("type"), &_81$$51, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_82$$51);
+ ZVAL_LONG(&_82$$51, 0);
+ zephir_array_update_string(&definition, SL("size"), &_82$$51, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 304) || _64$$41 == zephir_memnstr_str(&columnType, SL("numeric"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 305)) {
+ ZEPHIR_INIT_NVAR(&_83$$52);
+ ZVAL_LONG(&_83$$52, 3);
+ zephir_array_update_string(&definition, SL("type"), &_83$$52, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_84$$52);
+ ZVAL_LONG(&_84$$52, 32);
+ zephir_array_update_string(&definition, SL("bindType"), &_84$$52, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("double precision"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 316)) {
+ ZEPHIR_INIT_NVAR(&_85$$53);
+ ZVAL_LONG(&_85$$53, 9);
+ zephir_array_update_string(&definition, SL("type"), &_85$$53, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_86$$53);
+ ZVAL_LONG(&_86$$53, 32);
+ zephir_array_update_string(&definition, SL("bindType"), &_86$$53, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 327) || _64$$41 == zephir_memnstr_str(&columnType, SL("real"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 328)) {
+ ZEPHIR_INIT_NVAR(&_87$$54);
+ ZVAL_LONG(&_87$$54, 7);
+ zephir_array_update_string(&definition, SL("type"), &_87$$54, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_88$$54);
+ ZVAL_LONG(&_88$$54, 32);
+ zephir_array_update_string(&definition, SL("bindType"), &_88$$54, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("mediumblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 339)) {
+ ZEPHIR_INIT_NVAR(&_89$$55);
+ ZVAL_LONG(&_89$$55, 6);
+ zephir_array_update_string(&definition, SL("type"), &_89$$55, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("longblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 347)) {
+ ZEPHIR_INIT_NVAR(&_90$$56);
+ ZVAL_LONG(&_90$$56, 13);
+ zephir_array_update_string(&definition, SL("type"), &_90$$56, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("tinyblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 355)) {
+ ZEPHIR_INIT_NVAR(&_91$$57);
+ ZVAL_LONG(&_91$$57, 10);
+ zephir_array_update_string(&definition, SL("type"), &_91$$57, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("blob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 363)) {
+ ZEPHIR_INIT_NVAR(&_92$$58);
+ ZVAL_LONG(&_92$$58, 11);
+ zephir_array_update_string(&definition, SL("type"), &_92$$58, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 371)) {
+ ZEPHIR_INIT_NVAR(&_93$$59);
+ ZVAL_LONG(&_93$$59, 17);
+ zephir_array_update_string(&definition, SL("type"), &_93$$59, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("time"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 379)) {
+ ZEPHIR_INIT_NVAR(&_94$$60);
+ ZVAL_LONG(&_94$$60, 20);
+ zephir_array_update_string(&definition, SL("type"), &_94$$60, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("jsonb"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 387)) {
+ ZEPHIR_INIT_NVAR(&_95$$61);
+ ZVAL_LONG(&_95$$61, 16);
+ zephir_array_update_string(&definition, SL("type"), &_95$$61, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("json"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 395)) {
+ ZEPHIR_INIT_NVAR(&_96$$62);
+ ZVAL_LONG(&_96$$62, 15);
+ zephir_array_update_string(&definition, SL("type"), &_96$$62, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("longtext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 403)) {
+ ZEPHIR_INIT_NVAR(&_97$$63);
+ ZVAL_LONG(&_97$$63, 24);
+ zephir_array_update_string(&definition, SL("type"), &_97$$63, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("mediumtext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 411)) {
+ ZEPHIR_INIT_NVAR(&_98$$64);
+ ZVAL_LONG(&_98$$64, 23);
+ zephir_array_update_string(&definition, SL("type"), &_98$$64, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("tinytext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 419)) {
+ ZEPHIR_INIT_NVAR(&_99$$65);
+ ZVAL_LONG(&_99$$65, 25);
+ zephir_array_update_string(&definition, SL("type"), &_99$$65, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 427)) {
+ ZEPHIR_INIT_NVAR(&_100$$66);
+ ZVAL_LONG(&_100$$66, 6);
+ zephir_array_update_string(&definition, SL("type"), &_100$$66, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("varying"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 435) || _64$$41 == zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 436)) {
+ ZEPHIR_INIT_NVAR(&_101$$67);
+ ZVAL_LONG(&_101$$67, 2);
+ zephir_array_update_string(&definition, SL("type"), &_101$$67, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("size"), &charSize, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 445)) {
+ ZEPHIR_INIT_NVAR(&_102$$68);
+ ZVAL_LONG(&_102$$68, 5);
+ zephir_array_update_string(&definition, SL("type"), &_102$$68, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("size"), &charSize, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("uuid"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 454)) {
+ ZEPHIR_INIT_NVAR(&_103$$69);
+ ZVAL_LONG(&_103$$69, 5);
+ zephir_array_update_string(&definition, SL("type"), &_103$$69, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_104$$69);
+ ZVAL_LONG(&_104$$69, 36);
+ zephir_array_update_string(&definition, SL("size"), &_104$$69, PH_COPY | PH_SEPARATE);
+ break;
+ }
+ ZEPHIR_INIT_NVAR(&_105$$70);
+ ZVAL_LONG(&_105$$70, 2);
+ zephir_array_update_string(&definition, SL("type"), &_105$$70, PH_COPY | PH_SEPARATE);
+ break;
+ } while(0);
- if (UNEXPECTED(len <= 0)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "Require a positive integer > 0", "phalcon/Security/Random.zep", 271);
- return;
+ if (Z_TYPE_P(&oldColumn) == IS_NULL) {
+ zephir_array_update_string(&definition, SL("first"), &__$true, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_106$$41, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 481);
+ if (ZEPHIR_IS_STRING(&_106$$41, "PRI")) {
+ zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_107$$41, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 488);
+ if (ZEPHIR_IS_STRING(&_107$$41, "YES")) {
+ zephir_array_update_string(&definition, SL("notNull"), &__$false, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_108$$41, &field, 7, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 495);
+ if (ZEPHIR_IS_STRING(&_108$$41, "auto_increment")) {
+ zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_109$$41, &field, 9, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 502);
+ if (Z_TYPE_P(&_109$$41) != IS_NULL) {
+ zephir_array_fetch_long(&_110$$76, &field, 9, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 507);
+ ZEPHIR_INIT_NVAR(&_111$$76);
+ ZVAL_STRING(&_111$$76, "/^'|'?::[[:alnum:][:space:]]+$/");
+ ZEPHIR_INIT_NVAR(&_112$$76);
+ ZVAL_STRING(&_112$$76, "");
+ ZEPHIR_CALL_FUNCTION(&_113$$76, "preg_replace", &_55, 50, &_111$$76, &_112$$76, &_110$$76);
+ zephir_check_call_status();
+ zephir_array_update_string(&definition, SL("default"), &_113$$76, PH_COPY | PH_SEPARATE);
+ zephir_array_fetch_string(&_114$$76, &definition, SL("default"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 509);
+ ZEPHIR_INIT_NVAR(&_111$$76);
+ ZVAL_STRING(&_111$$76, "null");
+ ZEPHIR_CALL_FUNCTION(&_115$$76, "strcasecmp", &_58, 47, &_114$$76, &_111$$76);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_LONG(&_115$$76, 0)) {
+ zephir_array_update_string(&definition, SL("default"), &__$null, PH_COPY | PH_SEPARATE);
+ }
+ }
+ zephir_array_fetch_long(&_116$$41, &field, 10, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 517);
+ if (Z_TYPE_P(&_116$$41) != IS_NULL) {
+ zephir_array_fetch_long(&_117$$78, &field, 10, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 518);
+ zephir_array_update_string(&definition, SL("comment"), &_117$$78, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_OBS_NVAR(&columnName);
+ zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 524);
+ ZEPHIR_INIT_NVAR(&_118$$41);
+ object_init_ex(&_118$$41, phalcon_db_column_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_118$$41, "__construct", &_62, 212, &columnName, &definition);
+ zephir_check_call_status();
+ zephir_array_append(&columns, &_118$$41, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 525);
+ ZEPHIR_CPY_WRT(&oldColumn, &columnName);
+ ZEPHIR_CALL_METHOD(NULL, &fields, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- ZVAL_LONG(&_0, 0);
- ZVAL_LONG(&_1, len);
- ZEPHIR_RETURN_CALL_FUNCTION("random_int", NULL, 0, &_0, &_1);
- zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_INIT_NVAR(&field);
+ RETURN_CCTOR(&columns);
}
-static PHP_METHOD(Phalcon_Security_Random, uuid)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeReferences)
{
- zval ary, _0, _1, _2, _3, _4, _5, _6, _7;
+ zval _14$$3, _23$$6, _29$$9, _33$$10;
+ zend_string *_27;
+ zend_ulong _26;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_31 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *table_param = NULL, *schema_param = NULL, references, reference, arrayReference, constraintName, referenceObjects, name, referencedSchema, referencedTable, columns, referencedColumns, referenceUpdate, referenceDelete, _0, _1, _2, _3, *_4, _5, *_24, _25, _6$$5, _7$$5, _8$$5, _9$$5, _10$$5, _11$$5, _12$$3, _13$$3, _15$$8, _16$$8, _17$$8, _18$$8, _19$$8, _20$$8, _21$$6, _22$$6, _28$$9, _30$$9, _32$$10, _34$$10;
+ zval table, schema;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&ary);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+ ZVAL_UNDEF(&references);
+ ZVAL_UNDEF(&reference);
+ ZVAL_UNDEF(&arrayReference);
+ ZVAL_UNDEF(&constraintName);
+ ZVAL_UNDEF(&referenceObjects);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&referencedSchema);
+ ZVAL_UNDEF(&referencedTable);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&referencedColumns);
+ ZVAL_UNDEF(&referenceUpdate);
+ ZVAL_UNDEF(&referenceDelete);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
-
-
- ZEPHIR_MM_GROW();
-
- ZVAL_LONG(&_1, 16);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "bytes", NULL, 0, &_1);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "N1a/n1b/n1c/n1d/n1e/N1f");
- ZEPHIR_CALL_FUNCTION(&_3, "unpack", NULL, 0, &_2, &_0);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&ary, "array_values", NULL, 12, &_3);
- zephir_check_call_status();
- zephir_array_fetch_long(&_4, &ary, 2, PH_NOISY | PH_READONLY, "phalcon/Security/Random.zep", 310);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_LONG(&_2, ((((int) (zephir_get_numberval(&_4)) & 0x0fff)) | 0x4000));
- zephir_array_update_long(&ary, 2, &_2, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
- zephir_array_fetch_long(&_5, &ary, 3, PH_NOISY | PH_READONLY, "phalcon/Security/Random.zep", 311);
- ZEPHIR_INIT_VAR(&_6);
- ZVAL_LONG(&_6, ((((int) (zephir_get_numberval(&_5)) & 0x3fff)) | 0x8000));
- zephir_array_update_long(&ary, 3, &_6, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
- ZEPHIR_INIT_VAR(&_7);
- ZVAL_STRING(&_7, "%08x-%04x-%04x-%04x-%04x%08x");
- ZEPHIR_MAKE_REF(&ary);
- ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 0, &ary, &_7);
- ZEPHIR_UNREF(&ary);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_7);
- ZVAL_STRING(&_7, "sprintf");
- ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &_7, &ary);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Security_Random, base)
-{
- unsigned char _7$$3, _10$$5;
- double _4$$3, _8$$5;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_6 = NULL;
- zend_long base, ZEPHIR_LAST_CALL_STATUS;
- zval *alphabet_param = NULL, *base_param = NULL, *n = NULL, n_sub, __$null, bytes, idx, _0, _1, *_2, _3, _5$$4, _9$$6;
- zval alphabet, byteString;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&alphabet);
- ZVAL_UNDEF(&byteString);
- ZVAL_UNDEF(&n_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&bytes);
- ZVAL_UNDEF(&idx);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_5$$4);
- ZVAL_UNDEF(&_9$$6);
+ ZVAL_UNDEF(&_25);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_11$$5);
+ ZVAL_UNDEF(&_12$$3);
+ ZVAL_UNDEF(&_13$$3);
+ ZVAL_UNDEF(&_15$$8);
+ ZVAL_UNDEF(&_16$$8);
+ ZVAL_UNDEF(&_17$$8);
+ ZVAL_UNDEF(&_18$$8);
+ ZVAL_UNDEF(&_19$$8);
+ ZVAL_UNDEF(&_20$$8);
+ ZVAL_UNDEF(&_21$$6);
+ ZVAL_UNDEF(&_22$$6);
+ ZVAL_UNDEF(&_28$$9);
+ ZVAL_UNDEF(&_30$$9);
+ ZVAL_UNDEF(&_32$$10);
+ ZVAL_UNDEF(&_34$$10);
+ ZVAL_UNDEF(&_14$$3);
+ ZVAL_UNDEF(&_23$$6);
+ ZVAL_UNDEF(&_29$$9);
+ ZVAL_UNDEF(&_33$$10);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(alphabet)
- Z_PARAM_LONG(base)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(n)
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 1, &alphabet_param, &base_param, &n);
- zephir_get_strval(&alphabet, alphabet_param);
- base = zephir_get_intval(base_param);
- if (!n) {
- n = &n_sub;
- n = &__$null;
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
+ }
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(schema_param) != IS_STRING && Z_TYPE_P(schema_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schema' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schema_param) == IS_STRING)) {
+ zephir_get_strval(&schema, schema_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schema);
+ }
}
- ZEPHIR_INIT_VAR(&byteString);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "bytes", NULL, 0, n);
+ ZEPHIR_INIT_VAR(&references);
+ array_init(&references);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_2, &_1, "describereferences", NULL, 0, &table, &schema);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "C*");
- ZEPHIR_CALL_FUNCTION(&bytes, "unpack", NULL, 0, &_1, &_0);
+ ZVAL_LONG(&_3, 3);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3);
zephir_check_call_status();
- zephir_is_iterable(&bytes, 0, "phalcon/Security/Random.zep", 350);
- if (Z_TYPE_P(&bytes) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&bytes), _2)
+ zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 581);
+ if (Z_TYPE_P(&_0) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4)
{
- ZEPHIR_INIT_NVAR(&idx);
- ZVAL_COPY(&idx, _2);
- _4$$3 = zephir_safe_mod_zval_long(&idx, 64);
- ZEPHIR_INIT_NVAR(&idx);
- ZVAL_DOUBLE(&idx, _4$$3);
- if (ZEPHIR_GE_LONG(&idx, base)) {
- ZVAL_LONG(&_5$$4, (base - 1));
- ZEPHIR_CALL_METHOD(&idx, this_ptr, "number", &_6, 0, &_5$$4);
- zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&reference);
+ ZVAL_COPY(&reference, _4);
+ zephir_array_fetch_long(&constraintName, &reference, 2, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 550);
+ if (!(zephir_array_isset(&references, &constraintName))) {
+ ZEPHIR_OBS_NVAR(&referencedSchema);
+ zephir_array_fetch_long(&referencedSchema, &reference, 3, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 553);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_long(&referencedTable, &reference, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 554);
+ ZEPHIR_OBS_NVAR(&referenceUpdate);
+ zephir_array_fetch_long(&referenceUpdate, &reference, 6, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 555);
+ ZEPHIR_OBS_NVAR(&referenceDelete);
+ zephir_array_fetch_long(&referenceDelete, &reference, 7, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 556);
+ ZEPHIR_INIT_NVAR(&columns);
+ array_init(&columns);
+ ZEPHIR_INIT_NVAR(&referencedColumns);
+ array_init(&referencedColumns);
+ } else {
+ zephir_array_fetch(&_6$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 560);
+ ZEPHIR_OBS_NVAR(&referencedSchema);
+ zephir_array_fetch_string(&referencedSchema, &_6$$5, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 560);
+ zephir_array_fetch(&_7$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 561);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_string(&referencedTable, &_7$$5, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 561);
+ zephir_array_fetch(&_8$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 562);
+ ZEPHIR_OBS_NVAR(&columns);
+ zephir_array_fetch_string(&columns, &_8$$5, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 562);
+ zephir_array_fetch(&_9$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 563);
+ ZEPHIR_OBS_NVAR(&referencedColumns);
+ zephir_array_fetch_string(&referencedColumns, &_9$$5, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 563);
+ zephir_array_fetch(&_10$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 564);
+ ZEPHIR_OBS_NVAR(&referenceUpdate);
+ zephir_array_fetch_string(&referenceUpdate, &_10$$5, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 564);
+ zephir_array_fetch(&_11$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 565);
+ ZEPHIR_OBS_NVAR(&referenceDelete);
+ zephir_array_fetch_string(&referenceDelete, &_11$$5, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 565);
}
- _7$$3 = ZEPHIR_STRING_OFFSET(&alphabet, zephir_get_intval(&idx));
- zephir_concat_self_char(&byteString, _7$$3);
+ zephir_array_fetch_long(&_12$$3, &reference, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 568);
+ zephir_array_append(&columns, &_12$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 568);
+ zephir_array_fetch_long(&_13$$3, &reference, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 569);
+ zephir_array_append(&referencedColumns, &_13$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 569);
+ ZEPHIR_INIT_NVAR(&_14$$3);
+ zephir_create_array(&_14$$3, 6, 0);
+ zephir_array_update_string(&_14$$3, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_14$$3, SL("referencedTable"), &referencedTable, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_14$$3, SL("columns"), &columns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_14$$3, SL("referencedColumns"), &referencedColumns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_14$$3, SL("onUpdate"), &referenceUpdate, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_14$$3, SL("onDelete"), &referenceDelete, PH_COPY | PH_SEPARATE);
+ zephir_array_update_zval(&references, &constraintName, &_14$$3, PH_COPY | PH_SEPARATE);
} ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_CALL_METHOD(NULL, &bytes, "rewind", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0);
zephir_check_call_status();
while (1) {
- ZEPHIR_CALL_METHOD(&_3, &bytes, "valid", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_5, &_0, "valid", NULL, 0);
zephir_check_call_status();
- if (!zend_is_true(&_3)) {
+ if (!zend_is_true(&_5)) {
break;
}
- ZEPHIR_CALL_METHOD(&idx, &bytes, "current", NULL, 0);
+ ZEPHIR_CALL_METHOD(&reference, &_0, "current", NULL, 0);
zephir_check_call_status();
- _8$$5 = zephir_safe_mod_zval_long(&idx, 64);
- ZEPHIR_INIT_NVAR(&idx);
- ZVAL_DOUBLE(&idx, _8$$5);
- if (ZEPHIR_GE_LONG(&idx, base)) {
- ZVAL_LONG(&_9$$6, (base - 1));
- ZEPHIR_CALL_METHOD(&idx, this_ptr, "number", &_6, 0, &_9$$6);
- zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&constraintName);
+ zephir_array_fetch_long(&constraintName, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 550);
+ if (!(zephir_array_isset(&references, &constraintName))) {
+ ZEPHIR_OBS_NVAR(&referencedSchema);
+ zephir_array_fetch_long(&referencedSchema, &reference, 3, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 553);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_long(&referencedTable, &reference, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 554);
+ ZEPHIR_OBS_NVAR(&referenceUpdate);
+ zephir_array_fetch_long(&referenceUpdate, &reference, 6, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 555);
+ ZEPHIR_OBS_NVAR(&referenceDelete);
+ zephir_array_fetch_long(&referenceDelete, &reference, 7, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 556);
+ ZEPHIR_INIT_NVAR(&columns);
+ array_init(&columns);
+ ZEPHIR_INIT_NVAR(&referencedColumns);
+ array_init(&referencedColumns);
+ } else {
+ zephir_array_fetch(&_15$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 560);
+ ZEPHIR_OBS_NVAR(&referencedSchema);
+ zephir_array_fetch_string(&referencedSchema, &_15$$8, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 560);
+ zephir_array_fetch(&_16$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 561);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_string(&referencedTable, &_16$$8, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 561);
+ zephir_array_fetch(&_17$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 562);
+ ZEPHIR_OBS_NVAR(&columns);
+ zephir_array_fetch_string(&columns, &_17$$8, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 562);
+ zephir_array_fetch(&_18$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 563);
+ ZEPHIR_OBS_NVAR(&referencedColumns);
+ zephir_array_fetch_string(&referencedColumns, &_18$$8, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 563);
+ zephir_array_fetch(&_19$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 564);
+ ZEPHIR_OBS_NVAR(&referenceUpdate);
+ zephir_array_fetch_string(&referenceUpdate, &_19$$8, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 564);
+ zephir_array_fetch(&_20$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 565);
+ ZEPHIR_OBS_NVAR(&referenceDelete);
+ zephir_array_fetch_string(&referenceDelete, &_20$$8, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 565);
}
- _10$$5 = ZEPHIR_STRING_OFFSET(&alphabet, zephir_get_intval(&idx));
- zephir_concat_self_char(&byteString, _10$$5);
- ZEPHIR_CALL_METHOD(NULL, &bytes, "next", NULL, 0);
+ zephir_array_fetch_long(&_21$$6, &reference, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 568);
+ zephir_array_append(&columns, &_21$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 568);
+ zephir_array_fetch_long(&_22$$6, &reference, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 569);
+ zephir_array_append(&referencedColumns, &_22$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 569);
+ ZEPHIR_INIT_NVAR(&_23$$6);
+ zephir_create_array(&_23$$6, 6, 0);
+ zephir_array_update_string(&_23$$6, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_23$$6, SL("referencedTable"), &referencedTable, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_23$$6, SL("columns"), &columns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_23$$6, SL("referencedColumns"), &referencedColumns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_23$$6, SL("onUpdate"), &referenceUpdate, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_23$$6, SL("onDelete"), &referenceDelete, PH_COPY | PH_SEPARATE);
+ zephir_array_update_zval(&references, &constraintName, &_23$$6, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&reference);
+ ZEPHIR_INIT_VAR(&referenceObjects);
+ array_init(&referenceObjects);
+ zephir_is_iterable(&references, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 597);
+ if (Z_TYPE_P(&references) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&references), _26, _27, _24)
+ {
+ ZEPHIR_INIT_NVAR(&name);
+ if (_27 != NULL) {
+ ZVAL_STR_COPY(&name, _27);
+ } else {
+ ZVAL_LONG(&name, _26);
+ }
+ ZEPHIR_INIT_NVAR(&arrayReference);
+ ZVAL_COPY(&arrayReference, _24);
+ ZEPHIR_INIT_NVAR(&_28$$9);
+ object_init_ex(&_28$$9, phalcon_db_reference_ce);
+ ZEPHIR_INIT_NVAR(&_29$$9);
+ zephir_create_array(&_29$$9, 6, 0);
+ ZEPHIR_OBS_NVAR(&_30$$9);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 587);
+ zephir_array_update_string(&_29$$9, SL("referencedSchema"), &_30$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_30$$9);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 588);
+ zephir_array_update_string(&_29$$9, SL("referencedTable"), &_30$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_30$$9);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 589);
+ zephir_array_update_string(&_29$$9, SL("columns"), &_30$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_30$$9);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 590);
+ zephir_array_update_string(&_29$$9, SL("referencedColumns"), &_30$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_30$$9);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 591);
+ zephir_array_update_string(&_29$$9, SL("onUpdate"), &_30$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_30$$9);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 593);
+ zephir_array_update_string(&_29$$9, SL("onDelete"), &_30$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &_28$$9, "__construct", &_31, 33, &name, &_29$$9);
+ zephir_check_call_status();
+ zephir_array_update_zval(&referenceObjects, &name, &_28$$9, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &references, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_25, &references, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_25)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&name, &references, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&arrayReference, &references, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_32$$10);
+ object_init_ex(&_32$$10, phalcon_db_reference_ce);
+ ZEPHIR_INIT_NVAR(&_33$$10);
+ zephir_create_array(&_33$$10, 6, 0);
+ ZEPHIR_OBS_NVAR(&_34$$10);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 587);
+ zephir_array_update_string(&_33$$10, SL("referencedSchema"), &_34$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_34$$10);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 588);
+ zephir_array_update_string(&_33$$10, SL("referencedTable"), &_34$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_34$$10);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 589);
+ zephir_array_update_string(&_33$$10, SL("columns"), &_34$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_34$$10);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 590);
+ zephir_array_update_string(&_33$$10, SL("referencedColumns"), &_34$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_34$$10);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 591);
+ zephir_array_update_string(&_33$$10, SL("onUpdate"), &_34$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_34$$10);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 593);
+ zephir_array_update_string(&_33$$10, SL("onDelete"), &_34$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &_32$$10, "__construct", &_31, 33, &name, &_33$$10);
+ zephir_check_call_status();
+ zephir_array_update_zval(&referenceObjects, &name, &_32$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0);
zephir_check_call_status();
}
}
- ZEPHIR_INIT_NVAR(&idx);
- RETURN_CTOR(&byteString);
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Builder)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Security\\JWT, Builder, phalcon, security_jwt_builder, phalcon_security_jwt_builder_method_entry, 0);
-
- zend_declare_property_null(phalcon_security_jwt_builder_ce, SL("claims"), ZEND_ACC_PRIVATE);
- zend_declare_property_null(phalcon_security_jwt_builder_ce, SL("jose"), ZEND_ACC_PRIVATE);
- zend_declare_property_null(phalcon_security_jwt_builder_ce, SL("passphrase"), ZEND_ACC_PRIVATE);
- zend_declare_property_null(phalcon_security_jwt_builder_ce, SL("signer"), ZEND_ACC_PRIVATE);
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Builder, __construct)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *signer, signer_sub, _0, _1, _2, _3;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&signer_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(signer, phalcon_security_jwt_signer_signerinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &signer);
-
-
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("signer"), signer);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("jose"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("signer"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_2, &_1, "getalgheader", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "alg");
- ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &_3, &_2);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_INIT_NVAR(&arrayReference);
+ ZEPHIR_INIT_NVAR(&name);
+ RETURN_CCTOR(&referenceObjects);
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, init)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, getDefaultIdValue)
{
- zval _2;
- zval _0, _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);
- ZVAL_UNDEF(&_2);
ZEPHIR_MM_GROW();
+ object_init_ex(return_value, phalcon_db_rawvalue_ce);
ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "");
- zephir_update_property_zval(this_ptr, ZEND_STRL("passphrase"), &_0);
- ZEPHIR_INIT_NVAR(&_0);
- object_init_ex(&_0, phalcon_collection_ce);
- ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 22);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("claims"), &_0);
- ZEPHIR_INIT_VAR(&_1);
- object_init_ex(&_1, phalcon_collection_ce);
- ZEPHIR_INIT_VAR(&_2);
- zephir_create_array(&_2, 2, 0);
- add_assoc_stringl_ex(&_2, SL("typ"), SL("JWT"));
- add_assoc_stringl_ex(&_2, SL("alg"), SL("none"));
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 22, &_2);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("jose"), &_1);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Builder, getAudience)
-{
- 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_MM_GROW();
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("claims"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "aud");
- ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, &_1);
+ ZVAL_STRING(&_0, "DEFAULT");
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34, &_0);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, getClaims)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, modifyColumn)
{
- zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_4 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, *currentColumn = NULL, currentColumn_sub, __$null, sql, queries, query, exception, _0, *_1$$4, _2$$4, _3$$5, _5$$7, _6$$3, _7$$10, _8$$10, _9$$10;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(¤tColumn_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&queries);
+ ZVAL_UNDEF(&query);
+ ZVAL_UNDEF(&exception);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&_5$$7);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_7$$10);
+ ZVAL_UNDEF(&_8$$10);
+ ZVAL_UNDEF(&_9$$10);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 4)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_OBJECT_OF_CLASS_OR_NULL(currentColumn, phalcon_db_columninterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 1, &tableName_param, &schemaName_param, &column, ¤tColumn);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ if (!currentColumn) {
+ currentColumn = ¤tColumn_sub;
+ currentColumn = &__$null;
+ }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("claims"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_METHOD(&_0, "toarray", NULL, 0);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Builder, getContentType)
-{
- 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_MM_GROW();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("jose"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "cty");
- ZVAL_NULL(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "string");
- ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, &_1, &_2, &_3);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&sql, &_0, "modifycolumn", NULL, 0, &tableName, &schemaName, column, currentColumn);
zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Builder, getExpirationTime)
-{
- zval _0, _1, _2, _3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
+ ZEPHIR_INIT_VAR(&queries);
+ zephir_fast_explode_str(&queries, SL(";"), &sql, LONG_MAX);
+ if (zephir_fast_count_int(&queries) > 1) {
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
+ /* try_start_1: */
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "begin", NULL, 0);
+ zephir_check_call_status_or_jump(try_end_1);
+ zephir_is_iterable(&queries, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 653);
+ if (Z_TYPE_P(&queries) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&queries), _1$$4)
+ {
+ ZEPHIR_INIT_NVAR(&query);
+ ZVAL_COPY(&query, _1$$4);
+ if (ZEPHIR_IS_EMPTY(&query)) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&_3$$5);
+ ZEPHIR_CONCAT_VS(&_3$$5, &query, ";");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "query", &_4, 0, &_3$$5);
+ zephir_check_call_status_or_jump(try_end_1);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &queries, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2$$4, &queries, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2$$4)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&query, &queries, "current", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EMPTY(&query)) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&_5$$7);
+ ZEPHIR_CONCAT_VS(&_5$$7, &query, ";");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "query", &_4, 0, &_5$$7);
+ zephir_check_call_status_or_jump(try_end_1);
+ ZEPHIR_CALL_METHOD(NULL, &queries, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&query);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "commit", NULL, 0);
+ zephir_check_call_status_or_jump(try_end_1);
+ RETURN_MM();
- ZEPHIR_MM_GROW();
+ try_end_1:
- zephir_read_property(&_0, this_ptr, ZEND_STRL("claims"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "exp");
- ZVAL_NULL(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "int");
- ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, &_1, &_2, &_3);
- zephir_check_call_status();
- RETURN_MM();
+ if (EG(exception)) {
+ ZEPHIR_INIT_VAR(&_6$$3);
+ ZVAL_OBJ(&_6$$3, EG(exception));
+ Z_ADDREF_P(&_6$$3);
+ if (zephir_is_instance_of(&_6$$3, SL("Throwable"))) {
+ zend_clear_exception();
+ ZEPHIR_CPY_WRT(&exception, &_6$$3);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "rollback", NULL, 0);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&exception, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 657);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ }
+ } else {
+ ZEPHIR_INIT_VAR(&_7$$10);
+ if (!(ZEPHIR_IS_EMPTY(&sql))) {
+ zephir_array_fetch_long(&_8$$10, &queries, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 660);
+ ZEPHIR_INIT_VAR(&_9$$10);
+ ZEPHIR_CONCAT_VS(&_9$$10, &_8$$10, ";");
+ ZEPHIR_CALL_METHOD(&_7$$10, this_ptr, "execute", NULL, 0, &_9$$10);
+ zephir_check_call_status();
+ } else {
+ ZVAL_BOOL(&_7$$10, 1);
+ }
+ RETURN_CCTOR(&_7$$10);
+ }
+ RETURN_MM_BOOL(1);
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, getHeaders)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, supportSequences)
{
- zval _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
-
- ZEPHIR_MM_GROW();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("jose"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_METHOD(&_0, "toarray", NULL, 0);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_BOOL(1);
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, getId)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, useExplicitIdValue)
{
- 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_MM_GROW();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("claims"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "jti");
- ZVAL_NULL(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "string");
- ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, &_1, &_2, &_3);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_BOOL(1);
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, getIssuedAt)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, getDsnDefaults)
{
- 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_MM_GROW();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("claims"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "iat");
- ZVAL_NULL(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "int");
- ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, &_1, &_2, &_3);
- zephir_check_call_status();
- RETURN_MM();
+ array_init(return_value);
+ return;
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, getIssuer)
-{
- 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_MM_GROW();
+#ifdef HAVE_CONFIG_H
+#endif
- zephir_read_property(&_0, this_ptr, ZEND_STRL("claims"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "iss");
- ZVAL_NULL(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "string");
- ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, &_1, &_2, &_3);
- zephir_check_call_status();
- RETURN_MM();
-}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, getNotBefore)
-{
- 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_MM_GROW();
+ZEPHIR_INIT_CLASS(Phalcon_Db_Adapter_Pdo_Sqlite)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Db\\Adapter\\Pdo, Sqlite, phalcon, db_adapter_pdo_sqlite, phalcon_db_adapter_pdo_abstractpdo_ce, phalcon_db_adapter_pdo_sqlite_method_entry, 0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("claims"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "nbf");
- ZVAL_NULL(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "int");
- ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, &_1, &_2, &_3);
- zephir_check_call_status();
- RETURN_MM();
+ zend_declare_property_string(phalcon_db_adapter_pdo_sqlite_ce, SL("dialectType"), "sqlite", ZEND_ACC_PROTECTED);
+ zend_declare_property_string(phalcon_db_adapter_pdo_sqlite_ce, SL("type"), "sqlite", ZEND_ACC_PROTECTED);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, getSubject)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, __construct)
{
- zval _0, _1, _2, _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_1 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *descriptor_param = NULL, _0$$3;
+ zval descriptor;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&descriptor);
+ ZVAL_UNDEF(&_0$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(descriptor)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &descriptor_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&descriptor, descriptor_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("claims"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "sub");
- ZVAL_NULL(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "string");
- ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, &_1, &_2, &_3);
+
+ if (zephir_array_isset_string(&descriptor, SL("charset"))) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZVAL_STRING(&_0$$3, "SQLite does not allow the charset to be changed in the DSN.");
+ ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 7, &_0$$3);
+ zephir_check_call_status();
+ }
+ ZEPHIR_CALL_PARENT(NULL, phalcon_db_adapter_pdo_sqlite_ce, getThis(), "__construct", &_1, 0, &descriptor);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, getToken)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, connect)
{
- zval claims, encodedClaims, encodedHeaders, encodedSignature, headers, signature, signatureHash, _0, _2, _4, _5, _6, _7, _8, _9, _10, _11;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_1 = NULL, *_3 = NULL;
+ zephir_fcall_cache_entry *_1 = NULL;
+ zval *descriptor_param = NULL, dbname, _0$$3;
+ zval descriptor;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&claims);
- ZVAL_UNDEF(&encodedClaims);
- ZVAL_UNDEF(&encodedHeaders);
- ZVAL_UNDEF(&encodedSignature);
- ZVAL_UNDEF(&headers);
- ZVAL_UNDEF(&signature);
- ZVAL_UNDEF(&signatureHash);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- 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(&descriptor);
+ ZVAL_UNDEF(&dbname);
+ ZVAL_UNDEF(&_0$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(descriptor)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &descriptor_param);
+ if (!descriptor_param) {
+ ZEPHIR_INIT_VAR(&descriptor);
+ array_init(&descriptor);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&descriptor, descriptor_param);
+ }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("passphrase"), PH_NOISY_CC | PH_READONLY);
- if (ZEPHIR_IS_EMPTY(&_0)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid passphrase (empty)", "phalcon/Security/JWT/Builder.zep", 183);
+
+ if (ZEPHIR_IS_EMPTY(&descriptor)) {
+ zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("descriptor"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&descriptor, &_0$$3);
+ }
+ ZEPHIR_OBS_VAR(&dbname);
+ if (zephir_array_isset_string_fetch(&dbname, &descriptor, SL("dbname"), 0)) {
+ zephir_array_update_string(&descriptor, SL("dsn"), &dbname, PH_COPY | PH_SEPARATE);
+ zephir_array_unset_string(&descriptor, SL("dbname"), PH_SEPARATE);
+ } else if (UNEXPECTED(!(zephir_array_isset_string(&descriptor, SL("dsn"))))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The database must be specified with either 'dbname' or 'dsn'.", "phalcon/Db/Adapter/Pdo/Sqlite.zep", 82);
return;
}
- ZEPHIR_CALL_METHOD(&_4, this_ptr, "getclaims", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_CE_STATIC(&_2, phalcon_helper_json_ce, "encode", &_3, 14, &_4);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_db_adapter_pdo_sqlite_ce, getThis(), "connect", &_1, 0, &descriptor);
zephir_check_call_status();
- ZEPHIR_CALL_CE_STATIC(&encodedClaims, phalcon_helper_base64_ce, "encodeurl", &_1, 0, &_2);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&claims);
- object_init_ex(&claims, phalcon_security_jwt_token_item_ce);
- ZEPHIR_CALL_METHOD(&_5, this_ptr, "getclaims", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &claims, "__construct", NULL, 0, &_5, &encodedClaims);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_7, this_ptr, "getheaders", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_CE_STATIC(&_6, phalcon_helper_json_ce, "encode", &_3, 14, &_7);
- zephir_check_call_status();
- ZEPHIR_CALL_CE_STATIC(&encodedHeaders, phalcon_helper_base64_ce, "encodeurl", &_1, 0, &_6);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&headers);
- object_init_ex(&headers, phalcon_security_jwt_token_item_ce);
- ZEPHIR_CALL_METHOD(&_8, this_ptr, "getheaders", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &headers, "__construct", NULL, 0, &_8, &encodedHeaders);
- zephir_check_call_status();
- zephir_read_property(&_9, this_ptr, ZEND_STRL("signer"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_10);
- ZEPHIR_CONCAT_VSV(&_10, &encodedHeaders, ".", &encodedClaims);
- zephir_read_property(&_11, this_ptr, ZEND_STRL("passphrase"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&signatureHash, &_9, "sign", NULL, 0, &_10, &_11);
- zephir_check_call_status();
- ZEPHIR_CALL_CE_STATIC(&encodedSignature, phalcon_helper_base64_ce, "encodeurl", &_1, 0, &signatureHash);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&signature);
- object_init_ex(&signature, phalcon_security_jwt_token_signature_ce);
- ZEPHIR_CALL_METHOD(NULL, &signature, "__construct", NULL, 0, &signatureHash, &encodedSignature);
- zephir_check_call_status();
- object_init_ex(return_value, phalcon_security_jwt_token_token_ce);
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &headers, &claims, &signature);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Builder, getPassphrase)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "passphrase");
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, setAudience)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns)
{
- zend_bool _0;
+ zend_bool _5$$3, _34$$3, _43$$28, _71$$28;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_33 = NULL, *_40 = NULL, *_41 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *audience, audience_sub, aud, _1;
+ zval *table_param = NULL, *schema_param = NULL, __$true, __$false, columns, columnType, fields, field, definition, oldColumn, sizePattern, matches, matchOne, matchTwo, columnName, _0, _1, _2, *_3, _4, _28$$3, _29$$3, _30$$3, _31$$3, _32$$3, _35$$3, _6$$4, _7$$4, _8$$5, _9$$5, _10$$5, _11$$7, _12$$7, _13$$8, _14$$9, _15$$10, _16$$11, _17$$11, _18$$12, _19$$12, _20$$13, _21$$14, _22$$15, _23$$16, _24$$17, _25$$18, _26$$20, _27$$21, _36$$27, _37$$27, _38$$27, _39$$27, _42$$28, _66$$28, _67$$28, _68$$28, _69$$28, _70$$28, _72$$28, _44$$29, _45$$29, _46$$30, _47$$30, _48$$30, _49$$32, _50$$32, _51$$33, _52$$34, _53$$35, _54$$36, _55$$36, _56$$37, _57$$37, _58$$38, _59$$39, _60$$40, _61$$41, _62$$42, _63$$43, _64$$45, _65$$46, _73$$52, _74$$52, _75$$52, _76$$52;
+ zval table, schema;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&audience_sub);
- ZVAL_UNDEF(&aud);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&columnType);
+ ZVAL_UNDEF(&fields);
+ ZVAL_UNDEF(&field);
+ ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&oldColumn);
+ ZVAL_UNDEF(&sizePattern);
+ ZVAL_UNDEF(&matches);
+ ZVAL_UNDEF(&matchOne);
+ ZVAL_UNDEF(&matchTwo);
+ ZVAL_UNDEF(&columnName);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_28$$3);
+ ZVAL_UNDEF(&_29$$3);
+ ZVAL_UNDEF(&_30$$3);
+ ZVAL_UNDEF(&_31$$3);
+ ZVAL_UNDEF(&_32$$3);
+ ZVAL_UNDEF(&_35$$3);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_11$$7);
+ ZVAL_UNDEF(&_12$$7);
+ ZVAL_UNDEF(&_13$$8);
+ ZVAL_UNDEF(&_14$$9);
+ ZVAL_UNDEF(&_15$$10);
+ ZVAL_UNDEF(&_16$$11);
+ ZVAL_UNDEF(&_17$$11);
+ ZVAL_UNDEF(&_18$$12);
+ ZVAL_UNDEF(&_19$$12);
+ ZVAL_UNDEF(&_20$$13);
+ ZVAL_UNDEF(&_21$$14);
+ ZVAL_UNDEF(&_22$$15);
+ ZVAL_UNDEF(&_23$$16);
+ ZVAL_UNDEF(&_24$$17);
+ ZVAL_UNDEF(&_25$$18);
+ ZVAL_UNDEF(&_26$$20);
+ ZVAL_UNDEF(&_27$$21);
+ ZVAL_UNDEF(&_36$$27);
+ ZVAL_UNDEF(&_37$$27);
+ ZVAL_UNDEF(&_38$$27);
+ ZVAL_UNDEF(&_39$$27);
+ ZVAL_UNDEF(&_42$$28);
+ ZVAL_UNDEF(&_66$$28);
+ ZVAL_UNDEF(&_67$$28);
+ ZVAL_UNDEF(&_68$$28);
+ ZVAL_UNDEF(&_69$$28);
+ ZVAL_UNDEF(&_70$$28);
+ ZVAL_UNDEF(&_72$$28);
+ ZVAL_UNDEF(&_44$$29);
+ ZVAL_UNDEF(&_45$$29);
+ ZVAL_UNDEF(&_46$$30);
+ ZVAL_UNDEF(&_47$$30);
+ ZVAL_UNDEF(&_48$$30);
+ ZVAL_UNDEF(&_49$$32);
+ ZVAL_UNDEF(&_50$$32);
+ ZVAL_UNDEF(&_51$$33);
+ ZVAL_UNDEF(&_52$$34);
+ ZVAL_UNDEF(&_53$$35);
+ ZVAL_UNDEF(&_54$$36);
+ ZVAL_UNDEF(&_55$$36);
+ ZVAL_UNDEF(&_56$$37);
+ ZVAL_UNDEF(&_57$$37);
+ ZVAL_UNDEF(&_58$$38);
+ ZVAL_UNDEF(&_59$$39);
+ ZVAL_UNDEF(&_60$$40);
+ ZVAL_UNDEF(&_61$$41);
+ ZVAL_UNDEF(&_62$$42);
+ ZVAL_UNDEF(&_63$$43);
+ ZVAL_UNDEF(&_64$$45);
+ ZVAL_UNDEF(&_65$$46);
+ ZVAL_UNDEF(&_73$$52);
+ ZVAL_UNDEF(&_74$$52);
+ ZVAL_UNDEF(&_75$$52);
+ ZVAL_UNDEF(&_76$$52);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(audience)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &audience);
-
-
- _0 = Z_TYPE_P(audience) != IS_STRING;
- if (_0) {
- _0 = Z_TYPE_P(audience) != IS_ARRAY;
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
}
- if (_0) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid Audience", "phalcon/Security/JWT/Builder.zep", 233);
- return;
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
}
- if (Z_TYPE_P(audience) == IS_STRING) {
- ZEPHIR_INIT_VAR(&aud);
- zephir_create_array(&aud, 1, 0);
- zephir_array_fast_append(&aud, audience);
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
} else {
- ZEPHIR_CPY_WRT(&aud, audience);
+ if (UNEXPECTED(Z_TYPE_P(schema_param) != IS_STRING && Z_TYPE_P(schema_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schema' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schema_param) == IS_STRING)) {
+ zephir_get_strval(&schema, schema_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schema);
+ }
+ }
+
+
+ ZEPHIR_INIT_VAR(&oldColumn);
+ ZVAL_NULL(&oldColumn);
+ ZEPHIR_INIT_VAR(&sizePattern);
+ ZVAL_STRING(&sizePattern, "#\\(([0-9]+)(?:,\\s*([0-9]+))*\\)#");
+ ZEPHIR_INIT_VAR(&columns);
+ array_init(&columns);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &_0, "describecolumns", NULL, 0, &table, &schema);
+ zephir_check_call_status();
+ ZVAL_LONG(&_2, 3);
+ ZEPHIR_CALL_METHOD(&fields, this_ptr, "fetchall", NULL, 0, &_1, &_2);
+ zephir_check_call_status();
+ zephir_is_iterable(&fields, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 312);
+ if (Z_TYPE_P(&fields) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&fields), _3)
+ {
+ ZEPHIR_INIT_NVAR(&field);
+ ZVAL_COPY(&field, _3);
+ ZEPHIR_INIT_NVAR(&definition);
+ zephir_create_array(&definition, 1, 0);
+ add_assoc_long_ex(&definition, SL("bindType"), 2);
+ ZEPHIR_OBS_NVAR(&columnType);
+ zephir_array_fetch_long(&columnType, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 128);
+ _5$$3 = zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 150);
+ if (!(_5$$3)) {
+ _5$$3 = zephir_memnstr_str(&columnType, SL("INT"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 150);
+ }
+ if (zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 143)) {
+ ZEPHIR_INIT_NVAR(&_6$$4);
+ ZVAL_LONG(&_6$$4, 14);
+ zephir_array_update_string(&definition, SL("type"), &_6$$4, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_7$$4);
+ ZVAL_LONG(&_7$$4, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_7$$4, PH_COPY | PH_SEPARATE);
+ } else if (_5$$3) {
+ ZEPHIR_INIT_NVAR(&_8$$5);
+ ZVAL_LONG(&_8$$5, 0);
+ zephir_array_update_string(&definition, SL("type"), &_8$$5, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_9$$5);
+ ZVAL_LONG(&_9$$5, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_9$$5, PH_COPY | PH_SEPARATE);
+ zephir_array_fetch_long(&_10$$5, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 158);
+ if (zephir_is_true(&_10$$5)) {
+ zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ } else if (zephir_memnstr_str(&columnType, SL("tinyint(1)"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 161)) {
+ ZEPHIR_INIT_NVAR(&_11$$7);
+ ZVAL_LONG(&_11$$7, 8);
+ zephir_array_update_string(&definition, SL("type"), &_11$$7, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_12$$7);
+ ZVAL_LONG(&_12$$7, 5);
+ zephir_array_update_string(&definition, SL("bindType"), &_12$$7, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&columnType);
+ ZVAL_STRING(&columnType, "boolean");
+ } else if (zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 172)) {
+ ZEPHIR_INIT_NVAR(&_13$$8);
+ ZVAL_LONG(&_13$$8, 5);
+ zephir_array_update_string(&definition, SL("type"), &_13$$8, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 181)) {
+ ZEPHIR_INIT_NVAR(&_14$$9);
+ ZVAL_LONG(&_14$$9, 4);
+ zephir_array_update_string(&definition, SL("type"), &_14$$9, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 186)) {
+ ZEPHIR_INIT_NVAR(&_15$$10);
+ ZVAL_LONG(&_15$$10, 1);
+ zephir_array_update_string(&definition, SL("type"), &_15$$10, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 195)) {
+ ZEPHIR_INIT_NVAR(&_16$$11);
+ ZVAL_LONG(&_16$$11, 3);
+ zephir_array_update_string(&definition, SL("type"), &_16$$11, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_17$$11);
+ ZVAL_LONG(&_17$$11, 32);
+ zephir_array_update_string(&definition, SL("bindType"), &_17$$11, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 202)) {
+ ZEPHIR_INIT_NVAR(&_18$$12);
+ ZVAL_LONG(&_18$$12, 7);
+ zephir_array_update_string(&definition, SL("type"), &_18$$12, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_19$$12);
+ ZVAL_LONG(&_19$$12, 3);
+ zephir_array_update_string(&definition, SL("bindType"), &_19$$12, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 213)) {
+ ZEPHIR_INIT_NVAR(&_20$$13);
+ ZVAL_LONG(&_20$$13, 17);
+ zephir_array_update_string(&definition, SL("type"), &_20$$13, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 222)) {
+ ZEPHIR_INIT_NVAR(&_21$$14);
+ ZVAL_LONG(&_21$$14, 2);
+ zephir_array_update_string(&definition, SL("type"), &_21$$14, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 227)) {
+ ZEPHIR_INIT_NVAR(&_22$$15);
+ ZVAL_LONG(&_22$$15, 5);
+ zephir_array_update_string(&definition, SL("type"), &_22$$15, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 232)) {
+ ZEPHIR_INIT_NVAR(&_23$$16);
+ ZVAL_LONG(&_23$$16, 6);
+ zephir_array_update_string(&definition, SL("type"), &_23$$16, PH_COPY | PH_SEPARATE);
+ } else {
+ ZEPHIR_INIT_NVAR(&_24$$17);
+ ZVAL_LONG(&_24$$17, 2);
+ zephir_array_update_string(&definition, SL("type"), &_24$$17, PH_COPY | PH_SEPARATE);
+ }
+ if (zephir_memnstr_str(&columnType, SL("("), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 249)) {
+ ZEPHIR_INIT_NVAR(&matches);
+ ZVAL_NULL(&matches);
+ ZEPHIR_INIT_NVAR(&_25$$18);
+ zephir_preg_match(&_25$$18, &sizePattern, &columnType, &matches, 0, 0 , 0 );
+ if (zephir_is_true(&_25$$18)) {
+ ZEPHIR_OBS_NVAR(&matchOne);
+ if (zephir_array_isset_long_fetch(&matchOne, &matches, 1, 0)) {
+ ZEPHIR_INIT_NVAR(&_26$$20);
+ ZVAL_LONG(&_26$$20, zephir_get_intval(&matchOne));
+ zephir_array_update_string(&definition, SL("size"), &_26$$20, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_OBS_NVAR(&matchTwo);
+ if (zephir_array_isset_long_fetch(&matchTwo, &matches, 2, 0)) {
+ ZEPHIR_INIT_NVAR(&_27$$21);
+ ZVAL_LONG(&_27$$21, zephir_get_intval(&matchTwo));
+ zephir_array_update_string(&definition, SL("scale"), &_27$$21, PH_COPY | PH_SEPARATE);
+ }
+ }
+ }
+ if (zephir_memnstr_str(&columnType, SL("unsigned"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 265)) {
+ zephir_array_update_string(&definition, SL("unsigned"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ if (Z_TYPE_P(&oldColumn) == IS_NULL) {
+ zephir_array_update_string(&definition, SL("first"), &__$true, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_28$$3, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 281);
+ if (zephir_is_true(&_28$$3)) {
+ zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_29$$3, &field, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 288);
+ if (ZEPHIR_IS_LONG(&_29$$3, 0)) {
+ zephir_array_update_string(&definition, SL("notNull"), &__$false, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_30$$3, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 296);
+ ZEPHIR_INIT_NVAR(&_31$$3);
+ ZVAL_STRING(&_31$$3, "null");
+ ZEPHIR_CALL_FUNCTION(&_32$$3, "strcasecmp", &_33, 47, &_30$$3, &_31$$3);
+ zephir_check_call_status();
+ _34$$3 = !ZEPHIR_IS_LONG(&_32$$3, 0);
+ if (_34$$3) {
+ zephir_array_fetch_long(&_35$$3, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 296);
+ _34$$3 = !ZEPHIR_IS_STRING(&_35$$3, "");
+ }
+ if (_34$$3) {
+ zephir_array_fetch_long(&_36$$27, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 301);
+ ZEPHIR_INIT_NVAR(&_37$$27);
+ ZVAL_STRING(&_37$$27, "/^'|'$/");
+ ZEPHIR_INIT_NVAR(&_38$$27);
+ ZVAL_STRING(&_38$$27, "");
+ ZEPHIR_CALL_FUNCTION(&_39$$27, "preg_replace", &_40, 50, &_37$$27, &_38$$27, &_36$$27);
+ zephir_check_call_status();
+ zephir_array_update_string(&definition, SL("default"), &_39$$27, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&columnName, &field, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 307);
+ ZEPHIR_INIT_NVAR(&_31$$3);
+ object_init_ex(&_31$$3, phalcon_db_column_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_31$$3, "__construct", &_41, 212, &columnName, &definition);
+ zephir_check_call_status();
+ zephir_array_append(&columns, &_31$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 308);
+ ZEPHIR_CPY_WRT(&oldColumn, &columnName);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &fields, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_4, &fields, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_4)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&field, &fields, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_42$$28);
+ zephir_create_array(&_42$$28, 1, 0);
+ add_assoc_long_ex(&_42$$28, SL("bindType"), 2);
+ ZEPHIR_CPY_WRT(&definition, &_42$$28);
+ ZEPHIR_OBS_NVAR(&columnType);
+ zephir_array_fetch_long(&columnType, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 128);
+ _43$$28 = zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 150);
+ if (!(_43$$28)) {
+ _43$$28 = zephir_memnstr_str(&columnType, SL("INT"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 150);
+ }
+ if (zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 143)) {
+ ZEPHIR_INIT_NVAR(&_44$$29);
+ ZVAL_LONG(&_44$$29, 14);
+ zephir_array_update_string(&definition, SL("type"), &_44$$29, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_45$$29);
+ ZVAL_LONG(&_45$$29, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_45$$29, PH_COPY | PH_SEPARATE);
+ } else if (_43$$28) {
+ ZEPHIR_INIT_NVAR(&_46$$30);
+ ZVAL_LONG(&_46$$30, 0);
+ zephir_array_update_string(&definition, SL("type"), &_46$$30, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_47$$30);
+ ZVAL_LONG(&_47$$30, 1);
+ zephir_array_update_string(&definition, SL("bindType"), &_47$$30, PH_COPY | PH_SEPARATE);
+ zephir_array_fetch_long(&_48$$30, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 158);
+ if (zephir_is_true(&_48$$30)) {
+ zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ } else if (zephir_memnstr_str(&columnType, SL("tinyint(1)"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 161)) {
+ ZEPHIR_INIT_NVAR(&_49$$32);
+ ZVAL_LONG(&_49$$32, 8);
+ zephir_array_update_string(&definition, SL("type"), &_49$$32, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_50$$32);
+ ZVAL_LONG(&_50$$32, 5);
+ zephir_array_update_string(&definition, SL("bindType"), &_50$$32, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&columnType);
+ ZVAL_STRING(&columnType, "boolean");
+ } else if (zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 172)) {
+ ZEPHIR_INIT_NVAR(&_51$$33);
+ ZVAL_LONG(&_51$$33, 5);
+ zephir_array_update_string(&definition, SL("type"), &_51$$33, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 181)) {
+ ZEPHIR_INIT_NVAR(&_52$$34);
+ ZVAL_LONG(&_52$$34, 4);
+ zephir_array_update_string(&definition, SL("type"), &_52$$34, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 186)) {
+ ZEPHIR_INIT_NVAR(&_53$$35);
+ ZVAL_LONG(&_53$$35, 1);
+ zephir_array_update_string(&definition, SL("type"), &_53$$35, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 195)) {
+ ZEPHIR_INIT_NVAR(&_54$$36);
+ ZVAL_LONG(&_54$$36, 3);
+ zephir_array_update_string(&definition, SL("type"), &_54$$36, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_55$$36);
+ ZVAL_LONG(&_55$$36, 32);
+ zephir_array_update_string(&definition, SL("bindType"), &_55$$36, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 202)) {
+ ZEPHIR_INIT_NVAR(&_56$$37);
+ ZVAL_LONG(&_56$$37, 7);
+ zephir_array_update_string(&definition, SL("type"), &_56$$37, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_57$$37);
+ ZVAL_LONG(&_57$$37, 3);
+ zephir_array_update_string(&definition, SL("bindType"), &_57$$37, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 213)) {
+ ZEPHIR_INIT_NVAR(&_58$$38);
+ ZVAL_LONG(&_58$$38, 17);
+ zephir_array_update_string(&definition, SL("type"), &_58$$38, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 222)) {
+ ZEPHIR_INIT_NVAR(&_59$$39);
+ ZVAL_LONG(&_59$$39, 2);
+ zephir_array_update_string(&definition, SL("type"), &_59$$39, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 227)) {
+ ZEPHIR_INIT_NVAR(&_60$$40);
+ ZVAL_LONG(&_60$$40, 5);
+ zephir_array_update_string(&definition, SL("type"), &_60$$40, PH_COPY | PH_SEPARATE);
+ } else if (zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 232)) {
+ ZEPHIR_INIT_NVAR(&_61$$41);
+ ZVAL_LONG(&_61$$41, 6);
+ zephir_array_update_string(&definition, SL("type"), &_61$$41, PH_COPY | PH_SEPARATE);
+ } else {
+ ZEPHIR_INIT_NVAR(&_62$$42);
+ ZVAL_LONG(&_62$$42, 2);
+ zephir_array_update_string(&definition, SL("type"), &_62$$42, PH_COPY | PH_SEPARATE);
+ }
+ if (zephir_memnstr_str(&columnType, SL("("), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 249)) {
+ ZEPHIR_INIT_NVAR(&matches);
+ ZVAL_NULL(&matches);
+ ZEPHIR_INIT_NVAR(&_63$$43);
+ zephir_preg_match(&_63$$43, &sizePattern, &columnType, &matches, 0, 0 , 0 );
+ if (zephir_is_true(&_63$$43)) {
+ ZEPHIR_OBS_NVAR(&matchOne);
+ if (zephir_array_isset_long_fetch(&matchOne, &matches, 1, 0)) {
+ ZEPHIR_INIT_NVAR(&_64$$45);
+ ZVAL_LONG(&_64$$45, zephir_get_intval(&matchOne));
+ zephir_array_update_string(&definition, SL("size"), &_64$$45, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_OBS_NVAR(&matchTwo);
+ if (zephir_array_isset_long_fetch(&matchTwo, &matches, 2, 0)) {
+ ZEPHIR_INIT_NVAR(&_65$$46);
+ ZVAL_LONG(&_65$$46, zephir_get_intval(&matchTwo));
+ zephir_array_update_string(&definition, SL("scale"), &_65$$46, PH_COPY | PH_SEPARATE);
+ }
+ }
+ }
+ if (zephir_memnstr_str(&columnType, SL("unsigned"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 265)) {
+ zephir_array_update_string(&definition, SL("unsigned"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ if (Z_TYPE_P(&oldColumn) == IS_NULL) {
+ zephir_array_update_string(&definition, SL("first"), &__$true, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_66$$28, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 281);
+ if (zephir_is_true(&_66$$28)) {
+ zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_67$$28, &field, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 288);
+ if (ZEPHIR_IS_LONG(&_67$$28, 0)) {
+ zephir_array_update_string(&definition, SL("notNull"), &__$false, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch_long(&_68$$28, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 296);
+ ZEPHIR_INIT_NVAR(&_69$$28);
+ ZVAL_STRING(&_69$$28, "null");
+ ZEPHIR_CALL_FUNCTION(&_70$$28, "strcasecmp", &_33, 47, &_68$$28, &_69$$28);
+ zephir_check_call_status();
+ _71$$28 = !ZEPHIR_IS_LONG(&_70$$28, 0);
+ if (_71$$28) {
+ zephir_array_fetch_long(&_72$$28, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 296);
+ _71$$28 = !ZEPHIR_IS_STRING(&_72$$28, "");
+ }
+ if (_71$$28) {
+ zephir_array_fetch_long(&_73$$52, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 301);
+ ZEPHIR_INIT_NVAR(&_74$$52);
+ ZVAL_STRING(&_74$$52, "/^'|'$/");
+ ZEPHIR_INIT_NVAR(&_75$$52);
+ ZVAL_STRING(&_75$$52, "");
+ ZEPHIR_CALL_FUNCTION(&_76$$52, "preg_replace", &_40, 50, &_74$$52, &_75$$52, &_73$$52);
+ zephir_check_call_status();
+ zephir_array_update_string(&definition, SL("default"), &_76$$52, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_OBS_NVAR(&columnName);
+ zephir_array_fetch_long(&columnName, &field, 1, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 307);
+ ZEPHIR_INIT_NVAR(&_69$$28);
+ object_init_ex(&_69$$28, phalcon_db_column_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_69$$28, "__construct", &_41, 212, &columnName, &definition);
+ zephir_check_call_status();
+ zephir_array_append(&columns, &_69$$28, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 308);
+ ZEPHIR_CPY_WRT(&oldColumn, &columnName);
+ ZEPHIR_CALL_METHOD(NULL, &fields, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "aud");
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "setclaim", NULL, 0, &_1, &aud);
- zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_INIT_NVAR(&field);
+ RETURN_CCTOR(&columns);
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, setContentType)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes)
{
+ zend_string *_46;
+ zend_ulong _45;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_17 = NULL, *_50 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *contentType_param = NULL, _0, _1;
- zval contentType;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&contentType);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(contentType)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &contentType_param);
- zephir_get_strval(&contentType, contentType_param);
-
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("jose"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "cty");
- ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &_1, &contentType);
- zephir_check_call_status();
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Builder, setExpirationTime)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *timestamp_param = NULL, _0, _1, _2;
- zend_long timestamp, ZEPHIR_LAST_CALL_STATUS;
+ zval *table_param = NULL, *schema_param = NULL, __$null, indexes, index, keyName, indexObjects, name, columns, describeIndexes, describeIndex, indexSql, _0, _1, _2, _3, *_4, _5, *_43, _44, _6$$4, _7$$3, _9$$3, _10$$3, _11$$3, *_12$$3, _13$$3, _16$$3, _18$$3, _8$$6, _14$$7, _15$$8, _19$$9, _20$$9, _21$$9, _22$$9, _23$$10, _24$$11, _25$$14, _26$$13, _28$$13, _29$$13, _30$$13, *_31$$13, _32$$13, _35$$13, _36$$13, _27$$16, _33$$17, _34$$18, _37$$19, _38$$19, _39$$19, _40$$19, _41$$20, _42$$21, _47$$23, _48$$23, _49$$23, _51$$24, _52$$24, _53$$24;
+ zval table, schema;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&indexes);
+ ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&keyName);
+ ZVAL_UNDEF(&indexObjects);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&describeIndexes);
+ ZVAL_UNDEF(&describeIndex);
+ ZVAL_UNDEF(&indexSql);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_44);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_9$$3);
+ ZVAL_UNDEF(&_10$$3);
+ ZVAL_UNDEF(&_11$$3);
+ ZVAL_UNDEF(&_13$$3);
+ ZVAL_UNDEF(&_16$$3);
+ ZVAL_UNDEF(&_18$$3);
+ ZVAL_UNDEF(&_8$$6);
+ ZVAL_UNDEF(&_14$$7);
+ ZVAL_UNDEF(&_15$$8);
+ ZVAL_UNDEF(&_19$$9);
+ ZVAL_UNDEF(&_20$$9);
+ ZVAL_UNDEF(&_21$$9);
+ ZVAL_UNDEF(&_22$$9);
+ ZVAL_UNDEF(&_23$$10);
+ ZVAL_UNDEF(&_24$$11);
+ ZVAL_UNDEF(&_25$$14);
+ ZVAL_UNDEF(&_26$$13);
+ ZVAL_UNDEF(&_28$$13);
+ ZVAL_UNDEF(&_29$$13);
+ ZVAL_UNDEF(&_30$$13);
+ ZVAL_UNDEF(&_32$$13);
+ ZVAL_UNDEF(&_35$$13);
+ ZVAL_UNDEF(&_36$$13);
+ ZVAL_UNDEF(&_27$$16);
+ ZVAL_UNDEF(&_33$$17);
+ ZVAL_UNDEF(&_34$$18);
+ ZVAL_UNDEF(&_37$$19);
+ ZVAL_UNDEF(&_38$$19);
+ ZVAL_UNDEF(&_39$$19);
+ ZVAL_UNDEF(&_40$$19);
+ ZVAL_UNDEF(&_41$$20);
+ ZVAL_UNDEF(&_42$$21);
+ ZVAL_UNDEF(&_47$$23);
+ ZVAL_UNDEF(&_48$$23);
+ ZVAL_UNDEF(&_49$$23);
+ ZVAL_UNDEF(&_51$$24);
+ ZVAL_UNDEF(&_52$$24);
+ ZVAL_UNDEF(&_53$$24);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(timestamp)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, ×tamp_param);
- timestamp = zephir_get_intval(timestamp_param);
-
-
- ZEPHIR_INIT_VAR(&_0);
- zephir_time(&_0);
- if (ZEPHIR_GT_LONG(&_0, timestamp)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid Expiration Time", "phalcon/Security/JWT/Builder.zep", 278);
- return;
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
}
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "exp");
- ZVAL_LONG(&_2, timestamp);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "setclaim", NULL, 0, &_1, &_2);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Builder, setId)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *id_param = NULL, _0;
- zval id;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&id);
- ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(id)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &id_param);
- if (UNEXPECTED(Z_TYPE_P(id_param) != IS_STRING && Z_TYPE_P(id_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' must be of the type string"));
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
+ }
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(schema_param) != IS_STRING && Z_TYPE_P(schema_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schema' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(id_param) == IS_STRING)) {
- zephir_get_strval(&id, id_param);
+ if (EXPECTED(Z_TYPE_P(schema_param) == IS_STRING)) {
+ zephir_get_strval(&schema, schema_param);
} else {
- ZEPHIR_INIT_VAR(&id);
+ ZEPHIR_INIT_VAR(&schema);
+ }
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "jti");
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "setclaim", NULL, 0, &_0, &id);
+ ZEPHIR_INIT_VAR(&indexes);
+ array_init(&indexes);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_2, &_1, "describeindexes", NULL, 0, &table, &schema);
zephir_check_call_status();
- RETURN_MM();
+ ZVAL_LONG(&_3, 2);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3);
+ zephir_check_call_status();
+ zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 370);
+ if (Z_TYPE_P(&_0) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4)
+ {
+ ZEPHIR_INIT_NVAR(&index);
+ ZVAL_COPY(&index, _4);
+ ZEPHIR_OBS_NVAR(&keyName);
+ zephir_array_fetch_string(&keyName, &index, SL("name"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 332);
+ if (!(zephir_array_isset(&indexes, &keyName))) {
+ ZEPHIR_INIT_NVAR(&_6$$4);
+ array_init(&_6$$4);
+ zephir_array_update_zval(&indexes, &keyName, &_6$$4, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch(&_7$$3, &indexes, &keyName, PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 338);
+ if (!(zephir_array_isset_string(&_7$$3, SL("columns")))) {
+ ZEPHIR_INIT_NVAR(&columns);
+ array_init(&columns);
+ } else {
+ zephir_array_fetch(&_8$$6, &indexes, &keyName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 341);
+ ZEPHIR_OBS_NVAR(&columns);
+ zephir_array_fetch_string(&columns, &_8$$6, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 341);
+ }
+ zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_10$$3, &_9$$3, "describeindex", NULL, 0, &keyName);
+ zephir_check_call_status();
+ ZVAL_LONG(&_11$$3, 2);
+ ZEPHIR_CALL_METHOD(&describeIndexes, this_ptr, "fetchall", NULL, 0, &_10$$3, &_11$$3);
+ zephir_check_call_status();
+ zephir_is_iterable(&describeIndexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 353);
+ if (Z_TYPE_P(&describeIndexes) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&describeIndexes), _12$$3)
+ {
+ ZEPHIR_INIT_NVAR(&describeIndex);
+ ZVAL_COPY(&describeIndex, _12$$3);
+ zephir_array_fetch_string(&_14$$7, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350);
+ zephir_array_append(&columns, &_14$$7, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &describeIndexes, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_13$$3, &describeIndexes, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_13$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&describeIndex, &describeIndexes, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_15$$8, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350);
+ zephir_array_append(&columns, &_15$$8, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350);
+ ZEPHIR_CALL_METHOD(NULL, &describeIndexes, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&describeIndex);
+ zephir_array_update_multi(&indexes, &columns, SL("zs"), 3, &keyName, SL("columns"));
+ zephir_read_property(&_11$$3, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_16$$3, &_11$$3, "listindexessql", NULL, 0, &table, &schema, &keyName);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&indexSql, this_ptr, "fetchcolumn", &_17, 0, &_16$$3);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_18$$3, &index, SL("unique"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 359);
+ if (zephir_is_true(&_18$$3)) {
+ ZEPHIR_INIT_NVAR(&_19$$9);
+ ZEPHIR_INIT_NVAR(&_20$$9);
+ ZVAL_STRING(&_20$$9, "# UNIQUE #i");
+ ZEPHIR_INIT_NVAR(&_21$$9);
+ ZEPHIR_INIT_NVAR(&_22$$9);
+ ZVAL_STRING(&_22$$9, "# UNIQUE #i");
+ zephir_preg_match(&_21$$9, &_22$$9, &indexSql, &_19$$9, 0, 0 , 0 );
+ if (zephir_is_true(&_21$$9)) {
+ ZEPHIR_INIT_NVAR(&_23$$10);
+ ZVAL_STRING(&_23$$10, "UNIQUE");
+ zephir_array_update_multi(&indexes, &_23$$10, SL("zs"), 3, &keyName, SL("type"));
+ } else {
+ ZEPHIR_INIT_NVAR(&_24$$11);
+ ZVAL_STRING(&_24$$11, "PRIMARY");
+ zephir_array_update_multi(&indexes, &_24$$11, SL("zs"), 3, &keyName, SL("type"));
+ }
+ } else {
+ zephir_array_update_multi(&indexes, &__$null, SL("zs"), 3, &keyName, SL("type"));
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5, &_0, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&index, &_0, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&keyName);
+ zephir_array_fetch_string(&keyName, &index, SL("name"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 332);
+ if (!(zephir_array_isset(&indexes, &keyName))) {
+ ZEPHIR_INIT_NVAR(&_25$$14);
+ array_init(&_25$$14);
+ zephir_array_update_zval(&indexes, &keyName, &_25$$14, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_fetch(&_26$$13, &indexes, &keyName, PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 338);
+ if (!(zephir_array_isset_string(&_26$$13, SL("columns")))) {
+ ZEPHIR_INIT_NVAR(&columns);
+ array_init(&columns);
+ } else {
+ zephir_array_fetch(&_27$$16, &indexes, &keyName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 341);
+ ZEPHIR_OBS_NVAR(&columns);
+ zephir_array_fetch_string(&columns, &_27$$16, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 341);
+ }
+ zephir_read_property(&_28$$13, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_29$$13, &_28$$13, "describeindex", NULL, 0, &keyName);
+ zephir_check_call_status();
+ ZVAL_LONG(&_30$$13, 2);
+ ZEPHIR_CALL_METHOD(&describeIndexes, this_ptr, "fetchall", NULL, 0, &_29$$13, &_30$$13);
+ zephir_check_call_status();
+ zephir_is_iterable(&describeIndexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 353);
+ if (Z_TYPE_P(&describeIndexes) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&describeIndexes), _31$$13)
+ {
+ ZEPHIR_INIT_NVAR(&describeIndex);
+ ZVAL_COPY(&describeIndex, _31$$13);
+ zephir_array_fetch_string(&_33$$17, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350);
+ zephir_array_append(&columns, &_33$$17, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &describeIndexes, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_32$$13, &describeIndexes, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_32$$13)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&describeIndex, &describeIndexes, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_34$$18, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350);
+ zephir_array_append(&columns, &_34$$18, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350);
+ ZEPHIR_CALL_METHOD(NULL, &describeIndexes, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&describeIndex);
+ zephir_array_update_multi(&indexes, &columns, SL("zs"), 3, &keyName, SL("columns"));
+ zephir_read_property(&_30$$13, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_35$$13, &_30$$13, "listindexessql", NULL, 0, &table, &schema, &keyName);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&indexSql, this_ptr, "fetchcolumn", &_17, 0, &_35$$13);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_36$$13, &index, SL("unique"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 359);
+ if (zephir_is_true(&_36$$13)) {
+ ZEPHIR_INIT_NVAR(&_37$$19);
+ ZEPHIR_INIT_NVAR(&_38$$19);
+ ZVAL_STRING(&_38$$19, "# UNIQUE #i");
+ ZEPHIR_INIT_NVAR(&_39$$19);
+ ZEPHIR_INIT_NVAR(&_40$$19);
+ ZVAL_STRING(&_40$$19, "# UNIQUE #i");
+ zephir_preg_match(&_39$$19, &_40$$19, &indexSql, &_37$$19, 0, 0 , 0 );
+ if (zephir_is_true(&_39$$19)) {
+ ZEPHIR_INIT_NVAR(&_41$$20);
+ ZVAL_STRING(&_41$$20, "UNIQUE");
+ zephir_array_update_multi(&indexes, &_41$$20, SL("zs"), 3, &keyName, SL("type"));
+ } else {
+ ZEPHIR_INIT_NVAR(&_42$$21);
+ ZVAL_STRING(&_42$$21, "PRIMARY");
+ zephir_array_update_multi(&indexes, &_42$$21, SL("zs"), 3, &keyName, SL("type"));
+ }
+ } else {
+ zephir_array_update_multi(&indexes, &__$null, SL("zs"), 3, &keyName, SL("type"));
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&index);
+ ZEPHIR_INIT_VAR(&indexObjects);
+ array_init(&indexObjects);
+ zephir_is_iterable(&indexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 380);
+ if (Z_TYPE_P(&indexes) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&indexes), _45, _46, _43)
+ {
+ ZEPHIR_INIT_NVAR(&name);
+ if (_46 != NULL) {
+ ZVAL_STR_COPY(&name, _46);
+ } else {
+ ZVAL_LONG(&name, _45);
+ }
+ ZEPHIR_INIT_NVAR(&index);
+ ZVAL_COPY(&index, _43);
+ ZEPHIR_INIT_NVAR(&_47$$23);
+ object_init_ex(&_47$$23, phalcon_db_index_ce);
+ zephir_array_fetch_string(&_48$$23, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 375);
+ zephir_array_fetch_string(&_49$$23, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 377);
+ ZEPHIR_CALL_METHOD(NULL, &_47$$23, "__construct", &_50, 32, &name, &_48$$23, &_49$$23);
+ zephir_check_call_status();
+ zephir_array_update_zval(&indexObjects, &name, &_47$$23, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &indexes, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_44, &indexes, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_44)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&name, &indexes, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&index, &indexes, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_51$$24);
+ object_init_ex(&_51$$24, phalcon_db_index_ce);
+ zephir_array_fetch_string(&_52$$24, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 375);
+ zephir_array_fetch_string(&_53$$24, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 377);
+ ZEPHIR_CALL_METHOD(NULL, &_51$$24, "__construct", &_50, 32, &name, &_52$$24, &_53$$24);
+ zephir_check_call_status();
+ zephir_array_update_zval(&indexObjects, &name, &_51$$24, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &indexes, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&index);
+ ZEPHIR_INIT_NVAR(&name);
+ RETURN_CCTOR(&indexObjects);
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, setIssuedAt)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences)
{
+ zval _14$$3, _21$$6, _27$$9, _31$$10;
+ zend_string *_7, *_25;
+ zend_ulong _6, _24;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *timestamp_param = NULL, _0, _1;
- zend_long timestamp, ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_29 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *table_param = NULL, *schema_param = NULL, references, reference, arrayReference, constraintName, referenceObjects, name, referencedSchema, referencedTable, columns, referencedColumns, number, _0, _1, _2, _3, *_4, _5, *_22, _23, _8$$5, _9$$5, _10$$5, _11$$5, _12$$3, _13$$3, _15$$8, _16$$8, _17$$8, _18$$8, _19$$6, _20$$6, _26$$9, _28$$9, _30$$10, _32$$10;
+ zval table, schema;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+ ZVAL_UNDEF(&references);
+ ZVAL_UNDEF(&reference);
+ ZVAL_UNDEF(&arrayReference);
+ ZVAL_UNDEF(&constraintName);
+ ZVAL_UNDEF(&referenceObjects);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&referencedSchema);
+ ZVAL_UNDEF(&referencedTable);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&referencedColumns);
+ ZVAL_UNDEF(&number);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_23);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_11$$5);
+ ZVAL_UNDEF(&_12$$3);
+ ZVAL_UNDEF(&_13$$3);
+ ZVAL_UNDEF(&_15$$8);
+ ZVAL_UNDEF(&_16$$8);
+ ZVAL_UNDEF(&_17$$8);
+ ZVAL_UNDEF(&_18$$8);
+ ZVAL_UNDEF(&_19$$6);
+ ZVAL_UNDEF(&_20$$6);
+ ZVAL_UNDEF(&_26$$9);
+ ZVAL_UNDEF(&_28$$9);
+ ZVAL_UNDEF(&_30$$10);
+ ZVAL_UNDEF(&_32$$10);
+ ZVAL_UNDEF(&_14$$3);
+ ZVAL_UNDEF(&_21$$6);
+ ZVAL_UNDEF(&_27$$9);
+ ZVAL_UNDEF(&_31$$10);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(timestamp)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, ×tamp_param);
- if (UNEXPECTED(Z_TYPE_P(timestamp_param) != IS_LONG)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'timestamp' must be of the type int"));
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
RETURN_MM_NULL();
}
- timestamp = Z_LVAL_P(timestamp_param);
-
-
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "iat");
- ZVAL_LONG(&_1, timestamp);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "setclaim", NULL, 0, &_0, &_1);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Builder, setIssuer)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *issuer_param = NULL, _0;
- zval issuer;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&issuer);
- ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(issuer)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &issuer_param);
- if (UNEXPECTED(Z_TYPE_P(issuer_param) != IS_STRING && Z_TYPE_P(issuer_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'issuer' must be of the type string"));
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
+ }
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(schema_param) != IS_STRING && Z_TYPE_P(schema_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schema' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(issuer_param) == IS_STRING)) {
- zephir_get_strval(&issuer, issuer_param);
+ if (EXPECTED(Z_TYPE_P(schema_param) == IS_STRING)) {
+ zephir_get_strval(&schema, schema_param);
} else {
- ZEPHIR_INIT_VAR(&issuer);
+ ZEPHIR_INIT_VAR(&schema);
+ }
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "iss");
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "setclaim", NULL, 0, &_0, &issuer);
+ ZEPHIR_INIT_VAR(&references);
+ array_init(&references);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_2, &_1, "describereferences", NULL, 0, &table, &schema);
zephir_check_call_status();
- RETURN_MM();
+ ZVAL_LONG(&_3, 3);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3);
+ zephir_check_call_status();
+ zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 420);
+ if (Z_TYPE_P(&_0) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0), _6, _7, _4)
+ {
+ ZEPHIR_INIT_NVAR(&number);
+ if (_7 != NULL) {
+ ZVAL_STR_COPY(&number, _7);
+ } else {
+ ZVAL_LONG(&number, _6);
+ }
+ ZEPHIR_INIT_NVAR(&reference);
+ ZVAL_COPY(&reference, _4);
+ ZEPHIR_INIT_NVAR(&constraintName);
+ ZEPHIR_CONCAT_SV(&constraintName, "foreign_key_", &number);
+ if (!(zephir_array_isset(&references, &constraintName))) {
+ ZEPHIR_INIT_NVAR(&referencedSchema);
+ ZVAL_NULL(&referencedSchema);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_long(&referencedTable, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 399);
+ ZEPHIR_INIT_NVAR(&columns);
+ array_init(&columns);
+ ZEPHIR_INIT_NVAR(&referencedColumns);
+ array_init(&referencedColumns);
+ } else {
+ zephir_array_fetch(&_8$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403);
+ ZEPHIR_OBS_NVAR(&referencedSchema);
+ zephir_array_fetch_string(&referencedSchema, &_8$$5, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403);
+ zephir_array_fetch(&_9$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_string(&referencedTable, &_9$$5, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404);
+ zephir_array_fetch(&_10$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405);
+ ZEPHIR_OBS_NVAR(&columns);
+ zephir_array_fetch_string(&columns, &_10$$5, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405);
+ zephir_array_fetch(&_11$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 406);
+ ZEPHIR_OBS_NVAR(&referencedColumns);
+ zephir_array_fetch_string(&referencedColumns, &_11$$5, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 406);
+ }
+ zephir_array_fetch_long(&_12$$3, &reference, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409);
+ zephir_array_append(&columns, &_12$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409);
+ zephir_array_fetch_long(&_13$$3, &reference, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 410);
+ zephir_array_append(&referencedColumns, &_13$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 410);
+ ZEPHIR_INIT_NVAR(&_14$$3);
+ zephir_create_array(&_14$$3, 4, 0);
+ zephir_array_update_string(&_14$$3, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_14$$3, SL("referencedTable"), &referencedTable, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_14$$3, SL("columns"), &columns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_14$$3, SL("referencedColumns"), &referencedColumns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_zval(&references, &constraintName, &_14$$3, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5, &_0, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&number, &_0, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&reference, &_0, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&constraintName);
+ ZEPHIR_CONCAT_SV(&constraintName, "foreign_key_", &number);
+ if (!(zephir_array_isset(&references, &constraintName))) {
+ ZEPHIR_INIT_NVAR(&referencedSchema);
+ ZVAL_NULL(&referencedSchema);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_long(&referencedTable, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 399);
+ ZEPHIR_INIT_NVAR(&columns);
+ array_init(&columns);
+ ZEPHIR_INIT_NVAR(&referencedColumns);
+ array_init(&referencedColumns);
+ } else {
+ zephir_array_fetch(&_15$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403);
+ ZEPHIR_OBS_NVAR(&referencedSchema);
+ zephir_array_fetch_string(&referencedSchema, &_15$$8, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403);
+ zephir_array_fetch(&_16$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404);
+ ZEPHIR_OBS_NVAR(&referencedTable);
+ zephir_array_fetch_string(&referencedTable, &_16$$8, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404);
+ zephir_array_fetch(&_17$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405);
+ ZEPHIR_OBS_NVAR(&columns);
+ zephir_array_fetch_string(&columns, &_17$$8, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405);
+ zephir_array_fetch(&_18$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 406);
+ ZEPHIR_OBS_NVAR(&referencedColumns);
+ zephir_array_fetch_string(&referencedColumns, &_18$$8, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 406);
+ }
+ zephir_array_fetch_long(&_19$$6, &reference, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409);
+ zephir_array_append(&columns, &_19$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409);
+ zephir_array_fetch_long(&_20$$6, &reference, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 410);
+ zephir_array_append(&referencedColumns, &_20$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 410);
+ ZEPHIR_INIT_NVAR(&_21$$6);
+ zephir_create_array(&_21$$6, 4, 0);
+ zephir_array_update_string(&_21$$6, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_21$$6, SL("referencedTable"), &referencedTable, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_21$$6, SL("columns"), &columns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_21$$6, SL("referencedColumns"), &referencedColumns, PH_COPY | PH_SEPARATE);
+ zephir_array_update_zval(&references, &constraintName, &_21$$6, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&reference);
+ ZEPHIR_INIT_NVAR(&number);
+ ZEPHIR_INIT_VAR(&referenceObjects);
+ array_init(&referenceObjects);
+ zephir_is_iterable(&references, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 434);
+ if (Z_TYPE_P(&references) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&references), _24, _25, _22)
+ {
+ ZEPHIR_INIT_NVAR(&name);
+ if (_25 != NULL) {
+ ZVAL_STR_COPY(&name, _25);
+ } else {
+ ZVAL_LONG(&name, _24);
+ }
+ ZEPHIR_INIT_NVAR(&arrayReference);
+ ZVAL_COPY(&arrayReference, _22);
+ ZEPHIR_INIT_NVAR(&_26$$9);
+ object_init_ex(&_26$$9, phalcon_db_reference_ce);
+ ZEPHIR_INIT_NVAR(&_27$$9);
+ zephir_create_array(&_27$$9, 4, 0);
+ ZEPHIR_OBS_NVAR(&_28$$9);
+ zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 426);
+ zephir_array_update_string(&_27$$9, SL("referencedSchema"), &_28$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_28$$9);
+ zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 427);
+ zephir_array_update_string(&_27$$9, SL("referencedTable"), &_28$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_28$$9);
+ zephir_array_fetch_string(&_28$$9, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 428);
+ zephir_array_update_string(&_27$$9, SL("columns"), &_28$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_28$$9);
+ zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 430);
+ zephir_array_update_string(&_27$$9, SL("referencedColumns"), &_28$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &_26$$9, "__construct", &_29, 33, &name, &_27$$9);
+ zephir_check_call_status();
+ zephir_array_update_zval(&referenceObjects, &name, &_26$$9, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &references, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_23, &references, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_23)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&name, &references, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&arrayReference, &references, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_30$$10);
+ object_init_ex(&_30$$10, phalcon_db_reference_ce);
+ ZEPHIR_INIT_NVAR(&_31$$10);
+ zephir_create_array(&_31$$10, 4, 0);
+ ZEPHIR_OBS_NVAR(&_32$$10);
+ zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 426);
+ zephir_array_update_string(&_31$$10, SL("referencedSchema"), &_32$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_32$$10);
+ zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 427);
+ zephir_array_update_string(&_31$$10, SL("referencedTable"), &_32$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_32$$10);
+ zephir_array_fetch_string(&_32$$10, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 428);
+ zephir_array_update_string(&_31$$10, SL("columns"), &_32$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_32$$10);
+ zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 430);
+ zephir_array_update_string(&_31$$10, SL("referencedColumns"), &_32$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &_30$$10, "__construct", &_29, 33, &name, &_31$$10);
+ zephir_check_call_status();
+ zephir_array_update_zval(&referenceObjects, &name, &_30$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&arrayReference);
+ ZEPHIR_INIT_NVAR(&name);
+ RETURN_CCTOR(&referenceObjects);
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, setNotBefore)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, getDefaultValue)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *timestamp_param = NULL, _0, _1, _2;
- zend_long timestamp, ZEPHIR_LAST_CALL_STATUS;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(timestamp)
- ZEND_PARSE_PARAMETERS_END();
-#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, ×tamp_param);
- if (UNEXPECTED(Z_TYPE_P(timestamp_param) != IS_LONG)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'timestamp' must be of the type int"));
- RETURN_MM_NULL();
- }
- timestamp = Z_LVAL_P(timestamp_param);
-
+ object_init_ex(return_value, phalcon_db_rawvalue_ce);
ZEPHIR_INIT_VAR(&_0);
- zephir_time(&_0);
- if (ZEPHIR_LT_LONG(&_0, timestamp)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid Not Before", "phalcon/Security/JWT/Builder.zep", 352);
- return;
- }
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "nbf");
- ZVAL_LONG(&_2, timestamp);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "setclaim", NULL, 0, &_1, &_2);
+ ZVAL_STRING(&_0, "NULL");
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34, &_0);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, setSubject)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, useExplicitIdValue)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *subject_param = NULL, _0;
- zval subject;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&subject);
- ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(subject)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &subject_param);
- if (UNEXPECTED(Z_TYPE_P(subject_param) != IS_STRING && Z_TYPE_P(subject_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'subject' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(subject_param) == IS_STRING)) {
- zephir_get_strval(&subject, subject_param);
- } else {
- ZEPHIR_INIT_VAR(&subject);
- }
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "sub");
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "setclaim", NULL, 0, &_0, &subject);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_BOOL(1);
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, setPassphrase)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, supportsDefaultValue)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *passphrase_param = NULL, _0, _1, _2, _3;
- zval passphrase;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&passphrase);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(passphrase)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &passphrase_param);
- if (UNEXPECTED(Z_TYPE_P(passphrase_param) != IS_STRING && Z_TYPE_P(passphrase_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'passphrase' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(passphrase_param) == IS_STRING)) {
- zephir_get_strval(&passphrase, passphrase_param);
- } else {
- ZEPHIR_INIT_VAR(&passphrase);
- }
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "/(?=^.{16,}$)((?=.*\\d)|(?=.*\\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/");
- ZEPHIR_INIT_VAR(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "/(?=^.{16,}$)((?=.*\\d)|(?=.*\\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/");
- zephir_preg_match(&_2, &_3, &passphrase, &_0, 0, 0 , 0 );
- if (!(zephir_is_true(&_2))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid passphrase (too weak)", "phalcon/Security/JWT/Builder.zep", 390);
- return;
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("passphrase"), &passphrase);
- RETURN_THIS();
+ RETURN_BOOL(0);
}
-static PHP_METHOD(Phalcon_Security_JWT_Builder, setClaim)
+static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, getDsnDefaults)
{
- 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);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(name)
- Z_PARAM_ZVAL(value)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &name_param, &value);
- 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("claims"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &name, value);
- zephir_check_call_status();
- RETURN_THIS();
+ array_init(return_value);
+ return;
}
@@ -195089,3766 +193227,4725 @@ static PHP_METHOD(Phalcon_Security_JWT_Builder, setClaim)
-ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Validator)
+ZEPHIR_INIT_CLASS(Phalcon_Db_Dialect_Mysql)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Security\\JWT, Validator, phalcon, security_jwt_validator, phalcon_security_jwt_validator_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Db\\Dialect, Mysql, phalcon, db_dialect_mysql, phalcon_db_dialect_ce, phalcon_db_dialect_mysql_method_entry, 0);
- zend_declare_property_long(phalcon_security_jwt_validator_ce, SL("timeShift"), 0, ZEND_ACC_PRIVATE);
- zend_declare_property_null(phalcon_security_jwt_validator_ce, SL("token"), ZEND_ACC_PRIVATE);
+ zend_declare_property_string(phalcon_db_dialect_mysql_ce, SL("escapeChar"), "`", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Security_JWT_Validator, __construct)
-{
- zend_long timeShift;
- zval *token, token_sub, *timeShift_param = NULL, _0;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&token_sub);
- ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(token, phalcon_security_jwt_token_token_ce)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(timeShift)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 1, &token, &timeShift_param);
- if (!timeShift_param) {
- timeShift = 0;
- } else {
- timeShift = zephir_get_intval(timeShift_param);
- }
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("token"), token);
- ZEPHIR_INIT_ZVAL_NREF(_0);
- ZVAL_LONG(&_0, timeShift);
- zephir_update_property_zval(this_ptr, ZEND_STRL("timeShift"), &_0);
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Validator, setToken)
-{
- zval *token, token_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&token_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(token, phalcon_security_jwt_token_token_ce)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &token);
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("token"), token);
- RETURN_THISW();
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Validator, validateAudience)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, addColumn)
{
+ zend_bool _6$$5, _7$$5, _8$$5;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *audience_param = NULL, _0, _1, _2, _3, _4;
- zval audience;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, afterPosition, defaultValue, upperDefaultValue, _0, _1, _2, _3, _4, _5, _14, _15, _9$$5, _10$$6, _11$$7, _12$$7, _13$$7, _16$$11;
+ zval tableName, schemaName, sql;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&audience);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&afterPosition);
+ ZVAL_UNDEF(&defaultValue);
+ ZVAL_UNDEF(&upperDefaultValue);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_14);
+ ZVAL_UNDEF(&_15);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$6);
+ ZVAL_UNDEF(&_11$$7);
+ ZVAL_UNDEF(&_12$$7);
+ ZVAL_UNDEF(&_13$$7);
+ ZVAL_UNDEF(&_16$$11);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(audience)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &audience_param);
- if (UNEXPECTED(Z_TYPE_P(audience_param) != IS_STRING && Z_TYPE_P(audience_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'audience' must be of the type string"));
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &column);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(audience_param) == IS_STRING)) {
- zephir_get_strval(&audience, audience_param);
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&audience);
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_1, &_0, "getclaims", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_1, column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_2, this_ptr, "getcolumndefinition", NULL, 0, column);
zephir_check_call_status();
ZEPHIR_INIT_VAR(&_3);
- array_init(&_3);
- ZEPHIR_INIT_VAR(&_4);
- ZVAL_STRING(&_4, "aud");
- ZEPHIR_CALL_METHOD(&_2, &_1, "get", NULL, 0, &_4, &_3);
+ ZEPHIR_CONCAT_SVSVSV(&_3, "ALTER TABLE ", &_0, " ADD `", &_1, "` ", &_2);
+ zephir_get_strval(&sql, &_3);
+ ZEPHIR_CALL_METHOD(&_4, column, "isnotnull", NULL, 0);
zephir_check_call_status();
- if (!(zephir_fast_in_array(&audience, &_2))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Validation: audience not allowed", "phalcon/Security/JWT/Validator.zep", 71);
- return;
+ if (zephir_is_true(&_4)) {
+ zephir_concat_self_str(&sql, " NOT NULL", sizeof(" NOT NULL") - 1);
+ } else {
+ zephir_concat_self_str(&sql, " NULL", sizeof(" NULL") - 1);
+ }
+ ZEPHIR_CALL_METHOD(&_5, column, "hasdefault", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_5)) {
+ ZEPHIR_CALL_METHOD(&defaultValue, column, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&upperDefaultValue);
+ zephir_fast_strtoupper(&upperDefaultValue, &defaultValue);
+ _6$$5 = zephir_memnstr_str(&upperDefaultValue, SL("CURRENT_TIMESTAMP"), "phalcon/Db/Dialect/Mysql.zep", 54);
+ if (!(_6$$5)) {
+ _6$$5 = zephir_memnstr_str(&upperDefaultValue, SL("NULL"), "phalcon/Db/Dialect/Mysql.zep", 54);
+ }
+ _7$$5 = _6$$5;
+ if (!(_7$$5)) {
+ _7$$5 = Z_TYPE_P(&defaultValue) == IS_LONG;
+ }
+ _8$$5 = _7$$5;
+ if (!(_8$$5)) {
+ ZEPHIR_CALL_FUNCTION(&_9$$5, "is_float", NULL, 213, &defaultValue);
+ zephir_check_call_status();
+ _8$$5 = zephir_is_true(&_9$$5);
+ }
+ if (_8$$5) {
+ ZEPHIR_INIT_VAR(&_10$$6);
+ ZEPHIR_CONCAT_SV(&_10$$6, " DEFAULT ", &defaultValue);
+ zephir_concat_self(&sql, &_10$$6);
+ } else {
+ ZEPHIR_INIT_VAR(&_11$$7);
+ ZVAL_STRING(&_11$$7, "\"");
+ ZEPHIR_CALL_FUNCTION(&_12$$7, "addcslashes", NULL, 214, &defaultValue, &_11$$7);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_13$$7);
+ ZEPHIR_CONCAT_SVS(&_13$$7, " DEFAULT \"", &_12$$7, "\"");
+ zephir_concat_self(&sql, &_13$$7);
+ }
+ }
+ ZEPHIR_CALL_METHOD(&_14, column, "isautoincrement", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_14)) {
+ zephir_concat_self_str(&sql, " AUTO_INCREMENT", sizeof(" AUTO_INCREMENT") - 1);
+ }
+ ZEPHIR_CALL_METHOD(&_15, column, "isfirst", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_15)) {
+ zephir_concat_self_str(&sql, " FIRST", sizeof(" FIRST") - 1);
+ } else {
+ ZEPHIR_CALL_METHOD(&afterPosition, column, "getafterposition", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&afterPosition)) {
+ ZEPHIR_INIT_VAR(&_16$$11);
+ ZEPHIR_CONCAT_SVS(&_16$$11, " AFTER `", &afterPosition, "`");
+ zephir_concat_self(&sql, &_16$$11);
+ }
}
- RETURN_THIS();
+ RETURN_CTOR(&sql);
}
-static PHP_METHOD(Phalcon_Security_JWT_Validator, validateExpiration)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, addForeignKey)
{
- zend_bool _4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *timestamp_param = NULL, _0, _1, _2, _3, _5, _6, _7, _8;
- zend_long timestamp, ZEPHIR_LAST_CALL_STATUS;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *reference, reference_sub, onDelete, onUpdate, _0, _1, _2, _5, _6, _7, _8, _9, _10, _11, _12, _3$$3, _4$$3, _13$$4, _14$$5;
+ zval tableName, schemaName, sql;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&reference_sub);
+ ZVAL_UNDEF(&onDelete);
+ ZVAL_UNDEF(&onUpdate);
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(&_11);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_13$$4);
+ ZVAL_UNDEF(&_14$$5);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(timestamp)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(reference, phalcon_db_referenceinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, ×tamp_param);
- timestamp = zephir_get_intval(timestamp_param);
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &reference);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_1, &_0, "getclaims", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "exp");
- ZEPHIR_CALL_METHOD(&_2, &_1, "has", NULL, 0, &_3);
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_CONCAT_SVS(&_1, "ALTER TABLE ", &_0, " ADD");
+ zephir_get_strval(&sql, &_1);
+ ZEPHIR_CALL_METHOD(&_2, reference, "getname", NULL, 0);
zephir_check_call_status();
- _4 = zephir_is_true(&_2);
- if (_4) {
- ZVAL_LONG(&_6, timestamp);
- ZEPHIR_CALL_METHOD(&_5, this_ptr, "gettimestamp", NULL, 0, &_6);
- zephir_check_call_status();
- zephir_read_property(&_6, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_7, &_6, "getclaims", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_3);
- ZVAL_STRING(&_3, "exp");
- ZEPHIR_CALL_METHOD(&_8, &_7, "get", NULL, 0, &_3);
+ if (zephir_is_true(&_2)) {
+ ZEPHIR_CALL_METHOD(&_3$$3, reference, "getname", NULL, 0);
zephir_check_call_status();
- _4 = ZEPHIR_GE_LONG(&_5, zephir_get_intval(&_8));
+ ZEPHIR_INIT_VAR(&_4$$3);
+ ZEPHIR_CONCAT_SVS(&_4$$3, " CONSTRAINT `", &_3$$3, "`");
+ zephir_concat_self(&sql, &_4$$3);
}
- if (_4) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Validation: the token has expired", "phalcon/Security/JWT/Validator.zep", 91);
- return;
+ ZEPHIR_CALL_METHOD(&_6, reference, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 67, &_6);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_8, reference, "getreferencedtable", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_9, reference, "getreferencedschema", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_7, this_ptr, "preparetable", NULL, 0, &_8, &_9);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_11, reference, "getreferencedcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_10, this_ptr, "getcolumnlist", NULL, 67, &_11);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_12);
+ ZEPHIR_CONCAT_SVSVSVS(&_12, " FOREIGN KEY (", &_5, ") REFERENCES ", &_7, "(", &_10, ")");
+ zephir_concat_self(&sql, &_12);
+ ZEPHIR_CALL_METHOD(&onDelete, reference, "getondelete", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onDelete))) {
+ ZEPHIR_INIT_VAR(&_13$$4);
+ ZEPHIR_CONCAT_SV(&_13$$4, " ON DELETE ", &onDelete);
+ zephir_concat_self(&sql, &_13$$4);
}
- RETURN_THIS();
+ ZEPHIR_CALL_METHOD(&onUpdate, reference, "getonupdate", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onUpdate))) {
+ ZEPHIR_INIT_VAR(&_14$$5);
+ ZEPHIR_CONCAT_SV(&_14$$5, " ON UPDATE ", &onUpdate);
+ zephir_concat_self(&sql, &_14$$5);
+ }
+ RETURN_CTOR(&sql);
}
-static PHP_METHOD(Phalcon_Security_JWT_Validator, validateId)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, addIndex)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *id_param = NULL, _0, _1, _2, _3;
- zval id, _4;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub, indexType, _0, _1, _3, _4, _5, _6, _2$$3;
+ zval tableName, schemaName, sql;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&id);
- ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&indexType);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_2$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(id)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(index, phalcon_db_indexinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &id_param);
- if (UNEXPECTED(Z_TYPE_P(id_param) != IS_STRING && Z_TYPE_P(id_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' must be of the type string"));
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(id_param) == IS_STRING)) {
- zephir_get_strval(&id, id_param);
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&id);
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_1, &_0, "getclaims", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "jti");
- ZEPHIR_CALL_METHOD(&_2, &_1, "get", NULL, 0, &_3);
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_CONCAT_SV(&_1, "ALTER TABLE ", &_0);
+ zephir_get_strval(&sql, &_1);
+ ZEPHIR_CALL_METHOD(&indexType, index, "gettype", NULL, 0);
zephir_check_call_status();
- zephir_cast_to_string(&_4, &_2);
- if (!ZEPHIR_IS_IDENTICAL(&id, &_4)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Validation: incorrect Id", "phalcon/Security/JWT/Validator.zep", 108);
- return;
+ if (!(ZEPHIR_IS_EMPTY(&indexType))) {
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_SVS(&_2$$3, " ADD ", &indexType, " INDEX ");
+ zephir_concat_self(&sql, &_2$$3);
+ } else {
+ zephir_concat_self_str(&sql, " ADD INDEX ", sizeof(" ADD INDEX ") - 1);
}
- RETURN_THIS();
+ ZEPHIR_CALL_METHOD(&_3, index, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_5, index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_4, this_ptr, "getcolumnlist", NULL, 67, &_5);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_6);
+ ZEPHIR_CONCAT_SVSVS(&_6, "`", &_3, "` (", &_4, ")");
+ zephir_concat_self(&sql, &_6);
+ RETURN_CTOR(&sql);
}
-static PHP_METHOD(Phalcon_Security_JWT_Validator, validateIssuedAt)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, addPrimaryKey)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *timestamp_param = NULL, _0, _1, _2, _3, _4;
- zend_long timestamp, ZEPHIR_LAST_CALL_STATUS;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub, _0, _1, _2;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&index_sub);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(timestamp)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(index, phalcon_db_indexinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, ×tamp_param);
- timestamp = zephir_get_intval(timestamp_param);
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
- ZVAL_LONG(&_1, timestamp);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "gettimestamp", NULL, 0, &_1);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_2, &_1, "getclaims", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_2, index, "getcolumns", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_4);
- ZVAL_STRING(&_4, "iat");
- ZEPHIR_CALL_METHOD(&_3, &_2, "get", NULL, 0, &_4);
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 67, &_2);
zephir_check_call_status();
- if (ZEPHIR_LE_LONG(&_0, zephir_get_intval(&_3))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Validation: the token cannot be used yet (future)", "phalcon/Security/JWT/Validator.zep", 125);
- return;
- }
- RETURN_THIS();
+ ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " ADD PRIMARY KEY (", &_1, ")");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Security_JWT_Validator, validateIssuer)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable)
{
+ zend_bool _9$$10, _10$$10, _11$$10, _28$$19, _29$$19, _30$$19;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_6 = NULL, *_13 = NULL, *_17 = NULL, *_45 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *issuer_param = NULL, _0, _1, _2, _3;
- zval issuer, _4;
+ zval definition, createLines;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, temporary, options, table, columns, column, indexes, index, reference, references, indexName, columnLine, indexType, onDelete, onUpdate, defaultValue, upperDefaultValue, *_2, _3, _86, _87, _0$$5, _1$$6, _4$$7, _5$$7, _7$$7, _8$$7, _19$$7, _20$$7, _21$$7, _12$$10, _14$$11, _15$$12, _16$$12, _18$$12, _22$$15, _23$$15, _24$$16, _25$$16, _26$$16, _27$$16, _36$$16, _37$$16, _38$$16, _31$$19, _32$$20, _33$$21, _34$$21, _35$$21, _39$$24, _40$$24, *_41$$25, _42$$25, _43$$27, _44$$27, _46$$27, _47$$29, _48$$29, _49$$29, _50$$30, _51$$30, _52$$30, _53$$32, _54$$32, _55$$32, _56$$34, _57$$34, _58$$34, _59$$35, _60$$35, _61$$35, *_62$$36, _63$$36, _64$$37, _65$$37, _66$$37, _67$$37, _68$$37, _69$$37, _70$$37, _71$$37, _72$$37, _73$$38, _74$$39, _75$$40, _76$$40, _77$$40, _78$$40, _79$$40, _80$$40, _81$$40, _82$$40, _83$$40, _84$$41, _85$$42, _88$$43, _89$$43;
+ zval tableName, schemaName, indexSql, referenceSql, sql;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&issuer);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&indexSql);
+ ZVAL_UNDEF(&referenceSql);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&temporary);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&column);
+ ZVAL_UNDEF(&indexes);
+ ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&reference);
+ ZVAL_UNDEF(&references);
+ ZVAL_UNDEF(&indexName);
+ ZVAL_UNDEF(&columnLine);
+ ZVAL_UNDEF(&indexType);
+ ZVAL_UNDEF(&onDelete);
+ ZVAL_UNDEF(&onUpdate);
+ ZVAL_UNDEF(&defaultValue);
+ ZVAL_UNDEF(&upperDefaultValue);
ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_86);
+ ZVAL_UNDEF(&_87);
+ ZVAL_UNDEF(&_0$$5);
+ ZVAL_UNDEF(&_1$$6);
+ ZVAL_UNDEF(&_4$$7);
+ ZVAL_UNDEF(&_5$$7);
+ ZVAL_UNDEF(&_7$$7);
+ ZVAL_UNDEF(&_8$$7);
+ ZVAL_UNDEF(&_19$$7);
+ ZVAL_UNDEF(&_20$$7);
+ ZVAL_UNDEF(&_21$$7);
+ ZVAL_UNDEF(&_12$$10);
+ ZVAL_UNDEF(&_14$$11);
+ ZVAL_UNDEF(&_15$$12);
+ ZVAL_UNDEF(&_16$$12);
+ ZVAL_UNDEF(&_18$$12);
+ ZVAL_UNDEF(&_22$$15);
+ ZVAL_UNDEF(&_23$$15);
+ ZVAL_UNDEF(&_24$$16);
+ ZVAL_UNDEF(&_25$$16);
+ ZVAL_UNDEF(&_26$$16);
+ ZVAL_UNDEF(&_27$$16);
+ ZVAL_UNDEF(&_36$$16);
+ ZVAL_UNDEF(&_37$$16);
+ ZVAL_UNDEF(&_38$$16);
+ ZVAL_UNDEF(&_31$$19);
+ ZVAL_UNDEF(&_32$$20);
+ ZVAL_UNDEF(&_33$$21);
+ ZVAL_UNDEF(&_34$$21);
+ ZVAL_UNDEF(&_35$$21);
+ ZVAL_UNDEF(&_39$$24);
+ ZVAL_UNDEF(&_40$$24);
+ ZVAL_UNDEF(&_42$$25);
+ ZVAL_UNDEF(&_43$$27);
+ ZVAL_UNDEF(&_44$$27);
+ ZVAL_UNDEF(&_46$$27);
+ ZVAL_UNDEF(&_47$$29);
+ ZVAL_UNDEF(&_48$$29);
+ ZVAL_UNDEF(&_49$$29);
+ ZVAL_UNDEF(&_50$$30);
+ ZVAL_UNDEF(&_51$$30);
+ ZVAL_UNDEF(&_52$$30);
+ ZVAL_UNDEF(&_53$$32);
+ ZVAL_UNDEF(&_54$$32);
+ ZVAL_UNDEF(&_55$$32);
+ ZVAL_UNDEF(&_56$$34);
+ ZVAL_UNDEF(&_57$$34);
+ ZVAL_UNDEF(&_58$$34);
+ ZVAL_UNDEF(&_59$$35);
+ ZVAL_UNDEF(&_60$$35);
+ ZVAL_UNDEF(&_61$$35);
+ ZVAL_UNDEF(&_63$$36);
+ ZVAL_UNDEF(&_64$$37);
+ ZVAL_UNDEF(&_65$$37);
+ ZVAL_UNDEF(&_66$$37);
+ ZVAL_UNDEF(&_67$$37);
+ ZVAL_UNDEF(&_68$$37);
+ ZVAL_UNDEF(&_69$$37);
+ ZVAL_UNDEF(&_70$$37);
+ ZVAL_UNDEF(&_71$$37);
+ ZVAL_UNDEF(&_72$$37);
+ ZVAL_UNDEF(&_73$$38);
+ ZVAL_UNDEF(&_74$$39);
+ ZVAL_UNDEF(&_75$$40);
+ ZVAL_UNDEF(&_76$$40);
+ ZVAL_UNDEF(&_77$$40);
+ ZVAL_UNDEF(&_78$$40);
+ ZVAL_UNDEF(&_79$$40);
+ ZVAL_UNDEF(&_80$$40);
+ ZVAL_UNDEF(&_81$$40);
+ ZVAL_UNDEF(&_82$$40);
+ ZVAL_UNDEF(&_83$$40);
+ ZVAL_UNDEF(&_84$$41);
+ ZVAL_UNDEF(&_85$$42);
+ ZVAL_UNDEF(&_88$$43);
+ ZVAL_UNDEF(&_89$$43);
+ ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&createLines);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(issuer)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_ARRAY(definition)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &issuer_param);
- if (UNEXPECTED(Z_TYPE_P(issuer_param) != IS_STRING && Z_TYPE_P(issuer_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'issuer' must be of the type string"));
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &definition_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(issuer_param) == IS_STRING)) {
- zephir_get_strval(&issuer, issuer_param);
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&issuer);
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
}
+ ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_1, &_0, "getclaims", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "iss");
- ZEPHIR_CALL_METHOD(&_2, &_1, "get", NULL, 0, &_3);
- zephir_check_call_status();
- zephir_cast_to_string(&_4, &_2);
- if (!ZEPHIR_IS_IDENTICAL(&issuer, &_4)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Validation: incorrect issuer", "phalcon/Security/JWT/Validator.zep", 142);
+ ZEPHIR_OBS_VAR(&columns);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'columns' is required in the definition array", "phalcon/Db/Dialect/Mysql.zep", 151);
return;
}
- RETURN_THIS();
+ ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&temporary);
+ ZVAL_BOOL(&temporary, 0);
+ ZEPHIR_OBS_VAR(&options);
+ if (zephir_array_isset_string_fetch(&options, &definition, SL("options"), 0)) {
+ ZEPHIR_OBS_NVAR(&temporary);
+ zephir_array_isset_string_fetch(&temporary, &options, SL("temporary"), 0);
+ }
+ if (zephir_is_true(&temporary)) {
+ ZEPHIR_INIT_VAR(&_0$$5);
+ ZEPHIR_CONCAT_SVS(&_0$$5, "CREATE TEMPORARY TABLE ", &table, " (\n\t");
+ zephir_get_strval(&sql, &_0$$5);
+ } else {
+ ZEPHIR_INIT_VAR(&_1$$6);
+ ZEPHIR_CONCAT_SVS(&_1$$6, "CREATE TABLE ", &table, " (\n\t");
+ zephir_get_strval(&sql, &_1$$6);
+ }
+ ZEPHIR_INIT_VAR(&createLines);
+ array_init(&createLines);
+ zephir_is_iterable(&columns, 0, "phalcon/Db/Dialect/Mysql.zep", 228);
+ if (Z_TYPE_P(&columns) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&columns), _2)
+ {
+ ZEPHIR_INIT_NVAR(&column);
+ ZVAL_COPY(&column, _2);
+ ZEPHIR_CALL_METHOD(&_4$$7, &column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_5$$7, this_ptr, "getcolumndefinition", &_6, 0, &column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&columnLine);
+ ZEPHIR_CONCAT_SVSV(&columnLine, "`", &_4$$7, "` ", &_5$$7);
+ ZEPHIR_CALL_METHOD(&_7$$7, &column, "isnotnull", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_7$$7)) {
+ zephir_concat_self_str(&columnLine, SL(" NOT NULL"));
+ } else {
+ zephir_concat_self_str(&columnLine, SL(" NULL"));
+ }
+ ZEPHIR_CALL_METHOD(&_8$$7, &column, "hasdefault", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_8$$7)) {
+ ZEPHIR_CALL_METHOD(&defaultValue, &column, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&upperDefaultValue);
+ zephir_fast_strtoupper(&upperDefaultValue, &defaultValue);
+ _9$$10 = zephir_memnstr_str(&upperDefaultValue, SL("CURRENT_TIMESTAMP"), "phalcon/Db/Dialect/Mysql.zep", 194);
+ if (!(_9$$10)) {
+ _9$$10 = zephir_memnstr_str(&upperDefaultValue, SL("NULL"), "phalcon/Db/Dialect/Mysql.zep", 194);
+ }
+ _10$$10 = _9$$10;
+ if (!(_10$$10)) {
+ _10$$10 = Z_TYPE_P(&defaultValue) == IS_LONG;
+ }
+ _11$$10 = _10$$10;
+ if (!(_11$$10)) {
+ ZEPHIR_CALL_FUNCTION(&_12$$10, "is_float", &_13, 213, &defaultValue);
+ zephir_check_call_status();
+ _11$$10 = zephir_is_true(&_12$$10);
+ }
+ if (_11$$10) {
+ ZEPHIR_INIT_NVAR(&_14$$11);
+ ZEPHIR_CONCAT_SV(&_14$$11, " DEFAULT ", &defaultValue);
+ zephir_concat_self(&columnLine, &_14$$11);
+ } else {
+ ZEPHIR_INIT_NVAR(&_15$$12);
+ ZVAL_STRING(&_15$$12, "\"");
+ ZEPHIR_CALL_FUNCTION(&_16$$12, "addcslashes", &_17, 214, &defaultValue, &_15$$12);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_18$$12);
+ ZEPHIR_CONCAT_SVS(&_18$$12, " DEFAULT \"", &_16$$12, "\"");
+ zephir_concat_self(&columnLine, &_18$$12);
+ }
+ }
+ ZEPHIR_CALL_METHOD(&_19$$7, &column, "isautoincrement", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_19$$7)) {
+ zephir_concat_self_str(&columnLine, SL(" AUTO_INCREMENT"));
+ }
+ ZEPHIR_CALL_METHOD(&_20$$7, &column, "isprimary", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_20$$7)) {
+ zephir_concat_self_str(&columnLine, SL(" PRIMARY KEY"));
+ }
+ ZEPHIR_CALL_METHOD(&_21$$7, &column, "getcomment", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_21$$7)) {
+ ZEPHIR_CALL_METHOD(&_22$$15, &column, "getcomment", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_23$$15);
+ ZEPHIR_CONCAT_SVS(&_23$$15, " COMMENT '", &_22$$15, "'");
+ zephir_concat_self(&columnLine, &_23$$15);
+ }
+ zephir_array_append(&createLines, &columnLine, PH_SEPARATE, "phalcon/Db/Dialect/Mysql.zep", 222);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &columns, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3, &columns, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&column, &columns, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_24$$16, &column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_25$$16, this_ptr, "getcolumndefinition", &_6, 0, &column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&columnLine);
+ ZEPHIR_CONCAT_SVSV(&columnLine, "`", &_24$$16, "` ", &_25$$16);
+ ZEPHIR_CALL_METHOD(&_26$$16, &column, "isnotnull", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_26$$16)) {
+ zephir_concat_self_str(&columnLine, SL(" NOT NULL"));
+ } else {
+ zephir_concat_self_str(&columnLine, SL(" NULL"));
+ }
+ ZEPHIR_CALL_METHOD(&_27$$16, &column, "hasdefault", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_27$$16)) {
+ ZEPHIR_CALL_METHOD(&defaultValue, &column, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&upperDefaultValue);
+ zephir_fast_strtoupper(&upperDefaultValue, &defaultValue);
+ _28$$19 = zephir_memnstr_str(&upperDefaultValue, SL("CURRENT_TIMESTAMP"), "phalcon/Db/Dialect/Mysql.zep", 194);
+ if (!(_28$$19)) {
+ _28$$19 = zephir_memnstr_str(&upperDefaultValue, SL("NULL"), "phalcon/Db/Dialect/Mysql.zep", 194);
+ }
+ _29$$19 = _28$$19;
+ if (!(_29$$19)) {
+ _29$$19 = Z_TYPE_P(&defaultValue) == IS_LONG;
+ }
+ _30$$19 = _29$$19;
+ if (!(_30$$19)) {
+ ZEPHIR_CALL_FUNCTION(&_31$$19, "is_float", &_13, 213, &defaultValue);
+ zephir_check_call_status();
+ _30$$19 = zephir_is_true(&_31$$19);
+ }
+ if (_30$$19) {
+ ZEPHIR_INIT_NVAR(&_32$$20);
+ ZEPHIR_CONCAT_SV(&_32$$20, " DEFAULT ", &defaultValue);
+ zephir_concat_self(&columnLine, &_32$$20);
+ } else {
+ ZEPHIR_INIT_NVAR(&_33$$21);
+ ZVAL_STRING(&_33$$21, "\"");
+ ZEPHIR_CALL_FUNCTION(&_34$$21, "addcslashes", &_17, 214, &defaultValue, &_33$$21);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_35$$21);
+ ZEPHIR_CONCAT_SVS(&_35$$21, " DEFAULT \"", &_34$$21, "\"");
+ zephir_concat_self(&columnLine, &_35$$21);
+ }
+ }
+ ZEPHIR_CALL_METHOD(&_36$$16, &column, "isautoincrement", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_36$$16)) {
+ zephir_concat_self_str(&columnLine, SL(" AUTO_INCREMENT"));
+ }
+ ZEPHIR_CALL_METHOD(&_37$$16, &column, "isprimary", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_37$$16)) {
+ zephir_concat_self_str(&columnLine, SL(" PRIMARY KEY"));
+ }
+ ZEPHIR_CALL_METHOD(&_38$$16, &column, "getcomment", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_38$$16)) {
+ ZEPHIR_CALL_METHOD(&_39$$24, &column, "getcomment", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_40$$24);
+ ZEPHIR_CONCAT_SVS(&_40$$24, " COMMENT '", &_39$$24, "'");
+ zephir_concat_self(&columnLine, &_40$$24);
+ }
+ zephir_array_append(&createLines, &columnLine, PH_SEPARATE, "phalcon/Db/Dialect/Mysql.zep", 222);
+ ZEPHIR_CALL_METHOD(NULL, &columns, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&column);
+ ZEPHIR_OBS_VAR(&indexes);
+ if (zephir_array_isset_string_fetch(&indexes, &definition, SL("indexes"), 0)) {
+ zephir_is_iterable(&indexes, 0, "phalcon/Db/Dialect/Mysql.zep", 248);
+ if (Z_TYPE_P(&indexes) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&indexes), _41$$25)
+ {
+ ZEPHIR_INIT_NVAR(&index);
+ ZVAL_COPY(&index, _41$$25);
+ ZEPHIR_CALL_METHOD(&indexName, &index, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&indexType, &index, "gettype", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_STRING(&indexName, "PRIMARY")) {
+ ZEPHIR_CALL_METHOD(&_44$$27, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_43$$27, this_ptr, "getcolumnlist", &_45, 67, &_44$$27);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_46$$27);
+ ZEPHIR_CONCAT_SVS(&_46$$27, "PRIMARY KEY (", &_43$$27, ")");
+ zephir_get_strval(&indexSql, &_46$$27);
+ } else {
+ if (!(ZEPHIR_IS_EMPTY(&indexType))) {
+ ZEPHIR_CALL_METHOD(&_48$$29, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_47$$29, this_ptr, "getcolumnlist", &_45, 67, &_48$$29);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_49$$29);
+ ZEPHIR_CONCAT_VSVSVS(&_49$$29, &indexType, " KEY `", &indexName, "` (", &_47$$29, ")");
+ zephir_get_strval(&indexSql, &_49$$29);
+ } else {
+ ZEPHIR_CALL_METHOD(&_51$$30, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_50$$30, this_ptr, "getcolumnlist", &_45, 67, &_51$$30);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_52$$30);
+ ZEPHIR_CONCAT_SVSVS(&_52$$30, "KEY `", &indexName, "` (", &_50$$30, ")");
+ zephir_get_strval(&indexSql, &_52$$30);
+ }
+ }
+ zephir_array_append(&createLines, &indexSql, PH_SEPARATE, "phalcon/Db/Dialect/Mysql.zep", 246);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &indexes, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_42$$25, &indexes, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_42$$25)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&index, &indexes, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&indexName, &index, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&indexType, &index, "gettype", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_STRING(&indexName, "PRIMARY")) {
+ ZEPHIR_CALL_METHOD(&_54$$32, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_53$$32, this_ptr, "getcolumnlist", &_45, 67, &_54$$32);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_55$$32);
+ ZEPHIR_CONCAT_SVS(&_55$$32, "PRIMARY KEY (", &_53$$32, ")");
+ zephir_get_strval(&indexSql, &_55$$32);
+ } else {
+ if (!(ZEPHIR_IS_EMPTY(&indexType))) {
+ ZEPHIR_CALL_METHOD(&_57$$34, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_56$$34, this_ptr, "getcolumnlist", &_45, 67, &_57$$34);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_58$$34);
+ ZEPHIR_CONCAT_VSVSVS(&_58$$34, &indexType, " KEY `", &indexName, "` (", &_56$$34, ")");
+ zephir_get_strval(&indexSql, &_58$$34);
+ } else {
+ ZEPHIR_CALL_METHOD(&_60$$35, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_59$$35, this_ptr, "getcolumnlist", &_45, 67, &_60$$35);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_61$$35);
+ ZEPHIR_CONCAT_SVSVS(&_61$$35, "KEY `", &indexName, "` (", &_59$$35, ")");
+ zephir_get_strval(&indexSql, &_61$$35);
+ }
+ }
+ zephir_array_append(&createLines, &indexSql, PH_SEPARATE, "phalcon/Db/Dialect/Mysql.zep", 246);
+ ZEPHIR_CALL_METHOD(NULL, &indexes, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&index);
+ }
+ ZEPHIR_OBS_VAR(&references);
+ if (zephir_array_isset_string_fetch(&references, &definition, SL("references"), 0)) {
+ zephir_is_iterable(&references, 0, "phalcon/Db/Dialect/Mysql.zep", 270);
+ if (Z_TYPE_P(&references) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&references), _62$$36)
+ {
+ ZEPHIR_INIT_NVAR(&reference);
+ ZVAL_COPY(&reference, _62$$36);
+ ZEPHIR_CALL_METHOD(&_64$$37, &reference, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_66$$37, &reference, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_65$$37, this_ptr, "getcolumnlist", &_45, 67, &_66$$37);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_68$$37, &reference, "getreferencedtable", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_69$$37, &reference, "getreferencedschema", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_67$$37, this_ptr, "preparetable", NULL, 0, &_68$$37, &_69$$37);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_71$$37, &reference, "getreferencedcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_70$$37, this_ptr, "getcolumnlist", &_45, 67, &_71$$37);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_72$$37);
+ ZEPHIR_CONCAT_SVSVSSVSVS(&_72$$37, "CONSTRAINT `", &_64$$37, "` FOREIGN KEY (", &_65$$37, ")", " REFERENCES ", &_67$$37, " (", &_70$$37, ")");
+ zephir_get_strval(&referenceSql, &_72$$37);
+ ZEPHIR_CALL_METHOD(&onDelete, &reference, "getondelete", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onDelete))) {
+ ZEPHIR_INIT_NVAR(&_73$$38);
+ ZEPHIR_CONCAT_SV(&_73$$38, " ON DELETE ", &onDelete);
+ zephir_concat_self(&referenceSql, &_73$$38);
+ }
+ ZEPHIR_CALL_METHOD(&onUpdate, &reference, "getonupdate", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onUpdate))) {
+ ZEPHIR_INIT_NVAR(&_74$$39);
+ ZEPHIR_CONCAT_SV(&_74$$39, " ON UPDATE ", &onUpdate);
+ zephir_concat_self(&referenceSql, &_74$$39);
+ }
+ zephir_array_append(&createLines, &referenceSql, PH_SEPARATE, "phalcon/Db/Dialect/Mysql.zep", 268);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &references, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_63$$36, &references, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_63$$36)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&reference, &references, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_75$$40, &reference, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_77$$40, &reference, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_76$$40, this_ptr, "getcolumnlist", &_45, 67, &_77$$40);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_79$$40, &reference, "getreferencedtable", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_80$$40, &reference, "getreferencedschema", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_78$$40, this_ptr, "preparetable", NULL, 0, &_79$$40, &_80$$40);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_82$$40, &reference, "getreferencedcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_81$$40, this_ptr, "getcolumnlist", &_45, 67, &_82$$40);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_83$$40);
+ ZEPHIR_CONCAT_SVSVSSVSVS(&_83$$40, "CONSTRAINT `", &_75$$40, "` FOREIGN KEY (", &_76$$40, ")", " REFERENCES ", &_78$$40, " (", &_81$$40, ")");
+ zephir_get_strval(&referenceSql, &_83$$40);
+ ZEPHIR_CALL_METHOD(&onDelete, &reference, "getondelete", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onDelete))) {
+ ZEPHIR_INIT_NVAR(&_84$$41);
+ ZEPHIR_CONCAT_SV(&_84$$41, " ON DELETE ", &onDelete);
+ zephir_concat_self(&referenceSql, &_84$$41);
+ }
+ ZEPHIR_CALL_METHOD(&onUpdate, &reference, "getonupdate", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onUpdate))) {
+ ZEPHIR_INIT_NVAR(&_85$$42);
+ ZEPHIR_CONCAT_SV(&_85$$42, " ON UPDATE ", &onUpdate);
+ zephir_concat_self(&referenceSql, &_85$$42);
+ }
+ zephir_array_append(&createLines, &referenceSql, PH_SEPARATE, "phalcon/Db/Dialect/Mysql.zep", 268);
+ ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&reference);
+ }
+ ZEPHIR_INIT_VAR(&_86);
+ zephir_fast_join_str(&_86, SL(",\n\t"), &createLines);
+ ZEPHIR_INIT_VAR(&_87);
+ ZEPHIR_CONCAT_VS(&_87, &_86, "\n)");
+ zephir_concat_self(&sql, &_87);
+ if (zephir_array_isset_string(&definition, SL("options"))) {
+ ZEPHIR_CALL_METHOD(&_88$$43, this_ptr, "gettableoptions", NULL, 0, &definition);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_89$$43);
+ ZEPHIR_CONCAT_SV(&_89$$43, " ", &_88$$43);
+ zephir_concat_self(&sql, &_89$$43);
+ }
+ RETURN_CTOR(&sql);
}
-static PHP_METHOD(Phalcon_Security_JWT_Validator, validateNotBefore)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createView)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *timestamp_param = NULL, _0, _1, _2, _3, _4;
- zend_long timestamp, ZEPHIR_LAST_CALL_STATUS;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval definition;
+ zval *viewName_param = NULL, *definition_param = NULL, *schemaName_param = NULL, viewSql, _0;
+ zval viewName, schemaName;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&viewName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&viewSql);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&definition);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(timestamp)
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(viewName)
+ Z_PARAM_ARRAY(definition)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, ×tamp_param);
- timestamp = zephir_get_intval(timestamp_param);
+ zephir_fetch_params(1, 2, 1, &viewName_param, &definition_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) {
+ zephir_get_strval(&viewName, viewName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&viewName);
+ }
+ ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ zephir_get_strval(&schemaName, schemaName_param);
+ }
- ZVAL_LONG(&_1, timestamp);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "gettimestamp", NULL, 0, &_1);
- zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_2, &_1, "getclaims", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_4);
- ZVAL_STRING(&_4, "nbf");
- ZEPHIR_CALL_METHOD(&_3, &_2, "get", NULL, 0, &_4);
- zephir_check_call_status();
- if (ZEPHIR_LE_LONG(&_0, zephir_get_intval(&_3))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Validation: the token cannot be used yet (not before)", "phalcon/Security/JWT/Validator.zep", 159);
+ ZEPHIR_OBS_VAR(&viewSql);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&viewSql, &definition, SL("sql"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'sql' is required in the definition array", "phalcon/Db/Dialect/Mysql.zep", 291);
return;
}
- RETURN_THIS();
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &viewName, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SVSV(return_value, "CREATE VIEW ", &_0, " AS ", &viewSql);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Security_JWT_Validator, validateSignature)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, describeColumns)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval passphrase;
- zval *signer, signer_sub, *passphrase_param = NULL, _0, _1, _2, _3, _4, _5;
+ zval *table_param = NULL, *schema_param = NULL, _0;
+ zval table, schema;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&signer_sub);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&passphrase);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(signer, phalcon_security_jwt_signer_signerinterface_ce)
- Z_PARAM_STR(passphrase)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &signer, &passphrase_param);
- zephir_get_strval(&passphrase, passphrase_param);
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
+ }
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
+ }
- zephir_read_property(&_1, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_2, &_1, "getsignature", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_3, &_2, "gethash", NULL, 0);
- zephir_check_call_status();
- zephir_read_property(&_4, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_5, &_4, "getpayload", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_0, signer, "verify", NULL, 0, &_3, &_5, &passphrase);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &table, &schema);
zephir_check_call_status();
- if (!zephir_is_true(&_0)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Validation: the signature does not match", "phalcon/Security/JWT/Validator.zep", 183);
- return;
- }
- RETURN_THIS();
+ ZEPHIR_CONCAT_SV(return_value, "SHOW FULL COLUMNS FROM ", &_0);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Security_JWT_Validator, getTimestamp)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, describeIndexes)
{
- zval *timestamp_param = NULL, _0;
- zend_long timestamp;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *table_param = NULL, *schema_param = NULL, _0;
+ zval table, schema;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(timestamp)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(1, 0, ×tamp_param);
- timestamp = zephir_get_intval(timestamp_param);
-
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("timeShift"), PH_NOISY_CC | PH_READONLY);
- RETURN_LONG((timestamp + zephir_get_numberval(&_0)));
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Exceptions_UnsupportedAlgorithmException)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Security\\JWT\\Exceptions, UnsupportedAlgorithmException, phalcon, security_jwt_exceptions_unsupportedalgorithmexception, zend_ce_exception, NULL, 0);
-
- zend_class_implements(phalcon_security_jwt_exceptions_unsupportedalgorithmexception_ce, 1, zend_ce_throwable);
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Exceptions_ValidatorException)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Security\\JWT\\Exceptions, ValidatorException, phalcon, security_jwt_exceptions_validatorexception, zend_ce_exception, NULL, 0);
-
- zend_class_implements(phalcon_security_jwt_exceptions_validatorexception_ce, 1, zend_ce_throwable);
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Signer_AbstractSigner)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Security\\JWT\\Signer, AbstractSigner, phalcon, security_jwt_signer_abstractsigner, phalcon_security_jwt_signer_abstractsigner_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
-
- zend_declare_property_null(phalcon_security_jwt_signer_abstractsigner_ce, SL("algorithm"), ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_security_jwt_signer_abstractsigner_ce, 1, phalcon_security_jwt_signer_signerinterface_ce);
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Signer_AbstractSigner, getAlgorithm)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "algorithm");
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
+ }
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
+ }
-ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Signer_Hmac)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Security\\JWT\\Signer, Hmac, phalcon, security_jwt_signer_hmac, phalcon_security_jwt_signer_abstractsigner_ce, phalcon_security_jwt_signer_hmac_method_entry, 0);
- return SUCCESS;
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &table, &schema);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SV(return_value, "SHOW INDEXES FROM ", &_0);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Security_JWT_Signer_Hmac, __construct)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, describeReferences)
{
- zval supported;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *algo_param = NULL;
- zval algo;
+ zval *table_param = NULL, *schema_param = NULL;
+ zval table, schema, sql, _0$$3, _1$$4;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&algo);
- ZVAL_UNDEF(&supported);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
Z_PARAM_OPTIONAL
- Z_PARAM_STR(algo)
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &algo_param);
- if (!algo_param) {
- ZEPHIR_INIT_VAR(&algo);
- ZVAL_STRING(&algo, "sha512");
- } else {
- if (UNEXPECTED(Z_TYPE_P(algo_param) != IS_STRING && Z_TYPE_P(algo_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'algo' must be of the type string"));
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(algo_param) == IS_STRING)) {
- zephir_get_strval(&algo, algo_param);
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
} else {
- ZEPHIR_INIT_VAR(&algo);
+ ZEPHIR_INIT_VAR(&table);
}
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
}
- ZEPHIR_INIT_VAR(&supported);
- zephir_create_array(&supported, 3, 0);
- add_assoc_long_ex(&supported, SL("sha512"), 1);
- add_assoc_long_ex(&supported, SL("sha384"), 1);
- add_assoc_long_ex(&supported, SL("sha256"), 1);
- if (!(zephir_array_isset(&supported, &algo))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_unsupportedalgorithmexception_ce, "Unsupported HMAC algorithm", "phalcon/Security/JWT/Signer/Hmac.zep", 40);
- return;
+ ZEPHIR_INIT_VAR(&sql);
+ ZVAL_STRING(&sql, "SELECT DISTINCT KCU.TABLE_NAME, KCU.COLUMN_NAME, KCU.CONSTRAINT_NAME, KCU.REFERENCED_TABLE_SCHEMA, KCU.REFERENCED_TABLE_NAME, KCU.REFERENCED_COLUMN_NAME, RC.UPDATE_RULE, RC.DELETE_RULE FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS KCU LEFT JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS AS RC ON RC.CONSTRAINT_NAME = KCU.CONSTRAINT_NAME AND RC.CONSTRAINT_SCHEMA = KCU.CONSTRAINT_SCHEMA WHERE KCU.REFERENCED_TABLE_NAME IS NOT NULL AND ");
+ if (!(ZEPHIR_IS_EMPTY(&schema))) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZEPHIR_CONCAT_SVSVS(&_0$$3, "KCU.CONSTRAINT_SCHEMA = '", &schema, "' AND KCU.TABLE_NAME = '", &table, "'");
+ zephir_concat_self(&sql, &_0$$3);
+ } else {
+ ZEPHIR_INIT_VAR(&_1$$4);
+ ZEPHIR_CONCAT_SVS(&_1$$4, "KCU.CONSTRAINT_SCHEMA = DATABASE() AND KCU.TABLE_NAME = '", &table, "'");
+ zephir_concat_self(&sql, &_1$$4);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("algorithm"), &algo);
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Signer_Hmac, getAlgHeader)
-{
- zval _0, _1, _2, _3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
-
-
- ZEPHIR_MM_GROW();
-
- ZEPHIR_INIT_VAR(&_0);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("algorithm"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "sha");
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "");
- zephir_fast_str_replace(&_0, &_2, &_3, &_1);
- ZEPHIR_CONCAT_SV(return_value, "HS", &_0);
- RETURN_MM();
+ RETURN_CTOR(&sql);
}
-static PHP_METHOD(Phalcon_Security_JWT_Signer_Hmac, sign)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropColumn)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *payload_param = NULL, *passphrase_param = NULL;
- zval payload, passphrase;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *columnName_param = NULL, _0;
+ zval tableName, schemaName, columnName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&payload);
- ZVAL_UNDEF(&passphrase);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&columnName);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(payload)
- Z_PARAM_STR(passphrase)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_STR(columnName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &payload_param, &passphrase_param);
- if (UNEXPECTED(Z_TYPE_P(payload_param) != IS_STRING && Z_TYPE_P(payload_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'payload' must be of the type string"));
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &columnName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(payload_param) == IS_STRING)) {
- zephir_get_strval(&payload, payload_param);
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&payload);
+ ZEPHIR_INIT_VAR(&tableName);
}
- if (UNEXPECTED(Z_TYPE_P(passphrase_param) != IS_STRING && Z_TYPE_P(passphrase_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'passphrase' must be of the type string"));
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(passphrase_param) == IS_STRING)) {
- zephir_get_strval(&passphrase, passphrase_param);
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
} else {
- ZEPHIR_INIT_VAR(&passphrase);
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(columnName_param) != IS_STRING && Z_TYPE_P(columnName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'columnName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(columnName_param) == IS_STRING)) {
+ zephir_get_strval(&columnName, columnName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&columnName);
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethash", NULL, 0, &payload, &passphrase);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
zephir_check_call_status();
+ ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " DROP COLUMN `", &columnName, "`");
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Security_JWT_Signer_Hmac, verify)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropForeignKey)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *source_param = NULL, *payload_param = NULL, *passphrase_param = NULL, _0;
- zval source, payload, passphrase;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *referenceName_param = NULL, _0;
+ zval tableName, schemaName, referenceName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&source);
- ZVAL_UNDEF(&payload);
- ZVAL_UNDEF(&passphrase);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&referenceName);
ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(3, 3)
- Z_PARAM_STR(source)
- Z_PARAM_STR(payload)
- Z_PARAM_STR(passphrase)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_STR(referenceName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 3, 0, &source_param, &payload_param, &passphrase_param);
- if (UNEXPECTED(Z_TYPE_P(source_param) != IS_STRING && Z_TYPE_P(source_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'source' must be of the type string"));
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &referenceName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(source_param) == IS_STRING)) {
- zephir_get_strval(&source, source_param);
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&source);
+ ZEPHIR_INIT_VAR(&tableName);
}
- if (UNEXPECTED(Z_TYPE_P(payload_param) != IS_STRING && Z_TYPE_P(payload_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'payload' must be of the type string"));
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(payload_param) == IS_STRING)) {
- zephir_get_strval(&payload, payload_param);
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
} else {
- ZEPHIR_INIT_VAR(&payload);
+ ZEPHIR_INIT_VAR(&schemaName);
}
- if (UNEXPECTED(Z_TYPE_P(passphrase_param) != IS_STRING && Z_TYPE_P(passphrase_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'passphrase' must be of the type string"));
+ if (UNEXPECTED(Z_TYPE_P(referenceName_param) != IS_STRING && Z_TYPE_P(referenceName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(passphrase_param) == IS_STRING)) {
- zephir_get_strval(&passphrase, passphrase_param);
+ if (EXPECTED(Z_TYPE_P(referenceName_param) == IS_STRING)) {
+ zephir_get_strval(&referenceName, referenceName_param);
} else {
- ZEPHIR_INIT_VAR(&passphrase);
+ ZEPHIR_INIT_VAR(&referenceName);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "gethash", NULL, 0, &payload, &passphrase);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
zephir_check_call_status();
- RETURN_MM_BOOL(zephir_hash_equals(&source, &_0));
+ ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " DROP FOREIGN KEY `", &referenceName, "`");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Security_JWT_Signer_Hmac, getHash)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropIndex)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *payload_param = NULL, *passphrase_param = NULL, __$true, _0;
- zval payload, passphrase;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *indexName_param = NULL, _0;
+ zval tableName, schemaName, indexName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&payload);
- ZVAL_UNDEF(&passphrase);
- ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&indexName);
ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(payload)
- Z_PARAM_STR(passphrase)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_STR(indexName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &payload_param, &passphrase_param);
- if (UNEXPECTED(Z_TYPE_P(payload_param) != IS_STRING && Z_TYPE_P(payload_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'payload' must be of the type string"));
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &indexName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(payload_param) == IS_STRING)) {
- zephir_get_strval(&payload, payload_param);
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&payload);
+ ZEPHIR_INIT_VAR(&tableName);
}
- if (UNEXPECTED(Z_TYPE_P(passphrase_param) != IS_STRING && Z_TYPE_P(passphrase_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'passphrase' must be of the type string"));
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(passphrase_param) == IS_STRING)) {
- zephir_get_strval(&passphrase, passphrase_param);
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
} else {
- ZEPHIR_INIT_VAR(&passphrase);
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(indexName_param) != IS_STRING && Z_TYPE_P(indexName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'indexName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(indexName_param) == IS_STRING)) {
+ zephir_get_strval(&indexName, indexName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&indexName);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getalgorithm", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_FUNCTION("hash_hmac", NULL, 187, &_0, &payload, &passphrase, &__$true);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
zephir_check_call_status();
+ ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " DROP INDEX `", &indexName, "`");
RETURN_MM();
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Signer_None)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Security\\JWT\\Signer, None, phalcon, security_jwt_signer_none, phalcon_security_jwt_signer_none_method_entry, 0);
-
- zend_class_implements(phalcon_security_jwt_signer_none_ce, 1, phalcon_security_jwt_signer_signerinterface_ce);
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Signer_None, getAlgHeader)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_STRING("none");
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Signer_None, getAlgorithm)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_STRING("None");
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Signer_None, sign)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropPrimaryKey)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *payload_param = NULL, *passphrase_param = NULL;
- zval payload, passphrase;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, _0;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&payload);
- ZVAL_UNDEF(&passphrase);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(payload)
- Z_PARAM_STR(passphrase)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &payload_param, &passphrase_param);
- if (UNEXPECTED(Z_TYPE_P(payload_param) != IS_STRING && Z_TYPE_P(payload_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'payload' must be of the type string"));
+ zephir_fetch_params(1, 2, 0, &tableName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(payload_param) == IS_STRING)) {
- zephir_get_strval(&payload, payload_param);
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&payload);
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
}
- zephir_get_strval(&passphrase, passphrase_param);
- RETURN_MM_STRING("");
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SVS(return_value, "ALTER TABLE ", &_0, " DROP PRIMARY KEY");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Security_JWT_Signer_None, verify)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropTable)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *source_param = NULL, *payload_param = NULL, *passphrase_param = NULL, _0;
- zval source, payload, passphrase;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool ifExists;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, table;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&source);
- ZVAL_UNDEF(&payload);
- ZVAL_UNDEF(&passphrase);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&table);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(3, 3)
- Z_PARAM_STR(source)
- Z_PARAM_STR(payload)
- Z_PARAM_STR(passphrase)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
+ Z_PARAM_BOOL(ifExists)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 3, 0, &source_param, &payload_param, &passphrase_param);
- if (UNEXPECTED(Z_TYPE_P(source_param) != IS_STRING && Z_TYPE_P(source_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'source' must be of the type string"));
+ zephir_fetch_params(1, 1, 2, &tableName_param, &schemaName_param, &ifExists_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(source_param) == IS_STRING)) {
- zephir_get_strval(&source, source_param);
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&source);
- }
- if (UNEXPECTED(Z_TYPE_P(payload_param) != IS_STRING && Z_TYPE_P(payload_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'payload' must be of the type string"));
- RETURN_MM_NULL();
+ ZEPHIR_INIT_VAR(&tableName);
}
- if (EXPECTED(Z_TYPE_P(payload_param) == IS_STRING)) {
- zephir_get_strval(&payload, payload_param);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
} else {
- ZEPHIR_INIT_VAR(&payload);
+ zephir_get_strval(&schemaName, schemaName_param);
}
- if (UNEXPECTED(Z_TYPE_P(passphrase_param) != IS_STRING && Z_TYPE_P(passphrase_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'passphrase' must be of the type string"));
+ if (!ifExists_param) {
+ ifExists = 1;
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_TRUE && Z_TYPE_P(ifExists_param) != IS_FALSE)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be of the type bool"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(passphrase_param) == IS_STRING)) {
- zephir_get_strval(&passphrase, passphrase_param);
- } else {
- ZEPHIR_INIT_VAR(&passphrase);
+ ifExists = (Z_TYPE_P(ifExists_param) == IS_TRUE);
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "");
- RETURN_MM_BOOL(ZEPHIR_IS_IDENTICAL(&_0, &source));
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Signer_SignerInterface)
-{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Security\\JWT\\Signer, SignerInterface, phalcon, security_jwt_signer_signerinterface, phalcon_security_jwt_signer_signerinterface_method_entry);
-
- return SUCCESS;
-}
-
-ZEPHIR_DOC_METHOD(Phalcon_Security_JWT_Signer_SignerInterface, getAlgHeader);
-ZEPHIR_DOC_METHOD(Phalcon_Security_JWT_Signer_SignerInterface, getAlgorithm);
-ZEPHIR_DOC_METHOD(Phalcon_Security_JWT_Signer_SignerInterface, sign);
-ZEPHIR_DOC_METHOD(Phalcon_Security_JWT_Signer_SignerInterface, verify);
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Token_AbstractItem)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Security\\JWT\\Token, AbstractItem, phalcon, security_jwt_token_abstractitem, phalcon_security_jwt_token_abstractitem_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
-
- zend_declare_property_null(phalcon_security_jwt_token_abstractitem_ce, SL("data"), ZEND_ACC_PROTECTED);
- phalcon_security_jwt_token_abstractitem_ce->create_object = zephir_init_properties_Phalcon_Security_JWT_Token_AbstractItem;
-
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Token_AbstractItem, getEncoded)
-{
- zval _0, _1;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
-
-
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_1, &_0, SL("encoded"), PH_NOISY | PH_READONLY, "phalcon/Security/JWT/Token/AbstractItem.zep", 30);
- RETURN_CTORW(&_1);
-}
-
-zend_object *zephir_init_properties_Phalcon_Security_JWT_Token_AbstractItem(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_MM_GROW();
-
- {
- 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("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("data"), &_1$$3);
- }
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
+ ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ if (ifExists) {
+ ZEPHIR_CONCAT_SV(return_value, "DROP TABLE IF EXISTS ", &table);
+ RETURN_MM();
}
+ ZEPHIR_CONCAT_SV(return_value, "DROP TABLE ", &table);
+ RETURN_MM();
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Token_Enum)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Security\\JWT\\Token, Enum, phalcon, security_jwt_token_enum, NULL, 0);
-
- zephir_declare_class_constant_string(phalcon_security_jwt_token_enum_ce, SL("TYPE"), "typ");
-
- zephir_declare_class_constant_string(phalcon_security_jwt_token_enum_ce, SL("ALGO"), "alg");
-
- zephir_declare_class_constant_string(phalcon_security_jwt_token_enum_ce, SL("CONTENT_TYPE"), "cty");
-
- zephir_declare_class_constant_string(phalcon_security_jwt_token_enum_ce, SL("AUDIENCE"), "aud");
-
- zephir_declare_class_constant_string(phalcon_security_jwt_token_enum_ce, SL("EXPIRATION_TIME"), "exp");
-
- zephir_declare_class_constant_string(phalcon_security_jwt_token_enum_ce, SL("ID"), "jti");
-
- zephir_declare_class_constant_string(phalcon_security_jwt_token_enum_ce, SL("ISSUED_AT"), "iat");
-
- zephir_declare_class_constant_string(phalcon_security_jwt_token_enum_ce, SL("ISSUER"), "iss");
-
- zephir_declare_class_constant_string(phalcon_security_jwt_token_enum_ce, SL("NOT_BEFORE"), "nbf");
-
- zephir_declare_class_constant_string(phalcon_security_jwt_token_enum_ce, SL("SUBJECT"), "sub");
-
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Token_Item)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Security\\JWT\\Token, Item, phalcon, security_jwt_token_item, phalcon_security_jwt_token_abstractitem_ce, phalcon_security_jwt_token_item_method_entry, 0);
-
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Token_Item, __construct)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropView)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval encoded;
- zval *payload_param = NULL, *encoded_param = NULL, _0, _1;
- zval payload;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool ifExists;
+ zval *viewName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, view;
+ zval viewName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&payload);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&encoded);
+ ZVAL_UNDEF(&viewName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&view);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ARRAY(payload)
- Z_PARAM_STR(encoded)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(viewName)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
+ Z_PARAM_BOOL(ifExists)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &payload_param, &encoded_param);
- ZEPHIR_OBS_COPY_OR_DUP(&payload, payload_param);
- if (UNEXPECTED(Z_TYPE_P(encoded_param) != IS_STRING && Z_TYPE_P(encoded_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'encoded' must be of the type string"));
+ zephir_fetch_params(1, 1, 2, &viewName_param, &schemaName_param, &ifExists_param);
+ if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(encoded_param) == IS_STRING)) {
- zephir_get_strval(&encoded, encoded_param);
+ if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) {
+ zephir_get_strval(&viewName, viewName_param);
} else {
- ZEPHIR_INIT_VAR(&encoded);
+ ZEPHIR_INIT_VAR(&viewName);
+ }
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ zephir_get_strval(&schemaName, schemaName_param);
+ }
+ if (!ifExists_param) {
+ ifExists = 1;
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_TRUE && Z_TYPE_P(ifExists_param) != IS_FALSE)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be of the type bool"));
+ RETURN_MM_NULL();
+ }
+ ifExists = (Z_TYPE_P(ifExists_param) == IS_TRUE);
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "encoded");
- zephir_update_property_array(this_ptr, SL("data"), &_0, &encoded);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "payload");
- zephir_update_property_array(this_ptr, SL("data"), &_1, &payload);
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_CALL_METHOD(&view, this_ptr, "preparetable", NULL, 0, &viewName, &schemaName);
+ zephir_check_call_status();
+ if (ifExists) {
+ ZEPHIR_CONCAT_SV(return_value, "DROP VIEW IF EXISTS ", &view);
+ RETURN_MM();
+ }
+ ZEPHIR_CONCAT_SV(return_value, "DROP VIEW ", &view);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Security_JWT_Token_Item, get)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_41 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1, _2, _3;
- zval name;
+ zval *column, column_sub, columnType, columnSql, typeValues, _0$$3, _1$$3, _2$$3, _3$$5, _4$$11, _5$$15, _6$$17, _7$$18, _8$$18, _9$$18, _10$$20, _11$$20, _12$$20, _13$$22, _14$$24, _15$$24, _16$$24, _17$$26, _18$$26, _19$$26, _20$$36, _21$$36, _22$$36, _23$$40, _24$$40, _25$$40, _26$$44, _27$$46, _28$$47, _29$$49, _30$$52, _31$$52, _32$$52, _33$$56, _34$$59, _35$$59, _36$$59, value$$61, valueSql$$61, *_37$$61, _38$$61, _46$$61, _47$$61, _48$$61, _49$$61, _39$$62, _40$$62, _42$$62, _43$$63, _44$$63, _45$$63, _50$$64, _51$$64, _52$$64;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&columnType);
+ ZVAL_UNDEF(&columnSql);
+ ZVAL_UNDEF(&typeValues);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&_4$$11);
+ ZVAL_UNDEF(&_5$$15);
+ ZVAL_UNDEF(&_6$$17);
+ ZVAL_UNDEF(&_7$$18);
+ ZVAL_UNDEF(&_8$$18);
+ ZVAL_UNDEF(&_9$$18);
+ ZVAL_UNDEF(&_10$$20);
+ ZVAL_UNDEF(&_11$$20);
+ ZVAL_UNDEF(&_12$$20);
+ ZVAL_UNDEF(&_13$$22);
+ ZVAL_UNDEF(&_14$$24);
+ ZVAL_UNDEF(&_15$$24);
+ ZVAL_UNDEF(&_16$$24);
+ ZVAL_UNDEF(&_17$$26);
+ ZVAL_UNDEF(&_18$$26);
+ ZVAL_UNDEF(&_19$$26);
+ ZVAL_UNDEF(&_20$$36);
+ ZVAL_UNDEF(&_21$$36);
+ ZVAL_UNDEF(&_22$$36);
+ ZVAL_UNDEF(&_23$$40);
+ ZVAL_UNDEF(&_24$$40);
+ ZVAL_UNDEF(&_25$$40);
+ ZVAL_UNDEF(&_26$$44);
+ ZVAL_UNDEF(&_27$$46);
+ ZVAL_UNDEF(&_28$$47);
+ ZVAL_UNDEF(&_29$$49);
+ ZVAL_UNDEF(&_30$$52);
+ ZVAL_UNDEF(&_31$$52);
+ ZVAL_UNDEF(&_32$$52);
+ ZVAL_UNDEF(&_33$$56);
+ ZVAL_UNDEF(&_34$$59);
+ ZVAL_UNDEF(&_35$$59);
+ ZVAL_UNDEF(&_36$$59);
+ ZVAL_UNDEF(&value$$61);
+ ZVAL_UNDEF(&valueSql$$61);
+ ZVAL_UNDEF(&_38$$61);
+ ZVAL_UNDEF(&_46$$61);
+ ZVAL_UNDEF(&_47$$61);
+ ZVAL_UNDEF(&_48$$61);
+ ZVAL_UNDEF(&_49$$61);
+ ZVAL_UNDEF(&_39$$62);
+ ZVAL_UNDEF(&_40$$62);
+ ZVAL_UNDEF(&_42$$62);
+ ZVAL_UNDEF(&_43$$63);
+ ZVAL_UNDEF(&_44$$63);
+ ZVAL_UNDEF(&_45$$63);
+ ZVAL_UNDEF(&_50$$64);
+ ZVAL_UNDEF(&_51$$64);
+ ZVAL_UNDEF(&_52$$64);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(name)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &name_param, &defaultValue);
- 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 (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
- }
+ zephir_fetch_params(1, 1, 0, &column);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &name);
+ ZEPHIR_CALL_METHOD(&columnSql, this_ptr, "checkcolumntypesql", NULL, 0, column);
zephir_check_call_status();
- if (!(zephir_is_true(&_0))) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
- }
- zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_2, &_1, SL("payload"), PH_NOISY | PH_READONLY, "phalcon/Security/JWT/Token/Item.zep", 42);
- zephir_array_fetch(&_3, &_2, &name, PH_NOISY | PH_READONLY, "phalcon/Security/JWT/Token/Item.zep", 42);
- RETURN_CTOR(&_3);
-}
+ ZEPHIR_CALL_METHOD(&columnType, this_ptr, "checkcolumntype", NULL, 0, column);
+ zephir_check_call_status();
+ do {
+ if (ZEPHIR_IS_LONG(&columnType, 14)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("BIGINT"));
+ }
+ ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "checkcolumnunsigned", NULL, 215, column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_VV(&_2$$3, &_0$$3, &_1$$3);
+ zephir_concat_self(&columnSql, &_2$$3);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 19)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("BIT"));
+ }
+ ZEPHIR_CALL_METHOD(&_3$$5, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ zephir_concat_self(&columnSql, &_3$$5);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 11)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("BLOB"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 8)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("TINYINT(1)"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 5)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("CHAR"));
+ }
+ ZEPHIR_CALL_METHOD(&_4$$11, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ zephir_concat_self(&columnSql, &_4$$11);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 1)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("DATE"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 4)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("DATETIME"));
+ }
+ ZEPHIR_CALL_METHOD(&_5$$15, column, "getsize", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_GT_LONG(&_5$$15, 0)) {
+ ZEPHIR_CALL_METHOD(&_6$$17, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ zephir_concat_self(&columnSql, &_6$$17);
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 3)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("DECIMAL"));
+ }
+ ZEPHIR_CALL_METHOD(&_7$$18, this_ptr, "getcolumnsizeandscale", NULL, 0, column);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_8$$18, this_ptr, "checkcolumnunsigned", NULL, 215, column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_9$$18);
+ ZEPHIR_CONCAT_VV(&_9$$18, &_7$$18, &_8$$18);
+ zephir_concat_self(&columnSql, &_9$$18);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 9)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("DOUBLE"));
+ }
+ ZEPHIR_CALL_METHOD(&_10$$20, this_ptr, "checkcolumnsizeandscale", NULL, 216, column);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_11$$20, this_ptr, "checkcolumnunsigned", NULL, 215, column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_12$$20);
+ ZEPHIR_CONCAT_VV(&_12$$20, &_10$$20, &_11$$20);
+ zephir_concat_self(&columnSql, &_12$$20);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 18)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("ENUM"));
+ }
+ ZEPHIR_CALL_METHOD(&_13$$22, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ zephir_concat_self(&columnSql, &_13$$22);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 7)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("FLOAT"));
+ }
+ ZEPHIR_CALL_METHOD(&_14$$24, this_ptr, "checkcolumnsizeandscale", NULL, 216, column);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_15$$24, this_ptr, "checkcolumnunsigned", NULL, 215, column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_16$$24);
+ ZEPHIR_CONCAT_VV(&_16$$24, &_14$$24, &_15$$24);
+ zephir_concat_self(&columnSql, &_16$$24);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 0)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("INT"));
+ }
+ ZEPHIR_CALL_METHOD(&_17$$26, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_18$$26, this_ptr, "checkcolumnunsigned", NULL, 215, column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_19$$26);
+ ZEPHIR_CONCAT_VV(&_19$$26, &_17$$26, &_18$$26);
+ zephir_concat_self(&columnSql, &_19$$26);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 15)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("JSON"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 13)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("LONGBLOB"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 24)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("LONGTEXT"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 12)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("MEDIUMBLOB"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 21)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("MEDIUMINT"));
+ }
+ ZEPHIR_CALL_METHOD(&_20$$36, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_21$$36, this_ptr, "checkcolumnunsigned", NULL, 215, column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_22$$36);
+ ZEPHIR_CONCAT_VV(&_22$$36, &_20$$36, &_21$$36);
+ zephir_concat_self(&columnSql, &_22$$36);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 23)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("MEDIUMTEXT"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 22)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("SMALLINT"));
+ }
+ ZEPHIR_CALL_METHOD(&_23$$40, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_24$$40, this_ptr, "checkcolumnunsigned", NULL, 215, column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_25$$40);
+ ZEPHIR_CONCAT_VV(&_25$$40, &_23$$40, &_24$$40);
+ zephir_concat_self(&columnSql, &_25$$40);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 6)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("TEXT"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 20)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("TIME"));
+ }
+ ZEPHIR_CALL_METHOD(&_26$$44, column, "getsize", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_GT_LONG(&_26$$44, 0)) {
+ ZEPHIR_CALL_METHOD(&_27$$46, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ zephir_concat_self(&columnSql, &_27$$46);
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 17)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("TIMESTAMP"));
+ }
+ ZEPHIR_CALL_METHOD(&_28$$47, column, "getsize", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_GT_LONG(&_28$$47, 0)) {
+ ZEPHIR_CALL_METHOD(&_29$$49, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ zephir_concat_self(&columnSql, &_29$$49);
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 10)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("TINYBLOB"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 26)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("TINYINT"));
+ }
+ ZEPHIR_CALL_METHOD(&_30$$52, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_31$$52, this_ptr, "checkcolumnunsigned", NULL, 215, column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_32$$52);
+ ZEPHIR_CONCAT_VV(&_32$$52, &_30$$52, &_31$$52);
+ zephir_concat_self(&columnSql, &_32$$52);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 25)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("TINYTEXT"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 2)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("VARCHAR"));
+ }
+ ZEPHIR_CALL_METHOD(&_33$$56, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ zephir_concat_self(&columnSql, &_33$$56);
+ break;
+ }
+ if (UNEXPECTED(ZEPHIR_IS_EMPTY(&columnSql))) {
+ ZEPHIR_INIT_VAR(&_34$$59);
+ object_init_ex(&_34$$59, phalcon_db_exception_ce);
+ ZEPHIR_CALL_METHOD(&_35$$59, column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_36$$59);
+ ZEPHIR_CONCAT_SV(&_36$$59, "Unrecognized MySQL data type at column ", &_35$$59);
+ ZEPHIR_CALL_METHOD(NULL, &_34$$59, "__construct", NULL, 8, &_36$$59);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_34$$59, "phalcon/Db/Dialect/Mysql.zep", 635);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&typeValues, column, "gettypevalues", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&typeValues))) {
+ if (Z_TYPE_P(&typeValues) == IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&valueSql$$61);
+ ZVAL_STRING(&valueSql$$61, "");
+ zephir_is_iterable(&typeValues, 0, "phalcon/Db/Dialect/Mysql.zep", 649);
+ if (Z_TYPE_P(&typeValues) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&typeValues), _37$$61)
+ {
+ ZEPHIR_INIT_NVAR(&value$$61);
+ ZVAL_COPY(&value$$61, _37$$61);
+ ZEPHIR_INIT_NVAR(&_39$$62);
+ ZVAL_STRING(&_39$$62, "\"");
+ ZEPHIR_CALL_FUNCTION(&_40$$62, "addcslashes", &_41, 214, &value$$61, &_39$$62);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_42$$62);
+ ZEPHIR_CONCAT_SVS(&_42$$62, "\"", &_40$$62, "\", ");
+ zephir_concat_self(&valueSql$$61, &_42$$62);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &typeValues, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_38$$61, &typeValues, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_38$$61)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&value$$61, &typeValues, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_43$$63);
+ ZVAL_STRING(&_43$$63, "\"");
+ ZEPHIR_CALL_FUNCTION(&_44$$63, "addcslashes", &_41, 214, &value$$61, &_43$$63);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_45$$63);
+ ZEPHIR_CONCAT_SVS(&_45$$63, "\"", &_44$$63, "\", ");
+ zephir_concat_self(&valueSql$$61, &_45$$63);
+ ZEPHIR_CALL_METHOD(NULL, &typeValues, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&value$$61);
+ ZVAL_LONG(&_46$$61, 0);
+ ZVAL_LONG(&_47$$61, -2);
+ ZEPHIR_INIT_VAR(&_48$$61);
+ zephir_substr(&_48$$61, &valueSql$$61, 0 , -2 , 0);
+ ZEPHIR_INIT_VAR(&_49$$61);
+ ZEPHIR_CONCAT_SVS(&_49$$61, "(", &_48$$61, ")");
+ zephir_concat_self(&columnSql, &_49$$61);
+ } else {
+ ZEPHIR_INIT_VAR(&_50$$64);
+ ZVAL_STRING(&_50$$64, "\"");
+ ZEPHIR_CALL_FUNCTION(&_51$$64, "addcslashes", &_41, 214, &typeValues, &_50$$64);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_52$$64);
+ ZEPHIR_CONCAT_SVS(&_52$$64, "(\"", &_51$$64, "\")");
+ zephir_concat_self(&columnSql, &_52$$64);
+ }
+ }
+ } while(0);
-static PHP_METHOD(Phalcon_Security_JWT_Token_Item, getPayload)
-{
- zval _0, _1;
- zval *this_ptr = getThis();
+ RETURN_CCTOR(&columnSql);
+}
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getForeignKeyChecks)
+{
+ zval *this_ptr = getThis();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_1, &_0, SL("payload"), PH_NOISY | PH_READONLY, "phalcon/Security/JWT/Token/Item.zep", 50);
- RETURN_CTORW(&_1);
+ RETURN_STRING("SELECT @@foreign_key_checks");
}
-static PHP_METHOD(Phalcon_Security_JWT_Token_Item, has)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, listTables)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, _0, _1;
- zval name;
+ zval *schemaName_param = NULL;
+ zval schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&schemaName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, &schemaName_param);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
} else {
- ZEPHIR_INIT_VAR(&name);
+ zephir_get_strval(&schemaName, schemaName_param);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_1, &_0, SL("payload"), PH_READONLY, "phalcon/Security/JWT/Token/Item.zep", 60);
- RETURN_MM_BOOL(zephir_array_isset(&_1, &name));
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Token_Parser)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Security\\JWT\\Token, Parser, phalcon, security_jwt_token_parser, phalcon_security_jwt_token_parser_method_entry, 0);
-
- return SUCCESS;
+ if (!(ZEPHIR_IS_EMPTY(&schemaName))) {
+ ZEPHIR_CONCAT_SVS(return_value, "SHOW TABLES FROM `", &schemaName, "`");
+ RETURN_MM();
+ }
+ RETURN_MM_STRING("SHOW TABLES");
}
-static PHP_METHOD(Phalcon_Security_JWT_Token_Parser, parse)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, listViews)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *token_param = NULL, claims, encodedClaims, encodedHeaders, encodedSignature, headers, results, signature;
- zval token;
+ zval *schemaName_param = NULL;
+ zval schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&token);
- ZVAL_UNDEF(&claims);
- ZVAL_UNDEF(&encodedClaims);
- ZVAL_UNDEF(&encodedHeaders);
- ZVAL_UNDEF(&encodedSignature);
- ZVAL_UNDEF(&headers);
- ZVAL_UNDEF(&results);
- ZVAL_UNDEF(&signature);
+ ZVAL_UNDEF(&schemaName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(token)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &token_param);
- if (UNEXPECTED(Z_TYPE_P(token_param) != IS_STRING && Z_TYPE_P(token_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'token' must be of the type string"));
+ zephir_fetch_params(1, 0, 1, &schemaName_param);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(token_param) == IS_STRING)) {
- zephir_get_strval(&token, token_param);
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
} else {
- ZEPHIR_INIT_VAR(&token);
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
}
- ZEPHIR_CALL_METHOD(&results, this_ptr, "parsetoken", NULL, 0, &token);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(&encodedHeaders);
- zephir_array_fetch_long(&encodedHeaders, &results, 0, PH_NOISY, "phalcon/Security/JWT/Token/Parser.zep", 36);
- ZEPHIR_OBS_VAR(&encodedClaims);
- zephir_array_fetch_long(&encodedClaims, &results, 1, PH_NOISY, "phalcon/Security/JWT/Token/Parser.zep", 37);
- ZEPHIR_OBS_VAR(&encodedSignature);
- zephir_array_fetch_long(&encodedSignature, &results, 2, PH_NOISY, "phalcon/Security/JWT/Token/Parser.zep", 38);
- ZEPHIR_CALL_METHOD(&headers, this_ptr, "decodeheaders", NULL, 0, &encodedHeaders);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&claims, this_ptr, "decodeclaims", NULL, 0, &encodedClaims);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&signature, this_ptr, "decodesignature", NULL, 0, &headers, &encodedSignature);
- zephir_check_call_status();
- object_init_ex(return_value, phalcon_security_jwt_token_token_ce);
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &headers, &claims, &signature);
- zephir_check_call_status();
- RETURN_MM();
+ if (!(ZEPHIR_IS_EMPTY(&schemaName))) {
+ ZEPHIR_CONCAT_SVS(return_value, "SELECT `TABLE_NAME` AS view_name FROM `INFORMATION_SCHEMA`.`VIEWS` WHERE `TABLE_SCHEMA` = '", &schemaName, "' ORDER BY view_name");
+ RETURN_MM();
+ }
+ RETURN_MM_STRING("SELECT `TABLE_NAME` AS view_name FROM `INFORMATION_SCHEMA`.`VIEWS` WHERE `TABLE_SCHEMA` = DATABASE() ORDER BY view_name");
}
-static PHP_METHOD(Phalcon_Security_JWT_Token_Parser, decodeClaims)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, modifyColumn)
{
- zval _6$$4;
- zend_bool _4;
+ zend_bool _11$$8, _12$$8, _13$$8;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL, *_2 = NULL;
- zval *claims_param = NULL, decoded, _1, _3, _5, _7$$4;
- zval claims;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, *currentColumn = NULL, currentColumn_sub, __$null, afterPosition, defaultValue, upperDefaultValue, columnDefinition, _0, _1, _2, _3, _9, _10, _19, _20, _23, _4$$4, _5$$4, _6$$4, _7$$5, _8$$5, _14$$8, _15$$9, _16$$10, _17$$10, _18$$10, _21$$12, _22$$12, _24$$15;
+ zval tableName, schemaName, sql;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&claims);
- ZVAL_UNDEF(&decoded);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(¤tColumn_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&afterPosition);
+ ZVAL_UNDEF(&defaultValue);
+ ZVAL_UNDEF(&upperDefaultValue);
+ ZVAL_UNDEF(&columnDefinition);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_19);
+ ZVAL_UNDEF(&_20);
+ ZVAL_UNDEF(&_23);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$4);
ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_14$$8);
+ ZVAL_UNDEF(&_15$$9);
+ ZVAL_UNDEF(&_16$$10);
+ ZVAL_UNDEF(&_17$$10);
+ ZVAL_UNDEF(&_18$$10);
+ ZVAL_UNDEF(&_21$$12);
+ ZVAL_UNDEF(&_22$$12);
+ ZVAL_UNDEF(&_24$$15);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(claims)
+ ZEND_PARSE_PARAMETERS_START(3, 4)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_OBJECT_OF_CLASS_OR_NULL(currentColumn, phalcon_db_columninterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &claims_param);
- zephir_get_strval(&claims, claims_param);
+ zephir_fetch_params(1, 3, 1, &tableName_param, &schemaName_param, &column, ¤tColumn);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ if (!currentColumn) {
+ currentColumn = ¤tColumn_sub;
+ ZEPHIR_CPY_WRT(currentColumn, &__$null);
+ } else {
+ ZEPHIR_SEPARATE_PARAM(currentColumn);
+ }
- ZEPHIR_CALL_CE_STATIC(&_1, phalcon_helper_base64_ce, "decodeurl", &_2, 0, &claims);
+ ZEPHIR_CALL_METHOD(&columnDefinition, this_ptr, "getcolumndefinition", NULL, 0, column);
zephir_check_call_status();
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_CE_STATIC(&decoded, phalcon_helper_json_ce, "decode", &_0, 180, &_1, &_3);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
zephir_check_call_status();
- if (Z_TYPE_P(&decoded) != IS_ARRAY) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Invalid Claims (not an array)", "phalcon/Security/JWT/Token/Parser.zep", 62);
- return;
- }
- _4 = zephir_array_isset_string(&decoded, SL("aud"));
- if (_4) {
- ZEPHIR_OBS_VAR(&_5);
- zephir_array_fetch_string(&_5, &decoded, SL("aud"), PH_NOISY, "phalcon/Security/JWT/Token/Parser.zep", 68);
- _4 = Z_TYPE_P(&_5) != IS_ARRAY;
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_CONCAT_SV(&_1, "ALTER TABLE ", &_0);
+ zephir_get_strval(&sql, &_1);
+ if (Z_TYPE_P(currentColumn) != IS_OBJECT) {
+ ZEPHIR_CPY_WRT(currentColumn, column);
}
- if (_4) {
+ ZEPHIR_CALL_METHOD(&_2, column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_3, currentColumn, "getname", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_IDENTICAL(&_2, &_3)) {
+ ZEPHIR_CALL_METHOD(&_4$$4, currentColumn, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_5$$4, column, "getname", NULL, 0);
+ zephir_check_call_status();
ZEPHIR_INIT_VAR(&_6$$4);
- zephir_create_array(&_6$$4, 1, 0);
- ZEPHIR_OBS_VAR(&_7$$4);
- zephir_array_fetch_string(&_7$$4, &decoded, SL("aud"), PH_NOISY, "phalcon/Security/JWT/Token/Parser.zep", 69);
- zephir_array_fast_append(&_6$$4, &_7$$4);
- zephir_array_update_string(&decoded, SL("aud"), &_6$$4, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CONCAT_SVSVSV(&_6$$4, " CHANGE COLUMN `", &_4$$4, "` `", &_5$$4, "` ", &columnDefinition);
+ zephir_concat_self(&sql, &_6$$4);
+ } else {
+ ZEPHIR_CALL_METHOD(&_7$$5, column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_8$$5);
+ ZEPHIR_CONCAT_SVSV(&_8$$5, " MODIFY `", &_7$$5, "` ", &columnDefinition);
+ zephir_concat_self(&sql, &_8$$5);
}
- object_init_ex(return_value, phalcon_security_jwt_token_item_ce);
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &decoded, &claims);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Token_Parser, decodeHeaders)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL, *_2 = NULL;
- zval *headers_param = NULL, decoded, _1, _3;
- zval headers;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&headers);
- ZVAL_UNDEF(&decoded);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(headers)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &headers_param);
- zephir_get_strval(&headers, headers_param);
-
-
- ZEPHIR_CALL_CE_STATIC(&_1, phalcon_helper_base64_ce, "decodeurl", &_2, 0, &headers);
+ ZEPHIR_CALL_METHOD(&_9, column, "isnotnull", NULL, 0);
zephir_check_call_status();
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_CE_STATIC(&decoded, phalcon_helper_json_ce, "decode", &_0, 180, &_1, &_3);
+ if (zephir_is_true(&_9)) {
+ zephir_concat_self_str(&sql, " NOT NULL", sizeof(" NOT NULL") - 1);
+ } else {
+ zephir_concat_self_str(&sql, " NULL", sizeof(" NULL") - 1);
+ }
+ ZEPHIR_CALL_METHOD(&_10, column, "hasdefault", NULL, 0);
zephir_check_call_status();
- if (Z_TYPE_P(&decoded) != IS_ARRAY) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Invalid Header (not an array)", "phalcon/Security/JWT/Token/Parser.zep", 91);
- return;
+ if (zephir_is_true(&_10)) {
+ ZEPHIR_CALL_METHOD(&defaultValue, column, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&upperDefaultValue);
+ zephir_fast_strtoupper(&upperDefaultValue, &defaultValue);
+ _11$$8 = zephir_memnstr_str(&upperDefaultValue, SL("CURRENT_TIMESTAMP"), "phalcon/Db/Dialect/Mysql.zep", 731);
+ if (!(_11$$8)) {
+ _11$$8 = zephir_memnstr_str(&upperDefaultValue, SL("NULL"), "phalcon/Db/Dialect/Mysql.zep", 731);
+ }
+ _12$$8 = _11$$8;
+ if (!(_12$$8)) {
+ _12$$8 = Z_TYPE_P(&defaultValue) == IS_LONG;
+ }
+ _13$$8 = _12$$8;
+ if (!(_13$$8)) {
+ ZEPHIR_CALL_FUNCTION(&_14$$8, "is_float", NULL, 213, &defaultValue);
+ zephir_check_call_status();
+ _13$$8 = zephir_is_true(&_14$$8);
+ }
+ if (_13$$8) {
+ ZEPHIR_INIT_VAR(&_15$$9);
+ ZEPHIR_CONCAT_SV(&_15$$9, " DEFAULT ", &defaultValue);
+ zephir_concat_self(&sql, &_15$$9);
+ } else {
+ ZEPHIR_INIT_VAR(&_16$$10);
+ ZVAL_STRING(&_16$$10, "\"");
+ ZEPHIR_CALL_FUNCTION(&_17$$10, "addcslashes", NULL, 214, &defaultValue, &_16$$10);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_18$$10);
+ ZEPHIR_CONCAT_SVS(&_18$$10, " DEFAULT \"", &_17$$10, "\"");
+ zephir_concat_self(&sql, &_18$$10);
+ }
}
- if (!(zephir_array_isset_string(&decoded, SL("typ")))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Invalid Header (missing 'typ' element)", "phalcon/Security/JWT/Token/Parser.zep", 97);
- return;
+ ZEPHIR_CALL_METHOD(&_19, column, "isautoincrement", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_19)) {
+ zephir_concat_self_str(&sql, " AUTO_INCREMENT", sizeof(" AUTO_INCREMENT") - 1);
}
- object_init_ex(return_value, phalcon_security_jwt_token_item_ce);
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &decoded, &headers);
+ ZEPHIR_CALL_METHOD(&_20, column, "getcomment", NULL, 0);
zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Token_Parser, decodeSignature)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_3 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval signature;
- zval *headers, headers_sub, *signature_param = NULL, algo, decoded, _0, _1, _2;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&headers_sub);
- ZVAL_UNDEF(&algo);
- ZVAL_UNDEF(&decoded);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&signature);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(headers, phalcon_security_jwt_token_item_ce)
- Z_PARAM_STR(signature)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &headers, &signature_param);
- zephir_get_strval(&signature, signature_param);
-
-
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "alg");
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "none");
- ZEPHIR_CALL_METHOD(&algo, headers, "get", NULL, 0, &_0, &_1);
+ if (zephir_is_true(&_20)) {
+ ZEPHIR_CALL_METHOD(&_21$$12, column, "getcomment", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_22$$12);
+ ZEPHIR_CONCAT_SVS(&_22$$12, " COMMENT '", &_21$$12, "'");
+ zephir_concat_self(&sql, &_22$$12);
+ }
+ ZEPHIR_CALL_METHOD(&_23, column, "isfirst", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "none");
- if (ZEPHIR_IS_IDENTICAL(&_2, &algo)) {
- ZEPHIR_INIT_VAR(&decoded);
- ZVAL_STRING(&decoded, "");
- ZEPHIR_INIT_NVAR(&signature);
+ if (zephir_is_true(&_23)) {
+ zephir_concat_self_str(&sql, " FIRST", sizeof(" FIRST") - 1);
} else {
- ZEPHIR_CALL_CE_STATIC(&decoded, phalcon_helper_base64_ce, "decodeurl", &_3, 0, &signature);
+ ZEPHIR_CALL_METHOD(&afterPosition, column, "getafterposition", NULL, 0);
zephir_check_call_status();
+ if (zephir_is_true(&afterPosition)) {
+ ZEPHIR_INIT_VAR(&_24$$15);
+ ZEPHIR_CONCAT_SVS(&_24$$15, " AFTER `", &afterPosition, "`");
+ zephir_concat_self(&sql, &_24$$15);
+ }
}
- object_init_ex(return_value, phalcon_security_jwt_token_signature_ce);
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &decoded, &signature);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_CTOR(&sql);
}
-static PHP_METHOD(Phalcon_Security_JWT_Token_Parser, parseToken)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, sharedLock)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *token_param = NULL, parts;
- zval token;
+ zval *sqlQuery_param = NULL;
+ zval sqlQuery;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&token);
- ZVAL_UNDEF(&parts);
+ ZVAL_UNDEF(&sqlQuery);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(token)
+ Z_PARAM_STR(sqlQuery)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &token_param);
- if (UNEXPECTED(Z_TYPE_P(token_param) != IS_STRING && Z_TYPE_P(token_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'token' must be of the type string"));
+ zephir_fetch_params(1, 1, 0, &sqlQuery_param);
+ if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(token_param) == IS_STRING)) {
- zephir_get_strval(&token, token_param);
+ if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) {
+ zephir_get_strval(&sqlQuery, sqlQuery_param);
} else {
- ZEPHIR_INIT_VAR(&token);
- }
-
-
- ZEPHIR_INIT_VAR(&parts);
- zephir_fast_explode_str(&parts, SL("."), &token, LONG_MAX);
- if (zephir_fast_count_int(&parts) != 3) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Invalid JWT string (dots misalignment)", "phalcon/Security/JWT/Token/Parser.zep", 143);
- return;
+ ZEPHIR_INIT_VAR(&sqlQuery);
}
- RETURN_CCTOR(&parts);
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Token_Signature)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Security\\JWT\\Token, Signature, phalcon, security_jwt_token_signature, phalcon_security_jwt_token_abstractitem_ce, phalcon_security_jwt_token_signature_method_entry, 0);
-
- return SUCCESS;
+ ZEPHIR_CONCAT_VS(return_value, &sqlQuery, " LOCK IN SHARE MODE");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Security_JWT_Token_Signature, __construct)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, tableExists)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *hash_param = NULL, *encoded_param = NULL, _0, _1;
- zval hash, encoded;
+ zval *tableName_param = NULL, *schemaName_param = NULL;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&hash);
- ZVAL_UNDEF(&encoded);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 2)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(tableName)
Z_PARAM_OPTIONAL
- Z_PARAM_STR(hash)
- Z_PARAM_STR(encoded)
+ Z_PARAM_STR_OR_NULL(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 2, &hash_param, &encoded_param);
- if (!hash_param) {
- ZEPHIR_INIT_VAR(&hash);
- ZVAL_STRING(&hash, "");
- } else {
- if (UNEXPECTED(Z_TYPE_P(hash_param) != IS_STRING && Z_TYPE_P(hash_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'hash' must be of the type string"));
+ zephir_fetch_params(1, 1, 1, &tableName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(hash_param) == IS_STRING)) {
- zephir_get_strval(&hash, hash_param);
- } else {
- ZEPHIR_INIT_VAR(&hash);
- }
- }
- if (!encoded_param) {
- ZEPHIR_INIT_VAR(&encoded);
- ZVAL_STRING(&encoded, "");
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- if (UNEXPECTED(Z_TYPE_P(encoded_param) != IS_STRING && Z_TYPE_P(encoded_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'encoded' must be of the type string"));
- RETURN_MM_NULL();
+ ZEPHIR_INIT_VAR(&tableName);
}
- if (EXPECTED(Z_TYPE_P(encoded_param) == IS_STRING)) {
- zephir_get_strval(&encoded, encoded_param);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
} else {
- ZEPHIR_INIT_VAR(&encoded);
- }
+ zephir_get_strval(&schemaName, schemaName_param);
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "encoded");
- zephir_update_property_array(this_ptr, SL("data"), &_0, &encoded);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "hash");
- zephir_update_property_array(this_ptr, SL("data"), &_1, &hash);
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Token_Signature, getHash)
-{
- zval _0, _1;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
-
-
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_1, &_0, SL("hash"), PH_NOISY | PH_READONLY, "phalcon/Security/JWT/Token/Signature.zep", 35);
- RETURN_CTORW(&_1);
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Token_Token)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Security\\JWT\\Token, Token, phalcon, security_jwt_token_token, phalcon_security_jwt_token_token_method_entry, 0);
-
- zend_declare_property_null(phalcon_security_jwt_token_token_ce, SL("claims"), ZEND_ACC_PRIVATE);
- zend_declare_property_null(phalcon_security_jwt_token_token_ce, SL("headers"), ZEND_ACC_PRIVATE);
- zend_declare_property_null(phalcon_security_jwt_token_token_ce, SL("signature"), ZEND_ACC_PRIVATE);
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Token_Token, getClaims)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "claims");
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Token_Token, getHeaders)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "headers");
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Token_Token, getSignature)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "signature");
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Token_Token, __construct)
-{
- zval *headers, headers_sub, *claims, claims_sub, *signature, signature_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&headers_sub);
- ZVAL_UNDEF(&claims_sub);
- ZVAL_UNDEF(&signature_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(3, 3)
- Z_PARAM_OBJECT_OF_CLASS(headers, phalcon_security_jwt_token_item_ce)
- Z_PARAM_OBJECT_OF_CLASS(claims, phalcon_security_jwt_token_item_ce)
- Z_PARAM_OBJECT_OF_CLASS(signature, phalcon_security_jwt_token_signature_ce)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(3, 0, &headers, &claims, &signature);
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("headers"), headers);
- zephir_update_property_zval(this_ptr, ZEND_STRL("claims"), claims);
- zephir_update_property_zval(this_ptr, ZEND_STRL("signature"), signature);
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Token_Token, getPayload)
-{
- 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_MM_GROW();
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_1, &_0, "getencoded", NULL, 0);
- zephir_check_call_status();
- zephir_read_property(&_2, this_ptr, ZEND_STRL("claims"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_3, &_2, "getencoded", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CONCAT_VSV(return_value, &_1, ".", &_3);
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Security_JWT_Token_Token, getToken)
-{
- 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);
-
-
- ZEPHIR_MM_GROW();
-
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getpayload", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getsignature", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_2, &_1, "getencoded", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CONCAT_VSV(return_value, &_0, ".", &_2);
+ if (!(ZEPHIR_IS_EMPTY(&schemaName))) {
+ ZEPHIR_CONCAT_SVSVS(return_value, "SELECT IF(COUNT(*) > 0, 1, 0) FROM `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_NAME`= '", &tableName, "' AND `TABLE_SCHEMA` = '", &schemaName, "'");
+ RETURN_MM();
+ }
+ ZEPHIR_CONCAT_SVS(return_value, "SELECT IF(COUNT(*) > 0, 1, 0) FROM `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_NAME` = '", &tableName, "' AND `TABLE_SCHEMA` = DATABASE()");
RETURN_MM();
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Session_Bag)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Session, Bag, phalcon, session_bag, phalcon_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_di_injectionawareinterface_ce);
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Session_Bag, __construct)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, tableOptions)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL, *_3 = NULL, *_7 = NULL;
- zval *name_param = NULL, container, data, session, _5, _6, _1$$3, _2$$3, _4$$3;
- zval name;
+ zval *table_param = NULL, *schema_param = NULL;
+ zval table, schema, sql;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&session);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+ ZVAL_UNDEF(&sql);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' 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(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
} else {
- ZEPHIR_INIT_VAR(&name);
- }
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
- ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_ce, "getdefault", &_0, 0);
- zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_session_exception_ce);
- ZEPHIR_INIT_VAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "the 'session' service");
- ZEPHIR_CALL_CE_STATIC(&_2$$3, phalcon_session_exception_ce, "containerservicenotfound", &_3, 0, &_4$$3);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 8, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Session/Bag.zep", 66);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_INIT_VAR(&_5);
- ZVAL_STRING(&_5, "session");
- ZEPHIR_CALL_METHOD(&session, &container, "getshared", NULL, 0, &_5);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &container);
- zephir_update_property_zval(this_ptr, ZEND_STRL("session"), &session);
- zephir_read_property(&_6, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&data, &session, "get", NULL, 0, &_6);
- zephir_check_call_status();
- if (Z_TYPE_P(&data) != IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&data);
- array_init(&data);
+ ZEPHIR_INIT_VAR(&table);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_session_bag_ce, getThis(), "__construct", &_7, 0, &data);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Session_Bag, clear)
-{
- zval _1, _2;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
-
-
- ZEPHIR_MM_GROW();
-
- ZEPHIR_CALL_PARENT(NULL, phalcon_session_bag_ce, getThis(), "clear", &_0, 0);
- zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("session"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_1, "remove", NULL, 0, &_2);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Session_Bag, getDI)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "container");
-}
-
-static PHP_METHOD(Phalcon_Session_Bag, init)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *data_param = NULL;
- zval data;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&data);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(data)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &data_param);
- if (!data_param) {
- ZEPHIR_INIT_VAR(&data);
- array_init(&data);
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&data, data_param);
+ zephir_get_strval(&schema, schema_param);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_session_bag_ce, getThis(), "init", &_0, 0, &data);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_INIT_VAR(&sql);
+ ZVAL_STRING(&sql, "SELECT TABLES.TABLE_TYPE AS table_type,TABLES.AUTO_INCREMENT AS auto_increment,TABLES.ENGINE AS engine,TABLES.TABLE_COLLATION AS table_collation FROM INFORMATION_SCHEMA.TABLES WHERE ");
+ if (!(ZEPHIR_IS_EMPTY(&schema))) {
+ ZEPHIR_CONCAT_VSVSVS(return_value, &sql, "TABLES.TABLE_SCHEMA = '", &schema, "' AND TABLES.TABLE_NAME = '", &table, "'");
+ RETURN_MM();
+ }
+ ZEPHIR_CONCAT_VSVS(return_value, &sql, "TABLES.TABLE_SCHEMA = DATABASE() AND TABLES.TABLE_NAME = '", &table, "'");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Bag, remove)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, truncateTable)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *element_param = NULL, _1, _2, _3;
- zval element;
+ zval *tableName_param = NULL, *schemaName_param = NULL;
+ zval tableName, schemaName, table;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&element);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&table);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(element)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, 2, 0, &tableName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' 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(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&element);
+ ZEPHIR_INIT_VAR(&tableName);
}
-
-
- ZEPHIR_CALL_PARENT(NULL, phalcon_session_bag_ce, getThis(), "remove", &_0, 0, &element);
- zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("session"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_1, "set", NULL, 0, &_2, &_3);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Session_Bag, set)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *element_param = NULL, *value, value_sub, _1, _2, _3;
- zval element;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&element);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(element)
- Z_PARAM_ZVAL(value)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- 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"));
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' 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(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
} else {
- ZEPHIR_INIT_VAR(&element);
+ ZEPHIR_INIT_VAR(&schemaName);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_session_bag_ce, getThis(), "set", &_0, 0, &element, value);
- zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("session"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_1, "set", NULL, 0, &_2, &_3);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Session_Bag, setDI)
-{
- zval *container, container_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&container_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &container);
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container);
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Session_Exception)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Session, Exception, phalcon, session_exception, phalcon_exception_ce, NULL, 0);
-
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Session_Manager)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Session, Manager, phalcon, session_manager, phalcon_di_abstractinjectionaware_ce, phalcon_session_manager_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_class_implements(phalcon_session_manager_ce, 1, phalcon_session_managerinterface_ce);
- return SUCCESS;
+ if (!(ZEPHIR_IS_EMPTY(&schemaName))) {
+ ZEPHIR_INIT_VAR(&table);
+ ZEPHIR_CONCAT_SVSVS(&table, "`", &schemaName, "`.`", &tableName, "`");
+ } else {
+ ZEPHIR_INIT_NVAR(&table);
+ ZEPHIR_CONCAT_SVS(&table, "`", &tableName, "`");
+ }
+ ZEPHIR_CONCAT_SV(return_value, "TRUNCATE TABLE ", &table);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Manager, __construct)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, viewExists)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *options_param = NULL;
- zval options;
+ zval *viewName_param = NULL, *schemaName_param = NULL;
+ zval viewName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&viewName);
+ ZVAL_UNDEF(&schemaName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(viewName)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_STR_OR_NULL(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 1, 1, &viewName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) {
+ zephir_get_strval(&viewName, viewName_param);
} else {
- zephir_get_arrval(&options, options_param);
+ ZEPHIR_INIT_VAR(&viewName);
+ }
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ zephir_get_strval(&schemaName, schemaName_param);
}
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setoptions", NULL, 0, &options);
- 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);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- 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();
+ if (!(ZEPHIR_IS_EMPTY(&schemaName))) {
+ ZEPHIR_CONCAT_SVSVS(return_value, "SELECT IF(COUNT(*) > 0, 1, 0) FROM `INFORMATION_SCHEMA`.`VIEWS` WHERE `TABLE_NAME`= '", &viewName, "' AND `TABLE_SCHEMA`='", &schemaName, "'");
+ RETURN_MM();
+ }
+ ZEPHIR_CONCAT_SVS(return_value, "SELECT IF(COUNT(*) > 0, 1, 0) FROM `INFORMATION_SCHEMA`.`VIEWS` WHERE `TABLE_NAME`='", &viewName, "' AND `TABLE_SCHEMA` = DATABASE()");
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Manager, __isset)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getTableOptions)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL;
- zval key;
+ zval *definition_param = NULL, options, engine, autoIncrement, tableCollation, collationParts, _0$$5, _1$$7, _2$$9, _3$$9, _4$$9;
+ zval definition, tableOptions;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&tableOptions);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&engine);
+ ZVAL_UNDEF(&autoIncrement);
+ ZVAL_UNDEF(&tableCollation);
+ ZVAL_UNDEF(&collationParts);
+ ZVAL_UNDEF(&_0$$5);
+ ZVAL_UNDEF(&_1$$7);
+ ZVAL_UNDEF(&_2$$9);
+ ZVAL_UNDEF(&_3$$9);
+ ZVAL_UNDEF(&_4$$9);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_ARRAY(definition)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
+ zephir_fetch_params(1, 1, 0, &definition_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "has", NULL, 0, &key);
- zephir_check_call_status();
+ ZEPHIR_OBS_VAR(&options);
+ if (!(zephir_array_isset_string_fetch(&options, &definition, SL("options"), 0))) {
+ RETURN_MM_STRING("");
+ }
+ ZEPHIR_INIT_VAR(&tableOptions);
+ array_init(&tableOptions);
+ ZEPHIR_OBS_VAR(&engine);
+ if (zephir_array_isset_string_fetch(&engine, &options, SL("ENGINE"), 0)) {
+ if (zephir_is_true(&engine)) {
+ ZEPHIR_INIT_VAR(&_0$$5);
+ ZEPHIR_CONCAT_SV(&_0$$5, "ENGINE=", &engine);
+ zephir_array_append(&tableOptions, &_0$$5, PH_SEPARATE, "phalcon/Db/Dialect/Mysql.zep", 857);
+ }
+ }
+ ZEPHIR_OBS_VAR(&autoIncrement);
+ if (zephir_array_isset_string_fetch(&autoIncrement, &options, SL("AUTO_INCREMENT"), 0)) {
+ if (zephir_is_true(&autoIncrement)) {
+ ZEPHIR_INIT_VAR(&_1$$7);
+ ZEPHIR_CONCAT_SV(&_1$$7, "AUTO_INCREMENT=", &autoIncrement);
+ zephir_array_append(&tableOptions, &_1$$7, PH_SEPARATE, "phalcon/Db/Dialect/Mysql.zep", 866);
+ }
+ }
+ ZEPHIR_OBS_VAR(&tableCollation);
+ if (zephir_array_isset_string_fetch(&tableCollation, &options, SL("TABLE_COLLATION"), 0)) {
+ if (zephir_is_true(&tableCollation)) {
+ ZEPHIR_INIT_VAR(&collationParts);
+ zephir_fast_explode_str(&collationParts, SL("_"), &tableCollation, LONG_MAX);
+ zephir_array_fetch_long(&_2$$9, &collationParts, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Dialect/Mysql.zep", 876);
+ ZEPHIR_INIT_VAR(&_3$$9);
+ ZEPHIR_CONCAT_SV(&_3$$9, "DEFAULT CHARSET=", &_2$$9);
+ zephir_array_append(&tableOptions, &_3$$9, PH_SEPARATE, "phalcon/Db/Dialect/Mysql.zep", 876);
+ ZEPHIR_INIT_VAR(&_4$$9);
+ ZEPHIR_CONCAT_SV(&_4$$9, "COLLATE=", &tableCollation);
+ zephir_array_append(&tableOptions, &_4$$9, PH_SEPARATE, "phalcon/Db/Dialect/Mysql.zep", 877);
+ }
+ }
+ zephir_fast_join_str(return_value, SL(" "), &tableOptions);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Manager, __set)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, checkColumnSizeAndScale)
{
+ zval columnSql;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub;
- zval key;
+ zval *column, column_sub, _0, _1$$3, _2$$3, _3$$3, _4$$4, _5$$4;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&columnSql);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &key_param, &value);
- zephir_get_strval(&key, key_param);
+ zephir_fetch_params(1, 1, 0, &column);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "set", NULL, 0, &key, value);
+ ZEPHIR_CALL_METHOD(&_0, column, "getsize", NULL, 0);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ if (zephir_is_true(&_0)) {
+ ZEPHIR_CALL_METHOD(&_1$$3, column, "getsize", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_SV(&_2$$3, "(", &_1$$3);
+ zephir_concat_self(&columnSql, &_2$$3);
+ ZEPHIR_CALL_METHOD(&_3$$3, column, "getscale", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_3$$3)) {
+ ZEPHIR_CALL_METHOD(&_4$$4, column, "getscale", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_5$$4);
+ ZEPHIR_CONCAT_SVS(&_5$$4, ",", &_4$$4, ")");
+ zephir_concat_self(&columnSql, &_5$$4);
+ } else {
+ zephir_concat_self_str(&columnSql, ")", sizeof(")") - 1);
+ }
+ }
+ RETURN_CTOR(&columnSql);
}
-static PHP_METHOD(Phalcon_Session_Manager, __unset)
+static PHP_METHOD(Phalcon_Db_Dialect_Mysql, checkColumnUnsigned)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL;
- zval key;
+ zval *column, column_sub, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
+ zephir_fetch_params(1, 1, 0, &column);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "remove", NULL, 0, &key);
+ ZEPHIR_CALL_METHOD(&_0, column, "isunsigned", NULL, 0);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ if (zephir_is_true(&_0)) {
+ RETURN_MM_STRING(" UNSIGNED");
+ }
+ RETURN_MM_STRING("");
}
-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_MM_GROW();
- zephir_get_global(&_SESSION, SL("_SESSION"));
+#ifdef HAVE_CONFIG_H
+#endif
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
- zephir_check_call_status();
- if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- ZEPHIR_CALL_FUNCTION(NULL, "session_destroy", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_SESSION);
- array_init(&_SESSION);
- }
- ZEPHIR_MM_RESTORE();
-}
-static PHP_METHOD(Phalcon_Session_Manager, exists)
-{
- zval _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
- ZEPHIR_MM_GROW();
+ZEPHIR_INIT_CLASS(Phalcon_Db_Dialect_Postgresql)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Db\\Dialect, Postgresql, phalcon, db_dialect_postgresql, phalcon_db_dialect_ce, phalcon_db_dialect_postgresql_method_entry, 0);
- ZEPHIR_CALL_FUNCTION(&_0, "session_status", NULL, 0);
- zephir_check_call_status();
- RETURN_MM_BOOL(ZEPHIR_IS_LONG_IDENTICAL(&_0, 2));
+ zend_declare_property_string(phalcon_db_dialect_postgresql_ce, SL("escapeChar"), "\"", ZEND_ACC_PROTECTED);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Session_Manager, get)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addColumn)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_1 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool remove;
- zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, *remove_param = NULL, _SESSION, __$null, uniqueKey, value, _0;
- zval key;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, columnDefinition, _0, _1, _2, _3, _4, _7, _5$$3, _6$$3;
+ zval tableName, schemaName, sql;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_UNDEF(&_SESSION);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&uniqueKey);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&columnDefinition);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$3);
#if PHP_VERSION_ID >= 80000
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(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &column);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
}
- if (!remove_param) {
- remove = 0;
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- remove = zephir_get_boolval(remove_param);
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
}
- ZEPHIR_INIT_VAR(&value);
- ZVAL_NULL(&value);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
+ ZEPHIR_CALL_METHOD(&columnDefinition, this_ptr, "getcolumndefinition", NULL, 0, column);
zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) {
- RETURN_CCTOR(&value);
- }
- ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
zephir_check_call_status();
- ZEPHIR_CALL_CE_STATIC(&value, phalcon_helper_arr_ce, "get", &_1, 16, &_SESSION, &uniqueKey, defaultValue);
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_CONCAT_SVS(&_1, "ALTER TABLE ", &_0, " ADD COLUMN ");
+ zephir_get_strval(&sql, &_1);
+ ZEPHIR_CALL_METHOD(&_2, column, "getname", NULL, 0);
zephir_check_call_status();
- if (remove) {
- zephir_array_unset(&_SESSION, &uniqueKey, PH_SEPARATE);
+ ZEPHIR_INIT_VAR(&_3);
+ ZEPHIR_CONCAT_SVSV(&_3, "\"", &_2, "\" ", &columnDefinition);
+ zephir_concat_self(&sql, &_3);
+ ZEPHIR_CALL_METHOD(&_4, column, "hasdefault", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_4)) {
+ ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "castdefault", NULL, 0, column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_6$$3);
+ ZEPHIR_CONCAT_SV(&_6$$3, " DEFAULT ", &_5$$3);
+ zephir_concat_self(&sql, &_6$$3);
}
- RETURN_CCTOR(&value);
-}
-
-static PHP_METHOD(Phalcon_Session_Manager, getAdapter)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "adapter");
-}
-
-static PHP_METHOD(Phalcon_Session_Manager, getId)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
-
-
- ZEPHIR_MM_GROW();
-
- ZEPHIR_RETURN_CALL_FUNCTION("session_id", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_7, column, "isnotnull", NULL, 0);
zephir_check_call_status();
- RETURN_MM();
+ if (zephir_is_true(&_7)) {
+ zephir_concat_self_str(&sql, " NOT NULL", sizeof(" NOT NULL") - 1);
+ } else {
+ zephir_concat_self_str(&sql, " NULL", sizeof(" NULL") - 1);
+ }
+ RETURN_CTOR(&sql);
}
-static PHP_METHOD(Phalcon_Session_Manager, getName)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addForeignKey)
{
- zval _0, _1, _2$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *reference, reference_sub, onDelete, onUpdate, _0, _1, _2, _5, _6, _7, _8, _9, _10, _3$$3, _4$$3, _11$$4, _12$$5;
+ zval tableName, schemaName, sql;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&reference_sub);
+ ZVAL_UNDEF(&onDelete);
+ ZVAL_UNDEF(&onUpdate);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_11$$4);
+ ZVAL_UNDEF(&_12$$5);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(reference, phalcon_db_referenceinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &reference);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "");
- if (ZEPHIR_IS_IDENTICAL(&_1, &_0)) {
- ZEPHIR_CALL_FUNCTION(&_2$$3, "session_name", NULL, 0);
+ ZEPHIR_CONCAT_SVS(&_1, "ALTER TABLE ", &_0, " ADD");
+ zephir_get_strval(&sql, &_1);
+ ZEPHIR_CALL_METHOD(&_2, reference, "getname", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_2)) {
+ ZEPHIR_CALL_METHOD(&_3$$3, reference, "getname", NULL, 0);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &_2$$3);
+ ZEPHIR_INIT_VAR(&_4$$3);
+ ZEPHIR_CONCAT_SVS(&_4$$3, " CONSTRAINT \"", &_3$$3, "\"");
+ zephir_concat_self(&sql, &_4$$3);
}
- RETURN_MM_MEMBER(getThis(), "name");
+ ZEPHIR_CALL_METHOD(&_6, reference, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 67, &_6);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_7, reference, "getreferencedtable", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_9, reference, "getreferencedcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_8, this_ptr, "getcolumnlist", NULL, 67, &_9);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_10);
+ ZEPHIR_CONCAT_SVSSVSVS(&_10, " FOREIGN KEY (", &_5, ")", " REFERENCES \"", &_7, "\" (", &_8, ")");
+ zephir_concat_self(&sql, &_10);
+ ZEPHIR_CALL_METHOD(&onDelete, reference, "getondelete", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onDelete))) {
+ ZEPHIR_INIT_VAR(&_11$$4);
+ ZEPHIR_CONCAT_SV(&_11$$4, " ON DELETE ", &onDelete);
+ zephir_concat_self(&sql, &_11$$4);
+ }
+ ZEPHIR_CALL_METHOD(&onUpdate, reference, "getonupdate", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onUpdate))) {
+ ZEPHIR_INIT_VAR(&_12$$5);
+ ZEPHIR_CONCAT_SV(&_12$$5, " ON UPDATE ", &onUpdate);
+ zephir_concat_self(&sql, &_12$$5);
+ }
+ RETURN_CTOR(&sql);
}
-static PHP_METHOD(Phalcon_Session_Manager, has)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addIndex)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _SESSION, uniqueKey, _0;
- zval key;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub, indexType, _0, _2, _3, _4, _5, _6, _7, _1$$4;
+ zval tableName, schemaName, sql;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_SESSION);
- ZVAL_UNDEF(&uniqueKey);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&indexType);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_1$$4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(index, phalcon_db_indexinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_get_global(&_SESSION, SL("_SESSION"));
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_0, index, "getname", NULL, 0);
zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) {
- RETURN_MM_BOOL(0);
+ if (ZEPHIR_IS_STRING_IDENTICAL(&_0, "PRIMARY")) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addprimarykey", NULL, 0, &tableName, &schemaName, index);
+ zephir_check_call_status();
+ RETURN_MM();
}
- ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key);
+ ZEPHIR_INIT_VAR(&sql);
+ ZVAL_STRING(&sql, "CREATE");
+ ZEPHIR_CALL_METHOD(&indexType, index, "gettype", NULL, 0);
zephir_check_call_status();
- RETURN_MM_BOOL(zephir_array_isset(&_SESSION, &uniqueKey));
-}
-
-static PHP_METHOD(Phalcon_Session_Manager, getOptions)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "options");
+ if (!(ZEPHIR_IS_EMPTY(&indexType))) {
+ ZEPHIR_INIT_VAR(&_1$$4);
+ ZEPHIR_CONCAT_SV(&_1$$4, " ", &indexType);
+ zephir_concat_self(&sql, &_1$$4);
+ }
+ ZEPHIR_CALL_METHOD(&_2, index, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_3, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_4);
+ ZEPHIR_CONCAT_SVSV(&_4, " INDEX \"", &_2, "\" ON ", &_3);
+ zephir_concat_self(&sql, &_4);
+ ZEPHIR_CALL_METHOD(&_6, index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 67, &_6);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_7);
+ ZEPHIR_CONCAT_SVS(&_7, " (", &_5, ")");
+ zephir_concat_self(&sql, &_7);
+ RETURN_CTOR(&sql);
}
-static PHP_METHOD(Phalcon_Session_Manager, regenerateId)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addPrimaryKey)
{
- zend_bool delete = 0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *deleteOldSession = NULL, deleteOldSession_sub, __$true, _0, _1$$3;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub, _0, _1, _2;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&deleteOldSession_sub);
- ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&index_sub);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL(deleteOldSession)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(index, phalcon_db_indexinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &deleteOldSession);
- if (!deleteOldSession) {
- deleteOldSession = &deleteOldSession_sub;
- deleteOldSession = &__$true;
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
}
- delete = zephir_get_boolval(deleteOldSession);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
zephir_check_call_status();
- if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- ZVAL_BOOL(&_1$$3, (delete ? 1 : 0));
- ZEPHIR_CALL_FUNCTION(NULL, "session_regenerate_id", NULL, 0, &_1$$3);
- zephir_check_call_status();
- }
- RETURN_THIS();
+ ZEPHIR_CALL_METHOD(&_2, index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 67, &_2);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SVSVSVS(return_value, "ALTER TABLE ", &_0, " ADD CONSTRAINT \"", &tableName, "_PRIMARY\" PRIMARY KEY (", &_1, ")");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Manager, remove)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_4 = NULL, *_9 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _SESSION, _0, uniqueKey;
- zval key;
+ zval definition, createLines, primaryColumns;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, temporary, options, table, columns, column, indexes, index, reference, references, indexName, indexType, onDelete, onUpdate, columnDefinition, *_2, _3, _82, _83, _0$$5, _1$$6, _5$$7, _6$$7, _7$$7, _11$$7, _12$$7, _14$$7, _8$$8, _10$$8, _13$$11, _15$$12, _16$$12, _17$$12, _18$$13, _19$$13, _20$$13, _23$$13, _24$$13, _26$$13, _21$$14, _22$$14, _25$$17, _27$$18, _28$$18, _29$$18, _30$$19, _31$$19, *_32$$20, _33$$20, _34$$22, _35$$22, _36$$22, _37$$24, _38$$24, _39$$24, _40$$25, _41$$25, _42$$25, _43$$25, _44$$25, _45$$25, _46$$28, _47$$28, _48$$28, _49$$30, _50$$30, _51$$30, _52$$31, _53$$31, _54$$31, _55$$31, _56$$31, _57$$31, *_58$$33, _59$$33, _60$$34, _61$$34, _62$$34, _63$$34, _64$$34, _65$$34, _66$$34, _67$$34, _68$$34, _69$$35, _70$$36, _71$$37, _72$$37, _73$$37, _74$$37, _75$$37, _76$$37, _77$$37, _78$$37, _79$$37, _80$$38, _81$$39, _84$$40, _85$$40;
+ zval tableName, schemaName, indexSql, indexSqlAfterCreate, columnLine, referenceSql, sql, _86;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_SESSION);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&uniqueKey);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&indexSql);
+ ZVAL_UNDEF(&indexSqlAfterCreate);
+ ZVAL_UNDEF(&columnLine);
+ ZVAL_UNDEF(&referenceSql);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&_86);
+ ZVAL_UNDEF(&temporary);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&column);
+ ZVAL_UNDEF(&indexes);
+ ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&reference);
+ ZVAL_UNDEF(&references);
+ ZVAL_UNDEF(&indexName);
+ ZVAL_UNDEF(&indexType);
+ ZVAL_UNDEF(&onDelete);
+ ZVAL_UNDEF(&onUpdate);
+ ZVAL_UNDEF(&columnDefinition);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_82);
+ ZVAL_UNDEF(&_83);
+ ZVAL_UNDEF(&_0$$5);
+ ZVAL_UNDEF(&_1$$6);
+ ZVAL_UNDEF(&_5$$7);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&_7$$7);
+ ZVAL_UNDEF(&_11$$7);
+ ZVAL_UNDEF(&_12$$7);
+ ZVAL_UNDEF(&_14$$7);
+ ZVAL_UNDEF(&_8$$8);
+ ZVAL_UNDEF(&_10$$8);
+ ZVAL_UNDEF(&_13$$11);
+ ZVAL_UNDEF(&_15$$12);
+ ZVAL_UNDEF(&_16$$12);
+ ZVAL_UNDEF(&_17$$12);
+ ZVAL_UNDEF(&_18$$13);
+ ZVAL_UNDEF(&_19$$13);
+ ZVAL_UNDEF(&_20$$13);
+ ZVAL_UNDEF(&_23$$13);
+ ZVAL_UNDEF(&_24$$13);
+ ZVAL_UNDEF(&_26$$13);
+ ZVAL_UNDEF(&_21$$14);
+ ZVAL_UNDEF(&_22$$14);
+ ZVAL_UNDEF(&_25$$17);
+ ZVAL_UNDEF(&_27$$18);
+ ZVAL_UNDEF(&_28$$18);
+ ZVAL_UNDEF(&_29$$18);
+ ZVAL_UNDEF(&_30$$19);
+ ZVAL_UNDEF(&_31$$19);
+ ZVAL_UNDEF(&_33$$20);
+ ZVAL_UNDEF(&_34$$22);
+ ZVAL_UNDEF(&_35$$22);
+ ZVAL_UNDEF(&_36$$22);
+ ZVAL_UNDEF(&_37$$24);
+ ZVAL_UNDEF(&_38$$24);
+ ZVAL_UNDEF(&_39$$24);
+ ZVAL_UNDEF(&_40$$25);
+ ZVAL_UNDEF(&_41$$25);
+ ZVAL_UNDEF(&_42$$25);
+ ZVAL_UNDEF(&_43$$25);
+ ZVAL_UNDEF(&_44$$25);
+ ZVAL_UNDEF(&_45$$25);
+ ZVAL_UNDEF(&_46$$28);
+ ZVAL_UNDEF(&_47$$28);
+ ZVAL_UNDEF(&_48$$28);
+ ZVAL_UNDEF(&_49$$30);
+ ZVAL_UNDEF(&_50$$30);
+ ZVAL_UNDEF(&_51$$30);
+ ZVAL_UNDEF(&_52$$31);
+ ZVAL_UNDEF(&_53$$31);
+ ZVAL_UNDEF(&_54$$31);
+ ZVAL_UNDEF(&_55$$31);
+ ZVAL_UNDEF(&_56$$31);
+ ZVAL_UNDEF(&_57$$31);
+ ZVAL_UNDEF(&_59$$33);
+ ZVAL_UNDEF(&_60$$34);
+ ZVAL_UNDEF(&_61$$34);
+ ZVAL_UNDEF(&_62$$34);
+ ZVAL_UNDEF(&_63$$34);
+ ZVAL_UNDEF(&_64$$34);
+ ZVAL_UNDEF(&_65$$34);
+ ZVAL_UNDEF(&_66$$34);
+ ZVAL_UNDEF(&_67$$34);
+ ZVAL_UNDEF(&_68$$34);
+ ZVAL_UNDEF(&_69$$35);
+ ZVAL_UNDEF(&_70$$36);
+ ZVAL_UNDEF(&_71$$37);
+ ZVAL_UNDEF(&_72$$37);
+ ZVAL_UNDEF(&_73$$37);
+ ZVAL_UNDEF(&_74$$37);
+ ZVAL_UNDEF(&_75$$37);
+ ZVAL_UNDEF(&_76$$37);
+ ZVAL_UNDEF(&_77$$37);
+ ZVAL_UNDEF(&_78$$37);
+ ZVAL_UNDEF(&_79$$37);
+ ZVAL_UNDEF(&_80$$38);
+ ZVAL_UNDEF(&_81$$39);
+ ZVAL_UNDEF(&_84$$40);
+ ZVAL_UNDEF(&_85$$40);
+ ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&createLines);
+ ZVAL_UNDEF(&primaryColumns);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_ARRAY(definition)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_get_global(&_SESSION, SL("_SESSION"));
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &definition_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
+ ZEPHIR_OBS_VAR(&columns);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'columns' is required in the definition array", "phalcon/Db/Dialect/Postgresql.zep", 134);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) {
- RETURN_MM_NULL();
+ ZEPHIR_INIT_VAR(&temporary);
+ ZVAL_BOOL(&temporary, 0);
+ ZEPHIR_OBS_VAR(&options);
+ if (zephir_array_isset_string_fetch(&options, &definition, SL("options"), 0)) {
+ ZEPHIR_OBS_NVAR(&temporary);
+ zephir_array_isset_string_fetch(&temporary, &options, SL("temporary"), 0);
+ }
+ if (zephir_is_true(&temporary)) {
+ ZEPHIR_INIT_VAR(&_0$$5);
+ ZEPHIR_CONCAT_SVS(&_0$$5, "CREATE TEMPORARY TABLE ", &table, " (\n\t");
+ zephir_get_strval(&sql, &_0$$5);
+ } else {
+ ZEPHIR_INIT_VAR(&_1$$6);
+ ZEPHIR_CONCAT_SVS(&_1$$6, "CREATE TABLE ", &table, " (\n\t");
+ zephir_get_strval(&sql, &_1$$6);
+ }
+ ZEPHIR_INIT_VAR(&indexSqlAfterCreate);
+ ZEPHIR_INIT_VAR(&createLines);
+ array_init(&createLines);
+ ZEPHIR_INIT_VAR(&primaryColumns);
+ array_init(&primaryColumns);
+ zephir_is_iterable(&columns, 0, "phalcon/Db/Dialect/Postgresql.zep", 198);
+ if (Z_TYPE_P(&columns) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&columns), _2)
+ {
+ ZEPHIR_INIT_NVAR(&column);
+ ZVAL_COPY(&column, _2);
+ ZEPHIR_CALL_METHOD(&columnDefinition, this_ptr, "getcolumndefinition", &_4, 0, &column);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_5$$7, &column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_6$$7);
+ ZEPHIR_CONCAT_SVSV(&_6$$7, "\"", &_5$$7, "\" ", &columnDefinition);
+ zephir_get_strval(&columnLine, &_6$$7);
+ ZEPHIR_CALL_METHOD(&_7$$7, &column, "hasdefault", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_7$$7)) {
+ ZEPHIR_CALL_METHOD(&_8$$8, this_ptr, "castdefault", &_9, 0, &column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_10$$8);
+ ZEPHIR_CONCAT_SV(&_10$$8, " DEFAULT ", &_8$$8);
+ zephir_concat_self(&columnLine, &_10$$8);
+ }
+ ZEPHIR_CALL_METHOD(&_11$$7, &column, "isnotnull", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_11$$7)) {
+ zephir_concat_self_str(&columnLine, " NOT NULL", sizeof(" NOT NULL") - 1);
+ } else {
+ zephir_concat_self_str(&columnLine, " NULL", sizeof(" NULL") - 1);
+ }
+ ZEPHIR_CALL_METHOD(&_12$$7, &column, "isprimary", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_12$$7)) {
+ ZEPHIR_CALL_METHOD(&_13$$11, &column, "getname", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_append(&primaryColumns, &_13$$11, PH_SEPARATE, "phalcon/Db/Dialect/Postgresql.zep", 185);
+ }
+ zephir_array_append(&createLines, &columnLine, PH_SEPARATE, "phalcon/Db/Dialect/Postgresql.zep", 188);
+ ZEPHIR_CALL_METHOD(&_14$$7, &column, "getcomment", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_14$$7)) {
+ ZEPHIR_CALL_METHOD(&_15$$12, &column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_16$$12, &column, "getcomment", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_17$$12);
+ ZEPHIR_CONCAT_SVSVSVS(&_17$$12, " COMMENT ON COLUMN ", &table, ".\"", &_15$$12, "\" IS '", &_16$$12, "';");
+ zephir_concat_self(&indexSqlAfterCreate, &_17$$12);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &columns, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3, &columns, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&column, &columns, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&columnDefinition, this_ptr, "getcolumndefinition", &_4, 0, &column);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_18$$13, &column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_19$$13);
+ ZEPHIR_CONCAT_SVSV(&_19$$13, "\"", &_18$$13, "\" ", &columnDefinition);
+ zephir_get_strval(&columnLine, &_19$$13);
+ ZEPHIR_CALL_METHOD(&_20$$13, &column, "hasdefault", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_20$$13)) {
+ ZEPHIR_CALL_METHOD(&_21$$14, this_ptr, "castdefault", &_9, 0, &column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_22$$14);
+ ZEPHIR_CONCAT_SV(&_22$$14, " DEFAULT ", &_21$$14);
+ zephir_concat_self(&columnLine, &_22$$14);
+ }
+ ZEPHIR_CALL_METHOD(&_23$$13, &column, "isnotnull", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_23$$13)) {
+ zephir_concat_self_str(&columnLine, " NOT NULL", sizeof(" NOT NULL") - 1);
+ } else {
+ zephir_concat_self_str(&columnLine, " NULL", sizeof(" NULL") - 1);
+ }
+ ZEPHIR_CALL_METHOD(&_24$$13, &column, "isprimary", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_24$$13)) {
+ ZEPHIR_CALL_METHOD(&_25$$17, &column, "getname", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_append(&primaryColumns, &_25$$17, PH_SEPARATE, "phalcon/Db/Dialect/Postgresql.zep", 185);
+ }
+ zephir_array_append(&createLines, &columnLine, PH_SEPARATE, "phalcon/Db/Dialect/Postgresql.zep", 188);
+ ZEPHIR_CALL_METHOD(&_26$$13, &column, "getcomment", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_26$$13)) {
+ ZEPHIR_CALL_METHOD(&_27$$18, &column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_28$$18, &column, "getcomment", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_29$$18);
+ ZEPHIR_CONCAT_SVSVSVS(&_29$$18, " COMMENT ON COLUMN ", &table, ".\"", &_27$$18, "\" IS '", &_28$$18, "';");
+ zephir_concat_self(&indexSqlAfterCreate, &_29$$18);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &columns, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&column);
+ if (!(ZEPHIR_IS_EMPTY(&primaryColumns))) {
+ ZEPHIR_CALL_METHOD(&_30$$19, this_ptr, "getcolumnlist", NULL, 67, &primaryColumns);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_31$$19);
+ ZEPHIR_CONCAT_SVS(&_31$$19, "PRIMARY KEY (", &_30$$19, ")");
+ zephir_array_append(&createLines, &_31$$19, PH_SEPARATE, "phalcon/Db/Dialect/Postgresql.zep", 199);
+ }
+ ZEPHIR_OBS_VAR(&indexes);
+ if (zephir_array_isset_string_fetch(&indexes, &definition, SL("indexes"), 0)) {
+ zephir_is_iterable(&indexes, 0, "phalcon/Db/Dialect/Postgresql.zep", 227);
+ if (Z_TYPE_P(&indexes) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&indexes), _32$$20)
+ {
+ ZEPHIR_INIT_NVAR(&index);
+ ZVAL_COPY(&index, _32$$20);
+ ZEPHIR_CALL_METHOD(&indexName, &index, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&indexType, &index, "gettype", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&indexSql);
+ if (ZEPHIR_IS_STRING(&indexName, "PRIMARY")) {
+ ZEPHIR_CALL_METHOD(&_35$$22, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_34$$22, this_ptr, "getcolumnlist", NULL, 67, &_35$$22);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_36$$22);
+ ZEPHIR_CONCAT_SVS(&_36$$22, "CONSTRAINT \"PRIMARY\" PRIMARY KEY (", &_34$$22, ")");
+ zephir_get_strval(&indexSql, &_36$$22);
+ } else {
+ if (!(ZEPHIR_IS_EMPTY(&indexType))) {
+ ZEPHIR_CALL_METHOD(&_38$$24, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_37$$24, this_ptr, "getcolumnlist", NULL, 67, &_38$$24);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_39$$24);
+ ZEPHIR_CONCAT_SVSVSVS(&_39$$24, "CONSTRAINT \"", &indexName, "\" ", &indexType, " (", &_37$$24, ")");
+ zephir_get_strval(&indexSql, &_39$$24);
+ } else {
+ ZEPHIR_CALL_METHOD(&_40$$25, &index, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_41$$25, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_42$$25);
+ ZEPHIR_CONCAT_SVSV(&_42$$25, "CREATE INDEX \"", &_40$$25, "\" ON ", &_41$$25);
+ zephir_concat_self(&indexSqlAfterCreate, &_42$$25);
+ ZEPHIR_CALL_METHOD(&_44$$25, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_43$$25, this_ptr, "getcolumnlist", NULL, 67, &_44$$25);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_45$$25);
+ ZEPHIR_CONCAT_SVS(&_45$$25, " (", &_43$$25, ");");
+ zephir_concat_self(&indexSqlAfterCreate, &_45$$25);
+ }
+ }
+ if (!(ZEPHIR_IS_EMPTY(&indexSql))) {
+ zephir_array_append(&createLines, &indexSql, PH_SEPARATE, "phalcon/Db/Dialect/Postgresql.zep", 224);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &indexes, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_33$$20, &indexes, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_33$$20)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&index, &indexes, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&indexName, &index, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&indexType, &index, "gettype", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&indexSql);
+ if (ZEPHIR_IS_STRING(&indexName, "PRIMARY")) {
+ ZEPHIR_CALL_METHOD(&_47$$28, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_46$$28, this_ptr, "getcolumnlist", NULL, 67, &_47$$28);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_48$$28);
+ ZEPHIR_CONCAT_SVS(&_48$$28, "CONSTRAINT \"PRIMARY\" PRIMARY KEY (", &_46$$28, ")");
+ zephir_get_strval(&indexSql, &_48$$28);
+ } else {
+ if (!(ZEPHIR_IS_EMPTY(&indexType))) {
+ ZEPHIR_CALL_METHOD(&_50$$30, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_49$$30, this_ptr, "getcolumnlist", NULL, 67, &_50$$30);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_51$$30);
+ ZEPHIR_CONCAT_SVSVSVS(&_51$$30, "CONSTRAINT \"", &indexName, "\" ", &indexType, " (", &_49$$30, ")");
+ zephir_get_strval(&indexSql, &_51$$30);
+ } else {
+ ZEPHIR_CALL_METHOD(&_52$$31, &index, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_53$$31, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_54$$31);
+ ZEPHIR_CONCAT_SVSV(&_54$$31, "CREATE INDEX \"", &_52$$31, "\" ON ", &_53$$31);
+ zephir_concat_self(&indexSqlAfterCreate, &_54$$31);
+ ZEPHIR_CALL_METHOD(&_56$$31, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_55$$31, this_ptr, "getcolumnlist", NULL, 67, &_56$$31);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_57$$31);
+ ZEPHIR_CONCAT_SVS(&_57$$31, " (", &_55$$31, ");");
+ zephir_concat_self(&indexSqlAfterCreate, &_57$$31);
+ }
+ }
+ if (!(ZEPHIR_IS_EMPTY(&indexSql))) {
+ zephir_array_append(&createLines, &indexSql, PH_SEPARATE, "phalcon/Db/Dialect/Postgresql.zep", 224);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &indexes, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&index);
+ }
+ ZEPHIR_OBS_VAR(&references);
+ if (zephir_array_isset_string_fetch(&references, &definition, SL("references"), 0)) {
+ zephir_is_iterable(&references, 0, "phalcon/Db/Dialect/Postgresql.zep", 255);
+ if (Z_TYPE_P(&references) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&references), _58$$33)
+ {
+ ZEPHIR_INIT_NVAR(&reference);
+ ZVAL_COPY(&reference, _58$$33);
+ ZEPHIR_CALL_METHOD(&_60$$34, &reference, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_62$$34, &reference, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_61$$34, this_ptr, "getcolumnlist", NULL, 67, &_62$$34);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_63$$34);
+ ZEPHIR_CONCAT_SVSVS(&_63$$34, "CONSTRAINT \"", &_60$$34, "\" FOREIGN KEY (", &_61$$34, ") REFERENCES ");
+ zephir_get_strval(&referenceSql, &_63$$34);
+ ZEPHIR_CALL_METHOD(&_65$$34, &reference, "getreferencedtable", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_64$$34, this_ptr, "preparetable", NULL, 0, &_65$$34, &schemaName);
+ zephir_check_call_status();
+ zephir_concat_self(&referenceSql, &_64$$34);
+ ZEPHIR_CALL_METHOD(&_67$$34, &reference, "getreferencedcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_66$$34, this_ptr, "getcolumnlist", NULL, 67, &_67$$34);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_68$$34);
+ ZEPHIR_CONCAT_SVS(&_68$$34, " (", &_66$$34, ")");
+ zephir_concat_self(&referenceSql, &_68$$34);
+ ZEPHIR_CALL_METHOD(&onDelete, &reference, "getondelete", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onDelete))) {
+ ZEPHIR_INIT_NVAR(&_69$$35);
+ ZEPHIR_CONCAT_SV(&_69$$35, " ON DELETE ", &onDelete);
+ zephir_concat_self(&referenceSql, &_69$$35);
+ }
+ ZEPHIR_CALL_METHOD(&onUpdate, &reference, "getonupdate", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onUpdate))) {
+ ZEPHIR_INIT_NVAR(&_70$$36);
+ ZEPHIR_CONCAT_SV(&_70$$36, " ON UPDATE ", &onUpdate);
+ zephir_concat_self(&referenceSql, &_70$$36);
+ }
+ zephir_array_append(&createLines, &referenceSql, PH_SEPARATE, "phalcon/Db/Dialect/Postgresql.zep", 253);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &references, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_59$$33, &references, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_59$$33)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&reference, &references, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_71$$37, &reference, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_73$$37, &reference, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_72$$37, this_ptr, "getcolumnlist", NULL, 67, &_73$$37);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_74$$37);
+ ZEPHIR_CONCAT_SVSVS(&_74$$37, "CONSTRAINT \"", &_71$$37, "\" FOREIGN KEY (", &_72$$37, ") REFERENCES ");
+ zephir_get_strval(&referenceSql, &_74$$37);
+ ZEPHIR_CALL_METHOD(&_76$$37, &reference, "getreferencedtable", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_75$$37, this_ptr, "preparetable", NULL, 0, &_76$$37, &schemaName);
+ zephir_check_call_status();
+ zephir_concat_self(&referenceSql, &_75$$37);
+ ZEPHIR_CALL_METHOD(&_78$$37, &reference, "getreferencedcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_77$$37, this_ptr, "getcolumnlist", NULL, 67, &_78$$37);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_79$$37);
+ ZEPHIR_CONCAT_SVS(&_79$$37, " (", &_77$$37, ")");
+ zephir_concat_self(&referenceSql, &_79$$37);
+ ZEPHIR_CALL_METHOD(&onDelete, &reference, "getondelete", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onDelete))) {
+ ZEPHIR_INIT_NVAR(&_80$$38);
+ ZEPHIR_CONCAT_SV(&_80$$38, " ON DELETE ", &onDelete);
+ zephir_concat_self(&referenceSql, &_80$$38);
+ }
+ ZEPHIR_CALL_METHOD(&onUpdate, &reference, "getonupdate", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onUpdate))) {
+ ZEPHIR_INIT_NVAR(&_81$$39);
+ ZEPHIR_CONCAT_SV(&_81$$39, " ON UPDATE ", &onUpdate);
+ zephir_concat_self(&referenceSql, &_81$$39);
+ }
+ zephir_array_append(&createLines, &referenceSql, PH_SEPARATE, "phalcon/Db/Dialect/Postgresql.zep", 253);
+ ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&reference);
}
- ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key);
- zephir_check_call_status();
- zephir_array_unset(&_SESSION, &uniqueKey, PH_SEPARATE);
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_INIT_VAR(&_82);
+ zephir_fast_join_str(&_82, SL(",\n\t"), &createLines);
+ ZEPHIR_INIT_VAR(&_83);
+ ZEPHIR_CONCAT_VS(&_83, &_82, "\n)");
+ zephir_concat_self(&sql, &_83);
+ if (zephir_array_isset_string(&definition, SL("options"))) {
+ ZEPHIR_CALL_METHOD(&_84$$40, this_ptr, "gettableoptions", NULL, 0, &definition);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_85$$40);
+ ZEPHIR_CONCAT_SV(&_85$$40, " ", &_84$$40);
+ zephir_concat_self(&sql, &_85$$40);
+ }
+ ZEPHIR_INIT_VAR(&_86);
+ ZEPHIR_CONCAT_SV(&_86, ";", &indexSqlAfterCreate);
+ zephir_concat_self(&sql, &_86);
+ RETURN_CTOR(&sql);
}
-static PHP_METHOD(Phalcon_Session_Manager, set)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createView)
{
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 definition;
+ zval *viewName_param = NULL, *definition_param = NULL, *schemaName_param = NULL, viewSql, _0;
+ zval viewName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&_SESSION);
- ZVAL_UNDEF(&uniqueKey);
+ ZVAL_UNDEF(&viewName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&viewSql);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&definition);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(viewName)
+ Z_PARAM_ARRAY(definition)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_FALSE_IDENTICAL(&_0)) {
+ zephir_fetch_params(1, 2, 1, &viewName_param, &definition_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string"));
RETURN_MM_NULL();
}
- 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_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Session_Manager, setAdapter)
-{
- zval *adapter, adapter_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&adapter_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(adapter, php_session_iface_entry)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &adapter);
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), adapter);
- RETURN_THISW();
-}
-
-static PHP_METHOD(Phalcon_Session_Manager, setId)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *id_param = NULL, _0, _1$$3;
- zval id, _2$$3;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&id);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(id)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &id_param);
- zephir_get_strval(&id, id_param);
+ if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) {
+ zephir_get_strval(&viewName, viewName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&viewName);
+ }
+ ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ zephir_get_strval(&schemaName, schemaName_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, spl_ce_RuntimeException);
- 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, 270, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Session/Manager.zep", 254);
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_OBS_VAR(&viewSql);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&viewSql, &definition, SL("sql"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'sql' is required in the definition array", "phalcon/Db/Dialect/Postgresql.zep", 276);
return;
}
- ZEPHIR_CALL_FUNCTION(NULL, "session_id", NULL, 0, &id);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &viewName, &schemaName);
zephir_check_call_status();
- RETURN_THIS();
+ ZEPHIR_CONCAT_SVSV(return_value, "CREATE VIEW ", &_0, " AS ", &viewSql);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Manager, setName)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, describeColumns)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, _0, _1, _2, _3, _4;
- zval name;
+ zval *table_param = NULL, *schema_param = NULL;
+ zval table, schema;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &name_param);
- zephir_get_strval(&name, name_param);
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
+ }
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
+ }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
- zephir_check_call_status();
- if (UNEXPECTED(zephir_is_true(&_0))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Cannot set session name after a session has started", "phalcon/Session/Manager.zep", 277);
- return;
- }
- ZEPHIR_INIT_VAR(&_1);
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "/^[\\p{L}\\p{N}_-]+$/u");
- ZEPHIR_INIT_VAR(&_3);
- ZEPHIR_INIT_VAR(&_4);
- ZVAL_STRING(&_4, "/^[\\p{L}\\p{N}_-]+$/u");
- zephir_preg_match(&_3, &_4, &name, &_1, 0, 0 , 0 );
- if (UNEXPECTED(!zephir_is_true(&_3))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "The name contains non alphanum characters", "phalcon/Session/Manager.zep", 283);
- return;
+ if (ZEPHIR_IS_NULL(&schema)) {
+ ZEPHIR_INIT_NVAR(&schema);
+ ZVAL_STRING(&schema, "public");
}
- 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_CONCAT_SVSVS(return_value, "SELECT DISTINCT c.column_name AS Field, c.data_type AS Type, c.character_maximum_length AS Size, c.numeric_precision AS NumericSize, c.numeric_scale AS NumericScale, c.is_nullable AS Null, CASE WHEN pkc.column_name NOTNULL THEN 'PRI' ELSE '' END AS Key, CASE WHEN c.data_type LIKE '%int%' AND c.column_default LIKE '%nextval%' THEN 'auto_increment' ELSE '' END AS Extra, c.ordinal_position AS Position, c.column_default, des.description FROM information_schema.columns c LEFT JOIN ( SELECT kcu.column_name, kcu.table_name, kcu.table_schema FROM information_schema.table_constraints tc INNER JOIN information_schema.key_column_usage kcu on (kcu.constraint_name = tc.constraint_name and kcu.table_name=tc.table_name and kcu.table_schema=tc.table_schema) WHERE tc.constraint_type='PRIMARY KEY') pkc ON (c.column_name=pkc.column_name AND c.table_schema = pkc.table_schema AND c.table_name=pkc.table_name) LEFT JOIN ( SELECT objsubid, description, relname, nspname FROM pg_description JOIN pg_class ON pg_description.objoid = pg_class.oid JOIN pg_namespace ON pg_class.relnamespace = pg_namespace.oid ) des ON ( des.objsubid = C.ordinal_position AND C.table_schema = des.nspname AND C.TABLE_NAME = des.relname ) WHERE c.table_schema='", &schema, "' AND c.table_name='", &table, "' ORDER BY c.ordinal_position");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Manager, setOptions)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, describeIndexes)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_1 = NULL;
- zval *options_param = NULL, _0, _2, _3;
- zval options;
+ zval *table_param = NULL, *schema_param = NULL;
+ zval table, schema;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &options_param);
- zephir_get_arrval(&options, options_param);
-
-
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "uniqueId");
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "");
- ZEPHIR_CALL_CE_STATIC(&_0, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3);
- 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_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Session_Manager, start)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval _COOKIE, name, value, _0, _1, _2, _7, _3$$6, _4$$6, _5$$6, _6$$6;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_COOKIE);
- ZVAL_UNDEF(&name);
- 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);
-
-
- ZEPHIR_MM_GROW();
- 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_check_call_status();
- if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- RETURN_MM_BOOL(1);
- }
- ZEPHIR_CALL_FUNCTION(&_1, "headers_sent", NULL, 361);
- zephir_check_call_status();
- if (ZEPHIR_IS_TRUE_IDENTICAL(&_1)) {
- RETURN_MM_BOOL(0);
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
}
- ZEPHIR_OBS_VAR(&_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", 327);
- return;
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
}
- ZEPHIR_OBS_VAR(&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);
- }
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
}
- 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();
-}
-
-static PHP_METHOD(Phalcon_Session_Manager, status)
-{
- zval status;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&status);
-
-
- ZEPHIR_MM_GROW();
- 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);
+ ZEPHIR_CONCAT_SVS(return_value, "SELECT 0 as c0, t.relname as table_name, i.relname as key_name, 3 as c3, a.attname as column_name FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND a.attnum = ANY(ix.indkey) AND t.relkind = 'r' AND t.relname = '", &table, "' ORDER BY t.relname, i.relname;");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Manager, getUniqueKey)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, describeReferences)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key_param = NULL, uniqueId, _0, _1$$3;
- zval key;
+ zval *table_param = NULL, *schema_param = NULL;
+ zval table, schema;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&uniqueId);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
-
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("uniqueId"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&uniqueId, &_0);
- if (!(ZEPHIR_IS_EMPTY(&uniqueId))) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("uniqueId"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CONCAT_VSV(return_value, &_1$$3, "#", &key);
- RETURN_MM();
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
} else {
- RETURN_CTOR(&key);
+ ZEPHIR_INIT_VAR(&table);
}
-}
-
-zend_object *zephir_init_properties_Phalcon_Session_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_MM_GROW();
-
- {
- 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);
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
}
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Session_ManagerInterface)
-{
- 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);
-
- 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);
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_AbstractAdapter)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Session\\Adapter, AbstractAdapter, phalcon, session_adapter_abstractadapter, phalcon_session_adapter_abstractadapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
-
- 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)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_BOOL(1);
+ if (ZEPHIR_IS_NULL(&schema)) {
+ ZEPHIR_INIT_NVAR(&schema);
+ ZVAL_STRING(&schema, "public");
+ }
+ ZEPHIR_CONCAT_SVSVS(return_value, "SELECT DISTINCT tc.table_name AS TABLE_NAME, kcu.column_name AS COLUMN_NAME, tc.constraint_name AS CONSTRAINT_NAME, tc.table_catalog AS REFERENCED_TABLE_SCHEMA, ccu.table_name AS REFERENCED_TABLE_NAME, ccu.column_name AS REFERENCED_COLUMN_NAME, rc.update_rule AS UPDATE_RULE, rc.delete_rule AS DELETE_RULE FROM information_schema.table_constraints AS tc JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name JOIN information_schema.referential_constraints rc ON tc.constraint_catalog = rc.constraint_catalog AND tc.constraint_schema = rc.constraint_schema AND tc.constraint_name = rc.constraint_name AND tc.constraint_type = 'FOREIGN KEY' WHERE constraint_type = 'FOREIGN KEY' AND tc.table_schema = '", &schema, "' AND tc.table_name='", &table, "'");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, destroy)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropColumn)
{
- zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *id, id_sub, _1, _2, _3$$3;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *columnName_param = NULL, _0;
+ zval tableName, schemaName, columnName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&id_sub);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&columnName);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(id)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_STR(columnName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &id);
-
-
- _0 = !(ZEPHIR_IS_EMPTY(id));
- if (_0) {
- zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_2, &_1, "has", NULL, 0, id);
- zephir_check_call_status();
- _0 = zephir_is_true(&_2);
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &columnName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
}
- 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, id);
- zephir_check_call_status();
- RETURN_MM();
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(columnName_param) != IS_STRING && Z_TYPE_P(columnName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'columnName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(columnName_param) == IS_STRING)) {
+ zephir_get_strval(&columnName, columnName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&columnName);
}
- RETURN_MM_BOOL(1);
-}
-
-static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, gc)
-{
- zval *maxlifetime, maxlifetime_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&maxlifetime_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(maxlifetime)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &maxlifetime);
- RETURN_BOOL(1);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " DROP COLUMN \"", &columnName, "\"");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, read)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropForeignKey)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *id, id_sub, data, _0, _1;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *referenceName_param = NULL, _0;
+ zval tableName, schemaName, referenceName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&id_sub);
- ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&referenceName);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(id)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_STR(referenceName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &id);
-
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&data, &_0, "get", NULL, 0, id);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_1);
- if (Z_TYPE_P(&data) == IS_NULL) {
- ZVAL_STRING(&_1, "");
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &referenceName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_CPY_WRT(&_1, &data);
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(referenceName_param) != IS_STRING && Z_TYPE_P(referenceName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(referenceName_param) == IS_STRING)) {
+ zephir_get_strval(&referenceName, referenceName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&referenceName);
}
- RETURN_CCTOR(&_1);
-}
-
-static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, open)
-{
- zval *savePath, savePath_sub, *sessionName, sessionName_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&savePath_sub);
- ZVAL_UNDEF(&sessionName_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(savePath)
- Z_PARAM_ZVAL(sessionName)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(2, 0, &savePath, &sessionName);
- RETURN_BOOL(1);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " DROP CONSTRAINT \"", &referenceName, "\"");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, write)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropIndex)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *id, id_sub, *data, data_sub, _0;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *indexName_param = NULL;
+ zval tableName, schemaName, indexName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&id_sub);
- ZVAL_UNDEF(&data_sub);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&indexName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(id)
- Z_PARAM_ZVAL(data)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_STR(indexName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &id, &data);
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &indexName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(indexName_param) != IS_STRING && Z_TYPE_P(indexName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'indexName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(indexName_param) == IS_STRING)) {
+ zephir_get_strval(&indexName, indexName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&indexName);
+ }
- 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_check_call_status();
+ ZEPHIR_CONCAT_SVS(return_value, "DROP INDEX \"", &indexName, "\"");
RETURN_MM();
}
-
-
-
-#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;
-}
-
-static PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, __construct)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropPrimaryKey)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_1 = NULL;
- zval options;
- zval *factory, factory_sub, *options_param = NULL, _0, _2, _3, _4;
+ zval *tableName_param = NULL, *schemaName_param = NULL, _0;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&options);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_adapterfactory_ce)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &factory, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 2, 0, &tableName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
}
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "prefix");
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "sess-memc-");
- ZEPHIR_CALL_CE_STATIC(&_0, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("prefix"), &_0, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "libmemcached");
- ZEPHIR_CALL_METHOD(&_4, factory, "newinstance", NULL, 0, &_2, &options);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), &_4);
- ZEPHIR_MM_RESTORE();
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_Noop)
-{
- 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;
-
- zend_class_implements(phalcon_session_adapter_noop_ce, 1, php_session_iface_entry);
- return SUCCESS;
+ ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " DROP CONSTRAINT \"", &tableName, "_PRIMARY\"");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, __construct)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropTable)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *options_param = NULL, prefix;
- zval options;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool ifExists;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, table;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&prefix);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&table);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(tableName)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_STR_OR_NULL(schemaName)
+ Z_PARAM_BOOL(ifExists)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 1, 2, &tableName_param, &schemaName_param, &ifExists_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_INIT_VAR(&tableName);
}
-
-
- ZEPHIR_OBS_VAR(&prefix);
- if (!(zephir_array_isset_string_fetch(&prefix, &options, SL("prefix"), 0))) {
- ZEPHIR_INIT_NVAR(&prefix);
- ZVAL_STRING(&prefix, "");
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ zephir_get_strval(&schemaName, schemaName_param);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &prefix);
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, close)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_BOOL(1);
-}
-
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, destroy)
-{
- zval *id, id_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&id_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(id)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &id);
-
-
- RETURN_BOOL(1);
-}
-
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, gc)
-{
- zval *maxlifetime, maxlifetime_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&maxlifetime_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(maxlifetime)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &maxlifetime);
-
-
- RETURN_BOOL(1);
-}
-
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, read)
-{
- zval *id, id_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&id_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(id)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &id);
-
-
- RETURN_STRING("");
-}
-
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, open)
-{
- zval *savePath, savePath_sub, *sessionName, sessionName_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&savePath_sub);
- ZVAL_UNDEF(&sessionName_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(savePath)
- Z_PARAM_ZVAL(sessionName)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(2, 0, &savePath, &sessionName);
-
-
- RETURN_BOOL(1);
-}
-
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, write)
-{
- zval *id, id_sub, *data, data_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&id_sub);
- ZVAL_UNDEF(&data_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(id)
- Z_PARAM_ZVAL(data)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(2, 0, &id, &data);
-
-
- RETURN_BOOL(1);
-}
-
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, getPrefixedName)
-{
- zval _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name = NULL, name_sub, _1;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&name_sub);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(name)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- 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_MM_GROW();
-
- {
- 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);
+ if (!ifExists_param) {
+ ifExists = 1;
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_TRUE && Z_TYPE_P(ifExists_param) != IS_FALSE)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be of the type bool"));
+ RETURN_MM_NULL();
+ }
+ ifExists = (Z_TYPE_P(ifExists_param) == IS_TRUE);
}
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_Redis)
-{
- 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;
+ ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ if (ifExists) {
+ ZEPHIR_CONCAT_SV(return_value, "DROP TABLE IF EXISTS ", &table);
+ RETURN_MM();
+ }
+ ZEPHIR_CONCAT_SV(return_value, "DROP TABLE ", &table);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Redis, __construct)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropView)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_1 = NULL;
- zval options;
- zval *factory, factory_sub, *options_param = NULL, _0, _2, _3, _4;
+ zend_bool ifExists;
+ zval *viewName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, view;
+ zval viewName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&viewName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&view);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_adapterfactory_ce)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(viewName)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_STR_OR_NULL(schemaName)
+ Z_PARAM_BOOL(ifExists)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &factory, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 1, 2, &viewName_param, &schemaName_param, &ifExists_param);
+ if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) {
+ zephir_get_strval(&viewName, viewName_param);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_INIT_VAR(&viewName);
+ }
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ zephir_get_strval(&schemaName, schemaName_param);
+ }
+ if (!ifExists_param) {
+ ifExists = 1;
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_TRUE && Z_TYPE_P(ifExists_param) != IS_FALSE)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be of the type bool"));
+ RETURN_MM_NULL();
+ }
+ ifExists = (Z_TYPE_P(ifExists_param) == IS_TRUE);
}
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "prefix");
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "sess-reds-");
- ZEPHIR_CALL_CE_STATIC(&_0, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("prefix"), &_0, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "redis");
- ZEPHIR_CALL_METHOD(&_4, factory, "newinstance", NULL, 0, &_2, &options);
+ ZEPHIR_CALL_METHOD(&view, this_ptr, "preparetable", NULL, 0, &viewName, &schemaName);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), &_4);
- ZEPHIR_MM_RESTORE();
+ if (ifExists) {
+ ZEPHIR_CONCAT_SV(return_value, "DROP VIEW IF EXISTS ", &view);
+ RETURN_MM();
+ }
+ ZEPHIR_CONCAT_SV(return_value, "DROP VIEW ", &view);
+ RETURN_MM();
}
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition)
+{
+ zval valueSql$$38;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_12 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *column, column_sub, columnType, columnSql, typeValues, _0$$4, _1$$9, _2$$15, _3$$20, _4$$33, _5$$36, _6$$36, _7$$36, value$$38, *_8$$38, _9$$38, _17$$38, _18$$38, _19$$38, _20$$38, _10$$39, _11$$39, _13$$39, _14$$40, _15$$40, _16$$40, _21$$41, _22$$41, _23$$41;
+ zval *this_ptr = getThis();
-
-
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&columnType);
+ ZVAL_UNDEF(&columnSql);
+ ZVAL_UNDEF(&typeValues);
+ ZVAL_UNDEF(&_0$$4);
+ ZVAL_UNDEF(&_1$$9);
+ ZVAL_UNDEF(&_2$$15);
+ ZVAL_UNDEF(&_3$$20);
+ ZVAL_UNDEF(&_4$$33);
+ ZVAL_UNDEF(&_5$$36);
+ ZVAL_UNDEF(&_6$$36);
+ ZVAL_UNDEF(&_7$$36);
+ ZVAL_UNDEF(&value$$38);
+ ZVAL_UNDEF(&_9$$38);
+ ZVAL_UNDEF(&_17$$38);
+ ZVAL_UNDEF(&_18$$38);
+ ZVAL_UNDEF(&_19$$38);
+ ZVAL_UNDEF(&_20$$38);
+ ZVAL_UNDEF(&_10$$39);
+ ZVAL_UNDEF(&_11$$39);
+ ZVAL_UNDEF(&_13$$39);
+ ZVAL_UNDEF(&_14$$40);
+ ZVAL_UNDEF(&_15$$40);
+ ZVAL_UNDEF(&_16$$40);
+ ZVAL_UNDEF(&_21$$41);
+ ZVAL_UNDEF(&_22$$41);
+ ZVAL_UNDEF(&_23$$41);
+ ZVAL_UNDEF(&valueSql$$38);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &column);
+ ZEPHIR_CALL_METHOD(&columnSql, this_ptr, "checkcolumntypesql", NULL, 0, column);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&columnType, this_ptr, "checkcolumntype", NULL, 0, column);
+ zephir_check_call_status();
+ do {
+ if (ZEPHIR_IS_LONG(&columnType, 14)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ ZEPHIR_CALL_METHOD(&_0$$4, column, "isautoincrement", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_0$$4)) {
+ zephir_concat_self_str(&columnSql, SL("BIGSERIAL"));
+ } else {
+ zephir_concat_self_str(&columnSql, SL("BIGINT"));
+ }
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 8)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("BOOLEAN"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 5)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("CHARACTER"));
+ }
+ ZEPHIR_CALL_METHOD(&_1$$9, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ zephir_concat_self(&columnSql, &_1$$9);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 1)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("DATE"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 4)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("TIMESTAMP"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 3)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("NUMERIC"));
+ }
+ ZEPHIR_CALL_METHOD(&_2$$15, this_ptr, "getcolumnsizeandscale", NULL, 0, column);
+ zephir_check_call_status();
+ zephir_concat_self(&columnSql, &_2$$15);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 7)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("FLOAT"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 0)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ ZEPHIR_CALL_METHOD(&_3$$20, column, "isautoincrement", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_3$$20)) {
+ zephir_concat_self_str(&columnSql, SL("SERIAL"));
+ } else {
+ zephir_concat_self_str(&columnSql, SL("INT"));
+ }
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 22)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("SMALLINT"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 15)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("JSON"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 16)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("JSONB"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 17)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("TIMESTAMP"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 6)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("TEXT"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 2)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("CHARACTER VARYING"));
+ }
+ ZEPHIR_CALL_METHOD(&_4$$33, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ zephir_concat_self(&columnSql, &_4$$33);
+ break;
+ }
+ if (UNEXPECTED(ZEPHIR_IS_EMPTY(&columnSql))) {
+ ZEPHIR_INIT_VAR(&_5$$36);
+ object_init_ex(&_5$$36, phalcon_db_exception_ce);
+ ZEPHIR_CALL_METHOD(&_6$$36, column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_7$$36);
+ ZEPHIR_CONCAT_SV(&_7$$36, "Unrecognized PostgreSQL data type at column ", &_6$$36);
+ ZEPHIR_CALL_METHOD(NULL, &_5$$36, "__construct", NULL, 8, &_7$$36);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_5$$36, "phalcon/Db/Dialect/Postgresql.zep", 511);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&typeValues, column, "gettypevalues", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&typeValues))) {
+ if (Z_TYPE_P(&typeValues) == IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&valueSql$$38);
+ zephir_is_iterable(&typeValues, 0, "phalcon/Db/Dialect/Postgresql.zep", 526);
+ if (Z_TYPE_P(&typeValues) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&typeValues), _8$$38)
+ {
+ ZEPHIR_INIT_NVAR(&value$$38);
+ ZVAL_COPY(&value$$38, _8$$38);
+ ZEPHIR_INIT_NVAR(&_10$$39);
+ ZVAL_STRING(&_10$$39, "\'");
+ ZEPHIR_CALL_FUNCTION(&_11$$39, "addcslashes", &_12, 214, &value$$38, &_10$$39);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_13$$39);
+ ZEPHIR_CONCAT_SVS(&_13$$39, "'", &_11$$39, "', ");
+ zephir_concat_self(&valueSql$$38, &_13$$39);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &typeValues, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_9$$38, &typeValues, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_9$$38)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&value$$38, &typeValues, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_14$$40);
+ ZVAL_STRING(&_14$$40, "\'");
+ ZEPHIR_CALL_FUNCTION(&_15$$40, "addcslashes", &_12, 214, &value$$38, &_14$$40);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_16$$40);
+ ZEPHIR_CONCAT_SVS(&_16$$40, "'", &_15$$40, "', ");
+ zephir_concat_self(&valueSql$$38, &_16$$40);
+ ZEPHIR_CALL_METHOD(NULL, &typeValues, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&value$$38);
+ ZVAL_LONG(&_17$$38, 0);
+ ZVAL_LONG(&_18$$38, -2);
+ ZEPHIR_INIT_VAR(&_19$$38);
+ zephir_substr(&_19$$38, &valueSql$$38, 0 , -2 , 0);
+ ZEPHIR_INIT_VAR(&_20$$38);
+ ZEPHIR_CONCAT_SVS(&_20$$38, "(", &_19$$38, ")");
+ zephir_concat_self(&columnSql, &_20$$38);
+ } else {
+ ZEPHIR_INIT_VAR(&_21$$41);
+ ZVAL_STRING(&_21$$41, "\'");
+ ZEPHIR_CALL_FUNCTION(&_22$$41, "addcslashes", &_12, 214, &typeValues, &_21$$41);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_23$$41);
+ ZEPHIR_CONCAT_SVS(&_23$$41, "('", &_22$$41, "')");
+ zephir_concat_self(&columnSql, &_23$$41);
+ }
+ }
+ } while(0);
-ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_Stream)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Session\\Adapter, Stream, phalcon, session_adapter_stream, phalcon_session_adapter_noop_ce, phalcon_session_adapter_stream_method_entry, 0);
-
- zend_declare_property_string(phalcon_session_adapter_stream_ce, SL("path"), "", ZEND_ACC_PRIVATE);
- return SUCCESS;
+ RETURN_CCTOR(&columnSql);
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, __construct)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, listTables)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL, *_7 = NULL;
- zval options, *options_param = NULL, path, _1, _3, _6, _2$$3, _4$$4, _5$$4;
+ zval *schemaName_param = NULL;
+ zval schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&path);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_4$$4);
- ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&schemaName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_STR_OR_NULL(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 0, 1, &schemaName_param);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_get_strval(&schemaName, schemaName_param);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_session_adapter_stream_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&options, &_1);
- ZEPHIR_OBS_VAR(&path);
- if (!(zephir_array_isset_string_fetch(&path, &options, SL("savePath"), 0))) {
- ZEPHIR_INIT_VAR(&_2$$3);
- ZVAL_STRING(&_2$$3, "session.save_path");
- ZEPHIR_CALL_FUNCTION(&path, "ini_get", NULL, 0, &_2$$3);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_FUNCTION(&_3, "is_writable", NULL, 326, &path);
- zephir_check_call_status();
- if (UNEXPECTED(!zephir_is_true(&_3))) {
- ZEPHIR_INIT_VAR(&_4$$4);
- object_init_ex(&_4$$4, phalcon_session_exception_ce);
- ZEPHIR_INIT_VAR(&_5$$4);
- ZEPHIR_CONCAT_SVS(&_5$$4, "The session save path [", &path, "] is not writable");
- ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", NULL, 8, &_5$$4);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_4$$4, "phalcon/Session/Adapter/Stream.zep", 68);
- ZEPHIR_MM_RESTORE();
- return;
+ if (ZEPHIR_IS_NULL(&schemaName)) {
+ ZEPHIR_INIT_NVAR(&schemaName);
+ ZVAL_STRING(&schemaName, "public");
}
- ZEPHIR_CALL_CE_STATIC(&_6, phalcon_helper_str_ce, "dirseparator", &_7, 129, &path);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("path"), &_6);
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_CONCAT_SVS(return_value, "SELECT table_name FROM information_schema.tables WHERE table_schema = '", &schemaName, "' ORDER BY table_name");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, destroy)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, listViews)
{
- zend_bool _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *id, id_sub, file, _0, _1, _3;
+ zval *schemaName_param = NULL;
+ zval schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&id_sub);
- ZVAL_UNDEF(&file);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&schemaName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(id)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &id);
+ zephir_fetch_params(1, 0, 1, &schemaName_param);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ zephir_get_strval(&schemaName, schemaName_param);
+ }
- 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(&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_check_call_status();
- _2 = zephir_is_true(&_3);
- }
- if (_2) {
- ZEPHIR_CALL_FUNCTION(NULL, "unlink", NULL, 131, &file);
- zephir_check_call_status();
+ if (ZEPHIR_IS_NULL(&schemaName)) {
+ ZEPHIR_INIT_NVAR(&schemaName);
+ ZVAL_STRING(&schemaName, "public");
}
- RETURN_MM_BOOL(1);
+ ZEPHIR_CONCAT_SVS(return_value, "SELECT viewname AS view_name FROM pg_views WHERE schemaname = '", &schemaName, "' ORDER BY view_name");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, gc)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, modifyColumn)
{
- zend_bool _6$$3, _9$$3, _12$$5, _14$$5;
+ zend_bool _26$$10;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_8 = NULL, *_11 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *maxlifetime, maxlifetime_sub, file, pattern, time, _0, _1, _2, _3, *_4, _5, _7$$3, _10$$3, _13$$5, _15$$5;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, *currentColumn = NULL, currentColumn_sub, __$null, defaultValue, columnDefinition, _0, _1, _2, _3, _7, _8, _11, _12, _18, _23, _24, _4$$4, _5$$4, _6$$4, _9$$5, _10$$5, _13$$6, _14$$7, _15$$7, _16$$8, _17$$8, _19$$9, _20$$9, _21$$9, _22$$9, _25$$10, _27$$10, _30$$10, _28$$11, _29$$11, _31$$12, _32$$13, _33$$13, _34$$14, _35$$14;
+ zval tableName, schemaName, sql, sqlAlterTable;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&maxlifetime_sub);
- ZVAL_UNDEF(&file);
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&time);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&sqlAlterTable);
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(¤tColumn_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&defaultValue);
+ ZVAL_UNDEF(&columnDefinition);
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);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_18);
+ ZVAL_UNDEF(&_23);
+ ZVAL_UNDEF(&_24);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_13$$6);
+ ZVAL_UNDEF(&_14$$7);
+ ZVAL_UNDEF(&_15$$7);
+ ZVAL_UNDEF(&_16$$8);
+ ZVAL_UNDEF(&_17$$8);
+ ZVAL_UNDEF(&_19$$9);
+ ZVAL_UNDEF(&_20$$9);
+ ZVAL_UNDEF(&_21$$9);
+ ZVAL_UNDEF(&_22$$9);
+ ZVAL_UNDEF(&_25$$10);
+ ZVAL_UNDEF(&_27$$10);
+ ZVAL_UNDEF(&_30$$10);
+ ZVAL_UNDEF(&_28$$11);
+ ZVAL_UNDEF(&_29$$11);
+ ZVAL_UNDEF(&_31$$12);
+ ZVAL_UNDEF(&_32$$13);
+ ZVAL_UNDEF(&_33$$13);
+ ZVAL_UNDEF(&_34$$14);
+ ZVAL_UNDEF(&_35$$14);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(maxlifetime)
+ ZEND_PARSE_PARAMETERS_START(3, 4)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_OBJECT_OF_CLASS_OR_NULL(currentColumn, phalcon_db_columninterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &maxlifetime);
+ zephir_fetch_params(1, 3, 1, &tableName_param, &schemaName_param, &column, ¤tColumn);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ if (!currentColumn) {
+ currentColumn = ¤tColumn_sub;
+ ZEPHIR_CPY_WRT(currentColumn, &__$null);
+ } else {
+ ZEPHIR_SEPARATE_PARAM(currentColumn);
+ }
- 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);
- zephir_sub_function(&time, &_2, maxlifetime);
- ZEPHIR_CALL_FUNCTION(&_3, "glob", NULL, 0, &pattern);
+ ZEPHIR_INIT_VAR(&sql);
+ ZEPHIR_CALL_METHOD(&columnDefinition, this_ptr, "getcolumndefinition", NULL, 0, column);
zephir_check_call_status();
- zephir_is_iterable(&_3, 0, "phalcon/Session/Adapter/Stream.zep", 105);
- if (Z_TYPE_P(&_3) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_3), _4)
- {
- ZEPHIR_INIT_NVAR(&file);
- ZVAL_COPY(&file, _4);
- _6$$3 = (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(&_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, 131, &file);
- zephir_check_call_status();
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_3, "rewind", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_CONCAT_SV(&_1, "ALTER TABLE ", &_0);
+ zephir_get_strval(&sqlAlterTable, &_1);
+ if (Z_TYPE_P(currentColumn) != IS_OBJECT) {
+ ZEPHIR_CPY_WRT(currentColumn, column);
+ }
+ ZEPHIR_CALL_METHOD(&_2, column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_3, currentColumn, "getname", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_IDENTICAL(&_2, &_3)) {
+ ZEPHIR_CALL_METHOD(&_4$$4, currentColumn, "getname", NULL, 0);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_5, &_3, "valid", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_5$$4, column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_6$$4);
+ ZEPHIR_CONCAT_VSVSVS(&_6$$4, &sqlAlterTable, " RENAME COLUMN \"", &_4$$4, "\" TO \"", &_5$$4, "\";");
+ zephir_concat_self(&sql, &_6$$4);
+ }
+ ZEPHIR_CALL_METHOD(&_7, column, "gettype", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_8, currentColumn, "gettype", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_IDENTICAL(&_7, &_8)) {
+ ZEPHIR_CALL_METHOD(&_9$$5, column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_10$$5);
+ ZEPHIR_CONCAT_VSVSVS(&_10$$5, &sqlAlterTable, " ALTER COLUMN \"", &_9$$5, "\" TYPE ", &columnDefinition, ";");
+ zephir_concat_self(&sql, &_10$$5);
+ }
+ ZEPHIR_CALL_METHOD(&_11, column, "isnotnull", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_12, currentColumn, "isnotnull", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_IDENTICAL(&_11, &_12)) {
+ ZEPHIR_CALL_METHOD(&_13$$6, column, "isnotnull", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_13$$6)) {
+ ZEPHIR_CALL_METHOD(&_14$$7, column, "getname", NULL, 0);
zephir_check_call_status();
- if (!zend_is_true(&_5)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&file, &_3, "current", NULL, 0);
+ ZEPHIR_INIT_VAR(&_15$$7);
+ ZEPHIR_CONCAT_VSVS(&_15$$7, &sqlAlterTable, " ALTER COLUMN \"", &_14$$7, "\" SET NOT NULL;");
+ zephir_concat_self(&sql, &_15$$7);
+ } else {
+ ZEPHIR_CALL_METHOD(&_16$$8, column, "getname", NULL, 0);
zephir_check_call_status();
- _12$$5 = (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(&_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, 131, &file);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_METHOD(NULL, &_3, "next", NULL, 0);
+ ZEPHIR_INIT_VAR(&_17$$8);
+ ZEPHIR_CONCAT_VSVS(&_17$$8, &sqlAlterTable, " ALTER COLUMN \"", &_16$$8, "\" DROP NOT NULL;");
+ zephir_concat_self(&sql, &_17$$8);
+ }
+ }
+ ZEPHIR_CALL_METHOD(&_18, column, "getcomment", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_18)) {
+ ZEPHIR_CALL_METHOD(&_19$$9, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_20$$9, column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_21$$9, column, "getcomment", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_22$$9);
+ ZEPHIR_CONCAT_SVSVSVS(&_22$$9, "COMMENT ON COLUMN ", &_19$$9, ".\"", &_20$$9, "\" IS '", &_21$$9, "';");
+ zephir_concat_self(&sql, &_22$$9);
+ }
+ ZEPHIR_CALL_METHOD(&_23, column, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_24, currentColumn, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_IDENTICAL(&_23, &_24)) {
+ ZEPHIR_CALL_METHOD(&_25$$10, column, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ _26$$10 = ZEPHIR_IS_EMPTY(&_25$$10);
+ if (_26$$10) {
+ ZEPHIR_CALL_METHOD(&_27$$10, currentColumn, "getdefault", NULL, 0);
zephir_check_call_status();
+ _26$$10 = !(ZEPHIR_IS_EMPTY(&_27$$10));
+ }
+ if (_26$$10) {
+ ZEPHIR_CALL_METHOD(&_28$$11, column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_29$$11);
+ ZEPHIR_CONCAT_VSVS(&_29$$11, &sqlAlterTable, " ALTER COLUMN \"", &_28$$11, "\" DROP DEFAULT;");
+ zephir_concat_self(&sql, &_29$$11);
+ }
+ ZEPHIR_CALL_METHOD(&_30$$10, column, "hasdefault", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_30$$10)) {
+ ZEPHIR_CALL_METHOD(&defaultValue, this_ptr, "castdefault", NULL, 0, column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_31$$12);
+ zephir_fast_strtoupper(&_31$$12, &columnDefinition);
+ if (zephir_memnstr_str(&_31$$12, SL("BOOLEAN"), "phalcon/Db/Dialect/Postgresql.zep", 616)) {
+ ZEPHIR_CALL_METHOD(&_32$$13, column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_33$$13);
+ ZEPHIR_CONCAT_SVSV(&_33$$13, " ALTER COLUMN \"", &_32$$13, "\" SET DEFAULT ", &defaultValue);
+ zephir_concat_self(&sql, &_33$$13);
+ } else {
+ ZEPHIR_CALL_METHOD(&_34$$14, column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_35$$14);
+ ZEPHIR_CONCAT_VSVSV(&_35$$14, &sqlAlterTable, " ALTER COLUMN \"", &_34$$14, "\" SET DEFAULT ", &defaultValue);
+ zephir_concat_self(&sql, &_35$$14);
+ }
}
}
- ZEPHIR_INIT_NVAR(&file);
- RETURN_MM_BOOL(1);
+ RETURN_CTOR(&sql);
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, open)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, sharedLock)
{
- zval *savePath, savePath_sub, *sessionName, sessionName_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *sqlQuery_param = NULL;
+ zval sqlQuery;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&savePath_sub);
- ZVAL_UNDEF(&sessionName_sub);
+ ZVAL_UNDEF(&sqlQuery);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(savePath)
- Z_PARAM_ZVAL(sessionName)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(sqlQuery)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(2, 0, &savePath, &sessionName);
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &sqlQuery_param);
+ if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) {
+ zephir_get_strval(&sqlQuery, sqlQuery_param);
+ } else {
+ ZEPHIR_INIT_VAR(&sqlQuery);
+ }
- RETURN_BOOL(1);
+ RETURN_CTOR(&sqlQuery);
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, read)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, tableExists)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *id, id_sub, data, name, pointer, _0, _1, _2$$3, _3$$3, _4$$3;
+ zval *tableName_param = NULL, *schemaName_param = NULL;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&id_sub);
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&pointer);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(id)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &id);
+ zephir_fetch_params(1, 1, 1, &tableName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ zephir_get_strval(&schemaName, schemaName_param);
+ }
- 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);
- ZEPHIR_INIT_VAR(&data);
- ZVAL_STRING(&data, "");
- if ((zephir_file_exists(&name) == SUCCESS)) {
- ZEPHIR_INIT_VAR(&_2$$3);
- ZVAL_STRING(&_2$$3, "r");
- ZEPHIR_CALL_FUNCTION(&pointer, "fopen", NULL, 89, &name, &_2$$3);
- zephir_check_call_status();
- ZVAL_LONG(&_3$$3, 1);
- ZEPHIR_CALL_FUNCTION(&_4$$3, "flock", NULL, 143, &pointer, &_3$$3);
- zephir_check_call_status();
- if (zephir_is_true(&_4$$3)) {
- ZEPHIR_INIT_NVAR(&data);
- zephir_file_get_contents(&data, &name);
- }
- zephir_fclose(&pointer);
- if (ZEPHIR_IS_FALSE_IDENTICAL(&data)) {
- RETURN_MM_STRING("");
- }
+ if (ZEPHIR_IS_NULL(&schemaName)) {
+ ZEPHIR_INIT_NVAR(&schemaName);
+ ZVAL_STRING(&schemaName, "public");
}
- RETURN_CCTOR(&data);
+ ZEPHIR_CONCAT_SVSVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM information_schema.tables WHERE table_schema = '", &schemaName, "' AND table_name='", &tableName, "'");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, write)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, tableOptions)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *id, id_sub, *data, data_sub, name, _0, _1, _2, _3;
+ zval *table_param = NULL, *schema_param = NULL;
+ zval table, schema;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&id_sub);
- ZVAL_UNDEF(&data_sub);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(id)
- Z_PARAM_ZVAL(data)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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(&_2, 2);
- ZEPHIR_CALL_FUNCTION(&_3, "file_put_contents", NULL, 138, &name, data, &_2);
- zephir_check_call_status();
- RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_3));
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
+ }
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
+ }
-ZEPHIR_INIT_CLASS(Phalcon_Storage_AdapterFactory)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage, AdapterFactory, phalcon, storage_adapterfactory, phalcon_factory_abstractfactory_ce, phalcon_storage_adapterfactory_method_entry, 0);
- zend_declare_property_string(phalcon_storage_adapterfactory_ce, SL("exception"), "Phalcon\\Storage\\Exception", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_storage_adapterfactory_ce, SL("serializerFactory"), ZEND_ACC_PRIVATE);
- return SUCCESS;
+ RETURN_MM_STRING("");
}
-static PHP_METHOD(Phalcon_Storage_AdapterFactory, __construct)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, truncateTable)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval services;
- zval *factory, factory_sub, *services_param = NULL;
+ zval *tableName_param = NULL, *schemaName_param = NULL, table;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
- ZVAL_UNDEF(&services);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&table);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- 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_START(2, 2)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &factory, &services_param);
- if (!services_param) {
- ZEPHIR_INIT_VAR(&services);
- array_init(&services);
+ zephir_fetch_params(1, 2, 0, &tableName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&services, services_param);
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
}
- 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();
+ if (!(ZEPHIR_IS_EMPTY(&schemaName))) {
+ ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, &tableName);
+ zephir_check_call_status();
+ }
+ ZEPHIR_CONCAT_SV(return_value, "TRUNCATE TABLE ", &table);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_AdapterFactory, newInstance)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, viewExists)
{
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 *viewName_param = NULL, *schemaName_param = NULL;
+ zval viewName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&definition);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&viewName);
+ ZVAL_UNDEF(&schemaName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(name)
+ Z_PARAM_STR(viewName)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_STR_OR_NULL(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ zephir_fetch_params(1, 1, 1, &viewName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' 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(viewName_param) == IS_STRING)) {
+ zephir_get_strval(&viewName, viewName_param);
} else {
- ZEPHIR_INIT_VAR(&name);
+ ZEPHIR_INIT_VAR(&viewName);
}
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_get_strval(&schemaName, schemaName_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_OBS_VAR(&_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();
+ if (ZEPHIR_IS_NULL(&schemaName)) {
+ ZEPHIR_INIT_NVAR(&schemaName);
+ ZVAL_STRING(&schemaName, "public");
+ }
+ ZEPHIR_CONCAT_SVSVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM pg_views WHERE viewname='", &viewName, "' AND schemaname='", &schemaName, "'");
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_AdapterFactory, getAdapters)
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, castDefault)
{
+ zend_bool _2, _3, _4, _5;
+ zval preparedValue, _6$$5;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *column, column_sub, defaultValue, columnDefinition, columnType, _0, _1, _7$$6, _8$$6, _9$$6;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&defaultValue);
+ ZVAL_UNDEF(&columnDefinition);
+ ZVAL_UNDEF(&columnType);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_8$$6);
+ ZVAL_UNDEF(&_9$$6);
+ ZVAL_UNDEF(&preparedValue);
+ ZVAL_UNDEF(&_6$$5);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
- zephir_create_array(return_value, 5, 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"));
- return;
-}
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &column);
+ ZEPHIR_CALL_METHOD(&defaultValue, column, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&columnDefinition, this_ptr, "getcolumndefinition", NULL, 0, column);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&columnType, column, "gettype", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_fast_strtoupper(&_0, &columnDefinition);
+ if (zephir_memnstr_str(&_0, SL("BOOLEAN"), "phalcon/Db/Dialect/Postgresql.zep", 699)) {
+ RETURN_CCTOR(&defaultValue);
+ }
+ ZEPHIR_INIT_VAR(&_1);
+ zephir_fast_strtoupper(&_1, &defaultValue);
+ if (zephir_memnstr_str(&_1, SL("CURRENT_TIMESTAMP"), "phalcon/Db/Dialect/Postgresql.zep", 703)) {
+ RETURN_MM_STRING("CURRENT_TIMESTAMP");
+ }
+ _2 = ZEPHIR_IS_LONG_IDENTICAL(&columnType, 0);
+ if (!(_2)) {
+ _2 = ZEPHIR_IS_LONG_IDENTICAL(&columnType, 14);
+ }
+ _3 = _2;
+ if (!(_3)) {
+ _3 = ZEPHIR_IS_LONG_IDENTICAL(&columnType, 3);
+ }
+ _4 = _3;
+ if (!(_4)) {
+ _4 = ZEPHIR_IS_LONG_IDENTICAL(&columnType, 7);
+ }
+ _5 = _4;
+ if (!(_5)) {
+ _5 = ZEPHIR_IS_LONG_IDENTICAL(&columnType, 9);
+ }
+ if (_5) {
+ zephir_cast_to_string(&_6$$5, &defaultValue);
+ ZEPHIR_CPY_WRT(&preparedValue, &_6$$5);
+ } else {
+ ZEPHIR_INIT_VAR(&_7$$6);
+ ZVAL_STRING(&_7$$6, "\'");
+ ZEPHIR_CALL_FUNCTION(&_8$$6, "addcslashes", NULL, 214, &defaultValue, &_7$$6);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_9$$6);
+ ZEPHIR_CONCAT_SVS(&_9$$6, "'", &_8$$6, "'");
+ zephir_get_strval(&preparedValue, &_9$$6);
+ }
+ RETURN_CTOR(&preparedValue);
+}
+static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getTableOptions)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *definition_param = NULL;
+ zval definition;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&definition);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(definition)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &definition_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param);
-
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Exception)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage, Exception, phalcon, storage_exception, phalcon_exception_ce, NULL, 0);
-
- return SUCCESS;
+ RETURN_MM_STRING("");
}
@@ -198861,1761 +197958,2236 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Exception)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_SerializerFactory)
+ZEPHIR_INIT_CLASS(Phalcon_Db_Dialect_Sqlite)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage, SerializerFactory, phalcon, storage_serializerfactory, phalcon_factory_abstractfactory_ce, phalcon_storage_serializerfactory_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Db\\Dialect, Sqlite, phalcon, db_dialect_sqlite, phalcon_db_dialect_ce, phalcon_db_dialect_sqlite_method_entry, 0);
- zend_declare_property_string(phalcon_storage_serializerfactory_ce, SL("exception"), "Phalcon\\Storage\\Exception", ZEND_ACC_PROTECTED);
+ zend_declare_property_string(phalcon_db_dialect_sqlite_ce, SL("escapeChar"), "\"", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_SerializerFactory, __construct)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addColumn)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *services_param = NULL;
- zval services;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, defaultValue, _0, _1, _2, _3, _4, _5, _10, _11, _6$$3, _7$$5, _8$$5, _9$$5;
+ zval tableName, schemaName, sql;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&services);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&defaultValue);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(services)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &services_param);
- if (!services_param) {
- ZEPHIR_INIT_VAR(&services);
- array_init(&services);
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &column);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&services, services_param);
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
}
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_CONCAT_SVS(&_1, "ALTER TABLE ", &_0, " ADD COLUMN ");
+ zephir_get_strval(&sql, &_1);
+ ZEPHIR_CALL_METHOD(&_2, column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_3, this_ptr, "getcolumndefinition", NULL, 0, column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_4);
+ ZEPHIR_CONCAT_SVSV(&_4, "\"", &_2, "\" ", &_3);
+ zephir_concat_self(&sql, &_4);
+ ZEPHIR_CALL_METHOD(&_5, column, "hasdefault", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_5)) {
+ ZEPHIR_CALL_METHOD(&defaultValue, column, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_6$$3);
+ zephir_fast_strtoupper(&_6$$3, &defaultValue);
+ if (zephir_memnstr_str(&_6$$3, SL("CURRENT_TIMESTAMP"), "phalcon/Db/Dialect/Sqlite.zep", 46)) {
+ zephir_concat_self_str(&sql, " DEFAULT CURRENT_TIMESTAMP", sizeof(" DEFAULT CURRENT_TIMESTAMP") - 1);
+ } else {
+ ZEPHIR_INIT_VAR(&_7$$5);
+ ZVAL_STRING(&_7$$5, "\"");
+ ZEPHIR_CALL_FUNCTION(&_8$$5, "addcslashes", NULL, 214, &defaultValue, &_7$$5);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_9$$5);
+ ZEPHIR_CONCAT_SVS(&_9$$5, " DEFAULT \"", &_8$$5, "\"");
+ zephir_concat_self(&sql, &_9$$5);
+ }
+ }
+ ZEPHIR_CALL_METHOD(&_10, column, "isnotnull", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_10)) {
+ zephir_concat_self_str(&sql, " NOT NULL", sizeof(" NOT NULL") - 1);
+ } else {
+ zephir_concat_self_str(&sql, " NULL", sizeof(" NULL") - 1);
+ }
+ ZEPHIR_CALL_METHOD(&_11, column, "isautoincrement", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_11)) {
+ zephir_concat_self_str(&sql, " PRIMARY KEY AUTOINCREMENT", sizeof(" PRIMARY KEY AUTOINCREMENT") - 1);
+ }
+ RETURN_CTOR(&sql);
}
-static PHP_METHOD(Phalcon_Storage_SerializerFactory, newInstance)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addForeignKey)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, definition;
- zval name;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *reference, reference_sub;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&reference_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(reference, phalcon_db_referenceinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, 3, 0, &tableName_param, &schemaName_param, &reference);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' 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(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&name);
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
}
- 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_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Storage_SerializerFactory, getAdapters)
-{
- zval *this_ptr = getThis();
-
-
-
- zephir_create_array(return_value, 6, 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("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"));
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Adding a foreign key constraint to an existing table is not supported by SQLite", "phalcon/Db/Dialect/Sqlite.zep", 73);
return;
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_AbstractAdapter)
-{
- 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_string(phalcon_storage_adapter_abstractadapter_ce, SL("prefix"), "", 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);
- zend_class_implements(phalcon_storage_adapter_abstractadapter_ce, 1, phalcon_storage_adapter_adapterinterface_ce);
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getDefaultSerializer)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "defaultSerializer");
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, setDefaultSerializer)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addIndex)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *defaultSerializer_param = NULL;
- zval defaultSerializer;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub, indexType, _5, _6, _7, _0$$3, _1$$5, _2$$5, _3$$6, _4$$6;
+ zval tableName, schemaName, sql;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&defaultSerializer);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&indexType);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$5);
+ ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&_3$$6);
+ ZVAL_UNDEF(&_4$$6);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(defaultSerializer)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(index, phalcon_db_indexinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &defaultSerializer_param);
- zephir_get_strval(&defaultSerializer, defaultSerializer_param);
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &defaultSerializer);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getPrefix)
-{
- zval *this_ptr = getThis();
-
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
- RETURN_MEMBER(getThis(), "prefix");
+ ZEPHIR_CALL_METHOD(&indexType, index, "gettype", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&indexType))) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZEPHIR_CONCAT_SVS(&_0$$3, "CREATE ", &indexType, " INDEX ");
+ zephir_get_strval(&sql, &_0$$3);
+ } else {
+ ZEPHIR_INIT_VAR(&sql);
+ ZVAL_STRING(&sql, "CREATE INDEX ");
+ }
+ if (!(ZEPHIR_IS_EMPTY(&schemaName))) {
+ ZEPHIR_CALL_METHOD(&_1$$5, index, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_2$$5);
+ ZEPHIR_CONCAT_SVSVS(&_2$$5, "\"", &schemaName, "\".\"", &_1$$5, "\"");
+ zephir_concat_self(&sql, &_2$$5);
+ } else {
+ ZEPHIR_CALL_METHOD(&_3$$6, index, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_4$$6);
+ ZEPHIR_CONCAT_SVS(&_4$$6, "\"", &_3$$6, "\"");
+ zephir_concat_self(&sql, &_4$$6);
+ }
+ ZEPHIR_CALL_METHOD(&_6, index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 67, &_6);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_7);
+ ZEPHIR_CONCAT_SVSVS(&_7, " ON \"", &tableName, "\" (", &_5, ")");
+ zephir_concat_self(&sql, &_7);
+ RETURN_CTOR(&sql);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, __construct)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addPrimaryKey)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_1 = NULL;
- zval options;
- zval *factory, factory_sub, *options_param = NULL, _0, _2, _3, _4, _5, _6$$3;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6$$3);
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&index_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- 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_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(index, phalcon_db_indexinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &factory, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_INIT_VAR(&tableName);
}
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("serializerFactory"), factory);
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "defaultSerializer");
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "Php");
- ZEPHIR_CALL_CE_STATIC(&_0, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &_0);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "lifetime");
- ZVAL_LONG(&_5, 3600);
- ZEPHIR_CALL_CE_STATIC(&_4, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_5);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("lifetime"), &_4);
- if (zephir_array_isset_string(&options, SL("prefix"))) {
- zephir_array_fetch_string(&_6$$3, &options, SL("prefix"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/AbstractAdapter.zep", 81);
- zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_6$$3);
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
}
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, clear)
-{
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, decrement)
-{
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, delete)
-{
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, get)
-{
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getAdapter)
-{
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getKeys)
-{
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, has)
-{
-}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, increment)
-{
-}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, set)
-{
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Adding a primary key after table has been created is not supported by SQLite", "phalcon/Db/Dialect/Sqlite.zep", 110);
+ return;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getFilteredKeys)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable)
{
- zval results;
+ zend_bool hasPrimary = 0, _8$$7, _10$$7, _21$$15, _23$$15, _32$$24, _33$$24, _42$$27, _43$$27;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_5 = NULL;
+ zephir_fcall_cache_entry *_6 = NULL, *_15 = NULL, *_37 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval prefix;
- zval *keys = NULL, keys_sub, *prefix_param = NULL, key, pattern, _0, _1, *_2, _3, _4$$3, _6$$5;
+ zval definition;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, columns, table, temporary, options, createLines, columnLine, column, indexes, index, indexName, indexType, references, reference, defaultValue, referenceSql, onDelete, onUpdate, *_2, _3, _69, _70, _0$$5, _1$$6, _4$$7, _5$$7, _7$$7, _9$$7, _11$$7, _17$$7, _12$$10, _13$$12, _14$$12, _16$$12, _18$$15, _19$$15, _20$$15, _22$$15, _24$$15, _29$$15, _25$$18, _26$$20, _27$$20, _28$$20, *_30$$23, _31$$23, _34$$24, _35$$25, _36$$25, _38$$25, _39$$26, _40$$26, _41$$26, _44$$27, _45$$28, _46$$28, _47$$28, _48$$29, _49$$29, _50$$29, *_51$$30, _52$$30, _53$$31, _54$$31, _55$$31, _56$$31, _57$$31, _58$$31, _59$$32, _60$$33, _61$$34, _62$$34, _63$$34, _64$$34, _65$$34, _66$$34, _67$$35, _68$$36;
+ zval tableName, schemaName, sql;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&keys_sub);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&sql);
+ ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&temporary);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&createLines);
+ ZVAL_UNDEF(&columnLine);
+ ZVAL_UNDEF(&column);
+ ZVAL_UNDEF(&indexes);
+ ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&indexName);
+ ZVAL_UNDEF(&indexType);
+ ZVAL_UNDEF(&references);
+ ZVAL_UNDEF(&reference);
+ ZVAL_UNDEF(&defaultValue);
+ ZVAL_UNDEF(&referenceSql);
+ ZVAL_UNDEF(&onDelete);
+ ZVAL_UNDEF(&onUpdate);
ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&prefix);
- ZVAL_UNDEF(&results);
+ ZVAL_UNDEF(&_69);
+ ZVAL_UNDEF(&_70);
+ ZVAL_UNDEF(&_0$$5);
+ ZVAL_UNDEF(&_1$$6);
+ ZVAL_UNDEF(&_4$$7);
+ ZVAL_UNDEF(&_5$$7);
+ ZVAL_UNDEF(&_7$$7);
+ ZVAL_UNDEF(&_9$$7);
+ ZVAL_UNDEF(&_11$$7);
+ ZVAL_UNDEF(&_17$$7);
+ ZVAL_UNDEF(&_12$$10);
+ ZVAL_UNDEF(&_13$$12);
+ ZVAL_UNDEF(&_14$$12);
+ ZVAL_UNDEF(&_16$$12);
+ ZVAL_UNDEF(&_18$$15);
+ ZVAL_UNDEF(&_19$$15);
+ ZVAL_UNDEF(&_20$$15);
+ ZVAL_UNDEF(&_22$$15);
+ ZVAL_UNDEF(&_24$$15);
+ ZVAL_UNDEF(&_29$$15);
+ ZVAL_UNDEF(&_25$$18);
+ ZVAL_UNDEF(&_26$$20);
+ ZVAL_UNDEF(&_27$$20);
+ ZVAL_UNDEF(&_28$$20);
+ ZVAL_UNDEF(&_31$$23);
+ ZVAL_UNDEF(&_34$$24);
+ ZVAL_UNDEF(&_35$$25);
+ ZVAL_UNDEF(&_36$$25);
+ ZVAL_UNDEF(&_38$$25);
+ ZVAL_UNDEF(&_39$$26);
+ ZVAL_UNDEF(&_40$$26);
+ ZVAL_UNDEF(&_41$$26);
+ ZVAL_UNDEF(&_44$$27);
+ ZVAL_UNDEF(&_45$$28);
+ ZVAL_UNDEF(&_46$$28);
+ ZVAL_UNDEF(&_47$$28);
+ ZVAL_UNDEF(&_48$$29);
+ ZVAL_UNDEF(&_49$$29);
+ ZVAL_UNDEF(&_50$$29);
+ ZVAL_UNDEF(&_52$$30);
+ ZVAL_UNDEF(&_53$$31);
+ ZVAL_UNDEF(&_54$$31);
+ ZVAL_UNDEF(&_55$$31);
+ ZVAL_UNDEF(&_56$$31);
+ ZVAL_UNDEF(&_57$$31);
+ ZVAL_UNDEF(&_58$$31);
+ ZVAL_UNDEF(&_59$$32);
+ ZVAL_UNDEF(&_60$$33);
+ ZVAL_UNDEF(&_61$$34);
+ ZVAL_UNDEF(&_62$$34);
+ ZVAL_UNDEF(&_63$$34);
+ ZVAL_UNDEF(&_64$$34);
+ ZVAL_UNDEF(&_65$$34);
+ ZVAL_UNDEF(&_66$$34);
+ ZVAL_UNDEF(&_67$$35);
+ ZVAL_UNDEF(&_68$$36);
+ ZVAL_UNDEF(&definition);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(keys)
- Z_PARAM_STR(prefix)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_ARRAY(definition)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &definition_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) {
- zephir_get_strval(&prefix, prefix_param);
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&prefix);
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
}
+ ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param);
- 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);
+ ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&temporary);
+ ZVAL_BOOL(&temporary, 0);
+ ZEPHIR_OBS_VAR(&options);
+ if (zephir_array_isset_string_fetch(&options, &definition, SL("options"), 0)) {
+ ZEPHIR_OBS_NVAR(&temporary);
+ zephir_array_isset_string_fetch(&temporary, &options, SL("temporary"), 0);
+ }
+ ZEPHIR_OBS_VAR(&columns);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'columns' is required in the definition array", "phalcon/Db/Dialect/Sqlite.zep", 134);
+ return;
+ }
+ if (zephir_is_true(&temporary)) {
+ ZEPHIR_INIT_VAR(&_0$$5);
+ ZEPHIR_CONCAT_SV(&_0$$5, "CREATE TEMPORARY TABLE ", &table);
+ zephir_get_strval(&sql, &_0$$5);
} else {
- ZEPHIR_CPY_WRT(&_1, keys);
+ ZEPHIR_INIT_VAR(&_1$$6);
+ ZEPHIR_CONCAT_SV(&_1$$6, "CREATE TABLE ", &table);
+ zephir_get_strval(&sql, &_1$$6);
}
- ZEPHIR_CPY_WRT(keys, &_1);
- zephir_is_iterable(keys, 0, "phalcon/Storage/Adapter/AbstractAdapter.zep", 162);
- if (Z_TYPE_P(keys) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _2)
+ zephir_concat_self_str(&sql, " (\n\t", sizeof(" (\n\t") - 1);
+ hasPrimary = 0;
+ ZEPHIR_INIT_VAR(&createLines);
+ array_init(&createLines);
+ zephir_is_iterable(&columns, 0, "phalcon/Db/Dialect/Sqlite.zep", 197);
+ if (Z_TYPE_P(&columns) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&columns), _2)
{
- ZEPHIR_INIT_NVAR(&key);
- ZVAL_COPY(&key, _2);
- ZEPHIR_CALL_CE_STATIC(&_4$$3, phalcon_helper_str_ce, "startswith", &_5, 17, &key, &pattern);
+ ZEPHIR_INIT_NVAR(&column);
+ ZVAL_COPY(&column, _2);
+ ZEPHIR_CALL_METHOD(&_4$$7, &column, "getname", NULL, 0);
zephir_check_call_status();
- if (zephir_is_true(&_4$$3)) {
- zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/AbstractAdapter.zep", 158);
+ ZEPHIR_CALL_METHOD(&_5$$7, this_ptr, "getcolumndefinition", &_6, 0, &column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&columnLine);
+ ZEPHIR_CONCAT_SVSV(&columnLine, "`", &_4$$7, "` ", &_5$$7);
+ ZEPHIR_CALL_METHOD(&_7$$7, &column, "isprimary", NULL, 0);
+ zephir_check_call_status();
+ _8$$7 = zephir_is_true(&_7$$7);
+ if (_8$$7) {
+ _8$$7 = !hasPrimary;
+ }
+ if (_8$$7) {
+ zephir_concat_self_str(&columnLine, SL(" PRIMARY KEY"));
+ hasPrimary = 1;
+ }
+ ZEPHIR_CALL_METHOD(&_9$$7, &column, "isautoincrement", NULL, 0);
+ zephir_check_call_status();
+ _10$$7 = zephir_is_true(&_9$$7);
+ if (_10$$7) {
+ _10$$7 = hasPrimary;
+ }
+ if (_10$$7) {
+ zephir_concat_self_str(&columnLine, SL(" AUTOINCREMENT"));
+ }
+ ZEPHIR_CALL_METHOD(&_11$$7, &column, "hasdefault", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_11$$7)) {
+ ZEPHIR_CALL_METHOD(&defaultValue, &column, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_12$$10);
+ zephir_fast_strtoupper(&_12$$10, &defaultValue);
+ if (zephir_memnstr_str(&_12$$10, SL("CURRENT_TIMESTAMP"), "phalcon/Db/Dialect/Sqlite.zep", 175)) {
+ zephir_concat_self_str(&columnLine, SL(" DEFAULT CURRENT_TIMESTAMP"));
+ } else {
+ ZEPHIR_INIT_NVAR(&_13$$12);
+ ZVAL_STRING(&_13$$12, "\"");
+ ZEPHIR_CALL_FUNCTION(&_14$$12, "addcslashes", &_15, 214, &defaultValue, &_13$$12);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_16$$12);
+ ZEPHIR_CONCAT_SVS(&_16$$12, " DEFAULT \"", &_14$$12, "\"");
+ zephir_concat_self(&columnLine, &_16$$12);
+ }
+ }
+ ZEPHIR_CALL_METHOD(&_17$$7, &column, "isnotnull", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_17$$7)) {
+ zephir_concat_self_str(&columnLine, SL(" NOT NULL"));
+ } else {
+ zephir_concat_self_str(&columnLine, SL(" NULL"));
}
+ zephir_array_append(&createLines, &columnLine, PH_SEPARATE, "phalcon/Db/Dialect/Sqlite.zep", 191);
} ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_CALL_METHOD(NULL, keys, "rewind", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &columns, "rewind", NULL, 0);
zephir_check_call_status();
while (1) {
- ZEPHIR_CALL_METHOD(&_3, keys, "valid", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_3, &columns, "valid", NULL, 0);
zephir_check_call_status();
if (!zend_is_true(&_3)) {
break;
}
- ZEPHIR_CALL_METHOD(&key, keys, "current", NULL, 0);
+ ZEPHIR_CALL_METHOD(&column, &columns, "current", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_CE_STATIC(&_6$$5, phalcon_helper_str_ce, "startswith", &_5, 17, &key, &pattern);
+ ZEPHIR_CALL_METHOD(&_18$$15, &column, "getname", NULL, 0);
zephir_check_call_status();
- if (zephir_is_true(&_6$$5)) {
- zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/AbstractAdapter.zep", 158);
+ ZEPHIR_CALL_METHOD(&_19$$15, this_ptr, "getcolumndefinition", &_6, 0, &column);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&columnLine);
+ ZEPHIR_CONCAT_SVSV(&columnLine, "`", &_18$$15, "` ", &_19$$15);
+ ZEPHIR_CALL_METHOD(&_20$$15, &column, "isprimary", NULL, 0);
+ zephir_check_call_status();
+ _21$$15 = zephir_is_true(&_20$$15);
+ if (_21$$15) {
+ _21$$15 = !hasPrimary;
}
- ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0);
+ if (_21$$15) {
+ zephir_concat_self_str(&columnLine, SL(" PRIMARY KEY"));
+ hasPrimary = 1;
+ }
+ ZEPHIR_CALL_METHOD(&_22$$15, &column, "isautoincrement", NULL, 0);
+ zephir_check_call_status();
+ _23$$15 = zephir_is_true(&_22$$15);
+ if (_23$$15) {
+ _23$$15 = hasPrimary;
+ }
+ if (_23$$15) {
+ zephir_concat_self_str(&columnLine, SL(" AUTOINCREMENT"));
+ }
+ ZEPHIR_CALL_METHOD(&_24$$15, &column, "hasdefault", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_24$$15)) {
+ ZEPHIR_CALL_METHOD(&defaultValue, &column, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_25$$18);
+ zephir_fast_strtoupper(&_25$$18, &defaultValue);
+ if (zephir_memnstr_str(&_25$$18, SL("CURRENT_TIMESTAMP"), "phalcon/Db/Dialect/Sqlite.zep", 175)) {
+ zephir_concat_self_str(&columnLine, SL(" DEFAULT CURRENT_TIMESTAMP"));
+ } else {
+ ZEPHIR_INIT_NVAR(&_26$$20);
+ ZVAL_STRING(&_26$$20, "\"");
+ ZEPHIR_CALL_FUNCTION(&_27$$20, "addcslashes", &_15, 214, &defaultValue, &_26$$20);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_28$$20);
+ ZEPHIR_CONCAT_SVS(&_28$$20, " DEFAULT \"", &_27$$20, "\"");
+ zephir_concat_self(&columnLine, &_28$$20);
+ }
+ }
+ ZEPHIR_CALL_METHOD(&_29$$15, &column, "isnotnull", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_29$$15)) {
+ zephir_concat_self_str(&columnLine, SL(" NOT NULL"));
+ } else {
+ zephir_concat_self_str(&columnLine, SL(" NULL"));
+ }
+ zephir_array_append(&createLines, &columnLine, PH_SEPARATE, "phalcon/Db/Dialect/Sqlite.zep", 191);
+ ZEPHIR_CALL_METHOD(NULL, &columns, "next", NULL, 0);
zephir_check_call_status();
}
}
- ZEPHIR_INIT_NVAR(&key);
- RETURN_CTOR(&results);
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getPrefixedKey)
-{
- zval _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key = NULL, key_sub, _1;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&key_sub);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(key)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- 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();
+ ZEPHIR_INIT_NVAR(&column);
+ ZEPHIR_OBS_VAR(&indexes);
+ if (zephir_array_isset_string_fetch(&indexes, &definition, SL("indexes"), 0)) {
+ zephir_is_iterable(&indexes, 0, "phalcon/Db/Dialect/Sqlite.zep", 211);
+ if (Z_TYPE_P(&indexes) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&indexes), _30$$23)
+ {
+ ZEPHIR_INIT_NVAR(&index);
+ ZVAL_COPY(&index, _30$$23);
+ ZEPHIR_CALL_METHOD(&indexName, &index, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&indexType, &index, "gettype", NULL, 0);
+ zephir_check_call_status();
+ _32$$24 = ZEPHIR_IS_STRING(&indexName, "PRIMARY");
+ if (_32$$24) {
+ _32$$24 = !hasPrimary;
+ }
+ _33$$24 = !(ZEPHIR_IS_EMPTY(&indexType));
+ if (_33$$24) {
+ ZEPHIR_INIT_NVAR(&_34$$24);
+ zephir_fast_strtoupper(&_34$$24, &indexType);
+ _33$$24 = zephir_memnstr_str(&_34$$24, SL("UNIQUE"), "phalcon/Db/Dialect/Sqlite.zep", 207);
+ }
+ if (_32$$24) {
+ ZEPHIR_CALL_METHOD(&_36$$25, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_35$$25, this_ptr, "getcolumnlist", &_37, 67, &_36$$25);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_38$$25);
+ ZEPHIR_CONCAT_SVS(&_38$$25, "PRIMARY KEY (", &_35$$25, ")");
+ zephir_array_append(&createLines, &_38$$25, PH_SEPARATE, "phalcon/Db/Dialect/Sqlite.zep", 206);
+ } else if (_33$$24) {
+ ZEPHIR_CALL_METHOD(&_40$$26, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_39$$26, this_ptr, "getcolumnlist", &_37, 67, &_40$$26);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_41$$26);
+ ZEPHIR_CONCAT_SVS(&_41$$26, "UNIQUE (", &_39$$26, ")");
+ zephir_array_append(&createLines, &_41$$26, PH_SEPARATE, "phalcon/Db/Dialect/Sqlite.zep", 208);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &indexes, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_31$$23, &indexes, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_31$$23)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&index, &indexes, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&indexName, &index, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&indexType, &index, "gettype", NULL, 0);
+ zephir_check_call_status();
+ _42$$27 = ZEPHIR_IS_STRING(&indexName, "PRIMARY");
+ if (_42$$27) {
+ _42$$27 = !hasPrimary;
+ }
+ _43$$27 = !(ZEPHIR_IS_EMPTY(&indexType));
+ if (_43$$27) {
+ ZEPHIR_INIT_NVAR(&_44$$27);
+ zephir_fast_strtoupper(&_44$$27, &indexType);
+ _43$$27 = zephir_memnstr_str(&_44$$27, SL("UNIQUE"), "phalcon/Db/Dialect/Sqlite.zep", 207);
+ }
+ if (_42$$27) {
+ ZEPHIR_CALL_METHOD(&_46$$28, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_45$$28, this_ptr, "getcolumnlist", &_37, 67, &_46$$28);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_47$$28);
+ ZEPHIR_CONCAT_SVS(&_47$$28, "PRIMARY KEY (", &_45$$28, ")");
+ zephir_array_append(&createLines, &_47$$28, PH_SEPARATE, "phalcon/Db/Dialect/Sqlite.zep", 206);
+ } else if (_43$$27) {
+ ZEPHIR_CALL_METHOD(&_49$$29, &index, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_48$$29, this_ptr, "getcolumnlist", &_37, 67, &_49$$29);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_50$$29);
+ ZEPHIR_CONCAT_SVS(&_50$$29, "UNIQUE (", &_48$$29, ")");
+ zephir_array_append(&createLines, &_50$$29, PH_SEPARATE, "phalcon/Db/Dialect/Sqlite.zep", 208);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &indexes, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&index);
+ }
+ ZEPHIR_OBS_VAR(&references);
+ if (zephir_array_isset_string_fetch(&references, &definition, SL("references"), 0)) {
+ zephir_is_iterable(&references, 0, "phalcon/Db/Dialect/Sqlite.zep", 233);
+ if (Z_TYPE_P(&references) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&references), _51$$30)
+ {
+ ZEPHIR_INIT_NVAR(&reference);
+ ZVAL_COPY(&reference, _51$$30);
+ ZEPHIR_CALL_METHOD(&_53$$31, &reference, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_55$$31, &reference, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_54$$31, this_ptr, "getcolumnlist", &_37, 67, &_55$$31);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_56$$31, &reference, "getreferencedtable", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_58$$31, &reference, "getreferencedcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_57$$31, this_ptr, "getcolumnlist", &_37, 67, &_58$$31);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&referenceSql);
+ ZEPHIR_CONCAT_SVSVSSVSVS(&referenceSql, "CONSTRAINT `", &_53$$31, "` FOREIGN KEY (", &_54$$31, ")", " REFERENCES `", &_56$$31, "`(", &_57$$31, ")");
+ ZEPHIR_CALL_METHOD(&onDelete, &reference, "getondelete", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onDelete))) {
+ ZEPHIR_INIT_NVAR(&_59$$32);
+ ZEPHIR_CONCAT_SV(&_59$$32, " ON DELETE ", &onDelete);
+ zephir_concat_self(&referenceSql, &_59$$32);
+ }
+ ZEPHIR_CALL_METHOD(&onUpdate, &reference, "getonupdate", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onUpdate))) {
+ ZEPHIR_INIT_NVAR(&_60$$33);
+ ZEPHIR_CONCAT_SV(&_60$$33, " ON UPDATE ", &onUpdate);
+ zephir_concat_self(&referenceSql, &_60$$33);
+ }
+ zephir_array_append(&createLines, &referenceSql, PH_SEPARATE, "phalcon/Db/Dialect/Sqlite.zep", 231);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &references, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_52$$30, &references, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_52$$30)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&reference, &references, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_61$$34, &reference, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_63$$34, &reference, "getcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_62$$34, this_ptr, "getcolumnlist", &_37, 67, &_63$$34);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_64$$34, &reference, "getreferencedtable", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_66$$34, &reference, "getreferencedcolumns", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_65$$34, this_ptr, "getcolumnlist", &_37, 67, &_66$$34);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&referenceSql);
+ ZEPHIR_CONCAT_SVSVSSVSVS(&referenceSql, "CONSTRAINT `", &_61$$34, "` FOREIGN KEY (", &_62$$34, ")", " REFERENCES `", &_64$$34, "`(", &_65$$34, ")");
+ ZEPHIR_CALL_METHOD(&onDelete, &reference, "getondelete", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onDelete))) {
+ ZEPHIR_INIT_NVAR(&_67$$35);
+ ZEPHIR_CONCAT_SV(&_67$$35, " ON DELETE ", &onDelete);
+ zephir_concat_self(&referenceSql, &_67$$35);
+ }
+ ZEPHIR_CALL_METHOD(&onUpdate, &reference, "getonupdate", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&onUpdate))) {
+ ZEPHIR_INIT_NVAR(&_68$$36);
+ ZEPHIR_CONCAT_SV(&_68$$36, " ON UPDATE ", &onUpdate);
+ zephir_concat_self(&referenceSql, &_68$$36);
+ }
+ zephir_array_append(&createLines, &referenceSql, PH_SEPARATE, "phalcon/Db/Dialect/Sqlite.zep", 231);
+ ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&reference);
+ }
+ ZEPHIR_INIT_VAR(&_69);
+ zephir_fast_join_str(&_69, SL(",\n\t"), &createLines);
+ ZEPHIR_INIT_VAR(&_70);
+ ZEPHIR_CONCAT_VS(&_70, &_69, "\n)");
+ zephir_concat_self(&sql, &_70);
+ RETURN_CTOR(&sql);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getSerializedData)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createView)
{
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 definition;
+ zval *viewName_param = NULL, *definition_param = NULL, *schemaName_param = NULL, viewSql, _0;
+ zval viewName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&content_sub);
+ ZVAL_UNDEF(&viewName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&viewSql);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&definition);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(content)
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(viewName)
+ Z_PARAM_ARRAY(definition)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &content);
- ZEPHIR_SEPARATE_PARAM(content);
+ zephir_fetch_params(1, 2, 1, &viewName_param, &definition_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) {
+ zephir_get_strval(&viewName, viewName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&viewName);
+ }
+ ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ zephir_get_strval(&schemaName, schemaName_param);
+ }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC | PH_READONLY);
- if (!ZEPHIR_IS_STRING_IDENTICAL(&_0, "")) {
- 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_OBS_VAR(&viewSql);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&viewSql, &definition, SL("sql"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'sql' is required in the definition array", "phalcon/Db/Dialect/Sqlite.zep", 250);
+ return;
}
- RETVAL_ZVAL(content, 1, 0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &viewName, &schemaName);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SVSV(return_value, "CREATE VIEW ", &_0, " AS ", &viewSql);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getTtl)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, describeColumns)
{
- 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 *table_param = NULL, *schema_param = NULL;
+ zval table, schema;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&ttl_sub);
- ZVAL_UNDEF(&dateTime);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(ttl)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &ttl);
-
-
- if (Z_TYPE_P(ttl) == IS_NULL) {
- RETURN_MM_MEMBER(getThis(), "lifetime");
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
}
- _0 = Z_TYPE_P(ttl) == IS_OBJECT;
- if (_0) {
- _0 = zephir_is_instance_of(ttl, SL("DateInterval"));
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
}
- 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();
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
}
- RETURN_MM_LONG(zephir_get_intval(ttl));
+
+
+ ZEPHIR_CONCAT_SVS(return_value, "PRAGMA table_info('", &table, "')");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getUnserializedData)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, describeIndex)
{
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 *index_param = NULL;
+ zval index;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&content_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&index);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(content)
+ Z_PARAM_STR(index)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &content);
- ZEPHIR_SEPARATE_PARAM(content);
+ 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("defaultSerializer"), PH_NOISY_CC | PH_READONLY);
- if (!ZEPHIR_IS_STRING_IDENTICAL(&_0, "")) {
- 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(content, &_2$$3, "getdata", NULL, 0);
- zephir_check_call_status();
- }
- RETVAL_ZVAL(content, 1, 0);
+ ZEPHIR_CONCAT_SVS(return_value, "PRAGMA index_info('", &index, "')");
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, initSerializer)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, describeIndexes)
{
- zend_bool _1;
- zval _0, _2, _3$$3, _4$$3, _5$$3;
- zval className;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *table_param = NULL, *schema_param = NULL;
+ zval table, schema;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&className);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
-
- ZEPHIR_OBS_VAR(&_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC);
- _1 = Z_TYPE_P(&_0) == IS_OBJECT;
- if (_1) {
- ZEPHIR_OBS_VAR(&_2);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC);
- _1 = zephir_instance_of_ev(&_2, phalcon_storage_serializer_serializerinterface_ce);
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
}
- if (!(_1)) {
- zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&className);
- zephir_fast_strtolower(&className, &_3$$3);
- zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("serializerFactory"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_5$$3, &_4$$3, "newinstance", NULL, 0, &className);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("serializer"), &_5$$3);
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
+ }
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
}
- ZEPHIR_MM_RESTORE();
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_AdapterInterface)
-{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Storage\\Adapter, AdapterInterface, phalcon, storage_adapter_adapterinterface, phalcon_storage_adapter_adapterinterface_method_entry);
- return SUCCESS;
+ ZEPHIR_CONCAT_SVS(return_value, "PRAGMA index_list('", &table, "')");
+ RETURN_MM();
}
-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);
-
-
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, describeReferences)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *table_param = NULL, *schema_param = NULL;
+ zval table, schema;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schema)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
+ } else {
+ ZEPHIR_INIT_VAR(&table);
+ }
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
+ }
-
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Apcu)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Adapter, Apcu, phalcon, storage_adapter_apcu, phalcon_storage_adapter_abstractadapter_ce, phalcon_storage_adapter_apcu_method_entry, 0);
-
- zend_declare_property_null(phalcon_storage_adapter_apcu_ce, SL("options"), ZEND_ACC_PROTECTED);
- phalcon_storage_adapter_apcu_ce->create_object = zephir_init_properties_Phalcon_Storage_Adapter_Apcu;
-
- return SUCCESS;
+ ZEPHIR_CONCAT_SVS(return_value, "PRAGMA foreign_key_list('", &table, "')");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, __construct)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropColumn)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_1 = NULL;
- zval options;
- zval *factory, factory_sub, *options_param = NULL, _0;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *columnName_param = NULL;
+ zval tableName, schemaName, columnName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&columnName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- 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_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_STR(columnName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &factory, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &columnName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(columnName_param) != IS_STRING && Z_TYPE_P(columnName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'columnName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(columnName_param) == IS_STRING)) {
+ zephir_get_strval(&columnName, columnName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&columnName);
}
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "ph-apcu-");
- zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
- ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_apcu_ce, getThis(), "__construct", &_1, 0, factory, &options);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "initserializer", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Dropping DB column is not supported by SQLite", "phalcon/Db/Dialect/Sqlite.zep", 299);
+ return;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, clear)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropForeignKey)
{
- 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 *tableName_param = NULL, *schemaName_param = NULL, *referenceName_param = NULL;
+ zval tableName, schemaName, referenceName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&item);
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&apc);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&referenceName);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_STR(referenceName)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
-
- 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_INIT_NVAR(&apc);
- object_init_ex(&apc, zephir_get_internal_ce(SL("apcuiterator")));
- ZEPHIR_CALL_METHOD(NULL, &apc, "__construct", NULL, 0, &pattern);
- zephir_check_call_status();
- result = 1;
- if (Z_TYPE_P(&apc) != IS_OBJECT) {
- RETURN_MM_BOOL(0);
+ zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &referenceName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string"));
+ RETURN_MM_NULL();
}
- _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", 69);
- ZEPHIR_CALL_FUNCTION(&_3$$4, "apcu_delete", &_4, 119, &_2$$4);
- zephir_check_call_status();
- if (!(zephir_is_true(&_3$$4))) {
- result = 0;
- }
+ if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&tableName);
}
- zend_iterator_dtor(_1);
- RETURN_MM_BOOL(result);
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(referenceName_param) != IS_STRING && Z_TYPE_P(referenceName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(referenceName_param) == IS_STRING)) {
+ zephir_get_strval(&referenceName, referenceName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&referenceName);
+ }
+
+
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Dropping a foreign key constraint is not supported by SQLite", "phalcon/Db/Dialect/Sqlite.zep", 309);
+ return;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, decrement)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropIndex)
{
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 *tableName_param = NULL, *schemaName_param = NULL, *indexName_param = NULL;
+ zval tableName, schemaName, indexName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&indexName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_STR(indexName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, 3, 0, &tableName_param, &schemaName_param, &indexName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' 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(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_VAR(&tableName);
}
- if (!value_param) {
- value = 1;
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
} else {
- value = zephir_get_intval(value_param);
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(indexName_param) != IS_STRING && Z_TYPE_P(indexName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'indexName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(indexName_param) == IS_STRING)) {
+ zephir_get_strval(&indexName, indexName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&indexName);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- ZVAL_LONG(&_1, value);
- ZEPHIR_RETURN_CALL_FUNCTION("apcu_dec", NULL, 120, &_0, &_1);
- zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&schemaName))) {
+ ZEPHIR_CONCAT_SVSVS(return_value, "DROP INDEX \"", &schemaName, "\".\"", &indexName, "\"");
+ RETURN_MM();
+ }
+ ZEPHIR_CONCAT_SVS(return_value, "DROP INDEX \"", &indexName, "\"");
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, delete)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropPrimaryKey)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _0;
- zval key;
+ zval *tableName_param = NULL, *schemaName_param = NULL;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, 2, 0, &tableName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' 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(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_FUNCTION("apcu_delete", NULL, 119, &_0);
- zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Removing a primary key after table has been created is not supported by SQLite", "phalcon/Db/Dialect/Sqlite.zep", 331);
+ return;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, get)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropTable)
{
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, _1;
- zval key;
+ zend_bool ifExists;
+ zval *tableName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, table;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&content);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&table);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(tableName)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_STR_OR_NULL(schemaName)
+ Z_PARAM_BOOL(ifExists)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ zephir_fetch_params(1, 1, 2, &tableName_param, &schemaName_param, &ifExists_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' 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(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_VAR(&tableName);
}
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ zephir_get_strval(&schemaName, schemaName_param);
+ }
+ if (!ifExists_param) {
+ ifExists = 1;
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_TRUE && Z_TYPE_P(ifExists_param) != IS_FALSE)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be of the type bool"));
+ RETURN_MM_NULL();
+ }
+ ifExists = (Z_TYPE_P(ifExists_param) == IS_TRUE);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
+ ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName);
zephir_check_call_status();
- if (ZEPHIR_IS_FALSE(&_0)) {
- RETVAL_ZVAL(defaultValue, 1, 0);
+ if (ifExists) {
+ ZEPHIR_CONCAT_SV(return_value, "DROP TABLE IF EXISTS ", &table);
RETURN_MM();
}
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&content, "apcu_fetch", NULL, 121, &_1);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &content);
- zephir_check_call_status();
+ ZEPHIR_CONCAT_SV(return_value, "DROP TABLE ", &table);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, getAdapter)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "adapter");
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, getKeys)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropView)
{
- 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;
+ zend_bool ifExists;
+ zval *viewName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, view;
+ zval viewName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&prefix);
- ZVAL_UNDEF(&item);
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&apc);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&results);
+ ZVAL_UNDEF(&viewName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&view);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(viewName)
Z_PARAM_OPTIONAL
- Z_PARAM_STR(prefix)
+ Z_PARAM_STR_OR_NULL(schemaName)
+ Z_PARAM_BOOL(ifExists)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ zephir_fetch_params(1, 1, 2, &viewName_param, &schemaName_param, &ifExists_param);
+ if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) {
- zephir_get_strval(&prefix, prefix_param);
+ if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) {
+ zephir_get_strval(&viewName, viewName_param);
} else {
- ZEPHIR_INIT_VAR(&prefix);
+ ZEPHIR_INIT_VAR(&viewName);
+ }
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ zephir_get_strval(&schemaName, schemaName_param);
+ }
+ if (!ifExists_param) {
+ ifExists = 1;
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_TRUE && Z_TYPE_P(ifExists_param) != IS_FALSE)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be of the type bool"));
+ RETURN_MM_NULL();
}
+ ifExists = (Z_TYPE_P(ifExists_param) == IS_TRUE);
}
- 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_INIT_NVAR(&apc);
- object_init_ex(&apc, zephir_get_internal_ce(SL("apcuiterator")));
- ZEPHIR_CALL_METHOD(NULL, &apc, "__construct", NULL, 0, &pattern);
+ ZEPHIR_CALL_METHOD(&view, this_ptr, "preparetable", NULL, 0, &viewName, &schemaName);
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", 152);
- zephir_array_append(&results, &_2$$4, PH_SEPARATE, "phalcon/Storage/Adapter/Apcu.zep", 152);
+ if (ifExists) {
+ ZEPHIR_CONCAT_SV(return_value, "DROP VIEW IF EXISTS ", &view);
+ RETURN_MM();
}
- zend_iterator_dtor(_1);
- RETURN_CTOR(&results);
+ ZEPHIR_CONCAT_SV(return_value, "DROP VIEW ", &view);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, has)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, forUpdate)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _0;
- zval key;
+ zval *sqlQuery_param = NULL;
+ zval sqlQuery;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&sqlQuery);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(sqlQuery)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, &sqlQuery_param);
+ if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' 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(sqlQuery_param) == IS_STRING)) {
+ zephir_get_strval(&sqlQuery, sqlQuery_param);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_VAR(&sqlQuery);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_FUNCTION("apcu_exists", NULL, 122, &_0);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_CTOR(&sqlQuery);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, increment)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, getColumnDefinition)
{
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 *_12 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *column, column_sub, columnType, columnSql, typeValues, _0$$3, _1$$10, _2$$16, _3$$18, _4$$35, _5$$38, _6$$38, _7$$38, value$$40, valueSql$$40, *_8$$40, _9$$40, _17$$40, _18$$40, _19$$40, _20$$40, _10$$41, _11$$41, _13$$41, _14$$42, _15$$42, _16$$42, _21$$43, _22$$43, _23$$43;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(&columnType);
+ ZVAL_UNDEF(&columnSql);
+ ZVAL_UNDEF(&typeValues);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$10);
+ ZVAL_UNDEF(&_2$$16);
+ ZVAL_UNDEF(&_3$$18);
+ ZVAL_UNDEF(&_4$$35);
+ ZVAL_UNDEF(&_5$$38);
+ ZVAL_UNDEF(&_6$$38);
+ ZVAL_UNDEF(&_7$$38);
+ ZVAL_UNDEF(&value$$40);
+ ZVAL_UNDEF(&valueSql$$40);
+ ZVAL_UNDEF(&_9$$40);
+ ZVAL_UNDEF(&_17$$40);
+ ZVAL_UNDEF(&_18$$40);
+ ZVAL_UNDEF(&_19$$40);
+ ZVAL_UNDEF(&_20$$40);
+ ZVAL_UNDEF(&_10$$41);
+ ZVAL_UNDEF(&_11$$41);
+ ZVAL_UNDEF(&_13$$41);
+ ZVAL_UNDEF(&_14$$42);
+ ZVAL_UNDEF(&_15$$42);
+ ZVAL_UNDEF(&_16$$42);
+ ZVAL_UNDEF(&_21$$43);
+ ZVAL_UNDEF(&_22$$43);
+ ZVAL_UNDEF(&_23$$43);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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 {
- value = zephir_get_intval(value_param);
- }
+ zephir_fetch_params(1, 1, 0, &column);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
+ ZEPHIR_CALL_METHOD(&columnSql, this_ptr, "checkcolumntypesql", NULL, 0, column);
zephir_check_call_status();
- ZVAL_LONG(&_1, value);
- ZEPHIR_RETURN_CALL_FUNCTION("apcu_inc", NULL, 123, &_0, &_1);
+ ZEPHIR_CALL_METHOD(&columnType, this_ptr, "checkcolumntype", NULL, 0, column);
zephir_check_call_status();
- RETURN_MM();
+ do {
+ if (ZEPHIR_IS_LONG(&columnType, 14)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("BIGINT"));
+ }
+ ZEPHIR_CALL_METHOD(&_0$$3, column, "isunsigned", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_0$$3)) {
+ zephir_concat_self_str(&columnSql, SL(" UNSIGNED"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 11)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("BLOB"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 8)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("TINYINT"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 5)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("CHARACTER"));
+ }
+ ZEPHIR_CALL_METHOD(&_1$$10, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ zephir_concat_self(&columnSql, &_1$$10);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 1)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("DATE"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 4)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("DATETIME"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 3)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("NUMERIC"));
+ }
+ ZEPHIR_CALL_METHOD(&_2$$16, this_ptr, "getcolumnsizeandscale", NULL, 0, column);
+ zephir_check_call_status();
+ zephir_concat_self(&columnSql, &_2$$16);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 9)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("DOUBLE"));
+ }
+ ZEPHIR_CALL_METHOD(&_3$$18, column, "isunsigned", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_3$$18)) {
+ zephir_concat_self_str(&columnSql, SL(" UNSIGNED"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 7)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("FLOAT"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 0)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("INTEGER"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 13)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("LONGBLOB"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 12)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("MEDIUMBLOB"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 6)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("TEXT"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 17)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("TIMESTAMP"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 10)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("TINYBLOB"));
+ }
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&columnType, 2)) {
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ zephir_concat_self_str(&columnSql, SL("VARCHAR"));
+ }
+ ZEPHIR_CALL_METHOD(&_4$$35, this_ptr, "getcolumnsize", NULL, 0, column);
+ zephir_check_call_status();
+ zephir_concat_self(&columnSql, &_4$$35);
+ break;
+ }
+ if (ZEPHIR_IS_EMPTY(&columnSql)) {
+ ZEPHIR_INIT_VAR(&_5$$38);
+ object_init_ex(&_5$$38, phalcon_db_exception_ce);
+ ZEPHIR_CALL_METHOD(&_6$$38, column, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_7$$38);
+ ZEPHIR_CONCAT_SV(&_7$$38, "Unrecognized SQLite data type at column ", &_6$$38);
+ ZEPHIR_CALL_METHOD(NULL, &_5$$38, "__construct", NULL, 8, &_7$$38);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_5$$38, "phalcon/Db/Dialect/Sqlite.zep", 520);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&typeValues, column, "gettypevalues", NULL, 0);
+ zephir_check_call_status();
+ if (!(ZEPHIR_IS_EMPTY(&typeValues))) {
+ if (Z_TYPE_P(&typeValues) == IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&valueSql$$40);
+ ZVAL_STRING(&valueSql$$40, "");
+ zephir_is_iterable(&typeValues, 0, "phalcon/Db/Dialect/Sqlite.zep", 534);
+ if (Z_TYPE_P(&typeValues) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&typeValues), _8$$40)
+ {
+ ZEPHIR_INIT_NVAR(&value$$40);
+ ZVAL_COPY(&value$$40, _8$$40);
+ ZEPHIR_INIT_NVAR(&_10$$41);
+ ZVAL_STRING(&_10$$41, "\"");
+ ZEPHIR_CALL_FUNCTION(&_11$$41, "addcslashes", &_12, 214, &value$$40, &_10$$41);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_13$$41);
+ ZEPHIR_CONCAT_SVS(&_13$$41, "\"", &_11$$41, "\", ");
+ zephir_concat_self(&valueSql$$40, &_13$$41);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &typeValues, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_9$$40, &typeValues, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_9$$40)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&value$$40, &typeValues, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_14$$42);
+ ZVAL_STRING(&_14$$42, "\"");
+ ZEPHIR_CALL_FUNCTION(&_15$$42, "addcslashes", &_12, 214, &value$$40, &_14$$42);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_16$$42);
+ ZEPHIR_CONCAT_SVS(&_16$$42, "\"", &_15$$42, "\", ");
+ zephir_concat_self(&valueSql$$40, &_16$$42);
+ ZEPHIR_CALL_METHOD(NULL, &typeValues, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&value$$40);
+ ZVAL_LONG(&_17$$40, 0);
+ ZVAL_LONG(&_18$$40, -2);
+ ZEPHIR_INIT_VAR(&_19$$40);
+ zephir_substr(&_19$$40, &valueSql$$40, 0 , -2 , 0);
+ ZEPHIR_INIT_VAR(&_20$$40);
+ ZEPHIR_CONCAT_SVS(&_20$$40, "(", &_19$$40, ")");
+ zephir_concat_self(&columnSql, &_20$$40);
+ } else {
+ ZEPHIR_INIT_VAR(&_21$$43);
+ ZVAL_STRING(&_21$$43, "\"");
+ ZEPHIR_CALL_FUNCTION(&_22$$43, "addcslashes", &_12, 214, &typeValues, &_21$$43);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_23$$43);
+ ZEPHIR_CONCAT_SVS(&_23$$43, "(\"", &_22$$43, "\")");
+ zephir_concat_self(&columnSql, &_23$$43);
+ }
+ }
+ } while(0);
+
+ RETURN_CCTOR(&columnSql);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, set)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, listIndexesSql)
{
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, _2;
- zval key;
+ zval *table_param = NULL, *schema_param = NULL, *keyName_param = NULL, _0, _1, _2$$3, _3$$3;
+ zval table, schema, keyName, sql;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&ttl_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
+ ZVAL_UNDEF(&keyName);
+ ZVAL_UNDEF(&sql);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(table)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(ttl)
+ Z_PARAM_STR_OR_NULL(schema)
+ Z_PARAM_STR_OR_NULL(keyName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, 2, &table_param, &schema_param, &keyName_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' 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(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_VAR(&table);
}
- if (!ttl) {
- ttl = &ttl_sub;
- ttl = &__$null;
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
+ }
+ if (!keyName_param) {
+ ZEPHIR_INIT_VAR(&keyName);
+ } else {
+ zephir_get_strval(&keyName, keyName_param);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getserializeddata", NULL, 0, value);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "getttl", NULL, 0, ttl);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_FUNCTION("apcu_store", NULL, 124, &_0, &_1, &_2);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "escape", NULL, 66, &table);
zephir_check_call_status();
- RETURN_MM();
-}
-
-zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Apcu(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_MM_GROW();
-
- {
- 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);
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_CONCAT_SVS(&_1, "SELECT sql FROM sqlite_master WHERE type = 'index' AND tbl_name = ", &_0, " COLLATE NOCASE");
+ zephir_get_strval(&sql, &_1);
+ if (!(ZEPHIR_IS_EMPTY(&keyName))) {
+ ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "escape", NULL, 66, &keyName);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_3$$3);
+ ZEPHIR_CONCAT_SVS(&_3$$3, " AND name = ", &_2$$3, " COLLATE NOCASE");
+ zephir_concat_self(&sql, &_3$$3);
}
+ RETURN_CTOR(&sql);
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Libmemcached)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Adapter, Libmemcached, phalcon, storage_adapter_libmemcached, phalcon_storage_adapter_abstractadapter_ce, phalcon_storage_adapter_libmemcached_method_entry, 0);
-
- zend_declare_property_null(phalcon_storage_adapter_libmemcached_ce, SL("options"), ZEND_ACC_PROTECTED);
- phalcon_storage_adapter_libmemcached_ce->create_object = zephir_init_properties_Phalcon_Storage_Adapter_Libmemcached;
-
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, __construct)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, listTables)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_3 = NULL;
- zval options, _0$$3, _1$$3;
- zval *factory, factory_sub, *options_param = NULL, _2;
+ zval *schemaName_param = NULL;
+ zval schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&schemaName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_serializerfactory_ce)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_STR_OR_NULL(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &factory, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 0, 1, &schemaName_param);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_get_strval(&schemaName, schemaName_param);
}
- if (!(zephir_array_isset_string(&options, SL("servers")))) {
- ZEPHIR_INIT_VAR(&_0$$3);
- zephir_create_array(&_0$$3, 1, 0);
- ZEPHIR_INIT_VAR(&_1$$3);
- zephir_create_array(&_1$$3, 3, 0);
- add_assoc_stringl_ex(&_1$$3, SL("host"), SL("127.0.0.1"));
- add_assoc_long_ex(&_1$$3, SL("port"), 11211);
- add_assoc_long_ex(&_1$$3, SL("weight"), 1);
- zephir_array_update_long(&_0$$3, 0, &_1$$3, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY);
- zephir_array_update_string(&options, SL("servers"), &_0$$3, PH_COPY | PH_SEPARATE);
- }
- ZEPHIR_INIT_VAR(&_2);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "ph-memc-");
- zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_2);
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
- ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_libmemcached_ce, getThis(), "__construct", &_3, 0, factory, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_MM_STRING("SELECT tbl_name FROM sqlite_master WHERE type = 'table' ORDER BY tbl_name");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, clear)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, listViews)
{
- zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *schemaName_param = NULL;
+ zval schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&schemaName);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(schemaName)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &schemaName_param);
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(&_0, "flush", NULL, 0);
- zephir_check_call_status();
- RETURN_MM();
+
+ RETURN_MM_STRING("SELECT tbl_name FROM sqlite_master WHERE type = 'view' ORDER BY tbl_name");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, decrement)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, modifyColumn)
{
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 *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, *currentColumn = NULL, currentColumn_sub, __$null;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&column_sub);
+ ZVAL_UNDEF(¤tColumn_sub);
+ ZVAL_NULL(&__$null);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_START(3, 4)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
+ Z_PARAM_OBJECT_OF_CLASS(column, phalcon_db_columninterface_ce)
Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ Z_PARAM_OBJECT_OF_CLASS_OR_NULL(currentColumn, phalcon_db_columninterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, 3, 1, &tableName_param, &schemaName_param, &column, ¤tColumn);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' 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(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_VAR(&tableName);
}
- if (!value_param) {
- value = 1;
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
} else {
- value = zephir_get_intval(value_param);
+ ZEPHIR_INIT_VAR(&schemaName);
+ }
+ if (!currentColumn) {
+ currentColumn = ¤tColumn_sub;
+ currentColumn = &__$null;
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZVAL_LONG(&_1, value);
- ZEPHIR_RETURN_CALL_METHOD(&_0, "decrement", NULL, 0, &key, &_1);
- zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Altering a DB column is not supported by SQLite", "phalcon/Db/Dialect/Sqlite.zep", 593);
+ return;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, delete)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, sharedLock)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _0, _1;
- zval key;
+ zval *sqlQuery_param = NULL;
+ zval sqlQuery;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&sqlQuery);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(sqlQuery)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, &sqlQuery_param);
+ if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' 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(sqlQuery_param) == IS_STRING)) {
+ zephir_get_strval(&sqlQuery, sqlQuery_param);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_VAR(&sqlQuery);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZVAL_LONG(&_1, 0);
- ZEPHIR_RETURN_CALL_METHOD(&_0, "delete", NULL, 0, &key, &_1);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_CTOR(&sqlQuery);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, get)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, tableExists)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1, _2;
- zval key;
+ zval *tableName_param = NULL, *schemaName_param = NULL;
+ zval tableName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(tableName)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_STR_OR_NULL(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ zephir_fetch_params(1, 1, 1, &tableName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' 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(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_VAR(&tableName);
}
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
+ } else {
+ zephir_get_strval(&schemaName, schemaName_param);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE(&_0)) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
- }
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_2, &_1, "get", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &_2);
- zephir_check_call_status();
+ ZEPHIR_CONCAT_SVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM sqlite_master WHERE type='table' AND tbl_name='", &tableName, "'");
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, getAdapter)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval __$true, client, connection, failover, options, persistentId, sasl, saslPass, saslUser, servers, serverList, _0, _1$$3, _3$$3, _4$$3, _5$$3, _6$$4, _7$$4, _8$$4, _9$$4, _10$$4, _11$$4;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_2 = NULL;
- zval *this_ptr = getThis();
-
- ZVAL_BOOL(&__$true, 1);
- ZVAL_UNDEF(&client);
- ZVAL_UNDEF(&connection);
- ZVAL_UNDEF(&failover);
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&persistentId);
- ZVAL_UNDEF(&sasl);
- ZVAL_UNDEF(&saslPass);
- ZVAL_UNDEF(&saslUser);
- ZVAL_UNDEF(&servers);
- ZVAL_UNDEF(&serverList);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_6$$4);
- ZVAL_UNDEF(&_7$$4);
- ZVAL_UNDEF(&_8$$4);
- ZVAL_UNDEF(&_9$$4);
- ZVAL_UNDEF(&_10$$4);
- ZVAL_UNDEF(&_11$$4);
-
-
- ZEPHIR_MM_GROW();
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&options, &_1$$3);
- ZEPHIR_INIT_VAR(&_3$$3);
- ZVAL_STRING(&_3$$3, "persistentId");
- ZEPHIR_INIT_VAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "ph-mcid-");
- ZEPHIR_CALL_CE_STATIC(&persistentId, phalcon_helper_arr_ce, "get", &_2, 16, &options, &_3$$3, &_4$$3);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_3$$3);
- array_init(&_3$$3);
- ZEPHIR_INIT_NVAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "saslAuthData");
- ZEPHIR_CALL_CE_STATIC(&sasl, phalcon_helper_arr_ce, "get", &_2, 16, &options, &_4$$3, &_3$$3);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&connection);
- object_init_ex(&connection, zephir_get_internal_ce(SL("memcached")));
- ZEPHIR_CALL_METHOD(NULL, &connection, "__construct", NULL, 0, &persistentId);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&serverList, &connection, "getserverlist", NULL, 0);
- zephir_check_call_status();
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZVAL_LONG(&_5$$3, -1002);
- ZEPHIR_CALL_METHOD(NULL, &connection, "setoption", NULL, 0, &_5$$3, &_1$$3);
- zephir_check_call_status();
- if (zephir_fast_count_int(&serverList) < 1) {
- ZEPHIR_INIT_VAR(&_6$$4);
- array_init(&_6$$4);
- ZEPHIR_INIT_VAR(&_7$$4);
- ZVAL_STRING(&_7$$4, "servers");
- ZEPHIR_CALL_CE_STATIC(&servers, phalcon_helper_arr_ce, "get", &_2, 16, &options, &_7$$4, &_6$$4);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_7$$4);
- array_init(&_7$$4);
- ZEPHIR_INIT_VAR(&_8$$4);
- ZVAL_STRING(&_8$$4, "client");
- ZEPHIR_CALL_CE_STATIC(&client, phalcon_helper_arr_ce, "get", &_2, 16, &options, &_8$$4, &_7$$4);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_8$$4);
- ZVAL_STRING(&_8$$4, "user");
- ZEPHIR_INIT_VAR(&_9$$4);
- ZVAL_STRING(&_9$$4, "");
- ZEPHIR_CALL_CE_STATIC(&saslUser, phalcon_helper_arr_ce, "get", &_2, 16, &sasl, &_8$$4, &_9$$4);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_8$$4);
- ZVAL_STRING(&_8$$4, "pass");
- ZEPHIR_INIT_NVAR(&_9$$4);
- ZVAL_STRING(&_9$$4, "");
- ZEPHIR_CALL_CE_STATIC(&saslPass, phalcon_helper_arr_ce, "get", &_2, 16, &sasl, &_8$$4, &_9$$4);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&failover);
- zephir_create_array(&failover, 5, 0);
- add_index_long(&failover, 14, 10);
- add_index_long(&failover, 9, 1);
- add_index_long(&failover, 21, 2);
- zephir_array_update_long(&failover, 35, &__$true, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY);
- add_index_long(&failover, 15, 1);
- ZEPHIR_INIT_NVAR(&_8$$4);
- zephir_fast_array_merge(&_8$$4, &failover, &client);
- ZEPHIR_CPY_WRT(&client, &_8$$4);
- ZEPHIR_CALL_METHOD(&_10$$4, &connection, "setoptions", NULL, 0, &client);
- zephir_check_call_status();
- if (!(zephir_is_true(&_10$$4))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Cannot set Memcached client options", "phalcon/Storage/Adapter/Libmemcached.zep", 150);
- return;
- }
- ZEPHIR_CALL_METHOD(&_11$$4, &connection, "addservers", NULL, 0, &servers);
- zephir_check_call_status();
- if (!(zephir_is_true(&_11$$4))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Cannot connect to the Memcached server(s)", "phalcon/Storage/Adapter/Libmemcached.zep", 154);
- return;
- }
- if (!(ZEPHIR_IS_EMPTY(&saslUser))) {
- ZEPHIR_CALL_METHOD(NULL, &connection, "setsaslauthdata", NULL, 0, &saslUser, &saslPass);
- zephir_check_call_status();
- }
- }
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setserializer", NULL, 125, &connection);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), &connection);
- }
- RETURN_MM_MEMBER(getThis(), "adapter");
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, getKeys)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, tableOptions)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *prefix_param = NULL, _0, _1;
- zval prefix;
+ zval *table_param = NULL, *schema_param = NULL;
+ zval table, schema;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&prefix);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&table);
+ ZVAL_UNDEF(&schema);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(table)
Z_PARAM_OPTIONAL
- Z_PARAM_STR(prefix)
+ Z_PARAM_STR_OR_NULL(schema)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
+ if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) {
- zephir_get_strval(&prefix, prefix_param);
+ if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) {
+ zephir_get_strval(&table, table_param);
} else {
- ZEPHIR_INIT_VAR(&prefix);
+ ZEPHIR_INIT_VAR(&table);
}
+ if (!schema_param) {
+ ZEPHIR_INIT_VAR(&schema);
+ } else {
+ zephir_get_strval(&schema, schema_param);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_1, &_0, "getallkeys", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfilteredkeys", NULL, 0, &_1, &prefix);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_MM_STRING("");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, has)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, truncateTable)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, connection, result, _0;
- zval key;
+ zval *tableName_param = NULL, *schemaName_param = NULL;
+ zval tableName, schemaName, table;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&connection);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&tableName);
+ ZVAL_UNDEF(&schemaName);
+ ZVAL_UNDEF(&table);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(tableName)
+ Z_PARAM_STR(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, 2, 0, &tableName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' 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(tableName_param) == IS_STRING)) {
+ zephir_get_strval(&tableName, tableName_param);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_VAR(&tableName);
+ }
+ if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) {
+ zephir_get_strval(&schemaName, schemaName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&schemaName);
}
- ZEPHIR_CALL_METHOD(&connection, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&result, &connection, "get", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_0, &connection, "getresultcode", NULL, 0);
- zephir_check_call_status();
- RETURN_MM_BOOL(!ZEPHIR_IS_LONG_IDENTICAL(&_0, 16));
+ if (!(ZEPHIR_IS_EMPTY(&schemaName))) {
+ ZEPHIR_INIT_VAR(&table);
+ ZEPHIR_CONCAT_SVSVS(&table, "\"", &schemaName, "\".\"", &tableName, "\"");
+ } else {
+ ZEPHIR_INIT_NVAR(&table);
+ ZEPHIR_CONCAT_SVS(&table, "\"", &tableName, "\"");
+ }
+ ZEPHIR_CONCAT_SV(return_value, "DELETE FROM ", &table);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, increment)
+static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, viewExists)
{
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 *viewName_param = NULL, *schemaName_param = NULL;
+ zval viewName, schemaName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&viewName);
+ ZVAL_UNDEF(&schemaName);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(viewName)
Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ Z_PARAM_STR_OR_NULL(schemaName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, 1, &viewName_param, &schemaName_param);
+ if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' 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(viewName_param) == IS_STRING)) {
+ zephir_get_strval(&viewName, viewName_param);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_VAR(&viewName);
}
- if (!value_param) {
- value = 1;
+ if (!schemaName_param) {
+ ZEPHIR_INIT_VAR(&schemaName);
} else {
- value = zephir_get_intval(value_param);
+ zephir_get_strval(&schemaName, schemaName_param);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZVAL_LONG(&_1, value);
- ZEPHIR_RETURN_CALL_METHOD(&_0, "increment", NULL, 0, &key, &_1);
- zephir_check_call_status();
+ ZEPHIR_CONCAT_SVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM sqlite_master WHERE type='view' AND tbl_name='", &viewName, "'");
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, set)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Db_Result_Pdo)
{
- 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, _2;
- zval key;
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Db\\Result, Pdo, phalcon, db_result_pdo, phalcon_db_result_pdo_method_entry, 0);
+
+ zend_declare_property_null(phalcon_db_result_pdo_ce, SL("bindParams"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_result_pdo_ce, SL("bindTypes"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_result_pdo_ce, SL("connection"), ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_db_result_pdo_ce, SL("fetchMode"), 5, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_result_pdo_ce, SL("pdoStatement"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_result_pdo_ce, SL("result"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_db_result_pdo_ce, SL("rowCount"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_db_result_pdo_ce, SL("sqlStatement"), ZEND_ACC_PROTECTED);
+ phalcon_db_result_pdo_ce->create_object = zephir_init_properties_Phalcon_Db_Result_Pdo;
+
+ zend_class_implements(phalcon_db_result_pdo_ce, 1, phalcon_db_resultinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Db_Result_Pdo, __construct)
+{
+ zval *connection, connection_sub, *result, result_sub, *sqlStatement = NULL, sqlStatement_sub, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&ttl_sub);
+ ZVAL_UNDEF(&connection_sub);
+ ZVAL_UNDEF(&result_sub);
+ ZVAL_UNDEF(&sqlStatement_sub);
+ ZVAL_UNDEF(&bindParams_sub);
+ ZVAL_UNDEF(&bindTypes_sub);
ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_START(2, 5)
+ Z_PARAM_OBJECT_OF_CLASS(connection, phalcon_db_adapter_adapterinterface_ce)
+ Z_PARAM_OBJECT_OF_CLASS(result, zephir_get_internal_ce(SL("pdostatement")))
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(ttl)
+ Z_PARAM_ZVAL_OR_NULL(sqlStatement)
+ Z_PARAM_ZVAL_OR_NULL(bindParams)
+ Z_PARAM_ZVAL_OR_NULL(bindTypes)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- 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();
+ zephir_fetch_params_without_memory_grow(2, 3, &connection, &result, &sqlStatement, &bindParams, &bindTypes);
+ if (!sqlStatement) {
+ sqlStatement = &sqlStatement_sub;
+ sqlStatement = &__$null;
}
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
+ if (!bindParams) {
+ bindParams = &bindParams_sub;
+ bindParams = &__$null;
}
- if (!ttl) {
- ttl = &ttl_sub;
- ttl = &__$null;
+ if (!bindTypes) {
+ bindTypes = &bindTypes_sub;
+ bindTypes = &__$null;
}
- 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(&_2, this_ptr, "getttl", NULL, 0, ttl);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(&_0, "set", NULL, 0, &key, &_1, &_2);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("connection"), connection);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("pdoStatement"), result);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("sqlStatement"), sqlStatement);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("bindParams"), bindParams);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("bindTypes"), bindTypes);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setSerializer)
+static PHP_METHOD(Phalcon_Db_Result_Pdo, dataSeek)
{
- zval map;
+ long n = 0;
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;
+ zephir_fcall_cache_entry *_3 = NULL;
+ zval *number_param = NULL, connection, pdo, sqlStatement, bindParams, statement, _0, _1$$4, _2$$4;
+ zend_long number, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&connection_sub);
- ZVAL_UNDEF(&serializer);
+ ZVAL_UNDEF(&connection);
+ ZVAL_UNDEF(&pdo);
+ ZVAL_UNDEF(&sqlStatement);
+ ZVAL_UNDEF(&bindParams);
+ ZVAL_UNDEF(&statement);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&map);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(connection, zephir_get_internal_ce(SL("memcached")))
+ Z_PARAM_LONG(number)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &connection);
+ zephir_fetch_params(1, 1, 0, &number_param);
+ number = zephir_get_intval(number_param);
- ZEPHIR_INIT_VAR(&map);
- zephir_create_array(&map, 3, 0);
- add_assoc_long_ex(&map, SL("php"), 1);
- add_assoc_long_ex(&map, SL("json"), 3);
- add_assoc_long_ex(&map, SL("igbinary"), 2);
- 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", 255);
- ZVAL_LONG(&_3$$3, -1003);
- ZEPHIR_CALL_METHOD(NULL, connection, "setoption", NULL, 0, &_3$$3, &_2$$3);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("connection"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&connection, &_0);
+ ZEPHIR_CALL_METHOD(&pdo, &connection, "getinternalhandler", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("sqlStatement"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&sqlStatement, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("bindParams"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&bindParams, &_0);
+ if (Z_TYPE_P(&bindParams) == IS_ARRAY) {
+ ZEPHIR_CALL_METHOD(&statement, &pdo, "prepare", NULL, 0, &sqlStatement);
zephir_check_call_status();
+ if (Z_TYPE_P(&statement) == IS_OBJECT) {
+ zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("bindTypes"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1$$4, &connection, "executeprepared", NULL, 0, &statement, &bindParams, &_2$$4);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&statement, &_1$$4);
+ }
} else {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "initserializer", NULL, 0);
+ ZEPHIR_CALL_METHOD(&statement, &pdo, "query", NULL, 0, &sqlStatement);
+ zephir_check_call_status();
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("pdoStatement"), &statement);
+ n = -1;
+ number--;
+ while (1) {
+ if (!(n != number)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(NULL, &statement, "fetch", &_3, 0);
zephir_check_call_status();
+ n++;
}
ZEPHIR_MM_RESTORE();
}
-zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Libmemcached(zend_class_entry *class_type)
+static PHP_METHOD(Phalcon_Db_Result_Pdo, execute)
{
- zval _0, _1$$3;
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
-
-
- ZEPHIR_MM_GROW();
-
- {
- 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);
- }
-}
-
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&_0);
-#ifdef HAVE_CONFIG_H
-#endif
+ ZEPHIR_MM_GROW();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("pdoStatement"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "execute", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+static PHP_METHOD(Phalcon_Db_Result_Pdo, fetch)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *fetchStyle = NULL, fetchStyle_sub, *cursorOrientation = NULL, cursorOrientation_sub, *cursorOffset = NULL, cursorOffset_sub, __$null, _0;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&fetchStyle_sub);
+ ZVAL_UNDEF(&cursorOrientation_sub);
+ ZVAL_UNDEF(&cursorOffset_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 3)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(fetchStyle)
+ Z_PARAM_ZVAL_OR_NULL(cursorOrientation)
+ Z_PARAM_ZVAL_OR_NULL(cursorOffset)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Memory)
-{
- 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_MM_GROW();
+ zephir_fetch_params(1, 0, 3, &fetchStyle, &cursorOrientation, &cursorOffset);
+ if (!fetchStyle) {
+ fetchStyle = &fetchStyle_sub;
+ fetchStyle = &__$null;
+ }
+ if (!cursorOrientation) {
+ cursorOrientation = &cursorOrientation_sub;
+ cursorOrientation = &__$null;
+ }
+ if (!cursorOffset) {
+ cursorOffset = &cursorOffset_sub;
+ cursorOffset = &__$null;
+ }
- zend_declare_property_null(phalcon_storage_adapter_memory_ce, SL("data"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_storage_adapter_memory_ce, SL("options"), ZEND_ACC_PROTECTED);
- phalcon_storage_adapter_memory_ce->create_object = zephir_init_properties_Phalcon_Storage_Adapter_Memory;
- return SUCCESS;
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("pdoStatement"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "fetch", NULL, 0, fetchStyle, cursorOrientation, cursorOffset);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, __construct)
+static PHP_METHOD(Phalcon_Db_Result_Pdo, fetchAll)
{
+ zend_bool _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_1 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval options;
- zval *factory, factory_sub, *options_param = NULL, _0;
+ zval *fetchStyle = NULL, fetchStyle_sub, *fetchArgument = NULL, fetchArgument_sub, *ctorArgs = NULL, ctorArgs_sub, __$null, pdoStatement, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
+ ZVAL_UNDEF(&fetchStyle_sub);
+ ZVAL_UNDEF(&fetchArgument_sub);
+ ZVAL_UNDEF(&ctorArgs_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&pdoStatement);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&options);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_serializerfactory_ce)
+ ZEND_PARSE_PARAMETERS_START(0, 3)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_ZVAL_OR_NULL(fetchStyle)
+ Z_PARAM_ZVAL_OR_NULL(fetchArgument)
+ Z_PARAM_ZVAL_OR_NULL(ctorArgs)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, 0, 3, &fetchStyle, &fetchArgument, &ctorArgs);
+ if (!fetchStyle) {
+ fetchStyle = &fetchStyle_sub;
+ fetchStyle = &__$null;
+ }
+ if (!fetchArgument) {
+ fetchArgument = &fetchArgument_sub;
+ fetchArgument = &__$null;
+ }
+ if (!ctorArgs) {
+ ctorArgs = &ctorArgs_sub;
+ ctorArgs = &__$null;
}
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "ph-memo-");
- zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
- ZEPHIR_INIT_NVAR(&_0);
- object_init_ex(&_0, phalcon_collection_ce);
- ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 22);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_0);
- ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_memory_ce, getThis(), "__construct", &_1, 0, factory, &options);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "initserializer", NULL, 0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("pdoStatement"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&pdoStatement, &_0);
+ if (Z_TYPE_P(fetchStyle) != IS_LONG) {
+ ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ if (ZEPHIR_IS_LONG(fetchStyle, 8)) {
+ ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument, ctorArgs);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ _1 = ZEPHIR_IS_LONG(fetchStyle, 7);
+ if (!(_1)) {
+ _1 = ZEPHIR_IS_LONG(fetchStyle, 10);
+ }
+ if (_1) {
+ ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, fetchStyle);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, clear)
+static PHP_METHOD(Phalcon_Db_Result_Pdo, fetchArray)
{
zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
@@ -200627,1109 +200199,1025 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Memory, clear)
ZEPHIR_MM_GROW();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_0, "clear", NULL, 0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("pdoStatement"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "fetch", NULL, 0);
zephir_check_call_status();
- RETURN_MM_BOOL(1);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, decrement)
+static PHP_METHOD(Phalcon_Db_Result_Pdo, getInternalResult)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "pdoStatement");
+}
+
+static PHP_METHOD(Phalcon_Db_Result_Pdo, numRows)
{
+ zend_bool _2$$3;
+ zval sqlStatement, rowCount, connection, type, pdoStatement, matches, result, row, _0, _1$$3, _3$$4, _4$$5, _5$$6, _6$$6, _7$$6, _8$$7, _9$$7, _10$$7, _11$$7;
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, _2$$3;
- zval key;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(¤t);
- ZVAL_UNDEF(&newValue);
- ZVAL_UNDEF(&prefixedKey);
+ ZVAL_UNDEF(&sqlStatement);
+ ZVAL_UNDEF(&rowCount);
+ ZVAL_UNDEF(&connection);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&pdoStatement);
+ ZVAL_UNDEF(&matches);
ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&row);
ZVAL_UNDEF(&_0);
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$$7);
+ ZVAL_UNDEF(&_10$$7);
+ ZVAL_UNDEF(&_11$$7);
+
+
+ ZEPHIR_MM_GROW();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("rowCount"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&rowCount, &_0);
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&rowCount)) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("connection"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&connection, &_1$$3);
+ ZEPHIR_CALL_METHOD(&type, &connection, "gettype", NULL, 0);
+ zephir_check_call_status();
+ _2$$3 = ZEPHIR_IS_STRING(&type, "mysql");
+ if (!(_2$$3)) {
+ _2$$3 = ZEPHIR_IS_STRING(&type, "pgsql");
+ }
+ if (_2$$3) {
+ zephir_read_property(&_3$$4, this_ptr, ZEND_STRL("pdoStatement"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&pdoStatement, &_3$$4);
+ ZEPHIR_CALL_METHOD(&rowCount, &pdoStatement, "rowcount", NULL, 0);
+ zephir_check_call_status();
+ }
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&rowCount)) {
+ zephir_read_property(&_4$$5, this_ptr, ZEND_STRL("sqlStatement"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&sqlStatement, &_4$$5);
+ if (!(zephir_start_with_str(&sqlStatement, SL("SELECT COUNT(*) ")))) {
+ ZEPHIR_INIT_VAR(&matches);
+ ZVAL_NULL(&matches);
+ ZEPHIR_INIT_VAR(&_5$$6);
+ ZVAL_STRING(&_5$$6, "/^SELECT\\s+(.*)/i");
+ ZEPHIR_INIT_VAR(&_6$$6);
+ ZEPHIR_INIT_VAR(&_7$$6);
+ ZVAL_STRING(&_7$$6, "/^SELECT\\s+(.*)/i");
+ zephir_preg_match(&_6$$6, &_7$$6, &sqlStatement, &matches, 0, 0 , 0 );
+ if (zephir_is_true(&_6$$6)) {
+ zephir_array_fetch_long(&_8$$7, &matches, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Result/Pdo.zep", 309);
+ ZEPHIR_INIT_VAR(&_9$$7);
+ ZEPHIR_CONCAT_SVS(&_9$$7, "SELECT COUNT(*) \"numrows\" FROM (SELECT ", &_8$$7, ")");
+ zephir_read_property(&_10$$7, this_ptr, ZEND_STRL("bindParams"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_11$$7, this_ptr, ZEND_STRL("bindTypes"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&result, &connection, "query", NULL, 0, &_9$$7, &_10$$7, &_11$$7);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&row, &result, "fetch", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&rowCount);
+ zephir_array_fetch_string(&rowCount, &row, SL("numrows"), PH_NOISY, "phalcon/Db/Result/Pdo.zep", 315);
+ }
+ } else {
+ ZEPHIR_INIT_NVAR(&rowCount);
+ ZVAL_LONG(&rowCount, 1);
+ }
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("rowCount"), &rowCount);
+ }
+ RETURN_CCTOR(&rowCount);
+}
+
+static PHP_METHOD(Phalcon_Db_Result_Pdo, setFetchMode)
+{
+ zend_bool _1;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *fetchMode_param = NULL, *colNoOrClassNameOrObject = NULL, colNoOrClassNameOrObject_sub, *ctorargs = NULL, ctorargs_sub, __$null, pdoStatement, _0, _2$$3, _3$$3, _4$$5, _5$$5, _6$$7, _7$$7;
+ zend_long fetchMode, ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&colNoOrClassNameOrObject_sub);
+ ZVAL_UNDEF(&ctorargs_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&pdoStatement);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&_7$$7);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_LONG(fetchMode)
Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ Z_PARAM_ZVAL_OR_NULL(colNoOrClassNameOrObject)
+ Z_PARAM_ZVAL_OR_NULL(ctorargs)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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);
+ zephir_fetch_params(1, 1, 2, &fetchMode_param, &colNoOrClassNameOrObject, &ctorargs);
+ fetchMode = zephir_get_intval(fetchMode_param);
+ if (!colNoOrClassNameOrObject) {
+ colNoOrClassNameOrObject = &colNoOrClassNameOrObject_sub;
+ colNoOrClassNameOrObject = &__$null;
}
- if (!value_param) {
- value = 1;
- } else {
- value = zephir_get_intval(value_param);
+ if (!ctorargs) {
+ ctorargs = &ctorargs_sub;
+ ctorargs = &__$null;
}
- 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_CALL_METHOD(&result, &_0, "has", NULL, 0, &prefixedKey);
- zephir_check_call_status();
- if (zephir_is_true(&result)) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(¤t, &_1$$3, "get", NULL, 0, &prefixedKey);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("pdoStatement"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&pdoStatement, &_0);
+ _1 = fetchMode == 8;
+ if (!(_1)) {
+ _1 = fetchMode == 9;
+ }
+ if (_1) {
+ ZVAL_LONG(&_3$$3, fetchMode);
+ ZEPHIR_CALL_METHOD(&_2$$3, &pdoStatement, "setfetchmode", NULL, 0, &_3$$3, colNoOrClassNameOrObject, ctorargs);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&newValue);
- ZVAL_LONG(&newValue, (zephir_get_intval(¤t) - value));
- ZEPHIR_CPY_WRT(&result, &newValue);
- zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_2$$3, "set", NULL, 0, &prefixedKey, &newValue);
+ if (!(zephir_is_true(&_2$$3))) {
+ RETURN_MM_BOOL(0);
+ }
+ } else if (fetchMode == 7) {
+ ZVAL_LONG(&_5$$5, fetchMode);
+ ZEPHIR_CALL_METHOD(&_4$$5, &pdoStatement, "setfetchmode", NULL, 0, &_5$$5, colNoOrClassNameOrObject);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_4$$5))) {
+ RETURN_MM_BOOL(0);
+ }
+ } else {
+ ZVAL_LONG(&_7$$7, fetchMode);
+ ZEPHIR_CALL_METHOD(&_6$$7, &pdoStatement, "setfetchmode", NULL, 0, &_7$$7);
zephir_check_call_status();
+ if (!(zephir_is_true(&_6$$7))) {
+ RETURN_MM_BOOL(0);
+ }
}
- RETURN_CCTOR(&result);
+ ZEPHIR_INIT_ZVAL_NREF(_0);
+ ZVAL_LONG(&_0, fetchMode);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("fetchMode"), &_0);
+ RETURN_MM_BOOL(1);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, delete)
+zend_object *zephir_init_properties_Phalcon_Db_Result_Pdo(zend_class_entry *class_type)
{
+ zval _0, _2, _1$$3, _3$$4;
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(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_3$$4);
+
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&exists);
- ZVAL_UNDEF(&prefixedKey);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
- ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_MM_GROW();
+
+ {
+ 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("bindTypes"), 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("bindTypes"), &_1$$3);
+ }
+ zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("bindParams"), 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("bindParams"), &_3$$4);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
+ }
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- 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_CALL_METHOD(&exists, &_0, "has", NULL, 0, &prefixedKey);
- zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_1, "remove", NULL, 0, &prefixedKey);
- zephir_check_call_status();
- RETURN_CCTOR(&exists);
+
+ZEPHIR_INIT_CLASS(Phalcon_Flash_AbstractFlash)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Flash, AbstractFlash, phalcon, flash_abstractflash, phalcon_di_abstractinjectionaware_ce, phalcon_flash_abstractflash_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+
+ 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_Flash_AbstractFlash, getAutoescape)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "autoescape");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, get)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, getCssClasses)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, content, prefixedKey, _0, _1;
- zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&content);
- ZVAL_UNDEF(&prefixedKey);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
-#if PHP_VERSION_ID >= 80000
- 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();
-#endif
- ZEPHIR_MM_GROW();
- 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;
- }
+ RETURN_MEMBER(getThis(), "cssClasses");
+}
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, getCssIconClasses)
+{
+ zval *this_ptr = getThis();
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE(&_0)) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
- }
- ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&content, &_1, "get", NULL, 0, &prefixedKey);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &content);
- zephir_check_call_status();
- RETURN_MM();
+
+
+ RETURN_MEMBER(getThis(), "cssIconClasses");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, getAdapter)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, getCustomTemplate)
{
zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "adapter");
+ RETURN_MEMBER(getThis(), "customTemplate");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, getKeys)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, __construct)
{
+ zval _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *prefix_param = NULL, _0, _1;
- zval prefix;
+ zval *escaper = NULL, escaper_sub, *session = NULL, session_sub, __$null, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&prefix);
+ ZVAL_UNDEF(&escaper_sub);
+ ZVAL_UNDEF(&session_sub);
+ ZVAL_NULL(&__$null);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
- Z_PARAM_STR(prefix)
+ Z_PARAM_OBJECT_OF_CLASS_OR_NULL(escaper, phalcon_escaper_escaperinterface_ce)
+ Z_PARAM_OBJECT_OF_CLASS_OR_NULL(session, phalcon_session_managerinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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();
+ zephir_fetch_params(1, 0, 2, &escaper, &session);
+ if (!escaper) {
+ escaper = &escaper_sub;
+ escaper = &__$null;
}
- if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) {
- zephir_get_strval(&prefix, prefix_param);
- } else {
- ZEPHIR_INIT_VAR(&prefix);
+ if (!session) {
+ session = &session_sub;
+ session = &__$null;
}
+
+
+ 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_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();
+}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_1, &_0, "getkeys", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfilteredkeys", NULL, 0, &_1, &prefix);
- zephir_check_call_status();
- RETURN_MM();
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, clear)
+{
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+
+
+ ZEPHIR_MM_GROW();
+
+ ZEPHIR_INIT_VAR(&_0);
+ array_init(&_0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("messages"), &_0);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, has)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, error)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, prefixedKey, _0;
- zval key;
+ zval *message_param = NULL, _0;
+ zval message;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&prefixedKey);
+ ZVAL_UNDEF(&message);
ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(message)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_fetch_params(1, 1, 0, &message_param);
+ zephir_get_strval(&message, message_param);
- 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_RETURN_CALL_METHOD(&_0, "has", NULL, 0, &prefixedKey);
+ 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_Storage_Adapter_Memory, increment)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, getEscaperService)
{
+ zval container, _0, _1, _6, _7, _2$$4, _3$$4, _5$$4, _8$$5, _9$$5, _10$$6, _11$$6, _12$$6;
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, _2$$3;
- zval key;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_4 = NULL;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(¤t);
- ZVAL_UNDEF(&newValue);
- ZVAL_UNDEF(&prefixedKey);
- ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&container);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
- ZEND_PARSE_PARAMETERS_END();
-#endif
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$6);
+ ZVAL_UNDEF(&_11$$6);
+ ZVAL_UNDEF(&_12$$6);
ZEPHIR_MM_GROW();
- 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);
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("escaperService"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_is_true(&_0)) {
+ RETURN_MM_MEMBER(getThis(), "escaperService");
}
- if (!value_param) {
- value = 1;
- } else {
- value = zephir_get_intval(value_param);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&container, &_1);
+ if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) {
+ ZEPHIR_INIT_VAR(&_2$$4);
+ object_init_ex(&_2$$4, phalcon_flash_exception_ce);
+ ZEPHIR_INIT_VAR(&_5$$4);
+ ZVAL_STRING(&_5$$4, "the 'escaper' service");
+ ZEPHIR_CALL_CE_STATIC(&_3$$4, phalcon_flash_exception_ce, "containerservicenotfound", &_4, 0, &_5$$4);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 8, &_3$$4);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_2$$4, "phalcon/Flash/AbstractFlash.zep", 135);
+ ZEPHIR_MM_RESTORE();
+ return;
}
-
-
- 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_CALL_METHOD(&result, &_0, "has", NULL, 0, &prefixedKey);
+ ZEPHIR_INIT_VAR(&_7);
+ ZVAL_STRING(&_7, "escaper");
+ ZEPHIR_CALL_METHOD(&_6, &container, "has", NULL, 0, &_7);
zephir_check_call_status();
- if (zephir_is_true(&result)) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(¤t, &_1$$3, "get", NULL, 0, &prefixedKey);
+ if (UNEXPECTED(zephir_is_true(&_6))) {
+ ZEPHIR_INIT_VAR(&_9$$5);
+ ZVAL_STRING(&_9$$5, "escaper");
+ ZEPHIR_CALL_METHOD(&_8$$5, &container, "getshared", NULL, 0, &_9$$5);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&newValue);
- ZVAL_LONG(&newValue, (zephir_get_intval(¤t) + value));
- ZEPHIR_CPY_WRT(&result, &newValue);
- zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_2$$3, "set", NULL, 0, &prefixedKey, &newValue);
+ RETURN_CCTOR(&_8$$5);
+ } else {
+ ZEPHIR_INIT_VAR(&_10$$6);
+ object_init_ex(&_10$$6, phalcon_flash_exception_ce);
+ ZEPHIR_INIT_VAR(&_12$$6);
+ ZVAL_STRING(&_12$$6, "the 'escaper' service");
+ ZEPHIR_CALL_CE_STATIC(&_11$$6, phalcon_flash_exception_ce, "containerservicenotfound", &_4, 0, &_12$$6);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_10$$6, "__construct", NULL, 8, &_11$$6);
zephir_check_call_status();
+ zephir_throw_exception_debug(&_10$$6, "phalcon/Flash/AbstractFlash.zep", 143);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- RETURN_CCTOR(&result);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, set)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, notice)
{
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, lifetime, prefixedKey, _0;
- zval key;
+ zval *message_param = NULL, _0;
+ 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(&lifetime);
- ZVAL_UNDEF(&prefixedKey);
+ ZVAL_UNDEF(&message);
ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
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_START(1, 1)
+ Z_PARAM_STR(message)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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;
- }
+ zephir_fetch_params(1, 1, 0, &message_param);
+ zephir_get_strval(&message, message_param);
- ZEPHIR_CALL_METHOD(&content, this_ptr, "getserializeddata", NULL, 0, value);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&lifetime, this_ptr, "getttl", NULL, 0, ttl);
- zephir_check_call_status();
- 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_CALL_METHOD(NULL, &_0, "set", NULL, 0, &prefixedKey, &content);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "notice");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, &_0, &message);
zephir_check_call_status();
- RETURN_MM_BOOL(1);
+ RETURN_MM();
}
-zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Memory(zend_class_entry *class_type)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, setAutoescape)
{
- zval _0, _1$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
-
-
- ZEPHIR_MM_GROW();
-
- {
- 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);
- }
-}
+ zval *autoescape_param = NULL, __$true, __$false;
+ zend_bool autoescape;
+ zval *this_ptr = getThis();
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(autoescape)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+ zephir_fetch_params_without_memory_grow(1, 0, &autoescape_param);
+ autoescape = zephir_get_boolval(autoescape_param);
-#ifdef HAVE_CONFIG_H
-#endif
+ 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_Flash_AbstractFlash, setAutomaticHtml)
+{
+ zval *automaticHtml_param = NULL, __$true, __$false;
+ zend_bool automaticHtml;
+ zval *this_ptr = getThis();
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(automaticHtml)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Redis)
-{
- 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_fetch_params_without_memory_grow(1, 0, &automaticHtml_param);
+ automaticHtml = zephir_get_boolval(automaticHtml_param);
- zend_declare_property_null(phalcon_storage_adapter_redis_ce, SL("options"), ZEND_ACC_PROTECTED);
- phalcon_storage_adapter_redis_ce->create_object = zephir_init_properties_Phalcon_Storage_Adapter_Redis;
- return SUCCESS;
+ 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_Storage_Adapter_Redis, __construct)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, setCssClasses)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_1 = NULL, *_14 = NULL;
- zval options;
- zval *factory, factory_sub, *options_param = NULL, _0, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13;
+ zval *cssClasses_param = NULL;
+ zval cssClasses;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
- 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(&options);
+ ZVAL_UNDEF(&cssClasses);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- 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_START(1, 1)
+ Z_PARAM_ARRAY(cssClasses)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, &cssClasses_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&cssClasses, cssClasses_param);
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "host");
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "127.0.0.1");
- ZEPHIR_INIT_VAR(&_4);
- ZVAL_STRING(&_4, "string");
- ZEPHIR_CALL_CE_STATIC(&_0, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3, &_4);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("host"), &_0, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "port");
- ZVAL_LONG(&_6, 6379);
- ZEPHIR_INIT_NVAR(&_3);
- ZVAL_STRING(&_3, "int");
- ZEPHIR_CALL_CE_STATIC(&_5, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_6, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("port"), &_5, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "index");
- ZVAL_LONG(&_6, 0);
- ZEPHIR_INIT_NVAR(&_3);
- ZVAL_STRING(&_3, "int");
- ZEPHIR_CALL_CE_STATIC(&_7, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_6, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("index"), &_7, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "persistent");
- ZVAL_BOOL(&_6, 0);
- ZEPHIR_INIT_NVAR(&_3);
- ZVAL_STRING(&_3, "bool");
- ZEPHIR_CALL_CE_STATIC(&_8, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_6, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("persistent"), &_8, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "auth");
- ZEPHIR_INIT_NVAR(&_3);
- ZVAL_STRING(&_3, "");
- ZEPHIR_INIT_NVAR(&_4);
- ZVAL_STRING(&_4, "string");
- ZEPHIR_CALL_CE_STATIC(&_9, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3, &_4);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("auth"), &_9, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "socket");
- ZEPHIR_INIT_NVAR(&_3);
- ZVAL_STRING(&_3, "");
- ZEPHIR_INIT_NVAR(&_4);
- ZVAL_STRING(&_4, "string");
- ZEPHIR_CALL_CE_STATIC(&_10, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3, &_4);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("socket"), &_10, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "connectionTimeout");
- ZVAL_LONG(&_6, 0);
- ZEPHIR_INIT_NVAR(&_3);
- ZVAL_STRING(&_3, "int");
- ZEPHIR_CALL_CE_STATIC(&_11, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_6, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("connectionTimeout"), &_11, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "retryInterval");
- ZVAL_NULL(&_6);
- ZEPHIR_INIT_NVAR(&_3);
- ZVAL_STRING(&_3, "int");
- ZEPHIR_CALL_CE_STATIC(&_12, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_6, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("retryInterval"), &_12, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "readTimeout");
- ZVAL_LONG(&_6, 0);
- ZEPHIR_INIT_NVAR(&_3);
- ZVAL_STRING(&_3, "int");
- ZEPHIR_CALL_CE_STATIC(&_13, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_6, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("readTimeout"), &_13, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "ph-reds-");
- zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_2);
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
- ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_redis_ce, getThis(), "__construct", &_14, 0, factory, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("cssClasses"), &cssClasses);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, clear)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, setCssIconClasses)
{
- zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *cssIconClasses_param = NULL;
+ zval cssIconClasses;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&cssIconClasses);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(cssIconClasses)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &cssIconClasses_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&cssIconClasses, cssIconClasses_param);
- 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_update_property_zval(this_ptr, ZEND_STRL("cssIconClasses"), &cssIconClasses);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, decrement)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, setCustomTemplate)
{
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 *customTemplate_param = NULL;
+ zval customTemplate;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&customTemplate);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(customTemplate)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, &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(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(customTemplate_param) == IS_STRING)) {
+ zephir_get_strval(&customTemplate, customTemplate_param);
} else {
- value = zephir_get_intval(value_param);
+ ZEPHIR_INIT_VAR(&customTemplate);
}
- 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("customTemplate"), &customTemplate);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, delete)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, setEscaperService)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _0, _1;
- zval key;
+ zval *escaperService, escaperService_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&escaperService_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_OBJECT_OF_CLASS(escaperService, phalcon_escaper_escaperinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- 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_fetch_params_without_memory_grow(1, 0, &escaperService);
- 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_update_property_zval(this_ptr, ZEND_STRL("escaperService"), escaperService);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, get)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, setImplicitFlush)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1, _2;
- zval key;
+ zval *implicitFlush_param = NULL, __$true, __$false;
+ zend_bool implicitFlush;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
#if PHP_VERSION_ID >= 80000
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_START(1, 1)
+ Z_PARAM_BOOL(implicitFlush)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- 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_fetch_params_without_memory_grow(1, 0, &implicitFlush_param);
+ implicitFlush = zephir_get_boolval(implicitFlush_param);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE(&_0)) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
+ if (implicitFlush) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("implicitFlush"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("implicitFlush"), &__$false);
}
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_2, &_1, "get", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &_2);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, getAdapter)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, success)
{
- zend_bool _4$$3, _6$$3;
- zval auth, connection, connectionTimeout, host, index, options, port, readTimeout, reserved, result, retryInterval, persistent, persistentid, _0, _1$$3, _5$$3, _7$$3, _8$$3, _2$$6, _3$$6;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *message_param = NULL, _0;
+ zval message;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&auth);
- ZVAL_UNDEF(&connection);
- ZVAL_UNDEF(&connectionTimeout);
- ZVAL_UNDEF(&host);
- ZVAL_UNDEF(&index);
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&port);
- ZVAL_UNDEF(&readTimeout);
- ZVAL_UNDEF(&reserved);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&retryInterval);
- ZVAL_UNDEF(&persistent);
- ZVAL_UNDEF(&persistentid);
+ ZVAL_UNDEF(&message);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_7$$3);
- ZVAL_UNDEF(&_8$$3);
- ZVAL_UNDEF(&_2$$6);
- ZVAL_UNDEF(&_3$$6);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(message)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &message_param);
+ zephir_get_strval(&message, message_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&options, &_1$$3);
- 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_OBS_VAR(&auth);
- zephir_array_fetch_string(&auth, &options, SL("auth"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 140);
- ZEPHIR_OBS_VAR(&index);
- zephir_array_fetch_string(&index, &options, SL("index"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 141);
- ZEPHIR_OBS_VAR(&persistent);
- zephir_array_fetch_string(&persistent, &options, SL("persistent"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 142);
- ZEPHIR_OBS_VAR(&host);
- zephir_array_fetch_string(&host, &options, SL("host"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 143);
- ZEPHIR_OBS_VAR(&port);
- zephir_array_fetch_string(&port, &options, SL("port"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 144);
- ZEPHIR_OBS_VAR(&connectionTimeout);
- zephir_array_fetch_string(&connectionTimeout, &options, SL("connectionTimeout"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 145);
- ZEPHIR_OBS_VAR(&retryInterval);
- zephir_array_fetch_string(&retryInterval, &options, SL("retryInterval"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 146);
- ZEPHIR_OBS_VAR(&readTimeout);
- zephir_array_fetch_string(&readTimeout, &options, SL("readTimeout"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 147);
- ZEPHIR_INIT_VAR(&reserved);
- ZVAL_NULL(&reserved);
- if (!(zephir_is_true(&persistent))) {
- ZEPHIR_CALL_METHOD(&result, &connection, "connect", NULL, 0, &host, &port, &connectionTimeout, &reserved, &retryInterval, &readTimeout);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_VAR(&persistentid);
- ZEPHIR_CONCAT_SV(&persistentid, "persistentid_", &index);
- ZEPHIR_CALL_METHOD(&result, &connection, "pconnect", NULL, 0, &host, &port, &connectionTimeout, &persistentid, &retryInterval, &readTimeout);
- zephir_check_call_status();
- }
- if (!(zephir_is_true(&result))) {
- ZEPHIR_INIT_VAR(&_2$$6);
- object_init_ex(&_2$$6, phalcon_storage_exception_ce);
- ZEPHIR_INIT_VAR(&_3$$6);
- ZEPHIR_CONCAT_SVSVS(&_3$$6, "Could not connect to the Redisd server [", &host, ":", &port, "]");
- ZEPHIR_CALL_METHOD(NULL, &_2$$6, "__construct", NULL, 8, &_3$$6);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_2$$6, "phalcon/Storage/Adapter/Redis.zep", 175);
- ZEPHIR_MM_RESTORE();
- return;
- }
- _4$$3 = !(ZEPHIR_IS_EMPTY(&auth));
- if (_4$$3) {
- ZEPHIR_CALL_METHOD(&_5$$3, &connection, "auth", NULL, 0, &auth);
- zephir_check_call_status();
- _4$$3 = !zephir_is_true(&_5$$3);
- }
- if (_4$$3) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Failed to authenticate with the Redis server", "phalcon/Storage/Adapter/Redis.zep", 179);
- return;
- }
- _6$$3 = ZEPHIR_GT_LONG(&index, 0);
- if (_6$$3) {
- ZEPHIR_CALL_METHOD(&_7$$3, &connection, "select", NULL, 0, &index);
- zephir_check_call_status();
- _6$$3 = !zephir_is_true(&_7$$3);
- }
- if (_6$$3) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Redis server selected database failed", "phalcon/Storage/Adapter/Redis.zep", 183);
- return;
- }
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZVAL_LONG(&_8$$3, 2);
- ZEPHIR_CALL_METHOD(NULL, &connection, "setoption", NULL, 0, &_8$$3, &_1$$3);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setserializer", NULL, 126, &connection);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), &connection);
- }
- RETURN_MM_MEMBER(getThis(), "adapter");
+
+ 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_Storage_Adapter_Redis, getKeys)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, outputMessage)
{
+ zend_bool implicitFlush = 0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_3 = NULL, *_4 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *prefix_param = NULL, _0, _1, _2;
- zval prefix;
+ zval *type_param = NULL, *message, message_sub, content, msg, htmlMessage, preparedMsg, _0, *_1$$3, _2$$3;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&prefix);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&message_sub);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&msg);
+ ZVAL_UNDEF(&htmlMessage);
+ ZVAL_UNDEF(&preparedMsg);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_2$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR(prefix)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(type)
+ Z_PARAM_ZVAL(message)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_fetch_params(1, 2, 0, &type_param, &message);
+ zephir_get_strval(&type, type_param);
- 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("implicitFlush"), PH_NOISY_CC | PH_READONLY);
+ implicitFlush = zephir_is_true(&_0);
+ if (Z_TYPE_P(message) == IS_ARRAY) {
+ if (!(implicitFlush)) {
+ ZEPHIR_INIT_VAR(&content);
+ ZVAL_STRING(&content, "");
+ }
+ zephir_is_iterable(message, 0, "phalcon/Flash/AbstractFlash.zep", 297);
+ if (Z_TYPE_P(message) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(message), _1$$3)
+ {
+ ZEPHIR_INIT_NVAR(&msg);
+ ZVAL_COPY(&msg, _1$$3);
+ ZEPHIR_CALL_METHOD(&preparedMsg, this_ptr, "prepareescapedmessage", &_3, 103, &msg);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&htmlMessage, this_ptr, "preparehtmlmessage", &_4, 104, &type, &preparedMsg);
+ zephir_check_call_status();
+ if (implicitFlush) {
+ zend_print_zval(&htmlMessage, 0);
+ } else {
+ zephir_concat_self(&content, &htmlMessage);
+ zephir_update_property_array_append(this_ptr, SL("messages"), &htmlMessage);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, message, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2$$3, message, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&msg, message, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&preparedMsg, this_ptr, "prepareescapedmessage", &_3, 103, &msg);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&htmlMessage, this_ptr, "preparehtmlmessage", &_4, 104, &type, &preparedMsg);
+ zephir_check_call_status();
+ if (implicitFlush) {
+ zend_print_zval(&htmlMessage, 0);
+ } else {
+ zephir_concat_self(&content, &htmlMessage);
+ zephir_update_property_array_append(this_ptr, SL("messages"), &htmlMessage);
+ }
+ ZEPHIR_CALL_METHOD(NULL, message, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&msg);
+ if (!(implicitFlush)) {
+ RETURN_CCTOR(&content);
+ }
+ } else {
+ ZEPHIR_CALL_METHOD(&preparedMsg, this_ptr, "prepareescapedmessage", &_3, 103, message);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&htmlMessage, this_ptr, "preparehtmlmessage", &_4, 104, &type, &preparedMsg);
+ zephir_check_call_status();
+ if (implicitFlush) {
+ zend_print_zval(&htmlMessage, 0);
+ } else {
+ zephir_update_property_array_append(this_ptr, SL("messages"), &htmlMessage);
+ RETURN_CCTOR(&htmlMessage);
+ }
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, has)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, warning)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _0, _1;
- zval key;
+ zval *message_param = NULL, _0;
+ zval message;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&message);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(message)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_fetch_params(1, 1, 0, &message_param);
+ zephir_get_strval(&message, message_param);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_1, &_0, "exists", NULL, 0, &key);
+ 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_BOOL(zephir_get_boolval(&_1));
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, increment)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, getTemplate)
{
+ zval _5;
+ zend_bool _3;
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 *cssClassses_param = NULL, *cssIconClasses_param = NULL, _0, _1, _2, _4;
+ zval cssClassses, cssIconClasses, divString, iconString, template;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
+ 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(&_4);
+ ZVAL_UNDEF(&_5);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(cssClassses)
+ Z_PARAM_STR(cssIconClasses)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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();
+ 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 (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
+ _3 = !(ZEPHIR_IS_EMPTY(&cssClassses));
+ if (!(_3)) {
+ _3 = !(ZEPHIR_IS_EMPTY(&cssIconClasses));
}
- if (!value_param) {
- value = 1;
- } else {
- value = zephir_get_intval(value_param);
+ if (_3) {
+ ZEPHIR_INIT_NVAR(&divString);
+ ZVAL_STRING(&divString, " class=\"%cssClass%\"");
+ if (!(ZEPHIR_IS_EMPTY(&cssIconClasses))) {
+ ZEPHIR_INIT_NVAR(&iconString);
+ ZVAL_STRING(&iconString, " ");
+ }
}
-
-
- 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_read_property(&_4, this_ptr, ZEND_STRL("interpolator"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_5);
+ zephir_create_array(&_5, 2, 0);
+ zephir_array_update_string(&_5, SL("divString"), &divString, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_5, SL("iconString"), &iconString, PH_COPY | PH_SEPARATE);
+ ZEPHIR_RETURN_CALL_METHOD(&_4, "__invoke", NULL, 0, &template, &_5);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, set)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, prepareEscapedMessage)
{
+ zend_bool autoEscape = 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, _0, _1, _2;
- zval key;
+ zval *message_param = NULL, escaper, _0;
+ zval message;
zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&ttl_sub);
- ZVAL_NULL(&__$null);
+
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&escaper);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
#if PHP_VERSION_ID >= 80000
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_START(1, 1)
+ Z_PARAM_STR(message)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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;
- }
+ zephir_fetch_params(1, 1, 0, &message_param);
+ zephir_get_strval(&message, message_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();
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "getttl", NULL, 0, ttl);
+ ZEPHIR_OBS_VAR(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("autoescape"), PH_NOISY_CC);
+ autoEscape = zephir_get_boolval(&_0);
+ if (!(autoEscape)) {
+ RETURN_CTOR(&message);
+ }
+ ZEPHIR_CALL_METHOD(&escaper, this_ptr, "getescaperservice", NULL, 0);
zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(&_0, "set", NULL, 0, &key, &_1, &_2);
+ ZEPHIR_RETURN_CALL_METHOD(&escaper, "escapehtml", NULL, 0, &message);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, setSerializer)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, prepareHtmlMessage)
{
- zval map;
+ zval _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *connection, connection_sub, serializer, _0, _1, _4, _7, _2$$3, _3$$3, _5$$4, _6$$4, _8$$5, _9$$5, _10$$5;
+ zval *type_param = NULL, *message_param = NULL, classes, cssClasses, cssIconClasses, typeClasses, typeIconClasses, automaticHtml, _0, _1;
+ zval type, message;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&connection_sub);
- ZVAL_UNDEF(&serializer);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&classes);
+ ZVAL_UNDEF(&cssClasses);
+ ZVAL_UNDEF(&cssIconClasses);
+ ZVAL_UNDEF(&typeClasses);
+ ZVAL_UNDEF(&typeIconClasses);
+ ZVAL_UNDEF(&automaticHtml);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_7);
- 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(&_10$$5);
- ZVAL_UNDEF(&map);
+ ZVAL_UNDEF(&_2);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- 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_STR(type)
+ Z_PARAM_STR(message)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &connection);
+ zephir_fetch_params(1, 2, 0, &type_param, &message_param);
+ zephir_get_strval(&type, type_param);
+ zephir_get_strval(&message, message_param);
- ZEPHIR_INIT_VAR(&map);
- zephir_create_array(&map, 2, 0);
- add_assoc_long_ex(&map, SL("none"), 0);
- add_assoc_long_ex(&map, SL("php"), 1);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "\\Redis::SERIALIZER_IGBINARY");
- ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 127, &_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, 128, &_2$$3);
- zephir_check_call_status();
- zephir_array_update_string(&map, SL("igbinary"), &_3$$3, PH_COPY | PH_SEPARATE);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("automaticHtml"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&automaticHtml, &_0);
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&automaticHtml)) {
+ RETURN_CTOR(&message);
}
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "\\Redis::SERIALIZER_MSGPACK");
- ZEPHIR_CALL_FUNCTION(&_4, "defined", NULL, 127, &_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, 128, &_5$$4);
- zephir_check_call_status();
- zephir_array_update_string(&map, SL("msgpack"), &_6$$4, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_VAR(&classes);
+ zephir_read_property(&classes, this_ptr, ZEND_STRL("cssClasses"), PH_NOISY_CC);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("cssIconClasses"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&cssIconClasses, &_0);
+ ZEPHIR_OBS_VAR(&typeClasses);
+ if (zephir_array_isset_fetch(&typeClasses, &classes, &type, 0)) {
+ if (Z_TYPE_P(&typeClasses) == IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&cssClasses);
+ zephir_fast_join_str(&cssClasses, SL(" "), &typeClasses);
+ } else {
+ ZEPHIR_CPY_WRT(&cssClasses, &typeClasses);
+ }
+ } else {
+ ZEPHIR_INIT_NVAR(&cssClasses);
+ ZVAL_STRING(&cssClasses, "");
}
- zephir_read_property(&_7, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&serializer);
- zephir_fast_strtolower(&serializer, &_7);
- if (zephir_array_isset(&map, &serializer)) {
- ZEPHIR_INIT_VAR(&_8$$5);
- ZEPHIR_INIT_NVAR(&_8$$5);
- ZVAL_STRING(&_8$$5, "");
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &_8$$5);
- zephir_array_fetch(&_9$$5, &map, &serializer, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 288);
- ZVAL_LONG(&_10$$5, 1);
- ZEPHIR_CALL_METHOD(NULL, connection, "setoption", NULL, 0, &_10$$5, &_9$$5);
- zephir_check_call_status();
+ ZEPHIR_OBS_VAR(&typeIconClasses);
+ if (zephir_array_isset_fetch(&typeIconClasses, &cssIconClasses, &type, 0)) {
+ if (Z_TYPE_P(&typeIconClasses) == IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(&cssIconClasses);
+ zephir_fast_join_str(&cssIconClasses, SL(" "), &typeIconClasses);
+ } else {
+ ZEPHIR_CPY_WRT(&cssIconClasses, &typeIconClasses);
+ }
} else {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "initserializer", NULL, 0);
- zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&cssIconClasses);
+ ZVAL_STRING(&cssIconClasses, "");
}
- ZEPHIR_MM_RESTORE();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("interpolator"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "gettemplate", NULL, 105, &cssClasses, &cssIconClasses);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_2);
+ zephir_create_array(&_2, 3, 0);
+ zephir_array_update_string(&_2, SL("cssClass"), &cssClasses, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_2, SL("iconCssClass"), &cssIconClasses, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_2, SL("message"), &message, PH_COPY | PH_SEPARATE);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "__invoke", NULL, 0, &_1, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
}
-zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Redis(zend_class_entry *class_type)
+zend_object *zephir_init_properties_Phalcon_Flash_AbstractFlash(zend_class_entry *class_type)
{
- zval _0, _1$$3;
+ 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(&_1$$3);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_5$$5);
ZEPHIR_MM_GROW();
@@ -201737,11 +201225,23 @@ zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Redis(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("options"), 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("options"), &_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("messages"), &_1$$3);
+ }
+ 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("cssIconClasses"), &_3$$4);
+ }
+ 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("cssClasses"), &_5$$5);
}
ZEPHIR_MM_RESTORE();
return Z_OBJ_P(this_ptr);
@@ -201758,1441 +201258,1895 @@ zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Redis(zend_class_ent
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Stream)
+ZEPHIR_INIT_CLASS(Phalcon_Flash_Direct)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Adapter, Stream, phalcon, storage_adapter_stream, phalcon_storage_adapter_abstractadapter_ce, phalcon_storage_adapter_stream_method_entry, 0);
-
- zend_declare_property_string(phalcon_storage_adapter_stream_ce, SL("storageDir"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_storage_adapter_stream_ce, SL("options"), ZEND_ACC_PROTECTED);
- phalcon_storage_adapter_stream_ce->create_object = zephir_init_properties_Phalcon_Storage_Adapter_Stream;
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Flash, Direct, phalcon, flash_direct, phalcon_flash_abstractflash_ce, phalcon_flash_direct_method_entry, 0);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, __construct)
+static PHP_METHOD(Phalcon_Flash_Direct, message)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL, *_4 = NULL, *_5 = NULL;
- zval options;
- zval *factory, factory_sub, *options_param = NULL, storageDir, _1, _2, _3;
+ zval *type_param = NULL, *message, message_sub;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
- ZVAL_UNDEF(&storageDir);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&message_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- 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_START(2, 2)
+ Z_PARAM_STR(type)
+ Z_PARAM_ZVAL(message)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, 2, 0, &type_param, &message);
+ zephir_get_strval(&type, type_param);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "storageDir");
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "");
- ZEPHIR_CALL_CE_STATIC(&storageDir, phalcon_helper_arr_ce, "get", &_0, 16, &options, &_1, &_2);
- 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", 57);
- return;
- }
- ZEPHIR_CALL_CE_STATIC(&_3, phalcon_helper_str_ce, "dirseparator", &_4, 129, &storageDir);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("storageDir"), &_3);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "ph-strm");
- zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_1);
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
- ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_stream_ce, getThis(), "__construct", &_5, 0, factory, &options);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "initserializer", NULL, 0);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "outputmessage", NULL, 0, &type, message);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, clear)
+static PHP_METHOD(Phalcon_Flash_Direct, output)
{
- zend_bool result = 0, _5$$3, _10$$5;
- zval directory, iterator, file, _1, *_2, _3, _4$$3, _6$$3, _7$$3, _9$$5, _11$$5, _12$$5;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_3 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL, *_8 = NULL;
+ zval *remove_param = NULL, message, _0, *_1, _2;
+ zend_bool remove;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&directory);
- ZVAL_UNDEF(&iterator);
- ZVAL_UNDEF(&file);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_6$$3);
- ZVAL_UNDEF(&_7$$3);
- ZVAL_UNDEF(&_9$$5);
- ZVAL_UNDEF(&_11$$5);
- ZVAL_UNDEF(&_12$$5);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(remove)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &remove_param);
+ if (!remove_param) {
+ remove = 1;
+ } else {
+ remove = zephir_get_boolval(remove_param);
+ }
- result = 1;
- zephir_read_property(&_1, this_ptr, ZEND_STRL("storageDir"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_CE_STATIC(&directory, phalcon_helper_str_ce, "dirseparator", &_0, 129, &_1);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&iterator, this_ptr, "getiterator", NULL, 130, &directory);
- zephir_check_call_status();
- zephir_is_iterable(&iterator, 0, "phalcon/Storage/Adapter/Stream.zep", 90);
- if (Z_TYPE_P(&iterator) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&iterator), _2)
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ zephir_is_iterable(&_0, 0, "phalcon/Flash/Direct.zep", 40);
+ if (Z_TYPE_P(&_0) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1)
{
- ZEPHIR_INIT_NVAR(&file);
- ZVAL_COPY(&file, _2);
- ZEPHIR_CALL_METHOD(&_4$$3, &file, "isfile", NULL, 0);
- zephir_check_call_status();
- _5$$3 = zephir_is_true(&_4$$3);
- if (_5$$3) {
- ZEPHIR_CALL_METHOD(&_6$$3, &file, "getpathname", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&_7$$3, "unlink", &_8, 131, &_6$$3);
- zephir_check_call_status();
- _5$$3 = !zephir_is_true(&_7$$3);
- }
- if (_5$$3) {
- result = 0;
- }
+ ZEPHIR_INIT_NVAR(&message);
+ ZVAL_COPY(&message, _1);
+ zend_print_zval(&message, 0);
} ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_CALL_METHOD(NULL, &iterator, "rewind", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0);
zephir_check_call_status();
while (1) {
- ZEPHIR_CALL_METHOD(&_3, &iterator, "valid", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_2, &_0, "valid", NULL, 0);
zephir_check_call_status();
- if (!zend_is_true(&_3)) {
+ if (!zend_is_true(&_2)) {
break;
}
- ZEPHIR_CALL_METHOD(&file, &iterator, "current", NULL, 0);
+ ZEPHIR_CALL_METHOD(&message, &_0, "current", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_9$$5, &file, "isfile", NULL, 0);
- zephir_check_call_status();
- _10$$5 = zephir_is_true(&_9$$5);
- if (_10$$5) {
- ZEPHIR_CALL_METHOD(&_11$$5, &file, "getpathname", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&_12$$5, "unlink", &_8, 131, &_11$$5);
- zephir_check_call_status();
- _10$$5 = !zephir_is_true(&_12$$5);
- }
- if (_10$$5) {
- result = 0;
- }
- ZEPHIR_CALL_METHOD(NULL, &iterator, "next", NULL, 0);
+ zend_print_zval(&message, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0);
zephir_check_call_status();
}
}
- ZEPHIR_INIT_NVAR(&file);
- RETURN_MM_BOOL(result);
+ ZEPHIR_INIT_NVAR(&message);
+ if (remove) {
+ ZEPHIR_CALL_PARENT(NULL, phalcon_flash_direct_ce, getThis(), "clear", &_3, 0);
+ zephir_check_call_status();
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, decrement)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Flash_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Flash, Exception, phalcon, flash_exception, phalcon_exception_ce, NULL, 0);
+
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+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);
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Flash_Session)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Flash, Session, phalcon, flash_session, phalcon_flash_abstractflash_ce, phalcon_flash_session_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Flash_Session, clear)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long value, ZEPHIR_LAST_CALL_STATUS, _1;
- zval *key_param = NULL, *value_param = NULL, data, _0;
- zval key;
+ zephir_fcall_cache_entry *_1 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&data);
ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
- ZEND_PARSE_PARAMETERS_END();
-#endif
ZEPHIR_MM_GROW();
- 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 {
- value = zephir_get_intval(value_param);
- }
-
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
- zephir_check_call_status();
- if (!(zephir_is_true(&_0))) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_CALL_METHOD(&data, this_ptr, "get", NULL, 0, &key);
+ ZVAL_BOOL(&_0, 1);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "getsessionmessages", NULL, 0, &_0);
zephir_check_call_status();
- _1 = (zephir_get_intval(&data) - value);
- ZEPHIR_INIT_NVAR(&data);
- ZVAL_LONG(&data, _1);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, &key, &data);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_flash_session_ce, getThis(), "clear", &_1, 0);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, delete)
+static PHP_METHOD(Phalcon_Flash_Session, getMessages)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, filepath, _0;
- zval key;
+ zend_bool remove;
+ zval *type = NULL, type_sub, *remove_param = NULL, __$null, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&filepath);
+ ZVAL_UNDEF(&type_sub);
+ ZVAL_NULL(&__$null);
ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_START(0, 2)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(type)
+ Z_PARAM_BOOL(remove)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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();
+ zephir_fetch_params(1, 0, 2, &type, &remove_param);
+ if (!type) {
+ type = &type_sub;
+ type = &__$null;
}
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ if (!remove_param) {
+ remove = 1;
} else {
- ZEPHIR_INIT_VAR(&key);
+ remove = zephir_get_boolval(remove_param);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
- zephir_check_call_status();
- if (!(zephir_is_true(&_0))) {
- RETURN_MM_BOOL(0);
+ if (remove) {
+ ZVAL_BOOL(&_0, 1);
+ } else {
+ ZVAL_BOOL(&_0, 0);
}
- ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 132, &key);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_FUNCTION("unlink", NULL, 131, &filepath);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsessionmessages", NULL, 0, &_0, type);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, get)
+static PHP_METHOD(Phalcon_Flash_Session, has)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_2 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, content, filepath, payload, _0, _1, _3, _4;
- zval key;
+ zval *type = NULL, type_sub, __$null, messages, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_UNDEF(&type_sub);
ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&content);
- ZVAL_UNDEF(&filepath);
- ZVAL_UNDEF(&payload);
+ ZVAL_UNDEF(&messages);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_ZVAL_OR_NULL(type)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_fetch_params(1, 0, 1, &type);
+ if (!type) {
+ type = &type_sub;
+ type = &__$null;
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE(&_0)) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
- }
- ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 132, &key);
- zephir_check_call_status();
- if (!((zephir_file_exists(&filepath) == SUCCESS))) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
- }
- ZEPHIR_CALL_METHOD(&payload, this_ptr, "getpayload", NULL, 133, &filepath);
- zephir_check_call_status();
- if (UNEXPECTED(ZEPHIR_IS_EMPTY(&payload))) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
- }
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "isexpired", NULL, 134, &payload);
+ ZVAL_BOOL(&_0, 0);
+ ZEPHIR_CALL_METHOD(&messages, this_ptr, "getsessionmessages", NULL, 0, &_0);
zephir_check_call_status();
- if (zephir_is_true(&_1)) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
+ if (Z_TYPE_P(type) == IS_STRING) {
+ RETURN_MM_BOOL(zephir_array_isset(&messages, type));
}
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "content");
- ZVAL_NULL(&_4);
- ZEPHIR_CALL_CE_STATIC(&content, phalcon_helper_arr_ce, "get", &_2, 16, &payload, &_3, &_4);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &content);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_MM_BOOL(zephir_fast_count_int(&messages) > 0);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getAdapter)
+static PHP_METHOD(Phalcon_Flash_Session, message)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval message;
+ zval *type, type_sub, *message_param = NULL, messages, _0, _1$$3;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&type_sub);
+ ZVAL_UNDEF(&messages);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&message);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ZVAL(type)
+ Z_PARAM_STR(message)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &type, &message_param);
+ zephir_get_strval(&message, message_param);
- RETURN_MEMBER(getThis(), "adapter");
+ ZVAL_BOOL(&_0, 0);
+ ZEPHIR_CALL_METHOD(&messages, this_ptr, "getsessionmessages", NULL, 0, &_0);
+ zephir_check_call_status();
+ if (!(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();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getKeys)
+static PHP_METHOD(Phalcon_Flash_Session, output)
{
- zval files;
+ zend_string *_4;
+ zend_ulong _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_5 = NULL, *_6 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *prefix_param = NULL, directory, file, iterator, *_0, _1, _2$$4, _3$$5, _4$$5, _5$$5, _6$$6, _7$$7, _8$$7, _9$$7;
- zval prefix;
+ zval *remove_param = NULL, type, message, messages, _0, *_1, _2;
+ zend_bool remove;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&prefix);
- ZVAL_UNDEF(&directory);
- ZVAL_UNDEF(&file);
- ZVAL_UNDEF(&iterator);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$5);
- ZVAL_UNDEF(&_4$$5);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_6$$6);
- ZVAL_UNDEF(&_7$$7);
- ZVAL_UNDEF(&_8$$7);
- ZVAL_UNDEF(&_9$$7);
- ZVAL_UNDEF(&files);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&messages);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_STR(prefix)
+ Z_PARAM_BOOL(remove)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, &remove_param);
+ if (!remove_param) {
+ remove = 1;
} else {
- ZEPHIR_INIT_VAR(&prefix);
- }
+ remove = zephir_get_boolval(remove_param);
}
- ZEPHIR_INIT_VAR(&files);
- array_init(&files);
- ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdir", NULL, 135);
- zephir_check_call_status();
- if (!((zephir_file_exists(&directory) == SUCCESS))) {
- array_init(return_value);
- RETURN_MM();
+ if (remove) {
+ ZVAL_BOOL(&_0, 1);
+ } else {
+ ZVAL_BOOL(&_0, 0);
}
- ZEPHIR_CALL_METHOD(&iterator, this_ptr, "getiterator", NULL, 130, &directory);
+ ZEPHIR_CALL_METHOD(&messages, this_ptr, "getsessionmessages", NULL, 0, &_0);
zephir_check_call_status();
- zephir_is_iterable(&iterator, 0, "phalcon/Storage/Adapter/Stream.zep", 206);
- if (Z_TYPE_P(&iterator) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&iterator), _0)
+ zephir_is_iterable(&messages, 0, "phalcon/Flash/Session.zep", 100);
+ if (Z_TYPE_P(&messages) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&messages), _3, _4, _1)
{
- ZEPHIR_INIT_NVAR(&file);
- ZVAL_COPY(&file, _0);
- ZEPHIR_CALL_METHOD(&_2$$4, &file, "isfile", NULL, 0);
- zephir_check_call_status();
- if (zephir_is_true(&_2$$4)) {
- zephir_read_property(&_3$$5, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_4$$5, &file, "getfilename", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_5$$5);
- ZEPHIR_CONCAT_VV(&_5$$5, &_3$$5, &_4$$5);
- zephir_array_append(&files, &_5$$5, PH_SEPARATE, "phalcon/Storage/Adapter/Stream.zep", 202);
+ ZEPHIR_INIT_NVAR(&type);
+ if (_4 != NULL) {
+ ZVAL_STR_COPY(&type, _4);
+ } else {
+ ZVAL_LONG(&type, _3);
}
+ 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, &iterator, "rewind", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &messages, "rewind", NULL, 0);
zephir_check_call_status();
while (1) {
- ZEPHIR_CALL_METHOD(&_1, &iterator, "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(&file, &iterator, "current", NULL, 0);
+ ZEPHIR_CALL_METHOD(&type, &messages, "key", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_6$$6, &file, "isfile", NULL, 0);
+ ZEPHIR_CALL_METHOD(&message, &messages, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "outputmessage", &_5, 0, &type, &message);
zephir_check_call_status();
- if (zephir_is_true(&_6$$6)) {
- zephir_read_property(&_7$$7, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_8$$7, &file, "getfilename", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_9$$7);
- ZEPHIR_CONCAT_VV(&_9$$7, &_7$$7, &_8$$7);
- zephir_array_append(&files, &_9$$7, PH_SEPARATE, "phalcon/Storage/Adapter/Stream.zep", 202);
- }
- ZEPHIR_CALL_METHOD(NULL, &iterator, "next", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &messages, "next", NULL, 0);
zephir_check_call_status();
}
}
- ZEPHIR_INIT_NVAR(&file);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfilteredkeys", NULL, 0, &files, &prefix);
+ ZEPHIR_INIT_NVAR(&message);
+ ZEPHIR_INIT_NVAR(&type);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_flash_session_ce, getThis(), "clear", &_6, 0);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, has)
+static PHP_METHOD(Phalcon_Flash_Session, getSessionMessages)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, payload, filepath, _0;
- zval key;
+ zval *remove_param = NULL, *type = NULL, type_sub, __$null, session, messages, returnMessages, _0, _1$$6, _2$$7;
+ zend_bool remove;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&payload);
- ZVAL_UNDEF(&filepath);
+ ZVAL_UNDEF(&type_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&session);
+ ZVAL_UNDEF(&messages);
+ ZVAL_UNDEF(&returnMessages);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$6);
+ ZVAL_UNDEF(&_2$$7);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_BOOL(remove)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(type)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_fetch_params(1, 1, 1, &remove_param, &type);
+ remove = zephir_get_boolval(remove_param);
+ if (!type) {
+ type = &type_sub;
+ type = &__$null;
}
- ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 132, &key);
+ ZEPHIR_CALL_METHOD(&session, this_ptr, "getsessionservice", NULL, 0);
zephir_check_call_status();
- if (!((zephir_file_exists(&filepath) == SUCCESS))) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_CALL_METHOD(&payload, this_ptr, "getpayload", NULL, 133, &filepath);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "_flashMessages");
+ ZEPHIR_CALL_METHOD(&messages, &session, "get", NULL, 0, &_0);
zephir_check_call_status();
- if (UNEXPECTED(ZEPHIR_IS_EMPTY(&payload))) {
- RETURN_MM_BOOL(0);
+ if (Z_TYPE_P(&messages) != IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(&messages);
+ array_init(&messages);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "isexpired", NULL, 134, &payload);
- zephir_check_call_status();
- RETURN_MM_BOOL(!zephir_is_true(&_0));
+ if (Z_TYPE_P(type) == IS_STRING) {
+ ZEPHIR_OBS_VAR(&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();
+ }
+ RETURN_CCTOR(&returnMessages);
+ }
+ array_init(return_value);
+ RETURN_MM();
+ }
+ 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_Storage_Adapter_Stream, increment)
+static PHP_METHOD(Phalcon_Flash_Session, setSessionMessages)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long value, ZEPHIR_LAST_CALL_STATUS, _1;
- zval *key_param = NULL, *value_param = NULL, data, _0;
- zval key;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *messages_param = NULL, session, _0;
+ zval messages;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&messages);
+ ZVAL_UNDEF(&session);
ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(messages)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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 {
- value = zephir_get_intval(value_param);
- }
+ zephir_fetch_params(1, 1, 0, &messages_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&messages, messages_param);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
- zephir_check_call_status();
- if (!(zephir_is_true(&_0))) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_CALL_METHOD(&data, this_ptr, "get", NULL, 0, &key);
+ ZEPHIR_CALL_METHOD(&session, this_ptr, "getsessionservice", NULL, 0);
zephir_check_call_status();
- _1 = (zephir_get_intval(&data) + value);
- ZEPHIR_INIT_NVAR(&data);
- ZVAL_LONG(&data, _1);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, &key, &data);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "_flashMessages");
+ ZEPHIR_CALL_METHOD(NULL, &session, "set", NULL, 0, &_0, &messages);
zephir_check_call_status();
- RETURN_MM();
+ RETURN_CTOR(&messages);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, set)
+static PHP_METHOD(Phalcon_Flash_Session, getSessionService)
{
- zval payload;
+ zval container, _0, _1, _6, _7, _2$$4, _3$$4, _5$$4, _8$$5, _9$$5, _10$$6, _11$$6, _12$$6;
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, __$true, __$null, directory, _0, _1, _2, _4, _5, _6, _3$$3;
- zval key;
+ zephir_fcall_cache_entry *_4 = NULL;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&ttl_sub);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&directory);
+ ZVAL_UNDEF(&container);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&payload);
-#if PHP_VERSION_ID >= 80000
- 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();
-#endif
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$6);
+ ZVAL_UNDEF(&_11$$6);
+ ZVAL_UNDEF(&_12$$6);
ZEPHIR_MM_GROW();
- 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);
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("sessionService"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_is_true(&_0)) {
+ RETURN_MM_MEMBER(getThis(), "sessionService");
}
- if (!ttl) {
- ttl = &ttl_sub;
- ttl = &__$null;
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&container, &_1);
+ if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) {
+ ZEPHIR_INIT_VAR(&_2$$4);
+ object_init_ex(&_2$$4, phalcon_flash_exception_ce);
+ ZEPHIR_INIT_VAR(&_5$$4);
+ ZVAL_STRING(&_5$$4, "the 'session' service");
+ ZEPHIR_CALL_CE_STATIC(&_3$$4, phalcon_flash_exception_ce, "containerservicenotfound", &_4, 0, &_5$$4);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 8, &_3$$4);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_2$$4, "phalcon/Flash/Session.zep", 174);
+ ZEPHIR_MM_RESTORE();
+ return;
}
-
-
- 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);
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getttl", NULL, 0, ttl);
- zephir_check_call_status();
- zephir_array_update_string(&payload, SL("ttl"), &_1, PH_COPY | PH_SEPARATE);
- 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_CALL_FUNCTION(&_1, "serialize", NULL, 13, &payload);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&payload, &_1);
- ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdir", NULL, 135, &key);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&_2, "is_dir", NULL, 136, &directory);
+ ZEPHIR_INIT_VAR(&_7);
+ ZVAL_STRING(&_7, "session");
+ ZEPHIR_CALL_METHOD(&_6, &container, "has", NULL, 0, &_7);
zephir_check_call_status();
- if (!(zephir_is_true(&_2))) {
- ZVAL_LONG(&_3$$3, 0777);
- ZEPHIR_CALL_FUNCTION(NULL, "mkdir", NULL, 137, &directory, &_3$$3, &__$true);
+ if (UNEXPECTED(zephir_is_true(&_6))) {
+ ZEPHIR_INIT_VAR(&_9$$5);
+ ZVAL_STRING(&_9$$5, "session");
+ ZEPHIR_CALL_METHOD(&_8$$5, &container, "getshared", NULL, 0, &_9$$5);
+ zephir_check_call_status();
+ RETURN_CCTOR(&_8$$5);
+ } else {
+ ZEPHIR_INIT_VAR(&_10$$6);
+ object_init_ex(&_10$$6, phalcon_flash_exception_ce);
+ ZEPHIR_INIT_VAR(&_12$$6);
+ ZVAL_STRING(&_12$$6, "the 'session' service");
+ ZEPHIR_CALL_CE_STATIC(&_11$$6, phalcon_flash_exception_ce, "containerservicenotfound", &_4, 0, &_12$$6);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_10$$6, "__construct", NULL, 8, &_11$$6);
zephir_check_call_status();
+ zephir_throw_exception_debug(&_10$$6, "phalcon/Flash/Session.zep", 182);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- ZEPHIR_INIT_VAR(&_4);
- ZEPHIR_CONCAT_VV(&_4, &directory, &key);
- ZVAL_LONG(&_5, 2);
- ZEPHIR_CALL_FUNCTION(&_6, "file_put_contents", NULL, 138, &_4, &payload, &_5);
- zephir_check_call_status();
- RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_6));
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDir)
+
+
+
+#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, phalcon_exception_ce, 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);
+
+ zend_declare_property_string(phalcon_image_imagefactory_ce, SL("exception"), "Phalcon\\Image\\Exception", ZEND_ACC_PROTECTED);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Image_ImageFactory, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL, *_4 = NULL;
- zval *key_param = NULL, dirFromFile, dirPrefix, _1, _2, _3, _5, _6, _7, _8;
- zval key;
+ zval *services_param = NULL;
+ zval services;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&dirFromFile);
- ZVAL_UNDEF(&dirPrefix);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&services);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_STR(key)
+ Z_PARAM_ARRAY(services)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ zephir_fetch_params(1, 0, 1, &services_param);
+ if (!services_param) {
+ ZEPHIR_INIT_VAR(&services);
+ array_init(&services);
} else {
- ZEPHIR_INIT_VAR(&key);
- }
+ ZEPHIR_OBS_COPY_OR_DUP(&services, services_param);
}
- zephir_read_property(&_1, this_ptr, ZEND_STRL("storageDir"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_3);
- ZEPHIR_CONCAT_VV(&_3, &_1, &_2);
- ZEPHIR_CALL_CE_STATIC(&dirPrefix, phalcon_helper_str_ce, "dirseparator", &_0, 129, &_3);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_5);
- zephir_read_property(&_6, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_7);
- ZVAL_STRING(&_7, "");
- zephir_fast_str_replace(&_5, &_6, &_7, &key);
- ZEPHIR_CALL_CE_STATIC(&dirFromFile, phalcon_helper_str_ce, "dirfromfile", &_4, 139, &_5);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_8);
- ZEPHIR_CONCAT_VV(&_8, &dirPrefix, &dirFromFile);
- ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_helper_str_ce, "dirseparator", &_0, 129, &_8);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getFilepath)
+static PHP_METHOD(Phalcon_Image_ImageFactory, load)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_1 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _0, _1, _2, _3, _4;
- zval key;
+ zval *config = NULL, config_sub, height, file, name, width, _0, _2, _3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
+ 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);
ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_ZVAL(config)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_fetch_params(1, 1, 0, &config);
+ ZEPHIR_SEPARATE_PARAM(config);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdir", NULL, 135, &key);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkconfig", NULL, 0, config);
zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(config, &_0);
+ if (UNEXPECTED(!(zephir_array_isset_string(config, SL("file"))))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "You must provide 'file' option in factory config parameter.", "phalcon/Image/ImageFactory.zep", 52);
+ return;
+ }
+ ZEPHIR_OBS_VAR(&name);
+ zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Image/ImageFactory.zep", 55);
+ zephir_array_unset_string(config, SL("adapter"), PH_SEPARATE);
ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "");
- ZVAL_LONG(&_3, 1);
- ZEPHIR_MAKE_REF(&_3);
- ZEPHIR_CALL_FUNCTION(&_4, "str_replace", NULL, 140, &_1, &_2, &key, &_3);
- ZEPHIR_UNREF(&_3);
+ ZVAL_STRING(&_2, "file");
+ ZEPHIR_CALL_CE_STATIC(&file, phalcon_helper_arr_ce, "get", &_1, 16, config, &_2);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "height");
+ ZVAL_NULL(&_3);
+ ZEPHIR_CALL_CE_STATIC(&height, phalcon_helper_arr_ce, "get", &_1, 16, config, &_2, &_3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "width");
+ ZVAL_NULL(&_3);
+ ZEPHIR_CALL_CE_STATIC(&width, phalcon_helper_arr_ce, "get", &_1, 16, config, &_2, &_3);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &file, &width, &height);
zephir_check_call_status();
- ZEPHIR_CONCAT_VV(return_value, &_0, &_4);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getIterator)
+static PHP_METHOD(Phalcon_Image_ImageFactory, newInstance)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *dir_param = NULL, _0, _1;
- zval dir;
+ 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(&dir);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&definition);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(dir)
+ ZEND_PARSE_PARAMETERS_START(2, 4)
+ Z_PARAM_STR(name)
+ 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();
#endif
ZEPHIR_MM_GROW();
- 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, 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(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);
+ }
+ 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 {
+ width = zephir_get_intval(width_param);
+ }
+ if (!height_param) {
+ height = 0;
+ } else {
+ height = zephir_get_intval(height_param);
}
- 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, 141, &dir, &_1);
+ ZEPHIR_CALL_METHOD(&definition, this_ptr, "getservice", NULL, 0, &name);
zephir_check_call_status();
- ZVAL_LONG(&_1, 2);
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 142, &_0, &_1);
+ 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_Storage_Adapter_Stream, getPayload)
+static PHP_METHOD(Phalcon_Image_ImageFactory, getAdapters)
{
- 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$$5, _6$$5, _7$$6, _8$$6;
- zval filepath;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&filepath);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&payload);
- ZVAL_UNDEF(&pointer);
- ZVAL_UNDEF(&version);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_9);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&_7$$6);
- ZVAL_UNDEF(&_8$$6);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(filepath)
- ZEND_PARSE_PARAMETERS_END();
+
+
+ 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;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &filepath_param);
- zephir_get_strval(&filepath, filepath_param);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "r");
- ZEPHIR_CALL_FUNCTION(&pointer, "fopen", NULL, 89, &filepath, &_0);
- zephir_check_call_status();
- ZVAL_LONG(&_1, 1);
- ZEPHIR_CALL_FUNCTION(&_2, "flock", NULL, 143, &pointer, &_1);
- zephir_check_call_status();
- if (zephir_is_true(&_2)) {
- ZEPHIR_INIT_VAR(&payload);
- zephir_file_get_contents(&payload, &filepath);
- }
- zephir_fclose(&pointer);
- if (ZEPHIR_IS_FALSE_IDENTICAL(&payload)) {
- array_init(return_value);
- RETURN_MM();
- }
- ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 86);
- 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, 87, &version, &_0, &_3);
- zephir_check_call_status();
- if (zephir_is_true(&_4)) {
- ZEPHIR_INIT_VAR(&_5$$5);
- ZEPHIR_INIT_NVAR(&_5$$5);
- zephir_create_closure_ex(&_5$$5, NULL, phalcon_2__closure_ce, SL("__invoke"));
- ZVAL_LONG(&_6$$5, 8);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_5$$5, &_6$$5);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_VAR(&_7$$6);
- ZEPHIR_INIT_NVAR(&_7$$6);
- zephir_create_closure_ex(&_7$$6, NULL, phalcon_3__closure_ce, SL("__invoke"));
- ZVAL_LONG(&_8$$6, 8);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_7$$6, &_8$$6);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_FUNCTION(&_9, "unserialize", NULL, 15, &payload);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&payload, &_9);
- ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 90);
- zephir_check_call_status();
- _10 = ZEPHIR_GLOBAL(warning).enable;
- if (!(_10)) {
- _10 = Z_TYPE_P(&payload) != IS_ARRAY;
- }
- if (UNEXPECTED(_10)) {
- array_init(return_value);
- RETURN_MM();
- }
- RETURN_CCTOR(&payload);
+
+ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter_AbstractAdapter)
+{
+ 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_bool(phalcon_image_adapter_abstractadapter_ce, SL("checked"), 0, ZEND_ACC_PROTECTED|ZEND_ACC_STATIC);
+ 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_Storage_Adapter_Stream, isExpired)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, getHeight)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *payload_param = NULL, created, ttl, _1, _2, _3, _4;
- zval payload;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&payload);
- ZVAL_UNDEF(&created);
- ZVAL_UNDEF(&ttl);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(payload)
- ZEND_PARSE_PARAMETERS_END();
-#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &payload_param);
- ZEPHIR_OBS_COPY_OR_DUP(&payload, payload_param);
+ RETURN_MEMBER(getThis(), "height");
+}
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, getImage)
+{
+ zval *this_ptr = getThis();
- ZEPHIR_INIT_VAR(&_1);
- zephir_time(&_1);
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "created");
- ZEPHIR_CALL_CE_STATIC(&created, phalcon_helper_arr_ce, "get", &_0, 16, &payload, &_2, &_1);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "ttl");
- ZVAL_LONG(&_3, 3600);
- ZEPHIR_CALL_CE_STATIC(&ttl, phalcon_helper_arr_ce, "get", &_0, 16, &payload, &_2, &_3);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_4);
- zephir_add_function(&_4, &created, &ttl);
- ZEPHIR_INIT_NVAR(&_2);
- zephir_time(&_2);
- RETURN_MM_BOOL(ZEPHIR_LT(&_4, &_2));
+
+
+ RETURN_MEMBER(getThis(), "image");
}
-zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Stream(zend_class_entry *class_type)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, getMime)
{
- zval _0, _1$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
-
+ zval *this_ptr = getThis();
- ZEPHIR_MM_GROW();
-
- {
- 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);
- }
+
+
+ RETURN_MEMBER(getThis(), "mime");
}
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, getRealpath)
+{
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
+ RETURN_MEMBER(getThis(), "realpath");
+}
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, getType)
+{
+ zval *this_ptr = getThis();
+ RETURN_MEMBER(getThis(), "type");
+}
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_AbstractSerializer)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, getWidth)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Storage\\Serializer, AbstractSerializer, phalcon, storage_serializer_abstractserializer, phalcon_storage_serializer_abstractserializer_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ zval *this_ptr = getThis();
- zend_declare_property_null(phalcon_storage_serializer_abstractserializer_ce, SL("data"), ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_storage_serializer_abstractserializer_ce, 1, phalcon_storage_serializer_serializerinterface_ce);
- return SUCCESS;
+
+
+ RETURN_MEMBER(getThis(), "width");
}
-static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __construct)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, background)
{
- zval *data = NULL, data_sub, __$null;
+ zend_bool _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ 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(&data_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&color);
+ ZVAL_UNDEF(&colors);
+ ZVAL_UNDEF(&_1);
+ 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);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(color)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(data)
+ Z_PARAM_LONG(opacity)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(0, 1, &data);
- if (!data) {
- data = &data_sub;
- data = &__$null;
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 1, &color_param, &opacity_param);
+ zephir_get_strval(&color, color_param);
+ if (!opacity_param) {
+ opacity = 100;
+ } else {
+ opacity = zephir_get_intval(opacity_param);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
+ _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, 50, &_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, 108, &color, &_9);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_11);
+ ZVAL_STRING(&_11, "hexdec");
+ ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 102, &_11, &_10);
+ zephir_check_call_status();
+ zephir_array_fetch_long(&_12, &colors, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 93);
+ zephir_array_fetch_long(&_13, &colors, 1, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 93);
+ zephir_array_fetch_long(&_14, &colors, 2, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 93);
+ 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_Storage_Serializer_AbstractSerializer, isSerializable)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, blur)
{
- zend_bool _0, _1;
- zval *data, data_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *radius_param = NULL, _0;
+ zend_long radius, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
+ Z_PARAM_LONG(radius)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(1, 0, &data);
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &radius_param);
+ radius = zephir_get_intval(radius_param);
- _0 = ZEPHIR_IS_EMPTY(data);
- if (!(_0)) {
- _0 = ((Z_TYPE_P(data) == IS_TRUE || Z_TYPE_P(data) == IS_FALSE) == 1);
- }
- _1 = _0;
- if (!(_1)) {
- _1 = zephir_is_numeric(data);
+ if (radius < 1) {
+ radius = 1;
+ } else if (radius > 100) {
+ radius = 100;
}
- RETURN_BOOL(!(_1));
+ ZVAL_LONG(&_0, radius);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processblur", NULL, 0, &_0);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, getData)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, crop)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *width_param = NULL, *height_param = NULL, *offsetX_param = NULL, *offsetY_param = NULL, _0, _5, _10, _12, _14, _15, _16, _17, _1$$3, _2$$5, _3$$4, _4$$6, _6$$7, _7$$9, _8$$8, _9$$10, _11$$11, _13$$12;
+ zend_long width, height, offsetX, offsetY, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_14);
+ ZVAL_UNDEF(&_15);
+ ZVAL_UNDEF(&_16);
+ ZVAL_UNDEF(&_17);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_4$$6);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&_7$$9);
+ ZVAL_UNDEF(&_8$$8);
+ ZVAL_UNDEF(&_9$$10);
+ ZVAL_UNDEF(&_11$$11);
+ ZVAL_UNDEF(&_13$$12);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 4)
+ Z_PARAM_LONG(width)
+ Z_PARAM_LONG(height)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG_OR_NULL(offsetX, is_null_true)
+ Z_PARAM_LONG_OR_NULL(offsetY, is_null_true)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 2, &width_param, &height_param, &offsetX_param, &offsetY_param);
+ width = zephir_get_intval(width_param);
+ height = zephir_get_intval(height_param);
+ if (!offsetX_param) {
+ offsetX = 0;
+ } else {
+ offsetX = zephir_get_intval(offsetX_param);
+ }
+ if (!offsetY_param) {
+ offsetY = 0;
+ } else {
+ offsetY = zephir_get_intval(offsetY_param);
+ }
- RETURN_MEMBER(getThis(), "data");
+ ZVAL_LONG(&_0, offsetX);
+ if (Z_TYPE_P(&_0) == IS_NULL) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ offsetX = (long) ((zephir_safe_div_long_long(((zephir_get_numberval(&_1$$3) - width)), 2)));
+ } else {
+ if (offsetX < 0) {
+ zephir_read_property(&_2$$5, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ offsetX = ((zephir_get_numberval(&_2$$5) - width) + offsetX);
+ }
+ zephir_read_property(&_3$$4, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ if (ZEPHIR_LT_LONG(&_3$$4, offsetX)) {
+ ZEPHIR_OBS_VAR(&_4$$6);
+ zephir_read_property(&_4$$6, this_ptr, ZEND_STRL("width"), PH_NOISY_CC);
+ offsetX = zephir_get_intval(&_4$$6);
+ }
+ }
+ ZVAL_LONG(&_5, offsetY);
+ if (Z_TYPE_P(&_5) == IS_NULL) {
+ zephir_read_property(&_6$$7, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ offsetY = (long) ((zephir_safe_div_long_long(((zephir_get_numberval(&_6$$7) - height)), 2)));
+ } else {
+ if (offsetY < 0) {
+ zephir_read_property(&_7$$9, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ offsetY = ((zephir_get_numberval(&_7$$9) - height) + offsetY);
+ }
+ zephir_read_property(&_8$$8, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ if (ZEPHIR_LT_LONG(&_8$$8, offsetY)) {
+ ZEPHIR_OBS_VAR(&_9$$10);
+ zephir_read_property(&_9$$10, this_ptr, ZEND_STRL("height"), PH_NOISY_CC);
+ offsetY = zephir_get_intval(&_9$$10);
+ }
+ }
+ 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$$11, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ width = (zephir_get_numberval(&_11$$11) - 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$$12, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ height = (zephir_get_numberval(&_13$$12) - 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_Storage_Serializer_AbstractSerializer, setData)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, flip)
{
- zval *data, data_sub;
+ zend_bool _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *direction_param = NULL, _1;
+ zend_long direction, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
+ Z_PARAM_LONG(direction)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(1, 0, &data);
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &direction_param);
+ direction = zephir_get_intval(direction_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
+ _0 = direction != 11;
+ if (_0) {
+ _0 = direction != 12;
+ }
+ 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_Image_Adapter_AbstractAdapter, liquidRescale)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *width_param = NULL, *height_param = NULL, *deltaX_param = NULL, *rigidity_param = NULL, _0, _1, _2, _3;
+ zend_long width, height, deltaX, rigidity, ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
-
-
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 4)
+ Z_PARAM_LONG(width)
+ Z_PARAM_LONG(height)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(deltaX)
+ Z_PARAM_LONG(rigidity)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 2, &width_param, &height_param, &deltaX_param, &rigidity_param);
+ width = zephir_get_intval(width_param);
+ height = zephir_get_intval(height_param);
+ if (!deltaX_param) {
+ deltaX = 0;
+ } else {
+ deltaX = zephir_get_intval(deltaX_param);
+ }
+ if (!rigidity_param) {
+ rigidity = 0;
+ } else {
+ rigidity = zephir_get_intval(rigidity_param);
+ }
-
-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;
+ ZVAL_LONG(&_0, width);
+ ZVAL_LONG(&_1, height);
+ ZVAL_LONG(&_2, deltaX);
+ ZVAL_LONG(&_3, rigidity);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processliquidrescale", NULL, 0, &_0, &_1, &_2, &_3);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Base64, serialize)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, mask)
{
- zval _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *watermark, watermark_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&watermark_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(watermark, phalcon_image_adapter_adapterinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &watermark);
- ZEPHIR_OBS_VAR(&_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", 25);
- return;
- }
- zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 191, &_1);
+
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processmask", NULL, 0, watermark);
zephir_check_call_status();
- RETURN_MM();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Base64, unserialize)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, pixelate)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *data, data_sub, _0;
+ zval *amount_param = NULL, _0;
+ zend_long amount, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data_sub);
ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
+ Z_PARAM_LONG(amount)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &data);
+ zephir_fetch_params(1, 1, 0, &amount_param);
+ amount = zephir_get_intval(amount_param);
- if (Z_TYPE_P(data) != IS_STRING) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the unserializer must of type string", "phalcon/Storage/Serializer/Base64.zep", 39);
- return;
+ if (amount < 2) {
+ amount = 2;
}
- ZEPHIR_CALL_FUNCTION(&_0, "base64_decode", NULL, 188, data);
+ ZVAL_LONG(&_0, amount);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processpixelate", NULL, 0, &_0);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_0);
- ZEPHIR_MM_RESTORE();
+ RETURN_THIS();
}
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, reflection)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_bool fadeIn, _0;
+ zval *height_param = NULL, *opacity_param = NULL, *fadeIn_param = NULL, _1, _3, _4, _5, _2$$3;
+ zend_long height, opacity, ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
-
-
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_2$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_LONG(height)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(opacity)
+ Z_PARAM_BOOL(fadeIn)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 2, &height_param, &opacity_param, &fadeIn_param);
+ height = zephir_get_intval(height_param);
+ if (!opacity_param) {
+ opacity = 100;
+ } else {
+ opacity = zephir_get_intval(opacity_param);
+ }
+ if (!fadeIn_param) {
+ fadeIn = 0;
+ } else {
+ fadeIn = zephir_get_boolval(fadeIn_param);
+ }
+ _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);
+ }
+ if (_0) {
+ ZEPHIR_OBS_VAR(&_2$$3);
+ zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC);
+ height = zephir_get_intval(&_2$$3);
+ }
+ if (opacity < 0) {
+ opacity = 0;
+ } else if (opacity > 100) {
+ opacity = 100;
+ }
+ ZVAL_LONG(&_3, height);
+ ZVAL_LONG(&_4, opacity);
+ if (fadeIn) {
+ ZVAL_BOOL(&_5, 1);
+ } else {
+ ZVAL_BOOL(&_5, 0);
+ }
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processreflection", NULL, 0, &_3, &_4, &_5);
+ zephir_check_call_status();
+ RETURN_THIS();
+}
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Igbinary)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, render)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Igbinary, phalcon, storage_serializer_igbinary, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_igbinary_method_entry, 0);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long quality, ZEPHIR_LAST_CALL_STATUS;
+ zval *ext_param = NULL, *quality_param = NULL, _0$$3, _1$$3, _2$$3, _4;
+ zval ext, _3$$3;
+ zval *this_ptr = getThis();
- return SUCCESS;
+ ZVAL_UNDEF(&ext);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 2)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(ext)
+ Z_PARAM_LONG(quality)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 2, &ext_param, &quality_param);
+ if (!ext_param) {
+ ZEPHIR_INIT_VAR(&ext);
+ } else {
+ zephir_get_strval(&ext, ext_param);
+ }
+ if (!quality_param) {
+ quality = 100;
+ } else {
+ quality = zephir_get_intval(quality_param);
+ }
+
+
+ if (ZEPHIR_IS_EMPTY(&ext)) {
+ 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, 109, &_0$$3, &_1$$3);
+ zephir_check_call_status();
+ zephir_cast_to_string(&_3$$3, &_2$$3);
+ ZEPHIR_CPY_WRT(&ext, &_3$$3);
+ }
+ if (ZEPHIR_IS_EMPTY(&ext)) {
+ ZEPHIR_INIT_NVAR(&ext);
+ ZVAL_STRING(&ext, "png");
+ }
+ if (quality < 1) {
+ quality = 1;
+ } else if (quality > 100) {
+ quality = 100;
+ }
+ ZVAL_LONG(&_4, quality);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processrender", NULL, 0, &ext, &_4);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, serialize)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize)
{
- zval _0;
+ zend_bool _0$$3, _1$$6, _5$$8, _13$$14;
+ double ratio = 0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *width_param = NULL, *height_param = NULL, *master_param = NULL, _23, _24, _25, _26, _27, _28, _29, _30, _2$$6, _3$$6, _4$$6, _6$$8, _7$$8, _8$$8, _9$$10, _10$$10, _11$$12, _12$$12, _14$$14, _15$$14, _16$$14, _17$$16, _18$$16, _19$$17, _20$$17, _21$$19, _22$$20;
+ zend_long width, height, master, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_23);
+ ZVAL_UNDEF(&_24);
+ ZVAL_UNDEF(&_25);
+ ZVAL_UNDEF(&_26);
+ ZVAL_UNDEF(&_27);
+ ZVAL_UNDEF(&_28);
+ ZVAL_UNDEF(&_29);
+ ZVAL_UNDEF(&_30);
+ ZVAL_UNDEF(&_2$$6);
+ ZVAL_UNDEF(&_3$$6);
+ ZVAL_UNDEF(&_4$$6);
+ ZVAL_UNDEF(&_6$$8);
+ ZVAL_UNDEF(&_7$$8);
+ ZVAL_UNDEF(&_8$$8);
+ ZVAL_UNDEF(&_9$$10);
+ ZVAL_UNDEF(&_10$$10);
+ ZVAL_UNDEF(&_11$$12);
+ ZVAL_UNDEF(&_12$$12);
+ ZVAL_UNDEF(&_14$$14);
+ ZVAL_UNDEF(&_15$$14);
+ ZVAL_UNDEF(&_16$$14);
+ ZVAL_UNDEF(&_17$$16);
+ ZVAL_UNDEF(&_18$$16);
+ ZVAL_UNDEF(&_19$$17);
+ ZVAL_UNDEF(&_20$$17);
+ ZVAL_UNDEF(&_21$$19);
+ ZVAL_UNDEF(&_22$$20);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 3, &width_param, &height_param, &master_param);
+ if (!width_param) {
+ width = 0;
+ } else {
+ width = zephir_get_intval(width_param);
+ }
+ if (!height_param) {
+ height = 0;
+ } else {
+ height = zephir_get_intval(height_param);
+ }
+ if (!master_param) {
+ master = 4;
+ } else {
+ master = zephir_get_intval(master_param);
+ }
+
+
+ if (master == 7) {
+ _0$$3 = !width;
+ if (!(_0$$3)) {
+ _0$$3 = !height;
+ }
+ if (UNEXPECTED(_0$$3)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 277);
+ return;
+ }
+ } else {
+ if (master == 4) {
+ _1$$6 = !width;
+ if (!(_1$$6)) {
+ _1$$6 = !height;
+ }
+ if (UNEXPECTED(_1$$6)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 284);
+ return;
+ }
+ ZEPHIR_INIT_VAR(&_2$$6);
+ zephir_read_property(&_3$$6, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_4$$6, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ if ((zephir_safe_div_zval_long(&_3$$6, width)) > (int) (zephir_safe_div_zval_long(&_4$$6, height))) {
+ ZEPHIR_INIT_NVAR(&_2$$6);
+ ZVAL_LONG(&_2$$6, 2);
+ } else {
+ ZEPHIR_INIT_NVAR(&_2$$6);
+ ZVAL_LONG(&_2$$6, 3);
+ }
+ master = zephir_get_numberval(&_2$$6);
+ }
+ if (master == 5) {
+ _5$$8 = !width;
+ if (!(_5$$8)) {
+ _5$$8 = !height;
+ }
+ if (UNEXPECTED(_5$$8)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 293);
+ return;
+ }
+ ZEPHIR_INIT_VAR(&_6$$8);
+ zephir_read_property(&_7$$8, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_8$$8, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ if ((zephir_safe_div_zval_long(&_7$$8, width)) > (int) (zephir_safe_div_zval_long(&_8$$8, height))) {
+ ZEPHIR_INIT_NVAR(&_6$$8);
+ ZVAL_LONG(&_6$$8, 3);
+ } else {
+ ZEPHIR_INIT_NVAR(&_6$$8);
+ ZVAL_LONG(&_6$$8, 2);
+ }
+ master = zephir_get_numberval(&_6$$8);
+ }
+ do {
+ if (master == 2) {
+ if (UNEXPECTED(!width)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 303);
+ return;
+ }
+ zephir_read_property(&_9$$10, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_10$$10, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ height = (long) (zephir_safe_div_long_zval((zephir_get_numberval(&_9$$10) * width), &_10$$10));
+ break;
+ }
+ if (master == 3) {
+ if (UNEXPECTED(!height)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 312);
+ return;
+ }
+ zephir_read_property(&_11$$12, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_12$$12, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ width = (long) (zephir_safe_div_long_zval((zephir_get_numberval(&_11$$12) * height), &_12$$12));
+ break;
+ }
+ if (master == 6) {
+ _13$$14 = !width;
+ if (!(_13$$14)) {
+ _13$$14 = !height;
+ }
+ if (UNEXPECTED(_13$$14)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 323);
+ return;
+ }
+ zephir_read_property(&_14$$14, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_15$$14, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_16$$14);
+ div_function(&_16$$14, &_14$$14, &_15$$14);
+ ratio = zephir_get_numberval(&_16$$14);
+ if ((zephir_safe_div_long_long(width, height)) > ratio) {
+ zephir_read_property(&_17$$16, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_18$$16, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ height = (long) (zephir_safe_div_long_zval((zephir_get_numberval(&_17$$16) * width), &_18$$16));
+ } else {
+ zephir_read_property(&_19$$17, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_20$$17, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ width = (long) (zephir_safe_div_long_zval((zephir_get_numberval(&_19$$17) * height), &_20$$17));
+ }
+ break;
+ }
+ if (master == 1) {
+ if (!(width)) {
+ ZEPHIR_OBS_VAR(&_21$$19);
+ zephir_read_property(&_21$$19, this_ptr, ZEND_STRL("width"), PH_NOISY_CC);
+ width = zephir_get_intval(&_21$$19);
+ }
+ if (!(height)) {
+ ZEPHIR_OBS_VAR(&_22$$20);
+ zephir_read_property(&_22$$20, this_ptr, ZEND_STRL("height"), PH_NOISY_CC);
+ width = zephir_get_intval(&_22$$20);
+ }
+ break;
+ }
+ } while(0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_FUNCTION("igbinary_serialize", NULL, 0, &_0);
+ }
+ ZEPHIR_INIT_VAR(&_23);
+ ZVAL_LONG(&_24, width);
+ zephir_round(&_23, &_24, NULL, NULL);
+ ZVAL_LONG(&_25, 1);
+ ZEPHIR_CALL_FUNCTION(&_26, "max", NULL, 110, &_23, &_25);
zephir_check_call_status();
- RETURN_MM();
+ width = zephir_get_intval(&_26);
+ ZEPHIR_INIT_VAR(&_27);
+ ZVAL_LONG(&_25, height);
+ zephir_round(&_27, &_25, NULL, NULL);
+ ZVAL_LONG(&_28, 1);
+ ZEPHIR_CALL_FUNCTION(&_29, "max", NULL, 110, &_27, &_28);
+ zephir_check_call_status();
+ height = zephir_get_intval(&_29);
+ ZVAL_LONG(&_28, width);
+ ZVAL_LONG(&_30, height);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processresize", NULL, 0, &_28, &_30);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, unserialize)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, rotate)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *data, data_sub, __$false, __$null, version, _0, _1, _2, _7, _3$$3, _4$$3, _5$$4, _6$$4;
+ zval *degrees_param = NULL, _0;
+ zend_long degrees, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data_sub);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&version);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_5$$4);
- ZVAL_UNDEF(&_6$$4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
+ Z_PARAM_LONG(degrees)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &data);
+ zephir_fetch_params(1, 1, 0, °rees_param);
+ degrees = zephir_get_intval(degrees_param);
- ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 86);
- zephir_check_call_status();
- ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "8.0");
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, ">=");
- ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 87, &version, &_0, &_1);
- zephir_check_call_status();
- if (zephir_is_true(&_2)) {
- ZEPHIR_INIT_VAR(&_3$$3);
- ZEPHIR_INIT_NVAR(&_3$$3);
- zephir_create_closure_ex(&_3$$3, NULL, phalcon_10__closure_ce, SL("__invoke"));
- ZVAL_LONG(&_4$$3, 2);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_3$$3, &_4$$3);
- zephir_check_call_status();
+ if (degrees > 180) {
+ degrees %= 360;
+ if (degrees > 180) {
+ degrees -= 360;
+ }
} else {
- ZEPHIR_INIT_VAR(&_5$$4);
- ZEPHIR_INIT_NVAR(&_5$$4);
- zephir_create_closure_ex(&_5$$4, NULL, phalcon_11__closure_ce, SL("__invoke"));
- ZVAL_LONG(&_6$$4, 2);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_5$$4, &_6$$4);
- zephir_check_call_status();
+ while (1) {
+ if (!(degrees < -180)) {
+ break;
+ }
+ degrees += 360;
+ }
}
- ZEPHIR_CALL_FUNCTION(&_7, "igbinary_unserialize", NULL, 0, data);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_7);
- ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 90);
+ ZVAL_LONG(&_0, degrees);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processrotate", NULL, 0, &_0);
zephir_check_call_status();
- if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &__$null);
- }
- ZEPHIR_MM_RESTORE();
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Json)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Json, phalcon, storage_serializer_json, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_json_method_entry, 0);
-
- return SUCCESS;
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Json, serialize)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, save)
{
- zval _4$$3;
- zend_bool _1;
- zval _0, _2, _5, _6, _8, _3$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_7 = 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(&_0);
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_0$$3);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
ZEPHIR_MM_GROW();
-
- ZEPHIR_OBS_VAR(&_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC);
- _1 = Z_TYPE_P(&_0) == IS_OBJECT;
- if (_1) {
- ZEPHIR_OBS_VAR(&_2);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC);
- _1 = !(zephir_is_instance_of(&_2, SL("JsonSerializable")));
+ 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 (_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, 40, &_4$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_3$$3, "phalcon/Storage/Serializer/Json.zep", 28);
- ZEPHIR_MM_RESTORE();
- return;
+ if (!quality_param) {
+ quality = -1;
+ } else {
+ quality = zephir_get_intval(quality_param);
}
- 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(&_5))) {
- RETURN_MM_MEMBER(getThis(), "data");
+
+
+ if (!(!(ZEPHIR_IS_EMPTY(&file)))) {
+ ZEPHIR_OBS_VAR(&_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);
}
- zephir_read_property(&_8, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_helper_json_ce, "encode", &_7, 14, &_8);
+ ZVAL_LONG(&_2, quality);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processsave", NULL, 0, &file, &_2);
zephir_check_call_status();
- RETURN_MM();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Json, unserialize)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, sharpen)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_1 = NULL;
- zval *data, data_sub, _0;
+ zval *amount_param = NULL, _0;
+ zend_long amount, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data_sub);
ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
+ Z_PARAM_LONG(amount)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &data);
+ zephir_fetch_params(1, 1, 0, &amount_param);
+ amount = zephir_get_intval(amount_param);
- ZEPHIR_CALL_CE_STATIC(&_0, phalcon_helper_json_ce, "decode", &_1, 180, data);
+ if (amount > 100) {
+ amount = 100;
+ } else if (amount < 1) {
+ amount = 1;
+ }
+ ZVAL_LONG(&_0, amount);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processsharpen", NULL, 0, &_0);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_0);
- ZEPHIR_MM_RESTORE();
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Msgpack)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Msgpack, phalcon, storage_serializer_msgpack, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_msgpack_method_entry, 0);
-
- return SUCCESS;
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, serialize)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, text)
{
- zval _0, _1, _2;
+ zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ 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, _1, _2, _3, _9, _10, _11, _12, _13, _14, _15, _4$$6, _5$$6, _6$$7, _7$$7, _8$$7;
+ zval text, color, fontfile;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
+ 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(&_1);
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(&_15);
+ ZVAL_UNDEF(&_4$$6);
+ ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&_7$$7);
+ ZVAL_UNDEF(&_8$$7);
+#if PHP_VERSION_ID >= 80000
+ 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();
+#endif
ZEPHIR_MM_GROW();
+ 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;
+ }
+ if (!offsetY) {
+ offsetY = &offsetY_sub;
+ offsetY = &__$false;
+ }
+ if (!opacity_param) {
+ opacity = 100;
+ } else {
+ opacity = zephir_get_intval(opacity_param);
+ }
+ if (!color_param) {
+ ZEPHIR_INIT_VAR(&color);
+ ZVAL_STRING(&color, "000000");
+ } else {
+ zephir_get_strval(&color, color_param);
+ }
+ if (!size_param) {
+ size = 12;
+ } else {
+ size = zephir_get_intval(size_param);
+ }
+ if (!fontfile_param) {
+ ZEPHIR_INIT_VAR(&fontfile);
+ } else {
+ zephir_get_strval(&fontfile, fontfile_param);
+ }
- 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(&_0))) {
- RETURN_MM_MEMBER(getThis(), "data");
+
+ if (opacity < 0) {
+ opacity = 0;
+ } else {
+ if (opacity > 100) {
+ opacity = 100;
+ }
}
- zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_FUNCTION("msgpack_pack", NULL, 0, &_2);
+ _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$$6, 1);
+ ZEPHIR_INIT_VAR(&_5$$6);
+ zephir_substr(&_5$$6, &color, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
+ zephir_get_strval(&color, &_5$$6);
+ }
+ if (zephir_fast_strlen_ev(&color) == 3) {
+ ZEPHIR_INIT_VAR(&_6$$7);
+ ZVAL_STRING(&_6$$7, "/./");
+ ZEPHIR_INIT_VAR(&_7$$7);
+ ZVAL_STRING(&_7$$7, "$0$0");
+ ZEPHIR_CALL_FUNCTION(&_8$$7, "preg_replace", NULL, 50, &_6$$7, &_7$$7, &color);
+ zephir_check_call_status();
+ zephir_get_strval(&color, &_8$$7);
+ }
+ ZVAL_LONG(&_9, 2);
+ ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 108, &color, &_9);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_INIT_VAR(&_11);
+ ZVAL_STRING(&_11, "hexdec");
+ ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 102, &_11, &_10);
+ zephir_check_call_status();
+ zephir_array_fetch_long(&_12, &colors, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 449);
+ zephir_array_fetch_long(&_13, &colors, 1, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 450);
+ zephir_array_fetch_long(&_14, &colors, 2, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 451);
+ ZVAL_LONG(&_9, opacity);
+ ZVAL_LONG(&_15, size);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processtext", NULL, 0, &text, offsetX, offsetY, &_9, &_12, &_13, &_14, &_15, &fontfile);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, unserialize)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, watermark)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *data, data_sub, __$false, __$null, version, _0, _1, _2, _7, _3$$3, _4$$3, _5$$4, _6$$4;
+ zend_long offsetX, offsetY, opacity, ZEPHIR_LAST_CALL_STATUS, tmp = 0;
+ zval *watermark, watermark_sub, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, _0, _1, _2, _3, _4, _5;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data_sub);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&watermark_sub);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_5$$4);
- ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
+ 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();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &data);
+ zephir_fetch_params(1, 1, 3, &watermark, &offsetX_param, &offsetY_param, &opacity_param);
+ if (!offsetX_param) {
+ offsetX = 0;
+ } else {
+ offsetX = zephir_get_intval(offsetX_param);
+ }
+ if (!offsetY_param) {
+ offsetY = 0;
+ } else {
+ offsetY = zephir_get_intval(offsetY_param);
+ }
+ if (!opacity_param) {
+ opacity = 100;
+ } else {
+ opacity = zephir_get_intval(opacity_param);
+ }
- ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 86);
- zephir_check_call_status();
- ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "8.0");
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, ">=");
- ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 87, &version, &_0, &_1);
+ 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();
- if (zephir_is_true(&_2)) {
- ZEPHIR_INIT_VAR(&_3$$3);
- ZEPHIR_INIT_NVAR(&_3$$3);
- zephir_create_closure_ex(&_3$$3, NULL, phalcon_12__closure_ce, SL("__invoke"));
- ZVAL_LONG(&_4$$3, 2);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_3$$3, &_4$$3);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_VAR(&_5$$4);
- ZEPHIR_INIT_NVAR(&_5$$4);
- zephir_create_closure_ex(&_5$$4, NULL, phalcon_13__closure_ce, SL("__invoke"));
- ZVAL_LONG(&_6$$4, 2);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_5$$4, &_6$$4);
- zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_2);
+ zephir_sub_function(&_2, &_0, &_1);
+ tmp = zephir_get_numberval(&_2);
+ if (offsetX < 0) {
+ offsetX = 0;
+ } else if (offsetX > tmp) {
+ offsetX = tmp;
}
- ZEPHIR_CALL_FUNCTION(&_7, "msgpack_unpack", NULL, 0, data);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_7);
- ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 90);
+ 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();
- if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &__$null);
+ ZEPHIR_INIT_VAR(&_3);
+ zephir_sub_function(&_3, &_0, &_1);
+ tmp = zephir_get_numberval(&_3);
+ if (offsetY < 0) {
+ offsetY = 0;
+ } else if (offsetY > tmp) {
+ offsetY = tmp;
}
- ZEPHIR_MM_RESTORE();
+ if (opacity < 0) {
+ opacity = 0;
+ } else if (opacity > 100) {
+ opacity = 100;
+ }
+ ZVAL_LONG(&_0, offsetX);
+ ZVAL_LONG(&_4, offsetY);
+ ZVAL_LONG(&_5, opacity);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processwatermark", NULL, 0, watermark, &_0, &_4, &_5);
+ zephir_check_call_status();
+ RETURN_THIS();
}
@@ -203205,42 +203159,27 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, unserialize)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_None)
+ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter_AdapterInterface)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, None, phalcon, storage_serializer_none, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_none_method_entry, 0);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Image\\Adapter, AdapterInterface, phalcon, image_adapter_adapterinterface, phalcon_image_adapter_adapterinterface_method_entry);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Serializer_None, serialize)
-{
- zval *this_ptr = getThis();
-
-
-
- RETURN_MEMBER(getThis(), "data");
-}
-
-static PHP_METHOD(Phalcon_Storage_Serializer_None, unserialize)
-{
- zval *data, data_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&data_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &data);
-
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
-}
-
+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);
@@ -203251,552 +203190,623 @@ static PHP_METHOD(Phalcon_Storage_Serializer_None, unserialize)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Php)
+ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter_Gd)
{
- 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_REGISTER_CLASS_EX(Phalcon\\Image\\Adapter, Gd, phalcon, image_adapter_gd, phalcon_image_adapter_abstractadapter_ce, phalcon_image_adapter_gd_method_entry, 0);
+ zend_declare_property_bool(phalcon_image_adapter_gd_ce, SL("checked"), 0, ZEND_ACC_PROTECTED|ZEND_ACC_STATIC);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Php, serialize)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct)
{
- zval _0, _1, _2;
+ zend_bool _25$$13;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_long width, height, ZEPHIR_LAST_CALL_STATUS;
+ zval *file_param = NULL, *width_param = NULL, *height_param = NULL, __$true, imageinfo, _0, _1, _2$$4, _3$$4, _4$$4, _9$$4, _24$$4, _5$$5, _6$$5, _7$$5, _8$$5, _10$$6, _11$$6, _12$$7, _13$$7, _14$$8, _15$$8, _16$$9, _17$$9, _18$$10, _19$$10, _20$$11, _21$$12, _22$$12, _23$$12, _29$$13, _30$$13, _31$$13, _32$$13, _33$$13, _34$$13, _26$$14, _27$$14, _28$$14;
+ zval file;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&file);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&imageinfo);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
-
-
- ZEPHIR_MM_GROW();
-
- 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(&_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, 13, &_2);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Storage_Serializer_Php, unserialize)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *data, data_sub, __$false, __$null, version, _0, _1$$4, _2$$4, _3$$4, _8$$4, _4$$6, _5$$6, _6$$7, _7$$7;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&data_sub);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&version);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$4);
ZVAL_UNDEF(&_2$$4);
ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_8$$4);
- ZVAL_UNDEF(&_4$$6);
- ZVAL_UNDEF(&_5$$6);
- ZVAL_UNDEF(&_6$$7);
- ZVAL_UNDEF(&_7$$7);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_9$$4);
+ ZVAL_UNDEF(&_24$$4);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_10$$6);
+ ZVAL_UNDEF(&_11$$6);
+ ZVAL_UNDEF(&_12$$7);
+ ZVAL_UNDEF(&_13$$7);
+ ZVAL_UNDEF(&_14$$8);
+ ZVAL_UNDEF(&_15$$8);
+ ZVAL_UNDEF(&_16$$9);
+ ZVAL_UNDEF(&_17$$9);
+ ZVAL_UNDEF(&_18$$10);
+ ZVAL_UNDEF(&_19$$10);
+ ZVAL_UNDEF(&_20$$11);
+ ZVAL_UNDEF(&_21$$12);
+ ZVAL_UNDEF(&_22$$12);
+ ZVAL_UNDEF(&_23$$12);
+ ZVAL_UNDEF(&_29$$13);
+ ZVAL_UNDEF(&_30$$13);
+ ZVAL_UNDEF(&_31$$13);
+ ZVAL_UNDEF(&_32$$13);
+ ZVAL_UNDEF(&_33$$13);
+ ZVAL_UNDEF(&_34$$13);
+ ZVAL_UNDEF(&_26$$14);
+ ZVAL_UNDEF(&_27$$14);
+ ZVAL_UNDEF(&_28$$14);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
+ 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();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &data);
+ zephir_fetch_params(1, 1, 2, &file_param, &width_param, &height_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"));
+ 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 {
+ width = zephir_get_intval(width_param);
+ }
+ if (!height_param) {
+ height = 0;
+ } else {
+ height = zephir_get_intval(height_param);
+ }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, data);
- zephir_check_call_status();
+ zephir_read_static_property_ce(&_0, phalcon_image_adapter_gd_ce, SL("checked"), PH_NOISY_CC | PH_READONLY);
if (!(zephir_is_true(&_0))) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
- } else {
- if (Z_TYPE_P(data) != IS_STRING) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the unserializer must of type string", "phalcon/Storage/Serializer/Php.zep", 43);
- return;
- }
- ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 86);
+ ZEPHIR_CALL_SELF(NULL, "check", NULL, 0);
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, 87, &version, &_1$$4, &_2$$4);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("file"), &file);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ if ((zephir_file_exists(&_1) == SUCCESS)) {
+ zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_3$$4, "realpath", NULL, 94, &_2$$4);
zephir_check_call_status();
- if (zephir_is_true(&_3$$4)) {
- ZEPHIR_INIT_VAR(&_4$$6);
- ZEPHIR_INIT_NVAR(&_4$$6);
- zephir_create_closure_ex(&_4$$6, NULL, phalcon_14__closure_ce, SL("__invoke"));
- ZVAL_LONG(&_5$$6, 8);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_4$$6, &_5$$6);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_VAR(&_6$$7);
- ZEPHIR_INIT_NVAR(&_6$$7);
- zephir_create_closure_ex(&_6$$7, NULL, phalcon_15__closure_ce, SL("__invoke"));
- ZVAL_LONG(&_7$$7, 8);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_6$$7, &_7$$7);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_3$$4);
+ zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&imageinfo, "getimagesize", NULL, 363, &_4$$4);
+ zephir_check_call_status();
+ if (zephir_is_true(&imageinfo)) {
+ zephir_array_fetch_long(&_5$$5, &imageinfo, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/Gd.zep", 38);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_5$$5);
+ zephir_array_fetch_long(&_6$$5, &imageinfo, 1, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/Gd.zep", 39);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_6$$5);
+ zephir_array_fetch_long(&_7$$5, &imageinfo, 2, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/Gd.zep", 40);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_7$$5);
+ zephir_array_fetch_string(&_8$$5, &imageinfo, SL("mime"), PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/Gd.zep", 41);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_8$$5);
+ }
+ zephir_read_property(&_9$$4, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY);
+ do {
+ if (ZEPHIR_IS_LONG(&_9$$4, 1)) {
+ zephir_read_property(&_10$$6, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_11$$6, "imagecreatefromgif", NULL, 364, &_10$$6);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_11$$6);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&_9$$4, 2)) {
+ zephir_read_property(&_12$$7, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_13$$7, "imagecreatefromjpeg", NULL, 365, &_12$$7);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_13$$7);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&_9$$4, 3)) {
+ zephir_read_property(&_14$$8, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_15$$8, "imagecreatefrompng", NULL, 366, &_14$$8);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_15$$8);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&_9$$4, 15)) {
+ zephir_read_property(&_16$$9, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_17$$9, "imagecreatefromwbmp", NULL, 367, &_16$$9);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_17$$9);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&_9$$4, 16)) {
+ zephir_read_property(&_18$$10, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_19$$10, "imagecreatefromxbm", NULL, 368, &_18$$10);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_19$$10);
+ break;
+ }
+ zephir_read_property(&_20$$11, this_ptr, ZEND_STRL("mime"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_is_true(&_20$$11)) {
+ ZEPHIR_INIT_VAR(&_21$$12);
+ object_init_ex(&_21$$12, phalcon_image_exception_ce);
+ zephir_read_property(&_22$$12, this_ptr, ZEND_STRL("mime"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_23$$12);
+ ZEPHIR_CONCAT_SVS(&_23$$12, "Installed GD does not support ", &_22$$12, " images");
+ ZEPHIR_CALL_METHOD(NULL, &_21$$12, "__construct", NULL, 8, &_23$$12);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_21$$12, "phalcon/Image/Adapter/Gd.zep", 69);
+ 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", 74);
+ return;
+ } while(0);
+
+ zephir_read_property(&_24$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 369, &_24$$4, &__$true);
+ zephir_check_call_status();
+ } else {
+ _25$$13 = !width;
+ if (!(_25$$13)) {
+ _25$$13 = !height;
+ }
+ if (UNEXPECTED(_25$$13)) {
+ ZEPHIR_INIT_VAR(&_26$$14);
+ object_init_ex(&_26$$14, phalcon_image_exception_ce);
+ zephir_read_property(&_27$$14, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_28$$14);
+ ZEPHIR_CONCAT_SV(&_28$$14, "Failed to create image from file ", &_27$$14);
+ ZEPHIR_CALL_METHOD(NULL, &_26$$14, "__construct", NULL, 8, &_28$$14);
zephir_check_call_status();
+ zephir_throw_exception_debug(&_26$$14, "phalcon/Image/Adapter/Gd.zep", 83);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- ZEPHIR_CALL_FUNCTION(&_8$$4, "unserialize", NULL, 15, data);
+ ZVAL_LONG(&_29$$13, width);
+ ZVAL_LONG(&_30$$13, height);
+ ZEPHIR_CALL_FUNCTION(&_31$$13, "imagecreatetruecolor", NULL, 370, &_29$$13, &_30$$13);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_8$$4);
- ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 90);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_31$$13);
+ zephir_read_property(&_29$$13, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 371, &_29$$13, &__$true);
zephir_check_call_status();
- if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &__$null);
- }
+ zephir_read_property(&_30$$13, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 369, &_30$$13, &__$true);
+ zephir_check_call_status();
+ zephir_read_property(&_32$$13, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_32$$13);
+ ZEPHIR_INIT_ZVAL_NREF(_33$$13);
+ ZVAL_LONG(&_33$$13, width);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_33$$13);
+ ZEPHIR_INIT_ZVAL_NREF(_33$$13);
+ ZVAL_LONG(&_33$$13, height);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_33$$13);
+ ZEPHIR_INIT_ZVAL_NREF(_33$$13);
+ ZVAL_LONG(&_33$$13, 3);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_33$$13);
+ ZEPHIR_INIT_VAR(&_34$$13);
+ ZEPHIR_INIT_NVAR(&_34$$13);
+ ZVAL_STRING(&_34$$13, "image/png");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_34$$13);
}
ZEPHIR_MM_RESTORE();
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_SerializerInterface)
-{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Storage\\Serializer, SerializerInterface, phalcon, storage_serializer_serializerinterface, phalcon_storage_serializer_serializerinterface_method_entry);
-
- zend_class_implements(phalcon_storage_serializer_serializerinterface_ce, 1, zend_ce_serializable);
- return SUCCESS;
-}
-
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Serializer_SerializerInterface, getData);
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Serializer_SerializerInterface, setData);
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Support_Debug)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Support, Debug, phalcon, support_debug, phalcon_support_debug_method_entry, 0);
-
- zend_declare_property_null(phalcon_support_debug_ce, SL("blacklist"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_support_debug_ce, SL("data"), ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_support_debug_ce, SL("hideDocumentRoot"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_support_debug_ce, SL("isActive"), 0, ZEND_ACC_PROTECTED|ZEND_ACC_STATIC);
- zend_declare_property_bool(phalcon_support_debug_ce, SL("showBackTrace"), 1, ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_support_debug_ce, SL("showFileFragment"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_support_debug_ce, SL("showFiles"), 1, ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_support_debug_ce, SL("uri"), "https://assets.phalcon.io/debug/5.0.x/", ZEND_ACC_PROTECTED);
- phalcon_support_debug_ce->create_object = zephir_init_properties_Phalcon_Support_Debug;
-
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Support_Debug, clearVars)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, __destruct)
{
- zval _0;
+ zval image, _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&image);
ZVAL_UNDEF(&_0);
ZEPHIR_MM_GROW();
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_0);
- RETURN_THIS();
+ 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_RESOURCE) {
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 372, &image);
+ zephir_check_call_status();
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug, debugVar)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, check)
{
- zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval __$true, version, _0, _1, _2, _3, _6, _4$$5, _5$$5;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval key;
- zval *varz, varz_sub, *key_param = NULL, _1, _2;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&varz_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ZVAL(varz)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR_OR_NULL(key)
- ZEND_PARSE_PARAMETERS_END();
-#endif
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$5);
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &varz, &key_param);
- if (!key_param) {
- ZEPHIR_INIT_VAR(&key);
- } else {
- zephir_get_strval(&key, key_param);
- }
-
- ZEPHIR_INIT_VAR(&_0);
- zephir_create_array(&_0, 3, 0);
- zephir_array_fast_append(&_0, varz);
- ZEPHIR_CALL_FUNCTION(&_1, "debug_backtrace", NULL, 0);
+ zephir_read_static_property_ce(&_0, phalcon_image_adapter_gd_ce, SL("checked"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_is_true(&_0)) {
+ RETURN_MM_BOOL(1);
+ }
+ if (UNEXPECTED(!((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", 121);
+ return;
+ }
+ ZEPHIR_CALL_SELF(&version, "getversion", NULL, 0);
zephir_check_call_status();
- zephir_array_fast_append(&_0, &_1);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "2.0.1");
ZEPHIR_INIT_VAR(&_2);
- zephir_time(&_2);
- zephir_array_fast_append(&_0, &_2);
- zephir_update_property_array_append(this_ptr, SL("data"), &_0);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Support_Debug, getCssSources)
-{
- zval uri, sources, _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&uri);
- ZVAL_UNDEF(&sources);
- ZVAL_UNDEF(&_0);
-
-
- ZEPHIR_MM_GROW();
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("uri"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&uri, &_0);
- ZEPHIR_INIT_VAR(&sources);
- ZEPHIR_CONCAT_SVSSVSSVS(&sources, " ", " ", " ");
- RETURN_CCTOR(&sources);
+ ZVAL_STRING(&_2, ">=");
+ ZEPHIR_CALL_FUNCTION(&_3, "version_compare", NULL, 87, &version, &_1, &_2);
+ zephir_check_call_status();
+ if (UNEXPECTED(!zephir_is_true(&_3))) {
+ ZEPHIR_INIT_VAR(&_4$$5);
+ object_init_ex(&_4$$5, phalcon_image_exception_ce);
+ ZEPHIR_INIT_VAR(&_5$$5);
+ ZEPHIR_CONCAT_SV(&_5$$5, "Phalcon\\Image\\Adapter\\GD requires GD version '2.0.1' or greater, you have ", &version);
+ ZEPHIR_CALL_METHOD(NULL, &_4$$5, "__construct", NULL, 8, &_5$$5);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_4$$5, "phalcon/Image/Adapter/Gd.zep", 129);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ zephir_update_static_property_ce(phalcon_image_adapter_gd_ce, ZEND_STRL("checked"), &__$true);
+ zephir_read_static_property_ce(&_6, phalcon_image_adapter_gd_ce, SL("checked"), PH_NOISY_CC | PH_READONLY);
+ RETURN_CTOR(&_6);
}
-static PHP_METHOD(Phalcon_Support_Debug, getJsSources)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, getVersion)
{
- zval uri, sources, _0;
+ zval version, info, matches, _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 *this_ptr = getThis();
- ZVAL_UNDEF(&uri);
- ZVAL_UNDEF(&sources);
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&info);
+ ZVAL_UNDEF(&matches);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$5);
ZEPHIR_MM_GROW();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("uri"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&uri, &_0);
- ZEPHIR_INIT_VAR(&sources);
- ZEPHIR_CONCAT_SVSSVSSVSSVSSVS(&sources, "", "", "", "", "");
- RETURN_CCTOR(&sources);
+ if (UNEXPECTED(!((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", 144);
+ return;
+ }
+ ZEPHIR_INIT_VAR(&version);
+ ZVAL_NULL(&version);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "GD_VERSION");
+ ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 127, &_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, 373);
+ 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", 155);
+ 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", 156);
+ }
+ }
+ RETURN_CCTOR(&version);
}
-static PHP_METHOD(Phalcon_Support_Debug, getVersion)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processBackground)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_5 = NULL;
- zval __$false, link, version, _0, _1, _2, _3, _4;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *r_param = NULL, *g_param = NULL, *b_param = NULL, *opacity_param = NULL, __$true, background, color, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12$$3;
+ zend_long r, g, b, opacity, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&link);
- ZVAL_UNDEF(&version);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&background);
+ ZVAL_UNDEF(&color);
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$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(4, 4)
+ Z_PARAM_LONG(r)
+ Z_PARAM_LONG(g)
+ Z_PARAM_LONG(b)
+ Z_PARAM_LONG(opacity)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 4, 0, &r_param, &g_param, &b_param, &opacity_param);
+ r = zephir_get_intval(r_param);
+ g = zephir_get_intval(g_param);
+ b = zephir_get_intval(b_param);
+ opacity = zephir_get_intval(opacity_param);
- ZEPHIR_INIT_VAR(&version);
- object_init_ex(&version, phalcon_support_version_ce);
- if (zephir_has_constructor(&version)) {
- ZEPHIR_CALL_METHOD(NULL, &version, "__construct", NULL, 0);
- zephir_check_call_status();
- }
- ZEPHIR_INIT_VAR(&link);
- zephir_create_array(&link, 4, 0);
- ZVAL_LONG(&_1, 0);
- ZEPHIR_CALL_METHOD(&_0, &version, "getpart", NULL, 0, &_1);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_DOUBLE(&_1, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127)));
+ ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 238, &_1);
zephir_check_call_status();
- ZVAL_LONG(&_1, 1);
- ZEPHIR_CALL_METHOD(&_2, &version, "getpart", NULL, 0, &_1);
+ zephir_round(&_0, &_2, NULL, NULL);
+ opacity = zephir_get_intval(&_0);
+ 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();
- ZEPHIR_INIT_VAR(&_3);
- ZEPHIR_CONCAT_SVSVS(&_3, "https://docs.phalcon.io/", &_0, ".", &_2, "/en/");
- zephir_array_update_string(&link, SL("action"), &_3, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_4, &version, "get", NULL, 0);
+ ZVAL_LONG(&_4, r);
+ ZVAL_LONG(&_5, g);
+ ZVAL_LONG(&_6, b);
+ ZVAL_LONG(&_7, opacity);
+ ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 374, &background, &_4, &_5, &_6, &_7);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 371, &background, &__$true);
zephir_check_call_status();
- zephir_array_update_string(&link, SL("text"), &_4, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&link, SL("local"), &__$false, PH_COPY | PH_SEPARATE);
- add_assoc_stringl_ex(&link, SL("target"), SL("_new"));
- ZEPHIR_CALL_CE_STATIC(&_4, phalcon_tag_ce, "linkto", &_5, 0, &link);
+ 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(&_11, "imagecopy", NULL, 375, &background, &_4, &_7, &_8, &_9, &_10, &_5, &_6);
zephir_check_call_status();
- ZEPHIR_CONCAT_SVS(return_value, "Phalcon Framework ", &_4, "
");
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Support_Debug, halt)
-{
- zval *this_ptr = getThis();
-
-
-
- ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_support_exception_ce, "Halted request", "phalcon/Support/Debug.zep", 153);
- return;
+ if (zephir_is_true(&_11)) {
+ zephir_read_property(&_12$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 372, &_12$$3);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &background);
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug, listen)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processBlur)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *exceptions_param = NULL, *lowSeverity_param = NULL;
- zend_bool exceptions, lowSeverity;
+ zephir_fcall_cache_entry *_2 = NULL;
+ zval *radius_param = NULL, _0$$3, _1$$3;
+ zend_long radius, ZEPHIR_LAST_CALL_STATUS, i = 0;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 2)
- Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(exceptions)
- Z_PARAM_BOOL(lowSeverity)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(radius)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 2, &exceptions_param, &lowSeverity_param);
- if (!exceptions_param) {
- exceptions = 1;
- } else {
- exceptions = zephir_get_boolval(exceptions_param);
- }
- if (!lowSeverity_param) {
- lowSeverity = 0;
- } else {
- lowSeverity = zephir_get_boolval(lowSeverity_param);
- }
+ zephir_fetch_params(1, 1, 0, &radius_param);
+ radius = zephir_get_intval(radius_param);
- if (exceptions) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "listenexceptions", NULL, 0);
- zephir_check_call_status();
- }
- if (lowSeverity) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "listenlowseverity", NULL, 0);
+ i = 0;
+ while (1) {
+ if (!(i < 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, 376, &_0$$3, &_1$$3);
zephir_check_call_status();
+ i++;
}
- RETURN_THIS();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug, listenExceptions)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processCreate)
{
- zval _1;
- zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *width_param = NULL, *height_param = NULL, __$false, __$true, image, _0, _1;
+ zend_long width, height, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&image);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_LONG(width)
+ Z_PARAM_LONG(height)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &width_param, &height_param);
+ width = zephir_get_intval(width_param);
+ height = zephir_get_intval(height_param);
- ZEPHIR_INIT_VAR(&_0);
- zephir_create_array(&_0, 2, 0);
- zephir_array_fast_append(&_0, this_ptr);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "onUncaughtException");
- zephir_array_fast_append(&_0, &_1);
- ZEPHIR_CALL_FUNCTION(NULL, "set_exception_handler", NULL, 0, &_0);
- zephir_check_call_status();
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Support_Debug, listenLowSeverity)
-{
- zval _1;
- zval _0, _2;
- 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(&_1);
-
-
- ZEPHIR_MM_GROW();
- ZEPHIR_INIT_VAR(&_0);
- zephir_create_array(&_0, 2, 0);
- zephir_array_fast_append(&_0, this_ptr);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "onUncaughtLowSeverity");
- zephir_array_fast_append(&_0, &_1);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 88, &_0);
+ ZVAL_LONG(&_0, width);
+ ZVAL_LONG(&_1, height);
+ ZEPHIR_CALL_FUNCTION(&image, "imagecreatetruecolor", NULL, 370, &_0, &_1);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_2);
- zephir_create_array(&_2, 2, 0);
- zephir_array_fast_append(&_2, this_ptr);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "onUncaughtException");
- zephir_array_fast_append(&_2, &_1);
- ZEPHIR_CALL_FUNCTION(NULL, "set_exception_handler", NULL, 0, &_2);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 371, &image, &__$false);
zephir_check_call_status();
- RETURN_THIS();
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 369, &image, &__$true);
+ zephir_check_call_status();
+ RETURN_CCTOR(&image);
}
-static PHP_METHOD(Phalcon_Support_Debug, onUncaughtException)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processCrop)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *exception, exception_sub, __$true, __$false, obLevel, _0, _2, _1$$4;
+ zval *width_param = NULL, *height_param = NULL, *offsetX_param = NULL, *offsetY_param = NULL, image, rect, _0, _1, _2, _3, _4;
+ zend_long width, height, offsetX, offsetY, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&exception_sub);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&obLevel);
+ ZVAL_UNDEF(&image);
+ ZVAL_UNDEF(&rect);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(exception, zend_ce_throwable)
+ 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();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &exception);
+ zephir_fetch_params(1, 4, 0, &width_param, &height_param, &offsetX_param, &offsetY_param);
+ width = zephir_get_intval(width_param);
+ height = zephir_get_intval(height_param);
+ offsetX = zephir_get_intval(offsetX_param);
+ offsetY = zephir_get_intval(offsetY_param);
- ZEPHIR_CALL_FUNCTION(&obLevel, "ob_get_level", NULL, 0);
+ 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, 377, &_1, &rect);
zephir_check_call_status();
- if (ZEPHIR_GT_LONG(&obLevel, 0)) {
- ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 497);
- zephir_check_call_status();
- }
- zephir_read_static_property_ce(&_0, phalcon_support_debug_ce, SL("isActive"), PH_NOISY_CC | PH_READONLY);
- if (zephir_is_true(&_0)) {
- ZEPHIR_CALL_METHOD(&_1$$4, exception, "getmessage", NULL, 0);
- zephir_check_call_status();
- zend_print_zval(&_1$$4, 0);
- RETURN_MM_NULL();
- }
- zephir_update_static_property_ce(phalcon_support_debug_ce, ZEND_STRL("isActive"), &__$true);
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "renderhtml", NULL, 0, exception);
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 372, &_2);
zephir_check_call_status();
- zend_print_zval(&_2, 0);
- zephir_update_static_property_ce(phalcon_support_debug_ce, ZEND_STRL("isActive"), &__$false);
- RETURN_MM_BOOL(1);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image);
+ ZEPHIR_CALL_FUNCTION(&_3, "imagesx", NULL, 378, &image);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_3);
+ ZEPHIR_CALL_FUNCTION(&_4, "imagesy", NULL, 379, &image);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_4);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug, onUncaughtLowSeverity)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processFlip)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *severity, severity_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, _0, _1, _2$$3, _3$$3;
+ 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(&severity_sub);
- ZVAL_UNDEF(&message_sub);
- ZVAL_UNDEF(&file_sub);
- ZVAL_UNDEF(&line_sub);
- ZVAL_UNDEF(&context_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(5, 5)
- Z_PARAM_ZVAL(severity)
- Z_PARAM_ZVAL(message)
- Z_PARAM_ZVAL(file)
- Z_PARAM_ZVAL(line)
- Z_PARAM_ZVAL(context)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(direction)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 5, 0, &severity, &message, &file, &line, &context);
+ zephir_fetch_params(1, 1, 0, &direction_param);
+ direction = zephir_get_intval(direction_param);
- ZEPHIR_CALL_FUNCTION(&_0, "error_reporting", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_1);
- zephir_bitwise_and_function(&_1, &_0, severity);
- if (UNEXPECTED(zephir_is_true(&_1))) {
- ZEPHIR_INIT_VAR(&_2$$3);
- object_init_ex(&_2$$3, zend_ce_error_exception);
- ZVAL_LONG(&_3$$3, 0);
- ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 0, message, &_3$$3, severity, file, line);
+ 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, 380, &_0$$3, &_1$$3);
+ zephir_check_call_status();
+ } else {
+ 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, 380, &_2$$4, &_3$$4);
zephir_check_call_status();
- zephir_throw_exception_debug(&_2$$3, "phalcon/Support/Debug.zep", 249);
- ZEPHIR_MM_RESTORE();
- return;
}
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug, renderHtml)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processMask)
{
- zend_string *_12$$3, *_24$$3, *_40$$3, *_53$$3, *_62$$21;
- zend_ulong _11$$3, _23$$3, _39$$3, _52$$3, _61$$21;
- zval _7$$3, _16$$3, _34$$3, _48$$3, _58$$21;
+ zend_bool _9;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_14 = NULL, *_17 = NULL, *_28 = NULL, *_43 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *exception, exception_sub, _REQUEST, __$true, _SERVER, blacklist, className, dataVar, dataVars, escapedMessage, html, keyFile, keyRequest, keyServer, keyVar, n, showBackTrace, traceItem, value, _0, _1, _2, _3, _4, _5, _6, _69, _70, _8$$3, *_9$$3, _10$$3, _18$$3, _19$$3, _20$$3, *_21$$3, _22$$3, _35$$3, _36$$3, *_37$$3, _38$$3, _49$$3, *_50$$3, _51$$3, _56$$3, _57$$3, _13$$5, _15$$6, _25$$7, _26$$9, _27$$10, _29$$10, _30$$11, _31$$13, _32$$14, _33$$14, _41$$15, _42$$16, _44$$16, _45$$17, _46$$18, _47$$18, _54$$19, _55$$20, *_59$$21, _60$$21, _63$$22, _64$$22, _65$$22, _66$$23, _67$$23, _68$$23;
+ zephir_fcall_cache_entry *_23 = NULL, *_24 = NULL, *_29 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS, mask_width = 0, mask_height = 0, x = 0, y = 0, alpha = 0;
+ zval *mask, mask_sub, __$true, maskImage, newimage, tempImage, color, index, r, g, b, _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(&exception_sub);
- ZVAL_UNDEF(&_REQUEST);
+ ZVAL_UNDEF(&mask_sub);
ZVAL_BOOL(&__$true, 1);
- ZVAL_UNDEF(&_SERVER);
- ZVAL_UNDEF(&blacklist);
- ZVAL_UNDEF(&className);
- ZVAL_UNDEF(&dataVar);
- ZVAL_UNDEF(&dataVars);
- ZVAL_UNDEF(&escapedMessage);
- ZVAL_UNDEF(&html);
- ZVAL_UNDEF(&keyFile);
- ZVAL_UNDEF(&keyRequest);
- ZVAL_UNDEF(&keyServer);
- ZVAL_UNDEF(&keyVar);
- ZVAL_UNDEF(&n);
- ZVAL_UNDEF(&showBackTrace);
- ZVAL_UNDEF(&traceItem);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&maskImage);
+ ZVAL_UNDEF(&newimage);
+ ZVAL_UNDEF(&tempImage);
+ ZVAL_UNDEF(&color);
+ ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&r);
+ ZVAL_UNDEF(&g);
+ ZVAL_UNDEF(&b);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
@@ -203804,1405 +203814,1142 @@ static PHP_METHOD(Phalcon_Support_Debug, renderHtml)
ZVAL_UNDEF(&_4);
ZVAL_UNDEF(&_5);
ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_69);
- ZVAL_UNDEF(&_70);
- ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_8);
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$$3);
- ZVAL_UNDEF(&_22$$3);
- ZVAL_UNDEF(&_35$$3);
- ZVAL_UNDEF(&_36$$3);
- ZVAL_UNDEF(&_38$$3);
- ZVAL_UNDEF(&_49$$3);
- ZVAL_UNDEF(&_51$$3);
- ZVAL_UNDEF(&_56$$3);
- ZVAL_UNDEF(&_57$$3);
- ZVAL_UNDEF(&_13$$5);
- ZVAL_UNDEF(&_15$$6);
- ZVAL_UNDEF(&_25$$7);
- ZVAL_UNDEF(&_26$$9);
- ZVAL_UNDEF(&_27$$10);
- ZVAL_UNDEF(&_29$$10);
- ZVAL_UNDEF(&_30$$11);
- ZVAL_UNDEF(&_31$$13);
- ZVAL_UNDEF(&_32$$14);
- ZVAL_UNDEF(&_33$$14);
- ZVAL_UNDEF(&_41$$15);
- ZVAL_UNDEF(&_42$$16);
- ZVAL_UNDEF(&_44$$16);
- ZVAL_UNDEF(&_45$$17);
- ZVAL_UNDEF(&_46$$18);
- ZVAL_UNDEF(&_47$$18);
- ZVAL_UNDEF(&_54$$19);
- ZVAL_UNDEF(&_55$$20);
- ZVAL_UNDEF(&_60$$21);
- ZVAL_UNDEF(&_63$$22);
- ZVAL_UNDEF(&_64$$22);
- ZVAL_UNDEF(&_65$$22);
- ZVAL_UNDEF(&_66$$23);
- ZVAL_UNDEF(&_67$$23);
- ZVAL_UNDEF(&_68$$23);
- ZVAL_UNDEF(&_7$$3);
- ZVAL_UNDEF(&_16$$3);
- ZVAL_UNDEF(&_34$$3);
- ZVAL_UNDEF(&_48$$3);
- ZVAL_UNDEF(&_58$$21);
+ 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);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(exception, zend_ce_throwable)
+ Z_PARAM_OBJECT_OF_CLASS(mask, phalcon_image_adapter_adapterinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_get_global(&_SERVER, SL("_SERVER"));
- zephir_get_global(&_REQUEST, SL("_REQUEST"));
- zephir_fetch_params(1, 1, 0, &exception);
+ zephir_fetch_params(1, 1, 0, &mask);
- ZEPHIR_INIT_VAR(&className);
- zephir_get_class(&className, exception, 0);
- ZEPHIR_CALL_METHOD(&_0, exception, "getmessage", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_0, mask, "render", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&escapedMessage, this_ptr, "escapestring", NULL, 0, &_0);
+ ZEPHIR_CALL_FUNCTION(&maskImage, "imagecreatefromstring", NULL, 381, &_0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcsssources", NULL, 0);
+ ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 378, &maskImage);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&html);
- ZEPHIR_CONCAT_SSVSVSVS(&html, "", "", &className, ": ", &escapedMessage, " ", &_1, "");
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "getversion", NULL, 0);
+ mask_width = zephir_get_intval(&_1);
+ ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 379, &maskImage);
zephir_check_call_status();
- zephir_concat_self(&html, &_2);
- ZEPHIR_CALL_METHOD(&_3, exception, "getfile", NULL, 0);
+ mask_height = zephir_get_intval(&_2);
+ alpha = 127;
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 369, &maskImage, &__$true);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_4, exception, "getline", NULL, 0);
+ 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_INIT_VAR(&_5);
- ZEPHIR_CONCAT_SSSVSVSSVSVSS(&_5, "", "
", "
", &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_OBS_VAR(&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_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 369, &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, 374, &newimage, &_5, &_6, &_7, &_8);
+ zephir_check_call_status();
+ ZVAL_LONG(&_5, 0);
+ ZVAL_LONG(&_6, 0);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagefill", NULL, 382, &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(&_5, mask_width);
+ if (!(_9)) {
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ _9 = !ZEPHIR_IS_LONG(&_6, mask_height);
+ }
+ 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, 370, &_10$$3, &_11$$3);
zephir_check_call_status();
- zephir_is_iterable(&_8$$3, 0, "phalcon/Support/Debug.zep", 330);
- 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(&_18$$3, this_ptr, ZEND_STRL("blacklist"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_19$$3);
- array_init(&_19$$3);
- ZEPHIR_INIT_VAR(&_20$$3);
- ZVAL_STRING(&_20$$3, "request");
- ZEPHIR_CALL_CE_STATIC(&blacklist, phalcon_helper_arr_ce, "get", &_17, 16, &_18$$3, &_20$$3, &_19$$3);
+ 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, mask_width);
+ ZVAL_LONG(&_19$$3, mask_height);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagecopyresampled", NULL, 383, &tempImage, &maskImage, &_14$$3, &_15$$3, &_16$$3, &_17$$3, &_12$$3, &_13$$3, &_18$$3, &_19$$3);
zephir_check_call_status();
- zephir_is_iterable(&_REQUEST, 0, "phalcon/Support/Debug.zep", 350);
- if (Z_TYPE_P(&_REQUEST) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_REQUEST), _23$$3, _24$$3, _21$$3)
- {
- ZEPHIR_INIT_NVAR(&keyRequest);
- if (_24$$3 != NULL) {
- ZVAL_STR_COPY(&keyRequest, _24$$3);
- } else {
- ZVAL_LONG(&keyRequest, _23$$3);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _21$$3);
- ZEPHIR_INIT_NVAR(&_25$$7);
- zephir_fast_strtolower(&_25$$7, &keyRequest);
- if (1 != zephir_array_isset(&blacklist, &_25$$7)) {
- if (Z_TYPE_P(&value) != IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&_26$$9);
- ZEPHIR_CONCAT_SVSVS(&_26$$9, "", &keyRequest, " ", &value, " ");
- zephir_concat_self(&html, &_26$$9);
- } else {
- ZEPHIR_CALL_FUNCTION(&_27$$10, "print_r", &_28, 0, &value, &__$true);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_29$$10);
- ZEPHIR_CONCAT_SVSVS(&_29$$10, "", &keyRequest, " ", &_27$$10, " ");
- zephir_concat_self(&html, &_29$$10);
- }
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_REQUEST, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_22$$3, &_REQUEST, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_22$$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(&_30$$11);
- zephir_fast_strtolower(&_30$$11, &keyRequest);
- if (1 != zephir_array_isset(&blacklist, &_30$$11)) {
- if (Z_TYPE_P(&value) != IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&_31$$13);
- ZEPHIR_CONCAT_SVSVS(&_31$$13, "", &keyRequest, " ", &value, " ");
- zephir_concat_self(&html, &_31$$13);
- } else {
- ZEPHIR_CALL_FUNCTION(&_32$$14, "print_r", &_28, 0, &value, &__$true);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_33$$14);
- ZEPHIR_CONCAT_SVSVS(&_33$$14, "", &keyRequest, " ", &_32$$14, " ");
- zephir_concat_self(&html, &_33$$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(&_34$$3);
- ZEPHIR_CONCAT_SSS(&_34$$3, "
", "
", "Key Value ");
- zephir_concat_self(&html, &_34$$3);
- zephir_read_property(&_35$$3, this_ptr, ZEND_STRL("blacklist"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_NVAR(&_20$$3);
- array_init(&_20$$3);
- ZEPHIR_INIT_VAR(&_36$$3);
- ZVAL_STRING(&_36$$3, "server");
- ZEPHIR_CALL_CE_STATIC(&blacklist, phalcon_helper_arr_ce, "get", &_17, 16, &_35$$3, &_36$$3, &_20$$3);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 372, &maskImage);
zephir_check_call_status();
- zephir_is_iterable(&_SERVER, 0, "phalcon/Support/Debug.zep", 366);
- if (Z_TYPE_P(&_SERVER) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_SERVER), _39$$3, _40$$3, _37$$3)
- {
- ZEPHIR_INIT_NVAR(&keyServer);
- if (_40$$3 != NULL) {
- ZVAL_STR_COPY(&keyServer, _40$$3);
- } else {
- ZVAL_LONG(&keyServer, _39$$3);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _37$$3);
- ZEPHIR_INIT_NVAR(&_41$$15);
- zephir_fast_strtolower(&_41$$15, &keyServer);
- if (1 != zephir_array_isset(&blacklist, &_41$$15)) {
- ZEPHIR_CALL_METHOD(&_42$$16, this_ptr, "getvardump", &_43, 0, &value);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_44$$16);
- ZEPHIR_CONCAT_SVSVS(&_44$$16, "", &keyServer, " ", &_42$$16, " ");
- zephir_concat_self(&html, &_44$$16);
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_SERVER, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_38$$3, &_SERVER, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_38$$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(&_45$$17);
- zephir_fast_strtolower(&_45$$17, &keyServer);
- if (1 != zephir_array_isset(&blacklist, &_45$$17)) {
- ZEPHIR_CALL_METHOD(&_46$$18, this_ptr, "getvardump", &_43, 0, &value);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_47$$18);
- ZEPHIR_CONCAT_SVSVS(&_47$$18, "", &keyServer, " ", &_46$$18, " ");
- zephir_concat_self(&html, &_47$$18);
- }
- ZEPHIR_CALL_METHOD(NULL, &_SERVER, "next", NULL, 0);
- 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;
}
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&keyServer);
- zephir_concat_self_str(&html, SL("
"));
- ZEPHIR_INIT_VAR(&_48$$3);
- ZEPHIR_CONCAT_SSS(&_48$$3, "
", "
", "# Path ");
- zephir_concat_self(&html, &_48$$3);
- ZEPHIR_CALL_FUNCTION(&_49$$3, "get_included_files", NULL, 0);
- zephir_check_call_status();
- zephir_is_iterable(&_49$$3, 0, "phalcon/Support/Debug.zep", 379);
- if (Z_TYPE_P(&_49$$3) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_49$$3), _52$$3, _53$$3, _50$$3)
- {
- ZEPHIR_INIT_NVAR(&keyFile);
- if (_53$$3 != NULL) {
- ZVAL_STR_COPY(&keyFile, _53$$3);
- } else {
- ZVAL_LONG(&keyFile, _52$$3);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _50$$3);
- ZEPHIR_INIT_NVAR(&_54$$19);
- ZEPHIR_CONCAT_SVSVS(&_54$$19, "", &keyFile, " ", &value, " ");
- zephir_concat_self(&html, &_54$$19);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_49$$3, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_51$$3, &_49$$3, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_51$$3)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&keyFile, &_49$$3, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &_49$$3, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_55$$20);
- ZEPHIR_CONCAT_SVSVS(&_55$$20, "", &keyFile, " ", &value, " ");
- zephir_concat_self(&html, &_55$$20);
- ZEPHIR_CALL_METHOD(NULL, &_49$$3, "next", NULL, 0);
- zephir_check_call_status();
+ 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;
}
- }
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&keyFile);
- zephir_concat_self_str(&html, SL("
"));
- ZEPHIR_CALL_FUNCTION(&_56$$3, "memory_get_usage", NULL, 0, &__$true);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_57$$3);
- ZEPHIR_CONCAT_SSSVSS(&_57$$3, "
", "
", "Memory Usage ", &_56$$3, " ", "
");
- zephir_concat_self(&html, &_57$$3);
- if (!(ZEPHIR_IS_EMPTY(&dataVars))) {
- ZEPHIR_INIT_VAR(&_58$$21);
- ZEPHIR_CONCAT_SSS(&_58$$21, "
", "
", "Key Value ");
- zephir_concat_self(&html, &_58$$21);
- zephir_is_iterable(&dataVars, 0, "phalcon/Support/Debug.zep", 401);
- if (Z_TYPE_P(&dataVars) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&dataVars), _61$$21, _62$$21, _59$$21)
- {
- ZEPHIR_INIT_NVAR(&keyVar);
- if (_62$$21 != NULL) {
- ZVAL_STR_COPY(&keyVar, _62$$21);
- } else {
- ZVAL_LONG(&keyVar, _61$$21);
- }
- ZEPHIR_INIT_NVAR(&dataVar);
- ZVAL_COPY(&dataVar, _59$$21);
- zephir_array_fetch_long(&_64$$22, &dataVar, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Debug.zep", 398);
- ZEPHIR_CALL_METHOD(&_63$$22, this_ptr, "getvardump", &_43, 0, &_64$$22);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_65$$22);
- ZEPHIR_CONCAT_SVSVS(&_65$$22, "", &keyVar, " ", &_63$$22, " ");
- zephir_concat_self(&html, &_65$$22);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &dataVars, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_60$$21, &dataVars, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_60$$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(&_67$$23, &dataVar, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Debug.zep", 398);
- ZEPHIR_CALL_METHOD(&_66$$23, this_ptr, "getvardump", &_43, 0, &_67$$23);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_68$$23);
- ZEPHIR_CONCAT_SVSVS(&_68$$23, "", &keyVar, " ", &_66$$23, " ");
- zephir_concat_self(&html, &_68$$23);
- ZEPHIR_CALL_METHOD(NULL, &dataVars, "next", NULL, 0);
- zephir_check_call_status();
- }
+ ZVAL_LONG(&_21$$5, x);
+ ZVAL_LONG(&_22$$5, y);
+ ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_23, 384, &maskImage, &_21$$5, &_22$$5);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_24, 385, &maskImage, &index);
+ zephir_check_call_status();
+ if (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", 291);
+ ZVAL_DOUBLE(&_26$$6, zephir_safe_div_zval_long(&_25$$6, 2));
+ alpha = (127 - zephir_get_intval(&_26$$6));
}
- ZEPHIR_INIT_NVAR(&dataVar);
- ZEPHIR_INIT_NVAR(&keyVar);
- zephir_concat_self_str(&html, SL("
"));
+ 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, 384, &_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, 385, &_22$$5, &index);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&r);
+ zephir_array_fetch_string(&r, &color, SL("red"), PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 296);
+ ZEPHIR_OBS_NVAR(&g);
+ zephir_array_fetch_string(&g, &color, SL("green"), PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 297);
+ ZEPHIR_OBS_NVAR(&b);
+ zephir_array_fetch_string(&b, &color, SL("blue"), PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 298);
+ ZVAL_LONG(&_27$$5, alpha);
+ ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 374, &newimage, &r, &g, &b, &_27$$5);
+ zephir_check_call_status();
+ ZVAL_LONG(&_27$$5, x);
+ ZVAL_LONG(&_28$$5, y);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesetpixel", &_29, 386, &newimage, &_27$$5, &_28$$5, &color);
+ zephir_check_call_status();
+ y++;
}
- zephir_concat_self_str(&html, SL("
"));
+ x++;
}
- ZEPHIR_CALL_METHOD(&_69, this_ptr, "getjssources", NULL, 0);
+ zephir_read_property(&_8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 372, &_8);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_70);
- ZEPHIR_CONCAT_VS(&_70, &_69, "
");
- zephir_concat_self(&html, &_70);
- RETURN_CCTOR(&html);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 372, &maskImage);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &newimage);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug, setBlacklist)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processPixelate)
{
+ zend_bool _3$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *blacklist_param = NULL, area, result, subArray, value, _1, _2, *_3, _4, _7, *_8, _9, _5$$3, _6$$4, _10$$5, _11$$6;
- zval blacklist;
+ zephir_fcall_cache_entry *_8 = NULL, *_12 = NULL;
+ zval *amount_param = NULL, color, _0, _1$$3, _2$$4, _4$$4, _5$$4, _6$$4, _7$$4, _9$$4, _10$$4, _11$$4;
+ zend_long amount, ZEPHIR_LAST_CALL_STATUS, x = 0, y = 0, x1 = 0, y1 = 0, x2 = 0, y2 = 0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&blacklist);
- ZVAL_UNDEF(&area);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&subArray);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_9);
- ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&color);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$4);
ZVAL_UNDEF(&_6$$4);
- ZVAL_UNDEF(&_10$$5);
- ZVAL_UNDEF(&_11$$6);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_9$$4);
+ ZVAL_UNDEF(&_10$$4);
+ ZVAL_UNDEF(&_11$$4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(blacklist)
+ Z_PARAM_LONG(amount)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &blacklist_param);
- zephir_get_arrval(&blacklist, blacklist_param);
+ zephir_fetch_params(1, 1, 0, &amount_param);
+ amount = zephir_get_intval(amount_param);
- ZEPHIR_INIT_VAR(&_1);
- array_init(&_1);
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "request");
- ZEPHIR_CALL_CE_STATIC(&area, phalcon_helper_arr_ce, "get", &_0, 16, &blacklist, &_2, &_1);
- 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", 431);
- if (Z_TYPE_P(&area) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&area), _3)
- {
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _3);
- ZEPHIR_INIT_NVAR(&_5$$3);
- zephir_fast_strtolower(&_5$$3, &value);
- ZEPHIR_CPY_WRT(&value, &_5$$3);
- ZEPHIR_INIT_NVAR(&_5$$3);
- ZVAL_LONG(&_5$$3, 1);
- zephir_array_update_zval(&subArray, &value, &_5$$3, PH_COPY | PH_SEPARATE);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &area, "rewind", NULL, 0);
- zephir_check_call_status();
+ 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_CALL_METHOD(&_4, &area, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_4)) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ if (!(ZEPHIR_GT_LONG(&_1$$3, y))) {
break;
}
- ZEPHIR_CALL_METHOD(&value, &area, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_6$$4);
- zephir_fast_strtolower(&_6$$4, &value);
- ZEPHIR_CPY_WRT(&value, &_6$$4);
- ZEPHIR_INIT_NVAR(&_6$$4);
- ZVAL_LONG(&_6$$4, 1);
- zephir_array_update_zval(&subArray, &value, &_6$$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(&_2);
- array_init(&_2);
- ZEPHIR_INIT_VAR(&_7);
- ZVAL_STRING(&_7, "server");
- ZEPHIR_CALL_CE_STATIC(&area, phalcon_helper_arr_ce, "get", &_0, 16, &blacklist, &_7, &_2);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&subArray);
- array_init(&subArray);
- zephir_is_iterable(&area, 0, "phalcon/Support/Debug.zep", 440);
- if (Z_TYPE_P(&area) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&area), _8)
- {
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _8);
- ZEPHIR_INIT_NVAR(&_10$$5);
- zephir_fast_strtolower(&_10$$5, &value);
- ZEPHIR_CPY_WRT(&value, &_10$$5);
- ZEPHIR_INIT_NVAR(&_10$$5);
- ZVAL_LONG(&_10$$5, 1);
- zephir_array_update_zval(&subArray, &value, &_10$$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(&_9, &area, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_9)) {
+ 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_CALL_METHOD(&value, &area, "current", NULL, 0);
+ 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, 384, &_5$$4, &_6$$4, &_7$$4);
zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_11$$6);
- zephir_fast_strtolower(&_11$$6, &value);
- ZEPHIR_CPY_WRT(&value, &_11$$6);
- ZEPHIR_INIT_NVAR(&_11$$6);
- ZVAL_LONG(&_11$$6, 1);
- zephir_array_update_zval(&subArray, &value, &_11$$6, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &area, "next", NULL, 0);
+ x2 = (x + amount);
+ 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);
+ ZVAL_LONG(&_10$$4, x2);
+ ZVAL_LONG(&_11$$4, y2);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", &_12, 387, &_6$$4, &_7$$4, &_9$$4, &_10$$4, &_11$$4, &color);
zephir_check_call_status();
+ y += amount;
}
+ x += amount;
}
- 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_Support_Debug, setShowBackTrace)
-{
- zval *showBackTrace_param = NULL, __$true, __$false;
- zend_bool showBackTrace;
- zval *this_ptr = getThis();
-
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_BOOL(showBackTrace)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &showBackTrace_param);
- showBackTrace = zephir_get_boolval(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);
- }
- RETURN_THISW();
-}
-
-static PHP_METHOD(Phalcon_Support_Debug, setShowFileFragment)
-{
- zval *showFileFragment_param = NULL, __$true, __$false;
- zend_bool showFileFragment;
- zval *this_ptr = getThis();
-
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_BOOL(showFileFragment)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &showFileFragment_param);
- showFileFragment = zephir_get_boolval(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_Support_Debug, setShowFiles)
-{
- zval *showFiles_param = NULL, __$true, __$false;
- zend_bool showFiles;
- zval *this_ptr = getThis();
-
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_BOOL(showFiles)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- zephir_fetch_params_without_memory_grow(1, 0, &showFiles_param);
- showFiles = zephir_get_boolval(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();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug, setUri)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processReflection)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *uri_param = NULL;
- zval uri;
+ zephir_fcall_cache_entry *_25 = NULL;
+ zend_bool fadeIn;
+ zval *height_param = NULL, *opacity_param = NULL, *fadeIn_param = NULL, reflection, line, _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, stepping = 0, offset = 0, src_y = 0, dst_y = 0, dst_opacity = 0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&uri);
+ ZVAL_UNDEF(&reflection);
+ ZVAL_UNDEF(&line);
+ 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);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(uri)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_LONG(height)
+ Z_PARAM_LONG(opacity)
+ Z_PARAM_BOOL(fadeIn)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_fetch_params(1, 3, 0, &height_param, &opacity_param, &fadeIn_param);
+ height = zephir_get_intval(height_param);
+ opacity = zephir_get_intval(opacity_param);
+ fadeIn = zephir_get_boolval(fadeIn_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("uri"), &uri);
- RETURN_THIS();
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_DOUBLE(&_1, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127)));
+ ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 238, &_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, 375, &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);
+ src_y = ((zephir_get_numberval(&_11$$5) - offset) - 1);
+ zephir_read_property(&_12$$5, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ dst_y = (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);
+ dst_opacity = 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);
+ dst_opacity = 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, src_y);
+ ZVAL_LONG(&_24$$5, 1);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 375, &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, dst_opacity);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_25, 376, &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, dst_y);
+ ZVAL_LONG(&_23$$5, 0);
+ ZVAL_LONG(&_24$$5, 0);
+ ZVAL_LONG(&_26$$5, 1);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 375, &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, 372, &_7);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &reflection);
+ ZEPHIR_CALL_FUNCTION(&_27, "imagesx", NULL, 378, &reflection);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_27);
+ ZEPHIR_CALL_FUNCTION(&_28, "imagesy", NULL, 379, &reflection);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_28);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug, escapeString)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processRender)
{
+ zend_bool _4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *value, value_sub, _0$$3, _1$$3, _2$$3, _3$$3, _4$$3;
+ zend_long quality, ZEPHIR_LAST_CALL_STATUS;
+ zval *ext_param = NULL, *quality_param = NULL, __$null, _0, _1, _2, _3, _5, _6, _7, _8, _9$$3, _10$$4, _11$$4, _12$$5, _13$$6, _14$$7, _15$$8;
+ zval ext, _16$$8;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&ext);
+ ZVAL_UNDEF(&_16$$8);
+ ZVAL_NULL(&__$null);
+ 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$$3);
+ ZVAL_UNDEF(&_10$$4);
+ ZVAL_UNDEF(&_11$$4);
+ ZVAL_UNDEF(&_12$$5);
+ ZVAL_UNDEF(&_13$$6);
+ ZVAL_UNDEF(&_14$$7);
+ ZVAL_UNDEF(&_15$$8);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(ext)
+ Z_PARAM_LONG(quality)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &value);
+ zephir_fetch_params(1, 2, 0, &ext_param, &quality_param);
+ zephir_get_strval(&ext, ext_param);
+ quality = zephir_get_intval(quality_param);
- if (Z_TYPE_P(value) == IS_STRING) {
- ZEPHIR_INIT_VAR(&_0$$3);
- ZEPHIR_INIT_VAR(&_1$$3);
- ZVAL_STRING(&_1$$3, "\n");
- ZEPHIR_INIT_VAR(&_2$$3);
- ZVAL_STRING(&_2$$3, "\\n");
- zephir_fast_str_replace(&_0$$3, &_1$$3, &_2$$3, value);
- ZVAL_LONG(&_3$$3, 2);
- ZEPHIR_INIT_VAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "utf-8");
- ZEPHIR_RETURN_CALL_FUNCTION("htmlentities", NULL, 0, &_0$$3, &_3$$3, &_4$$3);
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_fast_strtolower(&_0, &ext);
+ zephir_get_strval(&ext, &_0);
+ ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 388);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "gif");
+ ZEPHIR_CALL_FUNCTION(&_2, "strcmp", NULL, 389, &ext, &_1);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "jpg");
+ ZEPHIR_CALL_FUNCTION(&_3, "strcmp", NULL, 389, &ext, &_1);
+ zephir_check_call_status();
+ _4 = ZEPHIR_IS_LONG(&_3, 0);
+ if (!(_4)) {
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "jpeg");
+ ZEPHIR_CALL_FUNCTION(&_5, "strcmp", NULL, 389, &ext, &_1);
zephir_check_call_status();
- RETURN_MM();
+ _4 = ZEPHIR_IS_LONG(&_5, 0);
}
- RETVAL_ZVAL(value, 1, 0);
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "png");
+ ZEPHIR_CALL_FUNCTION(&_6, "strcmp", NULL, 389, &ext, &_1);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "wbmp");
+ ZEPHIR_CALL_FUNCTION(&_7, "strcmp", NULL, 389, &ext, &_1);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "xbm");
+ ZEPHIR_CALL_FUNCTION(&_8, "strcmp", NULL, 389, &ext, &_1);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_LONG(&_2, 0)) {
+ zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 390, &_9$$3);
+ zephir_check_call_status();
+ } else if (_4) {
+ zephir_read_property(&_10$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_11$$4, quality);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 391, &_10$$4, &__$null, &_11$$4);
+ zephir_check_call_status();
+ } else if (ZEPHIR_IS_LONG(&_6, 0)) {
+ zephir_read_property(&_12$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 392, &_12$$5);
+ zephir_check_call_status();
+ } else if (ZEPHIR_IS_LONG(&_7, 0)) {
+ zephir_read_property(&_13$$6, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 393, &_13$$6);
+ zephir_check_call_status();
+ } else if (ZEPHIR_IS_LONG(&_8, 0)) {
+ zephir_read_property(&_14$$7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 394, &_14$$7, &__$null);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_VAR(&_15$$8);
+ object_init_ex(&_15$$8, phalcon_image_exception_ce);
+ ZEPHIR_INIT_VAR(&_16$$8);
+ ZEPHIR_CONCAT_SVS(&_16$$8, "Installed GD does not support '", &ext, "' images");
+ ZEPHIR_CALL_METHOD(NULL, &_15$$8, "__construct", NULL, 8, &_16$$8);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_15$$8, "phalcon/Image/Adapter/Gd.zep", 454);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 395);
+ zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Support_Debug, getArrayDump)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processResize)
{
- 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 *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 *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(&argument);
- ZVAL_UNDEF(&n_sub);
- ZVAL_UNDEF(&numberArguments);
- ZVAL_UNDEF(&dump);
- ZVAL_UNDEF(&varDump);
- ZVAL_UNDEF(&k);
- ZVAL_UNDEF(&v);
+ ZVAL_UNDEF(&image);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_6$$8);
- ZVAL_UNDEF(&_7$$8);
- ZVAL_UNDEF(&_9$$9);
- ZVAL_UNDEF(&_10$$5);
- ZVAL_UNDEF(&_11$$15);
- ZVAL_UNDEF(&_12$$15);
- ZVAL_UNDEF(&_13$$16);
- ZVAL_UNDEF(&_14$$12);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ARRAY(argument)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL(n)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_LONG(width)
+ Z_PARAM_LONG(height)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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);
- }
+ zephir_fetch_params(1, 2, 0, &width_param, &height_param);
+ width = zephir_get_intval(width_param);
+ height = zephir_get_intval(height_param);
- 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);
- }
- if (_0) {
- RETURN_MM_NULL();
- }
- if (ZEPHIR_GE_LONG(&numberArguments, 10)) {
- RETURN_CCTOR(&numberArguments);
- }
- ZEPHIR_INIT_VAR(&dump);
- array_init(&dump);
- zephir_is_iterable(&argument, 0, "phalcon/Support/Debug.zep", 540);
- if (Z_TYPE_P(&argument) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&argument), _3, _4, _1)
- {
- ZEPHIR_INIT_NVAR(&k);
- if (_4 != NULL) {
- ZVAL_STR_COPY(&k, _4);
- } else {
- ZVAL_LONG(&k, _3);
- }
- 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", 537);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &argument, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2, &argument, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_2)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&k, &argument, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&v, &argument, "current", NULL, 0);
- zephir_check_call_status();
- 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", 537);
- ZEPHIR_CALL_METHOD(NULL, &argument, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&v);
- ZEPHIR_INIT_NVAR(&k);
- zephir_fast_join_str(return_value, SL(", "), &dump);
- RETURN_MM();
+ 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, 396, &_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, 372, &_1);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image);
+ ZEPHIR_CALL_FUNCTION(&_3, "imagesx", NULL, 378, &image);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_3);
+ ZEPHIR_CALL_FUNCTION(&_4, "imagesy", NULL, 379, &image);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_4);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug, getVarDump)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processRotate)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *variable, variable_sub, className, dumpedObject, _0$$8, _1$$10;
+ zval *degrees_param = NULL, __$true, image, transparent, width, height, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9$$3;
+ zend_long degrees, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&variable_sub);
- ZVAL_UNDEF(&className);
- ZVAL_UNDEF(&dumpedObject);
- ZVAL_UNDEF(&_0$$8);
- ZVAL_UNDEF(&_1$$10);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&image);
+ ZVAL_UNDEF(&transparent);
+ ZVAL_UNDEF(&width);
+ ZVAL_UNDEF(&height);
+ 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$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(variable)
+ Z_PARAM_LONG(degrees)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &variable);
+ zephir_fetch_params(1, 1, 0, °rees_param);
+ degrees = zephir_get_intval(degrees_param);
- 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();
- }
- 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_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, 374, &_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));
+ ZVAL_LONG(&_3, 1);
+ ZEPHIR_CALL_FUNCTION(&image, "imagerotate", NULL, 397, &_1, &_2, &transparent, &_3);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 369, &image, &__$true);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&width, "imagesx", NULL, 378, &image);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&height, "imagesy", NULL, 379, &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(&_8, "imagecopymerge", NULL, 398, &_2, &image, &_3, &_4, &_5, &_6, &width, &height, &_7);
+ zephir_check_call_status();
+ if (zephir_is_true(&_8)) {
+ zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 372, &_9$$3);
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_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_gettype(return_value, variable);
- RETURN_MM();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug, showTraceItem)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processSave)
{
- zend_bool _42$$25;
- zval _1, _28$$17;
+ zend_bool _8;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_21 = NULL, *_49 = 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, _17, _2$$3, _3$$3, _4$$3, _5$$3, _12$$3, _13$$3, _6$$4, _7$$4, _8$$5, _9$$6, _10$$6, _11$$6, _14$$10, _15$$11, _16$$11, *_18$$14, _19$$14, _25$$14, _26$$14, _20$$15, _22$$15, _23$$16, _24$$16, _27$$17, _29$$17, _30$$17, _31$$18, _32$$19, _33$$24, _34$$27, _35$$27, _36$$27, _37$$27, _38$$27, _39$$28, _40$$28, _41$$28, _43$$30, _44$$30, _45$$30, _46$$30, _47$$30, _48$$30;
- zend_long n, ZEPHIR_LAST_CALL_STATUS, i = 0, beforeLine$$19, afterLine$$19;
+ zend_long quality, ZEPHIR_LAST_CALL_STATUS;
+ zval *file_param = NULL, *quality_param = NULL, __$false, ext, _0, _2, _3, _7, _9, _15, _19, _23, _27, _1$$3, _4$$4, _5$$4, _6$$4, _10$$5, _11$$5, _12$$6, _13$$6, _14$$9, _16$$10, _17$$10, _18$$10, _20$$11, _21$$11, _22$$11, _24$$12, _25$$12, _26$$12;
+ zval file;
zval *this_ptr = getThis();
- 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(&file);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&ext);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_17);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_12$$3);
- ZVAL_UNDEF(&_13$$3);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_15);
+ ZVAL_UNDEF(&_19);
+ ZVAL_UNDEF(&_23);
+ ZVAL_UNDEF(&_27);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$4);
ZVAL_UNDEF(&_6$$4);
- ZVAL_UNDEF(&_7$$4);
- ZVAL_UNDEF(&_8$$5);
- ZVAL_UNDEF(&_9$$6);
- ZVAL_UNDEF(&_10$$6);
- ZVAL_UNDEF(&_11$$6);
- ZVAL_UNDEF(&_14$$10);
- ZVAL_UNDEF(&_15$$11);
- ZVAL_UNDEF(&_16$$11);
- ZVAL_UNDEF(&_19$$14);
- ZVAL_UNDEF(&_25$$14);
- ZVAL_UNDEF(&_26$$14);
- ZVAL_UNDEF(&_20$$15);
- ZVAL_UNDEF(&_22$$15);
- ZVAL_UNDEF(&_23$$16);
- ZVAL_UNDEF(&_24$$16);
- ZVAL_UNDEF(&_27$$17);
- ZVAL_UNDEF(&_29$$17);
- ZVAL_UNDEF(&_30$$17);
- ZVAL_UNDEF(&_31$$18);
- ZVAL_UNDEF(&_32$$19);
- ZVAL_UNDEF(&_33$$24);
- ZVAL_UNDEF(&_34$$27);
- ZVAL_UNDEF(&_35$$27);
- ZVAL_UNDEF(&_36$$27);
- ZVAL_UNDEF(&_37$$27);
- ZVAL_UNDEF(&_38$$27);
- ZVAL_UNDEF(&_39$$28);
- ZVAL_UNDEF(&_40$$28);
- ZVAL_UNDEF(&_41$$28);
- ZVAL_UNDEF(&_43$$30);
- ZVAL_UNDEF(&_44$$30);
- ZVAL_UNDEF(&_45$$30);
- ZVAL_UNDEF(&_46$$30);
- ZVAL_UNDEF(&_47$$30);
- ZVAL_UNDEF(&_48$$30);
- ZVAL_UNDEF(&trace);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_28$$17);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_11$$5);
+ ZVAL_UNDEF(&_12$$6);
+ ZVAL_UNDEF(&_13$$6);
+ ZVAL_UNDEF(&_14$$9);
+ ZVAL_UNDEF(&_16$$10);
+ ZVAL_UNDEF(&_17$$10);
+ ZVAL_UNDEF(&_18$$10);
+ ZVAL_UNDEF(&_20$$11);
+ ZVAL_UNDEF(&_21$$11);
+ ZVAL_UNDEF(&_22$$11);
+ ZVAL_UNDEF(&_24$$12);
+ ZVAL_UNDEF(&_25$$12);
+ ZVAL_UNDEF(&_26$$12);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_LONG(n)
- Z_PARAM_ARRAY(trace)
+ Z_PARAM_STR(file)
+ Z_PARAM_LONG(quality)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &n_param, &trace_param);
- n = zephir_get_intval(n_param);
- ZEPHIR_OBS_COPY_OR_DUP(&trace, trace_param);
+ zephir_fetch_params(1, 2, 0, &file_param, &quality_param);
+ zephir_get_strval(&file, file_param);
+ quality = zephir_get_intval(quality_param);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_LONG(&_0, n);
- ZEPHIR_INIT_VAR(&_1);
- ZEPHIR_CONCAT_SVS(&_1, "
#", &_0, " ");
- ZEPHIR_CPY_WRT(&html, &_1);
- ZEPHIR_OBS_VAR(&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", 645);
- zephir_array_fetch_long(&_7$$4, &parts, 1, PH_NOISY | PH_READONLY, "phalcon/Support/Debug.zep", 645);
- ZEPHIR_INIT_VAR(&prepareUriClass);
- ZEPHIR_CONCAT_VSV(&prepareUriClass, &_6$$4, "_", &_7$$4);
- ZEPHIR_INIT_VAR(&classNameWithLink);
- ZEPHIR_CONCAT_SVSVS(&classNameWithLink, "", &className, " ");
- } else {
- ZEPHIR_INIT_VAR(&classReflection);
- object_init_ex(&classReflection, zephir_get_internal_ce(SL("reflectionclass")));
- ZEPHIR_CALL_METHOD(NULL, &classReflection, "__construct", NULL, 156, &className);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_8$$5, &classReflection, "isinternal", NULL, 0);
- zephir_check_call_status();
- if (zephir_is_true(&_8$$5)) {
- ZEPHIR_INIT_VAR(&_9$$6);
- zephir_fast_strtolower(&_9$$6, &className);
- ZEPHIR_INIT_VAR(&_10$$6);
- ZVAL_STRING(&_10$$6, "_");
- ZEPHIR_INIT_VAR(&_11$$6);
- ZVAL_STRING(&_11$$6, "-");
- ZEPHIR_INIT_VAR(&prepareInternalClass);
- zephir_fast_str_replace(&prepareInternalClass, &_10$$6, &_11$$6, &_9$$6);
- ZEPHIR_INIT_NVAR(&classNameWithLink);
- ZEPHIR_CONCAT_SVSVS(&classNameWithLink, "", &className, " ");
- } else {
- ZEPHIR_CPY_WRT(&classNameWithLink, &className);
- }
- }
- ZEPHIR_INIT_VAR(&_12$$3);
- ZEPHIR_CONCAT_SVS(&_12$$3, "", &classNameWithLink, " ");
- zephir_concat_self(&html, &_12$$3);
- zephir_array_fetch_string(&_13$$3, &trace, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Support/Debug.zep", 678);
- zephir_concat_self(&html, &_13$$3);
+ ZVAL_LONG(&_0, 4);
+ ZEPHIR_CALL_FUNCTION(&ext, "pathinfo", NULL, 109, &file, &_0);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&ext))) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&ext, "image_type_to_extension", NULL, 399, &_1$$3, &__$false);
+ zephir_check_call_status();
}
- ZEPHIR_OBS_VAR(&functionName);
- zephir_array_fetch_string(&functionName, &trace, SL("function"), PH_NOISY, "phalcon/Support/Debug.zep", 684);
- if (zephir_array_isset_string(&trace, SL("class"))) {
- ZEPHIR_CPY_WRT(&functionNameWithLink, &functionName);
- } else {
- 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();
- ZEPHIR_CALL_METHOD(&_14$$10, &functionReflection, "isinternal", NULL, 0);
- zephir_check_call_status();
- if (zephir_is_true(&_14$$10)) {
- ZEPHIR_INIT_VAR(&_15$$11);
- ZVAL_STRING(&_15$$11, "_");
- ZEPHIR_INIT_VAR(&_16$$11);
- ZVAL_STRING(&_16$$11, "-");
- ZEPHIR_INIT_VAR(&preparedFunctionName);
- zephir_fast_str_replace(&preparedFunctionName, &_15$$11, &_16$$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(&_2);
+ zephir_fast_strtolower(&_2, &ext);
+ ZEPHIR_CPY_WRT(&ext, &_2);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "gif");
+ ZEPHIR_CALL_FUNCTION(&_3, "strcmp", NULL, 389, &ext, &_2);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_LONG(&_3, 0)) {
+ ZEPHIR_INIT_ZVAL_NREF(_4$$4);
+ ZVAL_LONG(&_4$$4, 1);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_4$$4);
+ zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_5$$4, "image_type_to_mime_type", NULL, 400, &_4$$4);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_5$$4);
+ zephir_read_property(&_6$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 390, &_6$$4, &file);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(1);
}
- ZEPHIR_INIT_VAR(&_17);
- ZEPHIR_CONCAT_SVS(&_17, "", &functionNameWithLink, " ");
- zephir_concat_self(&html, &_17);
- ZEPHIR_OBS_VAR(&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", 736);
- if (Z_TYPE_P(&traceArgs) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&traceArgs), _18$$14)
- {
- ZEPHIR_INIT_NVAR(&argument);
- ZVAL_COPY(&argument, _18$$14);
- ZEPHIR_CALL_METHOD(&_20$$15, this_ptr, "getvardump", &_21, 0, &argument);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_22$$15);
- ZEPHIR_CONCAT_SVS(&_22$$15, "", &_20$$15, " ");
- zephir_array_append(&arguments, &_22$$15, PH_SEPARATE, "phalcon/Support/Debug.zep", 730);
- } ZEND_HASH_FOREACH_END();
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "jpg");
+ ZEPHIR_CALL_FUNCTION(&_7, "strcmp", NULL, 389, &ext, &_2);
+ zephir_check_call_status();
+ _8 = ZEPHIR_IS_LONG(&_7, 0);
+ if (!(_8)) {
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "jpeg");
+ ZEPHIR_CALL_FUNCTION(&_9, "strcmp", NULL, 389, &ext, &_2);
+ zephir_check_call_status();
+ _8 = ZEPHIR_IS_LONG(&_9, 0);
+ }
+ if (_8) {
+ ZEPHIR_INIT_ZVAL_NREF(_10$$5);
+ ZVAL_LONG(&_10$$5, 2);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_10$$5);
+ zephir_read_property(&_10$$5, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_11$$5, "image_type_to_mime_type", NULL, 400, &_10$$5);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_11$$5);
+ if (quality >= 0) {
+ if (quality < 1) {
+ quality = 1;
+ } else if (quality > 100) {
+ quality = 100;
+ }
+ zephir_read_property(&_12$$6, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_13$$6, quality);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 391, &_12$$6, &file, &_13$$6);
+ zephir_check_call_status();
} else {
- ZEPHIR_CALL_METHOD(NULL, &traceArgs, "rewind", NULL, 0);
+ zephir_read_property(&_14$$9, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 391, &_14$$9, &file);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_19$$14, &traceArgs, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_19$$14)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&argument, &traceArgs, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_23$$16, this_ptr, "getvardump", &_21, 0, &argument);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_24$$16);
- ZEPHIR_CONCAT_SVS(&_24$$16, "", &_23$$16, " ");
- zephir_array_append(&arguments, &_24$$16, PH_SEPARATE, "phalcon/Support/Debug.zep", 730);
- ZEPHIR_CALL_METHOD(NULL, &traceArgs, "next", NULL, 0);
- zephir_check_call_status();
- }
}
- ZEPHIR_INIT_NVAR(&argument);
- ZEPHIR_INIT_VAR(&_25$$14);
- zephir_fast_join_str(&_25$$14, SL(", "), &arguments);
- ZEPHIR_INIT_VAR(&_26$$14);
- ZEPHIR_CONCAT_SVS(&_26$$14, "(", &_25$$14, ")");
- zephir_concat_self(&html, &_26$$14);
+ RETURN_MM_BOOL(1);
}
- ZEPHIR_OBS_VAR(&filez);
- if (zephir_array_isset_string_fetch(&filez, &trace, SL("file"), 0)) {
- ZEPHIR_OBS_VAR(&_27$$17);
- zephir_array_fetch_string(&_27$$17, &trace, SL("line"), PH_NOISY, "phalcon/Support/Debug.zep", 744);
- zephir_cast_to_string(&_28$$17, &_27$$17);
- ZEPHIR_CPY_WRT(&line, &_28$$17);
- ZEPHIR_INIT_VAR(&_29$$17);
- ZEPHIR_CONCAT_SVSVS(&_29$$17, "", &filez, " (", &line, ")
");
- zephir_concat_self(&html, &_29$$17);
- zephir_read_property(&_30$$17, this_ptr, ZEND_STRL("showFiles"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&showFiles, &_30$$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(&_31$$18, this_ptr, ZEND_STRL("showFileFragment"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&showFileFragment, &_31$$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(&_32$$19);
- ZEPHIR_CONCAT_SVSVSVS(&_32$$19, "");
- zephir_concat_self(&html, &_32$$19);
- } else {
- ZEPHIR_INIT_NVAR(&firstLine);
- ZVAL_LONG(&firstLine, 1);
- ZEPHIR_CPY_WRT(&lastLine, &numberLines);
- ZEPHIR_INIT_VAR(&_33$$24);
- ZEPHIR_CONCAT_SVSVS(&_33$$24, "");
- zephir_concat_self(&html, &_33$$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", 817);
- if (zephir_is_true(&showFileFragment)) {
- if (ZEPHIR_IS_LONG(&firstLine, i)) {
- ZEPHIR_INIT_NVAR(&_34$$27);
- ZEPHIR_INIT_NVAR(&_35$$27);
- zephir_fast_trim(&_35$$27, ¤tLine, NULL , ZEPHIR_TRIM_RIGHT);
- ZEPHIR_INIT_NVAR(&_36$$27);
- ZVAL_STRING(&_36$$27, "#\\*\\/#");
- ZEPHIR_INIT_NVAR(&_37$$27);
- ZEPHIR_INIT_NVAR(&_38$$27);
- ZVAL_STRING(&_38$$27, "#\\*\\/#");
- zephir_preg_match(&_37$$27, &_38$$27, &_35$$27, &_34$$27, 0, 0 , 0 );
- if (zephir_is_true(&_37$$27)) {
- ZEPHIR_INIT_NVAR(&_39$$28);
- ZEPHIR_INIT_NVAR(&_40$$28);
- ZVAL_STRING(&_40$$28, "* /");
- ZEPHIR_INIT_NVAR(&_41$$28);
- ZVAL_STRING(&_41$$28, " ");
- zephir_fast_str_replace(&_39$$28, &_40$$28, &_41$$28, ¤tLine);
- ZEPHIR_CPY_WRT(¤tLine, &_39$$28);
- }
- }
- }
- _42$$25 = ZEPHIR_IS_STRING(¤tLine, "\n");
- if (!(_42$$25)) {
- _42$$25 = ZEPHIR_IS_STRING(¤tLine, "\r\n");
- }
- if (_42$$25) {
- zephir_concat_self_str(&html, SL(" \n"));
- } else {
- ZEPHIR_INIT_NVAR(&_43$$30);
- ZEPHIR_INIT_NVAR(&_44$$30);
- ZVAL_STRING(&_44$$30, "\t");
- ZEPHIR_INIT_NVAR(&_45$$30);
- ZVAL_STRING(&_45$$30, " ");
- zephir_fast_str_replace(&_43$$30, &_44$$30, &_45$$30, ¤tLine);
- ZVAL_LONG(&_46$$30, 2);
- ZEPHIR_INIT_NVAR(&_47$$30);
- ZVAL_STRING(&_47$$30, "UTF-8");
- ZEPHIR_CALL_FUNCTION(&_48$$30, "htmlentities", &_49, 0, &_43$$30, &_46$$30, &_47$$30);
- zephir_check_call_status();
- zephir_concat_self(&html, &_48$$30);
- }
- i++;
- }
- zephir_concat_self_str(&html, SL(" "));
- }
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "png");
+ ZEPHIR_CALL_FUNCTION(&_15, "strcmp", NULL, 389, &ext, &_2);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_LONG(&_15, 0)) {
+ ZEPHIR_INIT_ZVAL_NREF(_16$$10);
+ ZVAL_LONG(&_16$$10, 3);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_16$$10);
+ zephir_read_property(&_16$$10, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_17$$10, "image_type_to_mime_type", NULL, 400, &_16$$10);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_17$$10);
+ zephir_read_property(&_18$$10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 392, &_18$$10, &file);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(1);
}
- zephir_concat_self_str(&html, SL(" "));
- RETURN_CCTOR(&html);
-}
-
-zend_object *zephir_init_properties_Phalcon_Support_Debug(zend_class_entry *class_type)
-{
- 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_MM_GROW();
-
- {
- 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("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("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);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "wbmp");
+ ZEPHIR_CALL_FUNCTION(&_19, "strcmp", NULL, 389, &ext, &_2);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_LONG(&_19, 0)) {
+ ZEPHIR_INIT_ZVAL_NREF(_20$$11);
+ ZVAL_LONG(&_20$$11, 15);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_20$$11);
+ zephir_read_property(&_20$$11, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_21$$11, "image_type_to_mime_type", NULL, 400, &_20$$11);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_21$$11);
+ zephir_read_property(&_22$$11, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 393, &_22$$11, &file);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(1);
}
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "xbm");
+ ZEPHIR_CALL_FUNCTION(&_23, "strcmp", NULL, 389, &ext, &_2);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_LONG(&_23, 0)) {
+ ZEPHIR_INIT_ZVAL_NREF(_24$$12);
+ ZVAL_LONG(&_24$$12, 16);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_24$$12);
+ zephir_read_property(&_24$$12, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_25$$12, "image_type_to_mime_type", NULL, 400, &_24$$12);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_25$$12);
+ zephir_read_property(&_26$$12, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 394, &_26$$12, &file);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(1);
+ }
+ ZEPHIR_INIT_NVAR(&_2);
+ object_init_ex(&_2, phalcon_image_exception_ce);
+ ZEPHIR_INIT_VAR(&_27);
+ ZEPHIR_CONCAT_SVS(&_27, "Installed GD does not support '", &ext, "' images");
+ ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 8, &_27);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_2, "phalcon/Image/Adapter/Gd.zep", 576);
+ ZEPHIR_MM_RESTORE();
+ return;
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Support_Exception)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support, Exception, phalcon, support_exception, zend_ce_exception, NULL, 0);
-
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Support_HelperFactory)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support, HelperFactory, phalcon, support_helperfactory, phalcon_factory_abstractfactory_ce, phalcon_support_helperfactory_method_entry, 0);
-
- zend_declare_property_string(phalcon_support_helperfactory_ce, SL("exception"), "Phalcon\\Support\\Exception", ZEND_ACC_PROTECTED);
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Support_HelperFactory, __construct)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processSharpen)
{
+ zval _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *services_param = NULL;
- zval services;
+ zval *amount_param = NULL, matrix, _0, _1, _2, _4, _5, _6, _7, _8, _9$$3, _10$$3, _11$$3, _12$$3;
+ zend_long amount, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&services);
+ ZVAL_UNDEF(&matrix);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_9$$3);
+ ZVAL_UNDEF(&_10$$3);
+ ZVAL_UNDEF(&_11$$3);
+ ZVAL_UNDEF(&_12$$3);
+ ZVAL_UNDEF(&_3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(services)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(amount)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_fetch_params(1, 1, 0, &amount_param);
+ amount = zephir_get_intval(amount_param);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_LONG(&_1, (-18 + ((amount * 0.08))));
+ ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 238, &_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);
+ 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(&_8, "imageconvolution", NULL, 401, &_5, &matrix, &_6, &_7);
zephir_check_call_status();
+ if (zephir_is_true(&_8)) {
+ zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_10$$3, "imagesx", NULL, 378, &_9$$3);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_10$$3);
+ zephir_read_property(&_11$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_12$$3, "imagesy", NULL, 379, &_11$$3);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_12$$3);
+ }
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_HelperFactory, __call)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processText)
{
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;
+ zend_long offsetX, offsetY, opacity, r, g, b, size, ZEPHIR_LAST_CALL_STATUS, angle = 0, bottomLeftX, bottomLeftY, topRightX, topRightY, width = 0, height = 0;
+ zval *text_param = NULL, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, *r_param = NULL, *g_param = NULL, *b_param = NULL, *size_param = NULL, *fontfile_param = NULL, space, color, _0, _1, _2, _3$$3, _4$$3, _9$$3, _10$$3, _13$$3, _14$$3, _15$$3, _16$$3, _5$$5, _6$$5, _7$$5, _8$$5, _11$$6, _12$$7, _17$$8, _18$$8, _19$$8, _22$$8, _23$$8, _24$$8, _25$$8, _20$$9, _21$$10;
+ zval text, fontfile;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&helper);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&arguments);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&fontfile);
+ ZVAL_UNDEF(&space);
+ ZVAL_UNDEF(&color);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_9$$3);
+ ZVAL_UNDEF(&_10$$3);
+ ZVAL_UNDEF(&_13$$3);
+ ZVAL_UNDEF(&_14$$3);
+ ZVAL_UNDEF(&_15$$3);
+ ZVAL_UNDEF(&_16$$3);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_11$$6);
+ ZVAL_UNDEF(&_12$$7);
+ ZVAL_UNDEF(&_17$$8);
+ ZVAL_UNDEF(&_18$$8);
+ ZVAL_UNDEF(&_19$$8);
+ ZVAL_UNDEF(&_22$$8);
+ ZVAL_UNDEF(&_23$$8);
+ ZVAL_UNDEF(&_24$$8);
+ ZVAL_UNDEF(&_25$$8);
+ ZVAL_UNDEF(&_20$$9);
+ ZVAL_UNDEF(&_21$$10);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(name)
- Z_PARAM_ARRAY(arguments)
+ ZEND_PARSE_PARAMETERS_START(9, 9)
+ Z_PARAM_STR(text)
+ Z_PARAM_LONG(offsetX)
+ Z_PARAM_LONG(offsetY)
+ Z_PARAM_LONG(opacity)
+ Z_PARAM_LONG(r)
+ Z_PARAM_LONG(g)
+ Z_PARAM_LONG(b)
+ Z_PARAM_LONG(size)
+ Z_PARAM_STR(fontfile)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &name_param, &arguments_param);
- zephir_get_strval(&name, name_param);
- zephir_get_arrval(&arguments, arguments_param);
+ zephir_fetch_params(1, 9, 0, &text_param, &offsetX_param, &offsetY_param, &opacity_param, &r_param, &g_param, &b_param, &size_param, &fontfile_param);
+ zephir_get_strval(&text, text_param);
+ offsetX = zephir_get_intval(offsetX_param);
+ offsetY = zephir_get_intval(offsetY_param);
+ opacity = zephir_get_intval(opacity_param);
+ r = zephir_get_intval(r_param);
+ g = zephir_get_intval(g_param);
+ b = zephir_get_intval(b_param);
+ size = zephir_get_intval(size_param);
+ zephir_get_strval(&fontfile, fontfile_param);
- ZEPHIR_CALL_METHOD(&helper, this_ptr, "newinstance", NULL, 0, &name);
- zephir_check_call_status();
+ bottomLeftX = 0;
+ bottomLeftY = 0;
+ topRightX = 0;
+ topRightY = 0;
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);
+ ZVAL_DOUBLE(&_1, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127)));
+ ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 238, &_1);
zephir_check_call_status();
- RETURN_MM();
+ zephir_round(&_0, &_2, NULL, NULL);
+ opacity = zephir_get_intval(&_0);
+ if (!(ZEPHIR_IS_EMPTY(&fontfile))) {
+ ZVAL_LONG(&_3$$3, size);
+ ZVAL_LONG(&_4$$3, 0);
+ ZEPHIR_CALL_FUNCTION(&space, "imagettfbbox", NULL, 402, &_3$$3, &_4$$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", 618);
+ return;
+ }
+ if (zephir_array_isset_long(&space, 0)) {
+ ZEPHIR_OBS_VAR(&_5$$5);
+ zephir_array_fetch_long(&_5$$5, &space, 0, PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 622);
+ bottomLeftX = zephir_get_intval(&_5$$5);
+ ZEPHIR_OBS_VAR(&_6$$5);
+ zephir_array_fetch_long(&_6$$5, &space, 1, PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 623);
+ bottomLeftY = zephir_get_intval(&_6$$5);
+ ZEPHIR_OBS_VAR(&_7$$5);
+ zephir_array_fetch_long(&_7$$5, &space, 4, PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 624);
+ topRightX = zephir_get_intval(&_7$$5);
+ ZEPHIR_OBS_VAR(&_8$$5);
+ zephir_array_fetch_long(&_8$$5, &space, 5, PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 625);
+ topRightY = zephir_get_intval(&_8$$5);
+ }
+ ZVAL_LONG(&_3$$3, (topRightX - bottomLeftX));
+ ZEPHIR_CALL_FUNCTION(&_9$$3, "abs", NULL, 238, &_3$$3);
+ zephir_check_call_status();
+ width = (zephir_get_numberval(&_9$$3) + 10);
+ ZVAL_LONG(&_3$$3, (topRightY - bottomLeftY));
+ ZEPHIR_CALL_FUNCTION(&_10$$3, "abs", NULL, 238, &_3$$3);
+ zephir_check_call_status();
+ height = (zephir_get_numberval(&_10$$3) + 10);
+ if (offsetX < 0) {
+ zephir_read_property(&_11$$6, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ offsetX = ((zephir_get_numberval(&_11$$6) - width) + offsetX);
+ }
+ if (offsetY < 0) {
+ zephir_read_property(&_12$$7, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ offsetY = ((zephir_get_numberval(&_12$$7) - height) + offsetY);
+ }
+ zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_4$$3, r);
+ ZVAL_LONG(&_13$$3, g);
+ ZVAL_LONG(&_14$$3, b);
+ ZVAL_LONG(&_15$$3, opacity);
+ ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 374, &_3$$3, &_4$$3, &_13$$3, &_14$$3, &_15$$3);
+ zephir_check_call_status();
+ angle = 0;
+ zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_13$$3, size);
+ ZVAL_LONG(&_14$$3, angle);
+ ZVAL_LONG(&_15$$3, offsetX);
+ ZVAL_LONG(&_16$$3, offsetY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagettftext", NULL, 403, &_4$$3, &_13$$3, &_14$$3, &_15$$3, &_16$$3, &color, &fontfile, &text);
+ zephir_check_call_status();
+ } else {
+ ZVAL_LONG(&_17$$8, size);
+ ZEPHIR_CALL_FUNCTION(&_18$$8, "imagefontwidth", NULL, 404, &_17$$8);
+ zephir_check_call_status();
+ width = (zephir_get_intval(&_18$$8) * zephir_fast_strlen_ev(&text));
+ ZVAL_LONG(&_17$$8, size);
+ ZEPHIR_CALL_FUNCTION(&_19$$8, "imagefontheight", NULL, 405, &_17$$8);
+ zephir_check_call_status();
+ height = zephir_get_intval(&_19$$8);
+ if (offsetX < 0) {
+ zephir_read_property(&_20$$9, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ offsetX = ((zephir_get_numberval(&_20$$9) - width) + offsetX);
+ }
+ if (offsetY < 0) {
+ zephir_read_property(&_21$$10, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ offsetY = ((zephir_get_numberval(&_21$$10) - height) + offsetY);
+ }
+ zephir_read_property(&_17$$8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_22$$8, r);
+ ZVAL_LONG(&_23$$8, g);
+ ZVAL_LONG(&_24$$8, b);
+ ZVAL_LONG(&_25$$8, opacity);
+ ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 374, &_17$$8, &_22$$8, &_23$$8, &_24$$8, &_25$$8);
+ zephir_check_call_status();
+ zephir_read_property(&_22$$8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_23$$8, size);
+ ZVAL_LONG(&_24$$8, offsetX);
+ ZVAL_LONG(&_25$$8, offsetY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagestring", NULL, 406, &_22$$8, &_23$$8, &_24$$8, &_25$$8, &text, &color);
+ zephir_check_call_status();
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_HelperFactory, newInstance)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processWatermark)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, _0;
- zval name;
+ zend_long offsetX, offsetY, opacity, ZEPHIR_LAST_CALL_STATUS, width = 0, height = 0;
+ zval *watermark, watermark_sub, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, __$true, overlay, color, _0, _1, _2, _9, _10, _11, _12, _13, _14, _15, _16, _17, _3$$3, _4$$3, _5$$3, _6$$3, _7$$3, _8$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&watermark_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&overlay);
+ ZVAL_UNDEF(&color);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ 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(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_8$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ 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();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &name_param);
- zephir_get_strval(&name, name_param);
+ zephir_fetch_params(1, 4, 0, &watermark, &offsetX_param, &offsetY_param, &opacity_param);
+ offsetX = zephir_get_intval(offsetX_param);
+ offsetY = zephir_get_intval(offsetY_param);
+ opacity = zephir_get_intval(opacity_param);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getservice", NULL, 0, &name);
+ ZEPHIR_CALL_METHOD(&_0, watermark, "render", NULL, 0);
zephir_check_call_status();
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(return_value, &_0);
+ ZEPHIR_CALL_FUNCTION(&overlay, "imagecreatefromstring", NULL, 381, &_0);
zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Support_HelperFactory, getAdapters)
-{
- zval *this_ptr = getThis();
-
-
-
- zephir_create_array(return_value, 1, 0);
- add_assoc_stringl_ex(return_value, SL("interpolate"), SL("Phalcon\\Support\\Helper\\Str\\Interpolate"));
- return;
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 369, &overlay, &__$true);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 378, &overlay);
+ zephir_check_call_status();
+ width = zephir_get_intval(&_1);
+ ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 379, &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, 238, &_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, 374, &overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3);
+ zephir_check_call_status();
+ ZVAL_LONG(&_4$$3, 3);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagelayereffect", NULL, 407, &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, 387, &overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3, &color);
+ zephir_check_call_status();
+ }
+ zephir_read_property(&_9, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 371, &_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(&_17, "imagecopy", NULL, 375, &_10, &overlay, &_11, &_12, &_13, &_14, &_15, &_16);
+ zephir_check_call_status();
+ if (zephir_is_true(&_17)) {
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 372, &overlay);
+ zephir_check_call_status();
+ }
+ ZEPHIR_MM_RESTORE();
}
@@ -205215,1533 +204962,1864 @@ static PHP_METHOD(Phalcon_Support_HelperFactory, getAdapters)
-ZEPHIR_INIT_CLASS(Phalcon_Support_Version)
+ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter_Imagick)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Support, Version, phalcon, support_version, phalcon_support_version_method_entry, 0);
-
- 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);
+ 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_bool(phalcon_image_adapter_imagick_ce, SL("checked"), 0, ZEND_ACC_PROTECTED|ZEND_ACC_STATIC);
+ zend_declare_property_long(phalcon_image_adapter_imagick_ce, SL("version"), 0, ZEND_ACC_PROTECTED|ZEND_ACC_STATIC);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Support_Version, getVersion)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, __construct)
{
- zval _0;
+ zend_bool _20$$8;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long width, height, ZEPHIR_LAST_CALL_STATUS;
+ zval *file_param = NULL, *width_param = NULL, *height_param = NULL, image, _0, _1, _2, _30, _31, _32, _33, _34, _35, _36, _37, _38, _3$$4, _4$$4, _5$$4, _6$$4, _7$$4, _11$$4, _12$$4, _16$$4, _8$$5, _9$$5, _10$$5, _13$$6, _14$$6, _15$$6, _17$$7, _18$$7, _19$$7, _24$$8, _25$$8, _26$$8, _27$$8, _28$$8, _29$$8, _21$$9, _22$$9, _23$$9;
+ zval file;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&image);
ZVAL_UNDEF(&_0);
-
-
- ZEPHIR_MM_GROW();
-
- zephir_create_array(return_value, 5, 0);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_LONG(&_0, 5);
- 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, 0);
- zephir_array_fast_append(return_value, &_0);
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_LONG(&_0, 1);
- zephir_array_fast_append(return_value, &_0);
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_LONG(&_0, 4);
- zephir_array_fast_append(return_value, &_0);
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Support_Version, getSpecial)
-{
- zval suffix;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *special_param = NULL;
- zend_long special;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&suffix);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_30);
+ ZVAL_UNDEF(&_31);
+ ZVAL_UNDEF(&_32);
+ ZVAL_UNDEF(&_33);
+ ZVAL_UNDEF(&_34);
+ ZVAL_UNDEF(&_35);
+ ZVAL_UNDEF(&_36);
+ ZVAL_UNDEF(&_37);
+ ZVAL_UNDEF(&_38);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_11$$4);
+ ZVAL_UNDEF(&_12$$4);
+ ZVAL_UNDEF(&_16$$4);
+ 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(&_17$$7);
+ ZVAL_UNDEF(&_18$$7);
+ ZVAL_UNDEF(&_19$$7);
+ ZVAL_UNDEF(&_24$$8);
+ ZVAL_UNDEF(&_25$$8);
+ ZVAL_UNDEF(&_26$$8);
+ ZVAL_UNDEF(&_27$$8);
+ ZVAL_UNDEF(&_28$$8);
+ ZVAL_UNDEF(&_29$$8);
+ ZVAL_UNDEF(&_21$$9);
+ ZVAL_UNDEF(&_22$$9);
+ ZVAL_UNDEF(&_23$$9);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(special)
+ 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();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &special_param);
- special = zephir_get_intval(special_param);
+ zephir_fetch_params(1, 1, 2, &file_param, &width_param, &height_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"));
+ 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 {
+ width = zephir_get_intval(width_param);
+ }
+ if (!height_param) {
+ height = 0;
+ } else {
+ height = zephir_get_intval(height_param);
+ }
- ZEPHIR_INIT_VAR(&suffix);
- do {
- if (special == 1) {
- ZEPHIR_INIT_NVAR(&suffix);
- ZVAL_STRING(&suffix, "alpha");
- break;
+ zephir_read_static_property_ce(&_0, phalcon_image_adapter_imagick_ce, SL("checked"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_0))) {
+ ZEPHIR_CALL_SELF(NULL, "check", NULL, 0);
+ zephir_check_call_status();
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("file"), &file);
+ ZEPHIR_INIT_VAR(&_1);
+ object_init_ex(&_1, zephir_get_internal_ce(SL("imagick")));
+ ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_1);
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ if ((zephir_file_exists(&_2) == SUCCESS)) {
+ zephir_read_property(&_3$$4, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_4$$4, "realpath", NULL, 94, &_3$$4);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_4$$4);
+ zephir_read_property(&_5$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_7$$4, this_ptr, ZEND_STRL("realpath"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_6$$4, &_5$$4, "readimage", NULL, 0, &_7$$4);
+ zephir_check_call_status();
+ if (UNEXPECTED(!zephir_is_true(&_6$$4))) {
+ ZEPHIR_INIT_VAR(&_8$$5);
+ object_init_ex(&_8$$5, phalcon_image_exception_ce);
+ zephir_read_property(&_9$$5, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_10$$5);
+ ZEPHIR_CONCAT_SVS(&_10$$5, "Imagick::readImage ", &_9$$5, " failed");
+ ZEPHIR_CALL_METHOD(NULL, &_8$$5, "__construct", NULL, 8, &_10$$5);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_8$$5, "phalcon/Image/Adapter/Imagick.zep", 63);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- if (special == 2) {
- ZEPHIR_INIT_NVAR(&suffix);
- ZVAL_STRING(&suffix, "beta");
- break;
+ zephir_read_property(&_11$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_12$$4, &_11$$4, "getimagealphachannel", NULL, 0);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_12$$4))) {
+ zephir_read_property(&_13$$6, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_14$$6);
+ ZVAL_STRING(&_14$$6, "Imagick::ALPHACHANNEL_SET");
+ ZEPHIR_CALL_FUNCTION(&_15$$6, "constant", NULL, 128, &_14$$6);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_13$$6, "setimagealphachannel", NULL, 0, &_15$$6);
+ zephir_check_call_status();
}
- if (special == 3) {
- ZEPHIR_INIT_NVAR(&suffix);
- ZVAL_STRING(&suffix, "RC");
- break;
+ zephir_read_property(&_16$$4, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY);
+ if (ZEPHIR_IS_LONG(&_16$$4, 1)) {
+ zephir_read_property(&_17$$7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&image, &_17$$7, "coalesceimages", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_18$$7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_18$$7, "clear", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_19$$7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_19$$7, "destroy", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image);
}
- } while(0);
-
- RETURN_CTOR(&suffix);
+ } else {
+ _20$$8 = !width;
+ if (!(_20$$8)) {
+ _20$$8 = !height;
+ }
+ if (UNEXPECTED(_20$$8)) {
+ ZEPHIR_INIT_VAR(&_21$$9);
+ object_init_ex(&_21$$9, phalcon_image_exception_ce);
+ zephir_read_property(&_22$$9, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_23$$9);
+ ZEPHIR_CONCAT_SV(&_23$$9, "Failed to create image from file ", &_22$$9);
+ ZEPHIR_CALL_METHOD(NULL, &_21$$9, "__construct", NULL, 8, &_23$$9);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_21$$9, "phalcon/Image/Adapter/Imagick.zep", 84);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ zephir_read_property(&_24$$8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_25$$8);
+ object_init_ex(&_25$$8, zephir_get_internal_ce(SL("imagickpixel")));
+ ZEPHIR_INIT_VAR(&_26$$8);
+ ZVAL_STRING(&_26$$8, "transparent");
+ ZEPHIR_CALL_METHOD(NULL, &_25$$8, "__construct", NULL, 0, &_26$$8);
+ zephir_check_call_status();
+ ZVAL_LONG(&_27$$8, width);
+ ZVAL_LONG(&_28$$8, height);
+ ZEPHIR_CALL_METHOD(NULL, &_24$$8, "newimage", NULL, 0, &_27$$8, &_28$$8, &_25$$8);
+ zephir_check_call_status();
+ zephir_read_property(&_27$$8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_26$$8);
+ ZVAL_STRING(&_26$$8, "png");
+ ZEPHIR_CALL_METHOD(NULL, &_27$$8, "setformat", NULL, 0, &_26$$8);
+ zephir_check_call_status();
+ zephir_read_property(&_28$$8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_26$$8);
+ ZVAL_STRING(&_26$$8, "png");
+ ZEPHIR_CALL_METHOD(NULL, &_28$$8, "setimageformat", NULL, 0, &_26$$8);
+ zephir_check_call_status();
+ zephir_read_property(&_29$$8, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_29$$8);
+ }
+ zephir_read_property(&_30, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_31, &_30, "getimagewidth", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_31);
+ zephir_read_property(&_32, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_33, &_32, "getimageheight", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_33);
+ zephir_read_property(&_34, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_35, &_34, "getimagetype", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_35);
+ zephir_read_property(&_36, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_37, &_36, "getimageformat", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_38);
+ ZEPHIR_CONCAT_SV(&_38, "image/", &_37);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_38);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Version, get)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, __destruct)
{
- zval result;
- zval version, major, medium, minor, special, specialNumber, suffix, _0;
+ zval _0, _1$$3, _2$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- 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(&result);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
ZEPHIR_MM_GROW();
- ZEPHIR_CALL_METHOD(&version, this_ptr, "getversion", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(&major);
- zephir_array_fetch_long(&major, &version, 0, PH_NOISY, "phalcon/Support/Version.zep", 119);
- ZEPHIR_OBS_VAR(&medium);
- zephir_array_fetch_long(&medium, &version, 1, PH_NOISY, "phalcon/Support/Version.zep", 120);
- ZEPHIR_OBS_VAR(&minor);
- zephir_array_fetch_long(&minor, &version, 2, PH_NOISY, "phalcon/Support/Version.zep", 121);
- ZEPHIR_OBS_VAR(&special);
- zephir_array_fetch_long(&special, &version, 3, PH_NOISY, "phalcon/Support/Version.zep", 122);
- ZEPHIR_OBS_VAR(&specialNumber);
- zephir_array_fetch_long(&specialNumber, &version, 4, PH_NOISY, "phalcon/Support/Version.zep", 123);
- 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);
- }
+ ZEPHIR_OBS_VAR(&_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();
}
- RETURN_CTOR(&result);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Version, getId)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, check)
{
- zval version, major, medium, minor, special, specialNumber, _0, _1, _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval __$true, _0, _1, _2, _3, _6, _4$$5, _5$$5;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&version);
- ZVAL_UNDEF(&major);
- ZVAL_UNDEF(&medium);
- ZVAL_UNDEF(&minor);
- ZVAL_UNDEF(&special);
- ZVAL_UNDEF(&specialNumber);
+ ZVAL_BOOL(&__$true, 1);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$5);
ZEPHIR_MM_GROW();
- ZEPHIR_CALL_METHOD(&version, this_ptr, "getversion", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(&major);
- zephir_array_fetch_long(&major, &version, 0, PH_NOISY, "phalcon/Support/Version.zep", 157);
- ZEPHIR_OBS_VAR(&medium);
- zephir_array_fetch_long(&medium, &version, 1, PH_NOISY, "phalcon/Support/Version.zep", 158);
- ZEPHIR_OBS_VAR(&minor);
- zephir_array_fetch_long(&minor, &version, 2, PH_NOISY, "phalcon/Support/Version.zep", 159);
- ZEPHIR_OBS_VAR(&special);
- zephir_array_fetch_long(&special, &version, 3, PH_NOISY, "phalcon/Support/Version.zep", 160);
- ZEPHIR_OBS_VAR(&specialNumber);
- zephir_array_fetch_long(&specialNumber, &version, 4, PH_NOISY, "phalcon/Support/Version.zep", 161);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "%02s");
- ZEPHIR_CALL_FUNCTION(&_1, "sprintf", NULL, 194, &_0, &medium);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "%02s");
- ZEPHIR_CALL_FUNCTION(&_2, "sprintf", NULL, 194, &_0, &minor);
+ zephir_read_static_property_ce(&_0, phalcon_image_adapter_imagick_ce, SL("checked"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_is_true(&_0)) {
+ RETURN_MM_BOOL(1);
+ }
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "imagick");
+ if (UNEXPECTED(!(zephir_class_exists(&_1, 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", 128);
+ return;
+ }
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "Imagick::IMAGICK_EXTNUM");
+ ZEPHIR_CALL_FUNCTION(&_3, "defined", NULL, 127, &_2);
zephir_check_call_status();
- ZEPHIR_CONCAT_VVVVV(return_value, &major, &_1, &_2, &special, &specialNumber);
- RETURN_MM();
+ if (zephir_is_true(&_3)) {
+ ZEPHIR_INIT_VAR(&_4$$5);
+ ZVAL_STRING(&_4$$5, "Imagick::IMAGICK_EXTNUM");
+ ZEPHIR_CALL_FUNCTION(&_5$$5, "constant", NULL, 128, &_4$$5);
+ zephir_check_call_status();
+ zephir_update_static_property_ce(phalcon_image_adapter_imagick_ce, ZEND_STRL("version"), &_5$$5);
+ }
+ zephir_update_static_property_ce(phalcon_image_adapter_imagick_ce, ZEND_STRL("checked"), &__$true);
+ zephir_read_static_property_ce(&_6, phalcon_image_adapter_imagick_ce, SL("checked"), PH_NOISY_CC | PH_READONLY);
+ RETURN_CTOR(&_6);
}
-static PHP_METHOD(Phalcon_Support_Version, getPart)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, getInternalImInstance)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "image");
+}
+
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, setResourceLimit)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *part_param = NULL, version, _0$$3, _1$$4;
- zend_long part, ZEPHIR_LAST_CALL_STATUS;
+ zval *type_param = NULL, *limit_param = NULL, _0, _1, _2;
+ zend_long type, limit, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&version);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(part)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_LONG(type)
+ Z_PARAM_LONG(limit)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &part_param);
- part = zephir_get_intval(part_param);
-
+ zephir_fetch_params(1, 2, 0, &type_param, &limit_param);
+ type = zephir_get_intval(type_param);
+ limit = zephir_get_intval(limit_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_array_fetch_long(&_0$$3, &version, part, PH_NOISY | PH_READONLY, "phalcon/Support/Version.zep", 189);
- RETURN_CTOR(&_0$$3);
- }
- if (part == 3) {
- zephir_array_fetch_long(&_1$$4, &version, 3, PH_NOISY | PH_READONLY, "phalcon/Support/Version.zep", 192);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getspecial", NULL, 0, &_1$$4);
- zephir_check_call_status();
- RETURN_MM();
- }
- } while(0);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "get", NULL, 0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_1, type);
+ ZVAL_LONG(&_2, limit);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "setresourcelimit", NULL, 0, &_1, &_2);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_MM_RESTORE();
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Support_Debug_Dump)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processBackground)
{
- 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);
- phalcon_support_debug_dump_ce->create_object = zephir_init_properties_Phalcon_Support_Debug_Dump;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_6 = NULL, *_8 = NULL, *_11 = NULL, *_12 = NULL, *_13 = NULL, *_18 = NULL, *_20 = NULL, *_25 = NULL;
+ zval *r_param = NULL, *g_param = NULL, *b_param = NULL, *opacity_param = NULL, background, color, pixel1, pixel2, ret, _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 r, g, b, opacity, ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
- return SUCCESS;
-}
+ ZVAL_UNDEF(&background);
+ ZVAL_UNDEF(&color);
+ ZVAL_UNDEF(&pixel1);
+ ZVAL_UNDEF(&pixel2);
+ ZVAL_UNDEF(&ret);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ 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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(4, 4)
+ Z_PARAM_LONG(r)
+ Z_PARAM_LONG(g)
+ Z_PARAM_LONG(b)
+ Z_PARAM_LONG(opacity)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
-static PHP_METHOD(Phalcon_Support_Debug_Dump, getDetailed)
-{
- zval *this_ptr = getThis();
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 4, 0, &r_param, &g_param, &b_param, &opacity_param);
+ r = zephir_get_intval(r_param);
+ g = zephir_get_intval(g_param);
+ b = zephir_get_intval(b_param);
+ opacity = zephir_get_intval(opacity_param);
- RETURN_MEMBER(getThis(), "detailed");
+ opacity /= 100;
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "rgb(%d, %d, %d)");
+ ZVAL_LONG(&_1, r);
+ ZVAL_LONG(&_2, g);
+ ZVAL_LONG(&_3, b);
+ ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 194, &_0, &_1, &_2, &_3);
+ zephir_check_call_status();
+ 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) {
+ 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(&_7$$3))) {
+ ZEPHIR_INIT_NVAR(&_9$$4);
+ ZVAL_STRING(&_9$$4, "Imagick::ALPHACHANNEL_SET");
+ ZEPHIR_CALL_FUNCTION(&_10$$4, "constant", &_11, 128, &_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, 128, &_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, 128, &_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, 128, &_14$$3);
+ zephir_check_call_status();
+ ZVAL_LONG(&_23$$3, 0);
+ ZVAL_LONG(&_24$$3, 0);
+ ZEPHIR_CALL_METHOD(&ret, &background, "compositeimage", &_25, 0, &_21$$3, &_22$$3, &_23$$3, &_24$$3);
+ zephir_check_call_status();
+ if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&ret))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/Image/Adapter/Imagick.zep", 202);
+ 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_FALSE_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_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_update_property_zval(this_ptr, ZEND_STRL("image"), &background);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug_Dump, setDetailed)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processBlur)
{
- zval *detailed_param = NULL, __$true, __$false;
- zend_bool detailed;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ 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_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_BOOL(detailed)
+ Z_PARAM_LONG(radius)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(1, 0, &detailed_param);
- detailed = zephir_get_boolval(detailed_param);
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &radius_param);
+ radius = zephir_get_intval(radius_param);
- if (detailed) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("detailed"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("detailed"), &__$false);
+ 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) {
+ 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_FALSE_IDENTICAL(&_5$$3)) {
+ break;
+ }
}
- RETURN_THISW();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug_Dump, __construct)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processCrop)
{
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;
- zval styles;
+ 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(&styles);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&image);
+ ZVAL_UNDEF(&_0);
+ 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);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 2)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(styles)
- Z_PARAM_BOOL(detailed)
+ 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();
#endif
ZEPHIR_MM_GROW();
- 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 {
- detailed = zephir_get_boolval(detailed_param);
- }
+ zephir_fetch_params(1, 4, 0, &width_param, &height_param, &offsetX_param, &offsetY_param);
+ width = zephir_get_intval(width_param);
+ height = zephir_get_intval(height_param);
+ offsetX = zephir_get_intval(offsetX_param);
+ offsetY = zephir_get_intval(offsetY_param);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstyles", NULL, 0, &styles);
+ 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();
- if (detailed) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("detailed"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("detailed"), &__$false);
+ while (1) {
+ 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(&_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_Support_Debug_Dump, all)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processFlip)
{
- zval _1;
- zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *direction_param = NULL, func, _0, _1, _2$$4, _3$$4, _4$$4;
+ zend_long direction, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&func);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_4$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(direction)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &direction_param);
+ direction = zephir_get_intval(direction_param);
- 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_INIT_VAR(&func);
+ ZVAL_STRING(&func, "flipImage");
+ if (direction == 11) {
+ ZEPHIR_INIT_NVAR(&func);
+ ZVAL_STRING(&func, "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();
- RETURN_MM();
+ while (1) {
+ zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD_ZVAL(NULL, &_2$$4, &func, NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_3$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_4$$4, &_3$$4, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_4$$4)) {
+ break;
+ }
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug_Dump, one)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processLiquidRescale)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval name;
- zval *variable, variable_sub, *name_param = NULL;
+ zephir_fcall_cache_entry *_5 = NULL, *_7 = NULL;
+ zval *width_param = NULL, *height_param = NULL, *deltaX_param = NULL, *rigidity_param = NULL, ret, image, _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(&variable_sub);
- ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&ret);
+ ZVAL_UNDEF(&image);
+ 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$$3);
#if PHP_VERSION_ID >= 80000
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_START(4, 4)
+ Z_PARAM_LONG(width)
+ Z_PARAM_LONG(height)
+ Z_PARAM_LONG(deltaX)
+ Z_PARAM_LONG(rigidity)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &variable, &name_param);
- if (!name_param) {
- ZEPHIR_INIT_VAR(&name);
- } else {
- zephir_get_strval(&name, name_param);
- }
+ zephir_fetch_params(1, 4, 0, &width_param, &height_param, &deltaX_param, &rigidity_param);
+ width = zephir_get_intval(width_param);
+ height = zephir_get_intval(height_param);
+ deltaX = zephir_get_intval(deltaX_param);
+ rigidity = zephir_get_intval(rigidity_param);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "variable", NULL, 0, variable, &name);
+ 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();
- RETURN_MM();
+ while (1) {
+ ZVAL_LONG(&_1$$3, width);
+ ZVAL_LONG(&_2$$3, height);
+ ZVAL_LONG(&_3$$3, deltaX);
+ ZVAL_LONG(&_4$$3, rigidity);
+ ZEPHIR_CALL_METHOD(&ret, &image, "liquidrescaleimage", &_5, 0, &_1$$3, &_2$$3, &_3$$3, &_4$$3);
+ zephir_check_call_status();
+ if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&ret))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::liquidRescale failed", "phalcon/Image/Adapter/Imagick.zep", 308);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&_6$$3, &image, "nextimage", &_7, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_6$$3)) {
+ break;
+ }
+ }
+ 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);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug_Dump, setStyles)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processMask)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *styles_param = NULL, defaultStyles, _0;
- zval styles;
+ zephir_fcall_cache_entry *_7 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *image, image_sub, mask, ret, _0, _1, _2, _3$$3, _4$$3, _5$$3, _6$$3, _8$$3, _9$$3, _10$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&styles);
- ZVAL_UNDEF(&defaultStyles);
+ ZVAL_UNDEF(&image_sub);
+ ZVAL_UNDEF(&mask);
+ ZVAL_UNDEF(&ret);
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);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(styles)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(image, phalcon_image_adapter_adapterinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_fetch_params(1, 1, 0, &image);
- 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");
+ 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) {
+ zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_4$$3, 1);
+ ZEPHIR_CALL_METHOD(NULL, &_3$$3, "setimagematte", NULL, 0, &_4$$3);
+ 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, 128, &_5$$3);
+ zephir_check_call_status();
+ ZVAL_LONG(&_8$$3, 0);
+ ZVAL_LONG(&_9$$3, 0);
+ ZEPHIR_CALL_METHOD(&ret, &_4$$3, "compositeimage", NULL, 0, &mask, &_6$$3, &_8$$3, &_9$$3);
+ zephir_check_call_status();
+ if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&ret))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/Image/Adapter/Imagick.zep", 346);
+ 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_FALSE_IDENTICAL(&_10$$3)) {
+ break;
+ }
+ }
+ 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_Support_Debug_Dump, toJson)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processPixelate)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *variable, variable_sub, _1;
+ 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, width = 0, height = 0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&variable_sub);
+ 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);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(variable)
+ Z_PARAM_LONG(amount)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &variable);
+ zephir_fetch_params(1, 1, 0, &amount_param);
+ amount = zephir_get_intval(amount_param);
- ZVAL_LONG(&_1, ((128 | 64) | 256));
- ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_helper_json_ce, "encode", &_0, 14, variable, &_1);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ width = (long) (zephir_safe_div_zval_long(&_0, amount));
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ height = (long) (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();
- RETURN_MM();
+ while (1) {
+ zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_5$$3, width);
+ ZVAL_LONG(&_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_FALSE_IDENTICAL(&_9$$3)) {
+ break;
+ }
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug_Dump, variable)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processReflection)
{
- zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval name;
- zval *variable, variable_sub, *name_param = NULL, _1, _2;
+ zephir_fcall_cache_entry *_5 = NULL, *_7 = NULL, *_11 = NULL, *_13 = NULL, *_14 = NULL, *_16 = NULL, *_21 = NULL, *_24 = NULL, *_27 = NULL, *_29 = NULL, *_35 = NULL, *_38 = NULL, *_40 = NULL, *_43 = NULL, *_48 = NULL, *_55 = NULL;
+ zend_bool fadeIn, _56$$13;
+ zval *height_param = NULL, *opacity_param = NULL, *fadeIn_param = NULL, reflection, fade, pseudo, image, pixel, ret, _0, _4, _17, _18, _30, _31, _32, _58, _59, _60, _61, _62, _1$$3, _2$$4, _3$$4, _6$$5, _8$$5, _9$$5, _10$$5, _12$$5, _15$$5, _19$$7, _20$$7, _22$$7, _23$$7, _25$$7, _26$$7, _28$$7, _33$$10, _34$$10, _36$$10, _37$$10, _39$$10, _41$$10, _42$$10, _44$$10, _45$$10, _46$$10, _47$$10, _49$$10, _50$$13, _51$$13, _52$$13, _53$$13, _54$$13, _57$$13;
+ zend_long height, opacity, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&variable_sub);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&reflection);
+ ZVAL_UNDEF(&fade);
+ ZVAL_UNDEF(&pseudo);
+ ZVAL_UNDEF(&image);
+ ZVAL_UNDEF(&pixel);
+ ZVAL_UNDEF(&ret);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_17);
+ ZVAL_UNDEF(&_18);
+ ZVAL_UNDEF(&_30);
+ ZVAL_UNDEF(&_31);
+ ZVAL_UNDEF(&_32);
+ ZVAL_UNDEF(&_58);
+ ZVAL_UNDEF(&_59);
+ ZVAL_UNDEF(&_60);
+ ZVAL_UNDEF(&_61);
+ ZVAL_UNDEF(&_62);
+ 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(&_19$$7);
+ ZVAL_UNDEF(&_20$$7);
+ ZVAL_UNDEF(&_22$$7);
+ ZVAL_UNDEF(&_23$$7);
+ ZVAL_UNDEF(&_25$$7);
+ ZVAL_UNDEF(&_26$$7);
+ ZVAL_UNDEF(&_28$$7);
+ ZVAL_UNDEF(&_33$$10);
+ ZVAL_UNDEF(&_34$$10);
+ ZVAL_UNDEF(&_36$$10);
+ ZVAL_UNDEF(&_37$$10);
+ ZVAL_UNDEF(&_39$$10);
+ ZVAL_UNDEF(&_41$$10);
+ ZVAL_UNDEF(&_42$$10);
+ ZVAL_UNDEF(&_44$$10);
+ ZVAL_UNDEF(&_45$$10);
+ ZVAL_UNDEF(&_46$$10);
+ ZVAL_UNDEF(&_47$$10);
+ ZVAL_UNDEF(&_49$$10);
+ ZVAL_UNDEF(&_50$$13);
+ ZVAL_UNDEF(&_51$$13);
+ ZVAL_UNDEF(&_52$$13);
+ ZVAL_UNDEF(&_53$$13);
+ ZVAL_UNDEF(&_54$$13);
+ ZVAL_UNDEF(&_57$$13);
#if PHP_VERSION_ID >= 80000
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_START(3, 3)
+ Z_PARAM_LONG(height)
+ Z_PARAM_LONG(opacity)
+ Z_PARAM_BOOL(fadeIn)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &variable, &name_param);
- if (!name_param) {
- ZEPHIR_INIT_VAR(&name);
- } else {
- zephir_get_strval(&name, name_param);
- }
+ zephir_fetch_params(1, 3, 0, &height_param, &opacity_param, &fadeIn_param);
+ height = zephir_get_intval(height_param);
+ opacity = zephir_get_intval(opacity_param);
+ fadeIn = zephir_get_boolval(fadeIn_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_read_static_property_ce(&_0, phalcon_image_adapter_imagick_ce, SL("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_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();
+ }
+ }
+ ZVAL_LONG(&_4, 0);
+ ZEPHIR_CALL_METHOD(NULL, &reflection, "setiteratorindex", NULL, 0, &_4);
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);
+ while (1) {
+ 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_CALL_METHOD(&_15$$5, &reflection, "nextimage", &_16, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE_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_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_CALL_METHOD(&_17, &reflection, "getimagewidth", NULL, 0);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_CALL_METHOD(&_18, &reflection, "getimageheight", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &fade, "newpseudoimage", NULL, 0, &_17, &_18, &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) {
+ ZEPHIR_INIT_NVAR(&_19$$7);
+ ZVAL_STRING(&_19$$7, "Imagick::COMPOSITE_DSTOUT");
+ ZEPHIR_CALL_FUNCTION(&_20$$7, "constant", &_21, 128, &_19$$7);
+ zephir_check_call_status();
+ ZVAL_LONG(&_22$$7, 0);
+ ZVAL_LONG(&_23$$7, 0);
+ ZEPHIR_CALL_METHOD(&ret, &reflection, "compositeimage", &_24, 0, &fade, &_20$$7, &_22$$7, &_23$$7);
+ zephir_check_call_status();
+ if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&ret))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/Image/Adapter/Imagick.zep", 441);
+ return;
+ }
+ ZEPHIR_INIT_NVAR(&_19$$7);
+ ZVAL_STRING(&_19$$7, "Imagick::EVALUATE_MULTIPLY");
+ ZEPHIR_CALL_FUNCTION(&_25$$7, "constant", &_21, 128, &_19$$7);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_19$$7);
+ ZVAL_STRING(&_19$$7, "Imagick::CHANNEL_ALPHA");
+ ZEPHIR_CALL_FUNCTION(&_26$$7, "constant", &_21, 128, &_19$$7);
+ zephir_check_call_status();
+ ZVAL_LONG(&_22$$7, opacity);
+ ZEPHIR_CALL_METHOD(NULL, &reflection, "evaluateimage", &_27, 0, &_25$$7, &_22$$7, &_26$$7);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_28$$7, &reflection, "nextimage", &_29, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_28$$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(&_30, &_4, "getimageheight", NULL, 0);
+ zephir_check_call_status();
+ height = (zephir_get_numberval(&_30) + height);
+ zephir_read_property(&_31, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_32, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_31, "setiteratorindex", NULL, 0, &_32);
+ zephir_check_call_status();
+ while (1) {
+ zephir_read_property(&_33$$10, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_34$$10, height);
+ ZEPHIR_CALL_METHOD(NULL, &image, "newimage", &_35, 0, &_33$$10, &_34$$10, &pixel);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_36$$10);
+ ZVAL_STRING(&_36$$10, "Imagick::ALPHACHANNEL_SET");
+ ZEPHIR_CALL_FUNCTION(&_37$$10, "constant", &_21, 128, &_36$$10);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &image, "setimagealphachannel", &_38, 0, &_37$$10);
+ zephir_check_call_status();
+ zephir_read_property(&_34$$10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_39$$10, &_34$$10, "getcolorspace", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &image, "setcolorspace", &_40, 0, &_39$$10);
+ zephir_check_call_status();
+ zephir_read_property(&_41$$10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_42$$10, &_41$$10, "getimagedelay", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &image, "setimagedelay", &_43, 0, &_42$$10);
+ zephir_check_call_status();
+ zephir_read_property(&_44$$10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_36$$10);
+ ZVAL_STRING(&_36$$10, "Imagick::COMPOSITE_SRC");
+ ZEPHIR_CALL_FUNCTION(&_45$$10, "constant", &_21, 128, &_36$$10);
+ zephir_check_call_status();
+ ZVAL_LONG(&_46$$10, 0);
+ ZVAL_LONG(&_47$$10, 0);
+ ZEPHIR_CALL_METHOD(&ret, &image, "compositeimage", &_48, 0, &_44$$10, &_45$$10, &_46$$10, &_47$$10);
+ zephir_check_call_status();
+ if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&ret))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/Image/Adapter/Imagick.zep", 486);
+ return;
+ }
+ zephir_read_property(&_46$$10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_49$$10, &_46$$10, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_49$$10)) {
+ break;
+ }
+ }
+ ZVAL_LONG(&_32, 0);
+ ZEPHIR_CALL_METHOD(NULL, &image, "setiteratorindex", NULL, 0, &_32);
+ zephir_check_call_status();
+ ZVAL_LONG(&_32, 0);
+ ZEPHIR_CALL_METHOD(NULL, &reflection, "setiteratorindex", NULL, 0, &_32);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_INIT_NVAR(&_50$$13);
+ ZVAL_STRING(&_50$$13, "Imagick::COMPOSITE_OVER");
+ ZEPHIR_CALL_FUNCTION(&_51$$13, "constant", &_21, 128, &_50$$13);
+ zephir_check_call_status();
+ zephir_read_property(&_52$$13, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_53$$13, 0);
+ ZEPHIR_CALL_METHOD(&ret, &image, "compositeimage", &_48, 0, &reflection, &_51$$13, &_53$$13, &_52$$13);
+ zephir_check_call_status();
+ if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&ret))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/Image/Adapter/Imagick.zep", 506);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&_54$$13, &image, "nextimage", &_55, 0);
+ zephir_check_call_status();
+ _56$$13 = ZEPHIR_IS_FALSE_IDENTICAL(&_54$$13);
+ if (!(_56$$13)) {
+ ZEPHIR_CALL_METHOD(&_57$$13, &reflection, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ _56$$13 = ZEPHIR_IS_FALSE_IDENTICAL(&_57$$13);
+ }
+ if (_56$$13) {
+ break;
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &reflection, "destroy", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_32, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_32, "clear", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_58, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_58, "destroy", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image);
+ zephir_read_property(&_59, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_60, &_59, "getimagewidth", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_60);
+ zephir_read_property(&_61, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_62, &_61, "getimageheight", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_62);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Support_Debug_Dump, variables)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processRender)
{
- zend_string *_4;
- zend_ulong _3;
- zval output;
- zval key, value, _0, *_1, _2, _5$$3, _6$$3, _8$$4, _9$$4;
+ zend_bool _8$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_7 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_long quality, ZEPHIR_LAST_CALL_STATUS;
+ zval *extension_param = NULL, *quality_param = NULL, image, _0, _1, _2, _3, _4, _5, _6$$4, _7$$4, _9$$4, _12$$4, _10$$5, _11$$5;
+ zval extension;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&extension);
+ ZVAL_UNDEF(&image);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_6$$3);
- ZVAL_UNDEF(&_8$$4);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
ZVAL_UNDEF(&_9$$4);
- ZVAL_UNDEF(&output);
+ ZVAL_UNDEF(&_12$$4);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_11$$5);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(extension)
+ Z_PARAM_LONG(quality)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &extension_param, &quality_param);
+ zephir_get_strval(&extension, extension_param);
+ quality = zephir_get_intval(quality_param);
- ZEPHIR_INIT_VAR(&output);
- ZEPHIR_INIT_VAR(&_0);
- zephir_get_args(&_0);
- zephir_is_iterable(&_0, 0, "phalcon/Support/Debug/Dump.zep", 181);
- 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();
+
+ 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);
+ ZEPHIR_CONCAT_SV(&_3, "image/", &_2);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_3);
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_STRING(&_4, "gif");
+ ZEPHIR_CALL_FUNCTION(&_5, "strcasecmp", NULL, 47, &extension, &_4);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_LONG_IDENTICAL(&_5, 0)) {
+ ZEPHIR_CALL_METHOD(NULL, &image, "optimizeimagelayers", NULL, 0);
+ zephir_check_call_status();
} else {
- ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0);
+ ZEPHIR_INIT_VAR(&_6$$4);
+ ZVAL_STRING(&_6$$4, "jpg");
+ ZEPHIR_CALL_FUNCTION(&_7$$4, "strcasecmp", NULL, 47, &extension, &_6$$4);
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);
+ _8$$4 = ZEPHIR_IS_LONG_IDENTICAL(&_7$$4, 0);
+ if (!(_8$$4)) {
+ ZEPHIR_INIT_NVAR(&_6$$4);
+ ZVAL_STRING(&_6$$4, "jpeg");
+ ZEPHIR_CALL_FUNCTION(&_9$$4, "strcasecmp", NULL, 47, &extension, &_6$$4);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &_0, "current", NULL, 0);
+ _8$$4 = ZEPHIR_IS_LONG_IDENTICAL(&_9$$4, 0);
+ }
+ if (_8$$4) {
+ ZEPHIR_INIT_VAR(&_10$$5);
+ ZVAL_STRING(&_10$$5, "Imagick::COMPRESSION_JPEG");
+ ZEPHIR_CALL_FUNCTION(&_11$$5, "constant", NULL, 128, &_10$$5);
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_CALL_METHOD(NULL, &image, "setimagecompression", NULL, 0, &_11$$5);
zephir_check_call_status();
}
+ ZVAL_LONG(&_12$$4, quality);
+ ZEPHIR_CALL_METHOD(NULL, &image, "setimagecompressionquality", NULL, 0, &_12$$4);
+ zephir_check_call_status();
}
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- RETURN_CTOR(&output);
+ ZEPHIR_RETURN_CALL_METHOD(&image, "getimageblob", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Support_Debug_Dump, getStyle)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processResize)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *type_param = NULL, style, _0;
- zval type;
+ 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(&type);
- ZVAL_UNDEF(&style);
+ ZVAL_UNDEF(&image);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_4$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(type)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_LONG(width)
+ Z_PARAM_LONG(height)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_fetch_params(1, 2, 0, &width_param, &height_param);
+ width = zephir_get_intval(width_param);
+ height = zephir_get_intval(height_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("styles"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&style, &_0, &type, 1))) {
- RETURN_MM_STRING("color:gray");
+ 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) {
+ 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_FALSE_IDENTICAL(&_4$$3)) {
+ break;
+ }
}
- RETURN_CTOR(&style);
+ ZEPHIR_CALL_METHOD(&_6, &image, "getimagewidth", NULL, 0);
+ zephir_check_call_status();
+ 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_Support_Debug_Dump, output)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processRotate)
{
- 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 *_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 *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(&variable_sub);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
- 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(&_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);
+ ZVAL_UNDEF(&pixel);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_11);
+ 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(&_8$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(degrees)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, °rees_param);
+ degrees = zephir_get_intval(degrees_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) {
+ 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();
+ 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_FALSE_IDENTICAL(&_8$$3)) {
+ break;
+ }
+ }
+ 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_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_update_property_zval(this_ptr, ZEND_STRL("height"), &_11);
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processSave)
+{
+ zend_bool _13;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long quality, ZEPHIR_LAST_CALL_STATUS;
+ zval *file_param = NULL, *quality_param = NULL, ext, fp, _0, _1, _2, _3, _4, _5, _6, _7, _8, _12, _14, _20, _9$$3, _10$$3, _11$$3, _15$$4, _16$$4, _17$$4, _18$$5, _19$$5;
+ zval file;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&ext);
+ 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(&_8);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_14);
+ ZVAL_UNDEF(&_20);
+ ZVAL_UNDEF(&_9$$3);
+ ZVAL_UNDEF(&_10$$3);
+ ZVAL_UNDEF(&_11$$3);
+ ZVAL_UNDEF(&_15$$4);
+ ZVAL_UNDEF(&_16$$4);
+ ZVAL_UNDEF(&_17$$4);
+ ZVAL_UNDEF(&_18$$5);
+ ZVAL_UNDEF(&_19$$5);
#if PHP_VERSION_ID >= 80000
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_START(2, 2)
+ Z_PARAM_STR(file)
+ Z_PARAM_LONG(quality)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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 (!tab_param) {
- tab = 1;
- } else {
- tab = zephir_get_intval(tab_param);
- }
+ zephir_fetch_params(1, 2, 0, &file_param, &quality_param);
+ zephir_get_strval(&file, file_param);
+ quality = zephir_get_intval(quality_param);
- 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);
- }
- 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);
+ ZVAL_LONG(&_0, 4);
+ ZEPHIR_CALL_FUNCTION(&ext, "pathinfo", NULL, 109, &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, &ext);
+ 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, &ext);
+ 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);
+ ZVAL_STRING(&_7, "gif");
+ ZEPHIR_CALL_FUNCTION(&_8, "strcasecmp", NULL, 47, &ext, &_7);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_LONG(&_8, 0)) {
+ zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_9$$3, "optimizeimagelayers", NULL, 0);
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_INIT_VAR(&_10$$3);
+ ZVAL_STRING(&_10$$3, "w");
+ ZEPHIR_CALL_FUNCTION(&fp, "fopen", NULL, 89, &file, &_10$$3);
zephir_check_call_status();
- zephir_concat_self(&output, &_2$$4);
- zephir_is_iterable(variable, 0, "phalcon/Support/Debug/Dump.zep", 231);
- 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();
- 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, "");
- }
- _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();
- 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();
- }
- }
- 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_read_property(&_11$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_11$$3, "writeimagesfile", NULL, 0, &fp);
zephir_check_call_status();
- ZEPHIR_CONCAT_VVS(return_value, &output, &_33$$4, ")");
- RETURN_MM();
+ zephir_fclose(&fp);
+ RETURN_MM_NULL();
}
- 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_INIT_NVAR(&_7);
+ ZVAL_STRING(&_7, "jpg");
+ ZEPHIR_CALL_FUNCTION(&_12, "strcasecmp", NULL, 47, &ext, &_7);
+ zephir_check_call_status();
+ _13 = ZEPHIR_IS_LONG(&_12, 0);
+ if (!(_13)) {
+ ZEPHIR_INIT_NVAR(&_7);
+ ZVAL_STRING(&_7, "jpeg");
+ ZEPHIR_CALL_FUNCTION(&_14, "strcasecmp", NULL, 47, &ext, &_7);
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);
+ _13 = ZEPHIR_IS_LONG(&_14, 0);
+ }
+ if (_13) {
+ zephir_read_property(&_15$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_16$$4);
+ ZVAL_STRING(&_16$$4, "Imagick::COMPRESSION_JPEG");
+ ZEPHIR_CALL_FUNCTION(&_17$$4, "constant", NULL, 128, &_16$$4);
zephir_check_call_status();
- zephir_concat_self(&output, &_35$$9);
- ZEPHIR_CALL_FUNCTION(&_37$$9, "get_parent_class", NULL, 0, variable);
+ ZEPHIR_CALL_METHOD(NULL, &_15$$4, "setimagecompression", NULL, 0, &_17$$4);
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();
- 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_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, 438, variable);
- zephir_check_call_status();
- zephir_is_iterable(&_46$$12, 0, "phalcon/Support/Debug/Dump.zep", 263);
- 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_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, 156, variable);
- zephir_check_call_status();
- ZVAL_LONG(&_67$$15, ((1 | 2) | 4));
- ZEPHIR_CALL_METHOD(&props$$15, &reflect$$15, "getproperties", NULL, 160, &_67$$15);
- zephir_check_call_status();
- zephir_is_iterable(&props$$15, 0, "phalcon/Support/Debug/Dump.zep", 289);
- 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();
- 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;
- }
- 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);
+ }
+ if (quality >= 0) {
+ if (quality < 1) {
+ quality = 1;
+ } else if (quality > 100) {
+ quality = 100;
}
- ZEPHIR_CALL_FUNCTION(&attr, "get_class_methods", NULL, 0, variable);
+ zephir_read_property(&_18$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_19$$5, quality);
+ ZEPHIR_CALL_METHOD(NULL, &_18$$5, "setimagecompressionquality", NULL, 0, &_19$$5);
zephir_check_call_status();
- ZVAL_LONG(&_103$$9, tab);
- ZEPHIR_CALL_FUNCTION(&_104$$9, "str_repeat", &_10, 1, &space, &_103$$9);
+ }
+ zephir_read_property(&_20, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_20, "writeimage", NULL, 0, &file);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processSharpen)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ 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(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(amount)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &amount_param);
+ amount = zephir_get_intval(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();
+ while (1) {
+ 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_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_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();
- 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);
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_6$$3)) {
+ break;
+ }
+ }
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long opacity, r, g, b, size, ZEPHIR_LAST_CALL_STATUS, x = 0, y = 0;
+ zval *text_param = NULL, *offsetX = NULL, offsetX_sub, *offsetY = NULL, offsetY_sub, *opacity_param = NULL, *r_param = NULL, *g_param = NULL, *b_param = NULL, *size_param = NULL, *fontfile_param = NULL, draw, color, gravity, _0, _1, _2, _3, _4$$4, _5$$5, _6$$7, _7$$11, _8$$12, _9$$14, _10$$15, _11$$21, _12$$22, _13$$24, _14$$25, _15$$29, _16$$30, _17$$32, _18$$33, _19$$34, _20$$34, _21$$34;
+ zval text, fontfile;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&fontfile);
+ ZVAL_UNDEF(&offsetX_sub);
+ ZVAL_UNDEF(&offsetY_sub);
+ ZVAL_UNDEF(&draw);
+ ZVAL_UNDEF(&color);
+ ZVAL_UNDEF(&gravity);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&_7$$11);
+ ZVAL_UNDEF(&_8$$12);
+ ZVAL_UNDEF(&_9$$14);
+ ZVAL_UNDEF(&_10$$15);
+ ZVAL_UNDEF(&_11$$21);
+ ZVAL_UNDEF(&_12$$22);
+ ZVAL_UNDEF(&_13$$24);
+ ZVAL_UNDEF(&_14$$25);
+ ZVAL_UNDEF(&_15$$29);
+ ZVAL_UNDEF(&_16$$30);
+ ZVAL_UNDEF(&_17$$32);
+ ZVAL_UNDEF(&_18$$33);
+ ZVAL_UNDEF(&_19$$34);
+ ZVAL_UNDEF(&_20$$34);
+ ZVAL_UNDEF(&_21$$34);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(9, 9)
+ Z_PARAM_STR(text)
+ Z_PARAM_ZVAL(offsetX)
+ Z_PARAM_ZVAL(offsetY)
+ Z_PARAM_LONG(opacity)
+ Z_PARAM_LONG(r)
+ Z_PARAM_LONG(g)
+ Z_PARAM_LONG(b)
+ Z_PARAM_LONG(size)
+ Z_PARAM_STR(fontfile)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 9, 0, &text_param, &offsetX, &offsetY, &opacity_param, &r_param, &g_param, &b_param, &size_param, &fontfile_param);
+ zephir_get_strval(&text, text_param);
+ ZEPHIR_SEPARATE_PARAM(offsetX);
+ ZEPHIR_SEPARATE_PARAM(offsetY);
+ opacity = zephir_get_intval(opacity_param);
+ r = zephir_get_intval(r_param);
+ g = zephir_get_intval(g_param);
+ b = zephir_get_intval(b_param);
+ size = zephir_get_intval(size_param);
+ 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_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "rgb(%d, %d, %d)");
+ ZVAL_LONG(&_1, r);
+ ZVAL_LONG(&_2, g);
+ ZVAL_LONG(&_3, b);
+ ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 194, &_0, &_1, &_2, &_3);
+ zephir_check_call_status();
+ 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 (!(ZEPHIR_IS_EMPTY(&fontfile))) {
+ ZEPHIR_CALL_METHOD(NULL, &draw, "setfont", NULL, 0, &fontfile);
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);
+ }
+ 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, 128, &_6$$7);
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", 307);
- 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);
+ if (Z_TYPE_P(offsetY) == IS_LONG) {
+ y = zephir_get_intval(offsetY);
+ if (zephir_is_true(offsetX)) {
+ ZEPHIR_INIT_NVAR(offsetX);
+ if (y < 0) {
+ ZVAL_LONG(offsetX, 0);
+ ZEPHIR_INIT_NVAR(offsetY);
+ ZVAL_LONG(offsetY, (y * -1));
+ ZEPHIR_INIT_VAR(&_7$$11);
+ ZVAL_STRING(&_7$$11, "Imagick::GRAVITY_SOUTHEAST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 128, &_7$$11);
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 {
- ZVAL_LONG(&_120$$22, (tab + 1));
- ZEPHIR_CALL_FUNCTION(&_121$$22, "str_repeat", &_10, 1, &space, &_120$$22);
+ ZVAL_LONG(offsetX, 0);
+ ZEPHIR_INIT_VAR(&_8$$12);
+ ZVAL_STRING(&_8$$12, "Imagick::GRAVITY_NORTHEAST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 128, &_8$$12);
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);
+ }
+ } else {
+ ZEPHIR_INIT_NVAR(offsetX);
+ if (y < 0) {
+ ZVAL_LONG(offsetX, 0);
+ ZEPHIR_INIT_NVAR(offsetY);
+ ZVAL_LONG(offsetY, (y * -1));
+ ZEPHIR_INIT_VAR(&_9$$14);
+ ZVAL_STRING(&_9$$14, "Imagick::GRAVITY_SOUTH");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 128, &_9$$14);
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);
+ } else {
+ ZVAL_LONG(offsetX, 0);
+ ZEPHIR_INIT_VAR(&_10$$15);
+ ZVAL_STRING(&_10$$15, "Imagick::GRAVITY_NORTH");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 128, &_10$$15);
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);
+ }
+ }
+ }
+ } else {
+ if (Z_TYPE_P(offsetX) == IS_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)) {
+ if (zephir_is_true(offsetY)) {
+ ZEPHIR_INIT_NVAR(offsetY);
+ if (x < 0) {
+ ZEPHIR_INIT_NVAR(offsetX);
+ ZVAL_LONG(offsetX, (x * -1));
+ ZVAL_LONG(offsetY, 0);
+ ZEPHIR_INIT_VAR(&_11$$21);
+ ZVAL_STRING(&_11$$21, "Imagick::GRAVITY_SOUTHEAST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 128, &_11$$21);
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);
+ ZVAL_LONG(offsetY, 0);
+ ZEPHIR_INIT_VAR(&_12$$22);
+ ZVAL_STRING(&_12$$22, "Imagick::GRAVITY_SOUTH");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 128, &_12$$22);
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);
+ }
+ } else {
+ ZEPHIR_INIT_NVAR(offsetY);
+ if (x < 0) {
+ ZEPHIR_INIT_NVAR(offsetX);
+ ZVAL_LONG(offsetX, (x * -1));
+ ZVAL_LONG(offsetY, 0);
+ ZEPHIR_INIT_VAR(&_13$$24);
+ ZVAL_STRING(&_13$$24, "Imagick::GRAVITY_EAST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 128, &_13$$24);
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);
+ } else {
+ ZVAL_LONG(offsetY, 0);
+ ZEPHIR_INIT_VAR(&_14$$25);
+ ZVAL_STRING(&_14$$25, "Imagick::GRAVITY_WEST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 128, &_14$$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();
+ }
+ } else {
+ if (Z_TYPE_P(offsetY) == IS_LONG) {
+ x = zephir_get_intval(offsetX);
+ y = zephir_get_intval(offsetY);
+ if (x < 0) {
+ ZEPHIR_INIT_NVAR(offsetX);
+ if (y < 0) {
+ ZVAL_LONG(offsetX, (x * -1));
+ ZEPHIR_INIT_NVAR(offsetY);
+ ZVAL_LONG(offsetY, (y * -1));
+ ZEPHIR_INIT_VAR(&_15$$29);
+ ZVAL_STRING(&_15$$29, "Imagick::GRAVITY_SOUTHEAST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 128, &_15$$29);
+ zephir_check_call_status();
+ } else {
+ ZVAL_LONG(offsetX, (x * -1));
+ ZEPHIR_INIT_VAR(&_16$$30);
+ ZVAL_STRING(&_16$$30, "Imagick::GRAVITY_NORTHEAST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 128, &_16$$30);
+ zephir_check_call_status();
+ }
+ } else {
+ ZEPHIR_INIT_NVAR(offsetX);
+ if (y < 0) {
+ ZVAL_LONG(offsetX, 0);
+ ZEPHIR_INIT_NVAR(offsetY);
+ ZVAL_LONG(offsetY, (y * -1));
+ ZEPHIR_INIT_VAR(&_17$$32);
+ ZVAL_STRING(&_17$$32, "Imagick::GRAVITY_SOUTHWEST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 128, &_17$$32);
+ zephir_check_call_status();
+ } else {
+ ZVAL_LONG(offsetX, 0);
+ ZEPHIR_INIT_VAR(&_18$$33);
+ ZVAL_STRING(&_18$$33, "Imagick::GRAVITY_NORTHWEST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 128, &_18$$33);
+ zephir_check_call_status();
+ }
+ }
+ }
}
}
- 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();
- }
- 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();
}
- ZEPHIR_CALL_FUNCTION(&_147, "is_float", NULL, 213, variable);
+ ZEPHIR_CALL_METHOD(NULL, &draw, "setgravity", NULL, 0, &gravity);
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_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) {
+ zephir_read_property(&_19$$34, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_20$$34, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_19$$34, "annotateimage", NULL, 0, &draw, offsetX, offsetY, &_20$$34, &text);
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_read_property(&_20$$34, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_21$$34, &_20$$34, "nextimage", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CONCAT_VV(return_value, &output, &_164$$31);
- RETURN_MM();
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_21$$34)) {
+ break;
+ }
}
- 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_CALL_METHOD(NULL, &draw, "destroy", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CONCAT_VV(return_value, &output, &_167);
- RETURN_MM();
+ ZEPHIR_MM_RESTORE();
}
-zend_object *zephir_init_properties_Phalcon_Support_Debug_Dump(zend_class_entry *class_type)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processWatermark)
{
- zval _0, _2, _1$$3, _3$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
+ zend_long offsetX, offsetY, opacity, ZEPHIR_LAST_CALL_STATUS;
+ zval *image, image_sub, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, watermark, ret, _0, _1, _2, _3, _4, _5, _6$$3, _7$$3, _8$$3, _9$$3, _10$$3, _11$$3;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&image_sub);
+ ZVAL_UNDEF(&watermark);
+ ZVAL_UNDEF(&ret);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$4);
-
+ 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(&_10$$3);
+ ZVAL_UNDEF(&_11$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ 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();
+#endif
- ZEPHIR_MM_GROW();
-
- {
- 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("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("styles"), &_1$$3);
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 4, 0, &image, &offsetX_param, &offsetY_param, &opacity_param);
+ offsetX = zephir_get_intval(offsetX_param);
+ offsetY = zephir_get_intval(offsetY_param);
+ opacity = zephir_get_intval(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, 128, &_1);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "Imagick::CHANNEL_ALPHA");
+ ZEPHIR_CALL_FUNCTION(&_3, "constant", NULL, 128, &_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) {
+ 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, 128, &_7$$3);
+ zephir_check_call_status();
+ ZVAL_LONG(&_9$$3, offsetX);
+ ZVAL_LONG(&_10$$3, offsetY);
+ ZEPHIR_CALL_METHOD(&ret, &_6$$3, "compositeimage", NULL, 0, &watermark, &_8$$3, &_9$$3, &_10$$3);
+ zephir_check_call_status();
+ if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&ret))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/Image/Adapter/Imagick.zep", 834);
+ return;
}
- 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_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_FALSE_IDENTICAL(&_11$$3)) {
+ break;
}
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
}
+ 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();
}
@@ -206754,132 +206832,237 @@ zend_object *zephir_init_properties_Phalcon_Support_Debug_Dump(zend_class_entry
-ZEPHIR_INIT_CLASS(Phalcon_Support_Debug_Exception)
+ZEPHIR_INIT_CLASS(Phalcon_Config_ConfigFactory)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Debug, Exception, phalcon, support_debug_exception, phalcon_exception_ce, NULL, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Config, ConfigFactory, phalcon, config_configfactory, phalcon_factory_abstractfactory_ce, phalcon_config_configfactory_method_entry, 0);
+ zend_declare_property_string(phalcon_config_configfactory_ce, SL("exception"), "Phalcon\\Config\\Exception", ZEND_ACC_PROTECTED);
return SUCCESS;
}
+static PHP_METHOD(Phalcon_Config_ConfigFactory, __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();
-
-
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&services);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(services)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &services_param);
+ if (!services_param) {
+ ZEPHIR_INIT_VAR(&services);
+ array_init(&services);
+ } else {
+ zephir_get_arrval(&services, services_param);
+ }
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
+}
-ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Interpolate)
+static PHP_METHOD(Phalcon_Config_ConfigFactory, load)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, Interpolate, phalcon, support_helper_str_interpolate, phalcon_support_helper_str_interpolate_method_entry, 0);
+ zend_bool _2;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_11 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *config = NULL, config_sub, adapter, extension, first, oldConfig, second, _4, _5, _6, _9, _10, _0$$3, _1$$3, _3$$5, _7$$9, _8$$9, _12$$10, _13$$10, _14$$11, _15$$11;
+ zval *this_ptr = getThis();
- return SUCCESS;
+ ZVAL_UNDEF(&config_sub);
+ ZVAL_UNDEF(&adapter);
+ ZVAL_UNDEF(&extension);
+ ZVAL_UNDEF(&first);
+ ZVAL_UNDEF(&oldConfig);
+ ZVAL_UNDEF(&second);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&_7$$9);
+ ZVAL_UNDEF(&_8$$9);
+ ZVAL_UNDEF(&_12$$10);
+ ZVAL_UNDEF(&_13$$10);
+ ZVAL_UNDEF(&_14$$11);
+ ZVAL_UNDEF(&_15$$11);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(config)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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, 109, config, &_0$$3);
+ zephir_check_call_status();
+ if (UNEXPECTED(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", 66);
+ 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_check_call_status();
+ ZEPHIR_CPY_WRT(config, &_3$$5);
+ }
+ if (UNEXPECTED(Z_TYPE_P(config) != IS_ARRAY)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_config_exception_ce, "Config must be array or Phalcon\\Config object", "phalcon/Config/ConfigFactory.zep", 82);
+ return;
+ }
+ if (UNEXPECTED(!(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", 88);
+ return;
+ }
+ if (UNEXPECTED(!(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", 94);
+ return;
+ }
+ zephir_array_fetch_string(&_4, config, SL("adapter"), PH_NOISY | PH_READONLY, "phalcon/Config/ConfigFactory.zep", 97);
+ ZEPHIR_INIT_VAR(&adapter);
+ zephir_fast_strtolower(&adapter, &_4);
+ ZEPHIR_OBS_VAR(&first);
+ zephir_array_fetch_string(&first, config, SL("filePath"), PH_NOISY, "phalcon/Config/ConfigFactory.zep", 98);
+ ZEPHIR_INIT_VAR(&second);
+ ZVAL_NULL(&second);
+ ZVAL_LONG(&_5, 4);
+ ZEPHIR_CALL_FUNCTION(&_6, "pathinfo", NULL, 109, &first, &_5);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EMPTY(&_6)) {
+ ZEPHIR_CALL_FUNCTION(&_7$$9, "lcfirst", NULL, 96, &adapter);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_8$$9);
+ ZEPHIR_CONCAT_VSV(&_8$$9, &first, ".", &_7$$9);
+ ZEPHIR_CPY_WRT(&first, &_8$$9);
+ }
+ ZEPHIR_INIT_VAR(&_9);
+ ZVAL_STRING(&_9, "ini");
+ ZEPHIR_INIT_VAR(&_10);
+ ZVAL_STRING(&_10, "yaml");
+ if (ZEPHIR_IS_IDENTICAL(&_9, &adapter)) {
+ ZEPHIR_INIT_VAR(&_12$$10);
+ ZVAL_STRING(&_12$$10, "mode");
+ ZVAL_LONG(&_13$$10, 1);
+ ZEPHIR_CALL_CE_STATIC(&second, phalcon_helper_arr_ce, "get", &_11, 16, config, &_12$$10, &_13$$10);
+ zephir_check_call_status();
+ } else if (ZEPHIR_IS_IDENTICAL(&_10, &adapter)) {
+ ZEPHIR_INIT_VAR(&_14$$11);
+ array_init(&_14$$11);
+ ZEPHIR_INIT_VAR(&_15$$11);
+ ZVAL_STRING(&_15$$11, "callbacks");
+ ZEPHIR_CALL_CE_STATIC(&second, phalcon_helper_arr_ce, "get", &_11, 16, config, &_15$$11, &_14$$11);
+ zephir_check_call_status();
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &adapter, &first, &second);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Support_Helper_Str_Interpolate, __invoke)
+static PHP_METHOD(Phalcon_Config_ConfigFactory, newInstance)
{
- zend_string *_3$$3;
- zend_ulong _2$$3;
+ zend_bool _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- 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 *name_param = NULL, *fileName_param = NULL, *params = NULL, params_sub, __$null, definition, options, _0, _2;
+ zval name, fileName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&message);
- ZVAL_UNDEF(&leftToken);
- ZVAL_UNDEF(&rightToken);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_4$$4);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&context);
- ZVAL_UNDEF(&replace);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&fileName);
+ ZVAL_UNDEF(¶ms_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 4)
- Z_PARAM_STR(message)
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(name)
+ Z_PARAM_STR(fileName)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(context)
- Z_PARAM_STR(leftToken)
- Z_PARAM_STR(rightToken)
+ Z_PARAM_ZVAL_OR_NULL(params)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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 {
- zephir_get_arrval(&context, context_param);
+ 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;
}
- if (!leftToken_param) {
- ZEPHIR_INIT_VAR(&leftToken);
- ZVAL_STRING(&leftToken, "%");
- } else {
- zephir_get_strval(&leftToken, leftToken_param);
+
+
+ ZEPHIR_CALL_METHOD(&definition, this_ptr, "getservice", NULL, 0, &name);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&options);
+ array_init(&options);
+ zephir_array_append(&options, &fileName, PH_SEPARATE, "phalcon/Config/ConfigFactory.zep", 123);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "json");
+ _1 = !ZEPHIR_IS_IDENTICAL(&_0, &name);
+ if (_1) {
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "php");
+ _1 = !ZEPHIR_IS_IDENTICAL(&_2, &name);
}
- if (!rightToken_param) {
- ZEPHIR_INIT_VAR(&rightToken);
- ZVAL_STRING(&rightToken, "%");
- } else {
- zephir_get_strval(&rightToken, rightToken_param);
+ if (_1) {
+ zephir_array_append(&options, params, PH_SEPARATE, "phalcon/Config/ConfigFactory.zep", 126);
}
+ ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(return_value, &definition, &options);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+static PHP_METHOD(Phalcon_Config_ConfigFactory, getAdapters)
+{
+ zval *this_ptr = getThis();
- if (!(ZEPHIR_IS_EMPTY(&context))) {
- ZEPHIR_INIT_VAR(&replace);
- array_init(&replace);
- zephir_is_iterable(&context, 0, "phalcon/Support/Helper/Str/Interpolate.zep", 39);
- 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_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);
+
+
+ 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;
}
@@ -206892,13 +207075,18 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_Interpolate, __invoke)
-ZEPHIR_INIT_CLASS(Phalcon_Tag_Exception)
+ZEPHIR_INIT_CLASS(Phalcon_Config_ConfigInterface)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Tag, Exception, phalcon, tag_exception, phalcon_exception_ce, NULL, 0);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Config, ConfigInterface, phalcon, config_configinterface, phalcon_config_configinterface_method_entry);
+ zend_class_implements(phalcon_config_configinterface_ce, 1, phalcon_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);
@@ -206909,505 +207097,693 @@ ZEPHIR_INIT_CLASS(Phalcon_Tag_Exception)
-ZEPHIR_INIT_CLASS(Phalcon_Tag_Select)
+ZEPHIR_INIT_CLASS(Phalcon_Config_Exception)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Tag, Select, phalcon, tag_select, phalcon_tag_select_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Config, Exception, phalcon, config_exception, phalcon_exception_ce, NULL, 0);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Tag_Select, selectField)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Config_Adapter_Grouped)
{
- zend_bool _2$$19;
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Config\\Adapter, Grouped, phalcon, config_adapter_grouped, phalcon_config_ce, phalcon_config_adapter_grouped_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct)
+{
+ zend_bool _4$$3, _20$$11;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_1 = NULL, *_4 = NULL, *_9 = NULL, *_13 = NULL;
- zval *parameters, parameters_sub, *data = NULL, data_sub, __$null, params, name, id, value, useEmpty, code, emptyValue, emptyText, options, using, _3, _5, _0$$5, _6$$22, _7$$22, _8$$23, _10$$23, _11$$23, _12$$25, _14$$25, _15$$25;
+ zephir_fcall_cache_entry *_0 = NULL, *_5 = NULL, *_8 = NULL, *_10 = NULL, *_16 = NULL, *_17 = NULL;
+ zval defaultAdapter, _15$$9, _28$$17;
+ zval *arrayConfig_param = NULL, *defaultAdapter_param = NULL, configArray, configInstance, configName, _1, *_2, _3, _12$$3, _13$$3, _6$$5, _11$$5, _7$$6, _9$$6, _14$$9, _18$$10, _19$$10, _25$$11, _26$$11, _21$$13, _24$$13, _22$$14, _23$$14, _27$$17, _29$$18, _30$$18;
+ zval arrayConfig;
zval *this_ptr = getThis();
- ZVAL_UNDEF(¶meters_sub);
- ZVAL_UNDEF(&data_sub);
- ZVAL_NULL(&__$null);
- 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(&arrayConfig);
+ ZVAL_UNDEF(&configArray);
+ ZVAL_UNDEF(&configInstance);
+ ZVAL_UNDEF(&configName);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_0$$5);
- ZVAL_UNDEF(&_6$$22);
- ZVAL_UNDEF(&_7$$22);
- ZVAL_UNDEF(&_8$$23);
- ZVAL_UNDEF(&_10$$23);
- ZVAL_UNDEF(&_11$$23);
- ZVAL_UNDEF(&_12$$25);
- ZVAL_UNDEF(&_14$$25);
- ZVAL_UNDEF(&_15$$25);
+ ZVAL_UNDEF(&_12$$3);
+ ZVAL_UNDEF(&_13$$3);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_11$$5);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_9$$6);
+ ZVAL_UNDEF(&_14$$9);
+ 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$$18);
+ ZVAL_UNDEF(&_30$$18);
+ ZVAL_UNDEF(&defaultAdapter);
+ ZVAL_UNDEF(&_15$$9);
+ ZVAL_UNDEF(&_28$$17);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ZVAL(parameters)
+ Z_PARAM_ARRAY(arrayConfig)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(data)
+ Z_PARAM_STR(defaultAdapter)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, ¶meters, &data);
- if (!data) {
- data = &data_sub;
- data = &__$null;
- }
-
-
- 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_OBS_VAR(&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_OBS_VAR(&name);
- if (!(zephir_array_isset_string_fetch(&name, ¶ms, SL("name"), 0))) {
- zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE);
+ 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 (!(zephir_is_true(&name))) {
- zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE);
- }
+ 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_OBS_VAR(&value);
- if (!(zephir_array_isset_string_fetch(&value, ¶ms, SL("value"), 0))) {
- ZEPHIR_CALL_CE_STATIC(&value, phalcon_tag_ce, "getvalue", &_1, 0, &id, ¶ms);
- zephir_check_call_status();
+ if (EXPECTED(Z_TYPE_P(defaultAdapter_param) == IS_STRING)) {
+ zephir_get_strval(&defaultAdapter, defaultAdapter_param);
} else {
- zephir_array_unset_string(¶ms, SL("value"), PH_SEPARATE);
- }
- ZEPHIR_OBS_VAR(&useEmpty);
- if (zephir_array_isset_string_fetch(&useEmpty, ¶ms, SL("useEmpty"), 0)) {
- ZEPHIR_OBS_VAR(&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_OBS_VAR(&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_OBS_VAR(&options);
- if (!(zephir_array_isset_long_fetch(&options, ¶ms, 1, 0))) {
- ZEPHIR_CPY_WRT(&options, data);
+ ZEPHIR_INIT_VAR(&defaultAdapter);
}
- if (Z_TYPE_P(&options) == IS_OBJECT) {
- ZEPHIR_OBS_VAR(&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;
- }
- _2$$19 = Z_TYPE_P(&using) != IS_ARRAY;
- if (_2$$19) {
- _2$$19 = Z_TYPE_P(&using) != IS_OBJECT;
- }
- if (UNEXPECTED(_2$$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(&_5);
- ZVAL_STRING(&_5, "
", &_5);
- if (zephir_is_true(&useEmpty)) {
- ZEPHIR_INIT_VAR(&_6$$22);
- ZEPHIR_GET_CONSTANT(&_6$$22, "PHP_EOL");
- ZEPHIR_INIT_VAR(&_7$$22);
- ZEPHIR_CONCAT_SVSVSV(&_7$$22, "\t", &emptyText, " ", &_6$$22);
- zephir_concat_self(&code, &_7$$22);
- }
- if (Z_TYPE_P(&options) == IS_OBJECT) {
- ZEPHIR_INIT_VAR(&_10$$23);
- ZEPHIR_GET_CONSTANT(&_10$$23, "PHP_EOL");
- ZEPHIR_INIT_VAR(&_11$$23);
- ZEPHIR_CONCAT_SV(&_11$$23, "", &_10$$23);
- ZEPHIR_CALL_SELF(&_8$$23, "optionsfromresultset", &_9, 0, &options, &using, &value, &_11$$23);
- zephir_check_call_status();
- zephir_concat_self(&code, &_8$$23);
+ 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), _2)
+ {
+ ZEPHIR_INIT_NVAR(&configName);
+ ZVAL_COPY(&configName, _2);
+ ZEPHIR_CPY_WRT(&configInstance, &configName);
+ _4$$3 = Z_TYPE_P(&configName) == IS_OBJECT;
+ if (_4$$3) {
+ _4$$3 = zephir_instance_of_ev(&configName, phalcon_config_configinterface_ce);
+ }
+ if (_4$$3) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_5, 0, &configInstance);
+ zephir_check_call_status();
+ continue;
+ } else if (Z_TYPE_P(&configName) == IS_STRING) {
+ ZEPHIR_INIT_NVAR(&_6$$5);
+ ZVAL_STRING(&_6$$5, "");
+ if (ZEPHIR_IS_IDENTICAL(&_6$$5, &defaultAdapter)) {
+ ZEPHIR_INIT_NVAR(&_7$$6);
+ object_init_ex(&_7$$6, phalcon_config_configfactory_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 175);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_9$$6, &_7$$6, "load", &_10, 176, &configName);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_5, 0, &_9$$6);
+ zephir_check_call_status();
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&_11$$5);
+ zephir_create_array(&_11$$5, 2, 0);
+ zephir_array_update_string(&_11$$5, SL("filePath"), &configName, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_11$$5, SL("adapter"), &defaultAdapter, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CPY_WRT(&configInstance, &_11$$5);
+ } 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(&_12$$3, &configInstance, SL("adapter"), PH_NOISY | PH_READONLY, "phalcon/Config/Adapter/Grouped.zep", 105);
+ ZEPHIR_INIT_NVAR(&_13$$3);
+ ZVAL_STRING(&_13$$3, "array");
+ if (ZEPHIR_IS_IDENTICAL(&_13$$3, &_12$$3)) {
+ if (!(zephir_array_isset_string(&configInstance, SL("config")))) {
+ ZEPHIR_INIT_NVAR(&_14$$9);
+ object_init_ex(&_14$$9, phalcon_config_exception_ce);
+ ZEPHIR_INIT_NVAR(&_15$$9);
+ ZEPHIR_CONCAT_SS(&_15$$9, "To use 'array' adapter you have to specify ", "the 'config' as an array.");
+ ZEPHIR_CALL_METHOD(NULL, &_14$$9, "__construct", &_16, 8, &_15$$9);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_14$$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_ce);
+ ZEPHIR_CALL_METHOD(NULL, &configInstance, "__construct", &_17, 22, &configArray);
+ 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", &_8, 175);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_19$$10, &_18$$10, "load", &_10, 176, &configInstance);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&configInstance, &_19$$10);
+ }
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_5, 0, &configInstance);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
} else {
- if (Z_TYPE_P(&options) == IS_ARRAY) {
- ZEPHIR_INIT_VAR(&_14$$25);
- ZEPHIR_GET_CONSTANT(&_14$$25, "PHP_EOL");
- ZEPHIR_INIT_VAR(&_15$$25);
- ZEPHIR_CONCAT_SV(&_15$$25, "", &_14$$25);
- ZEPHIR_CALL_SELF(&_12$$25, "optionsfromarray", &_13, 0, &options, &value, &_15$$25);
+ ZEPHIR_CALL_METHOD(NULL, &arrayConfig, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3, &arrayConfig, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3)) {
+ 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", &_5, 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", &_8, 175);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_23$$14, &_22$$14, "load", &_10, 176, &configName);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_5, 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", &_16, 8, &_28$$17);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_27$$17, "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_ce);
+ ZEPHIR_CALL_METHOD(NULL, &configInstance, "__construct", &_17, 22, &configArray);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_NVAR(&_29$$18);
+ object_init_ex(&_29$$18, phalcon_config_configfactory_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_29$$18, "__construct", &_8, 175);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_30$$18, &_29$$18, "load", &_10, 176, &configInstance);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&configInstance, &_30$$18);
+ }
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_5, 0, &configInstance);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &arrayConfig, "next", NULL, 0);
zephir_check_call_status();
- zephir_concat_self(&code, &_12$$25);
}
}
- zephir_concat_self_str(&code, SL(" "));
- RETURN_CCTOR(&code);
+ ZEPHIR_INIT_NVAR(&configName);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Tag_Select, optionsFromArray)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Config_Adapter_Ini)
{
- zend_string *_3;
- zend_ulong _2;
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Config\\Adapter, Ini, phalcon, config_adapter_ini, phalcon_config_ce, phalcon_config_adapter_ini_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct)
+{
+ zend_string *_6, *_10$$6, *_23$$12;
+ zend_ulong _5, _9$$6, _22$$12;
+ zval config;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_4 = NULL, *_7 = NULL;
+ zephir_fcall_cache_entry *_13 = NULL, *_19 = NULL, *_31 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- 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 *filePath_param = NULL, *mode = NULL, mode_sub, __$true, __$null, directives, iniConfig, lastValue, path, section, sections, *_3, _4, _0$$4, _1$$4, _2$$4, *_7$$6, _8$$6, _11$$7, _14$$8, _16$$9, _17$$9, _18$$10, *_20$$12, _21$$12, _24$$13, _26$$14, _28$$15, _29$$15, _30$$16;
+ zval filePath, _12$$7, _15$$8, _25$$13, _27$$14;
zval *this_ptr = getThis();
- 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(&_5$$4);
- ZVAL_UNDEF(&_6$$4);
- ZVAL_UNDEF(&_8$$4);
- ZVAL_UNDEF(&_9$$4);
- ZVAL_UNDEF(&_10$$6);
+ ZVAL_UNDEF(&filePath);
+ ZVAL_UNDEF(&_12$$7);
+ ZVAL_UNDEF(&_15$$8);
+ ZVAL_UNDEF(&_25$$13);
+ ZVAL_UNDEF(&_27$$14);
+ ZVAL_UNDEF(&mode_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&directives);
+ ZVAL_UNDEF(&iniConfig);
+ ZVAL_UNDEF(&lastValue);
+ ZVAL_UNDEF(&path);
+ ZVAL_UNDEF(§ion);
+ ZVAL_UNDEF(§ions);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_0$$4);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_8$$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);
+ ZVAL_UNDEF(&_14$$8);
+ ZVAL_UNDEF(&_16$$9);
+ ZVAL_UNDEF(&_17$$9);
+ ZVAL_UNDEF(&_18$$10);
+ ZVAL_UNDEF(&_21$$12);
+ ZVAL_UNDEF(&_24$$13);
+ ZVAL_UNDEF(&_26$$14);
+ ZVAL_UNDEF(&_28$$15);
+ ZVAL_UNDEF(&_29$$15);
+ ZVAL_UNDEF(&_30$$16);
+ ZVAL_UNDEF(&config);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(3, 3)
- Z_PARAM_ARRAY(data)
- Z_PARAM_ZVAL(value)
- Z_PARAM_STR(closeOption)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(filePath)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(mode)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 3, 0, &data_param, &value, &closeOption_param);
- zephir_get_arrval(&data, data_param);
- zephir_get_strval(&closeOption, closeOption_param);
+ zephir_fetch_params(1, 1, 1, &filePath_param, &mode);
+ 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 (!mode) {
+ mode = &mode_sub;
+ ZEPHIR_CPY_WRT(mode, &__$null);
+ } else {
+ ZEPHIR_SEPARATE_PARAM(mode);
+ }
- 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)
+ if (EXPECTED(Z_TYPE_P(mode) == IS_NULL)) {
+ ZEPHIR_INIT_NVAR(mode);
+ ZVAL_LONG(mode, 1);
+ }
+ ZEPHIR_CALL_FUNCTION(&iniConfig, "parse_ini_file", NULL, 177, &filePath, &__$true, mode);
+ zephir_check_call_status();
+ if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&iniConfig))) {
+ ZEPHIR_INIT_VAR(&_0$$4);
+ object_init_ex(&_0$$4, phalcon_config_exception_ce);
+ ZEPHIR_INIT_VAR(&_1$$4);
+ zephir_basename(&_1$$4, &filePath);
+ ZEPHIR_INIT_VAR(&_2$$4);
+ ZEPHIR_CONCAT_SVS(&_2$$4, "Configuration file ", &_1$$4, " cannot be loaded");
+ ZEPHIR_CALL_METHOD(NULL, &_0$$4, "__construct", NULL, 8, &_2$$4);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_0$$4, "phalcon/Config/Adapter/Ini.zep", 78);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_INIT_VAR(&config);
+ array_init(&config);
+ zephir_is_iterable(&iniConfig, 0, "phalcon/Config/Adapter/Ini.zep", 105);
+ if (Z_TYPE_P(&iniConfig) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&iniConfig), _5, _6, _3)
{
- ZEPHIR_INIT_NVAR(&optionValue);
- if (_3 != NULL) {
- ZVAL_STR_COPY(&optionValue, _3);
+ ZEPHIR_INIT_NVAR(§ion);
+ if (_6 != NULL) {
+ ZVAL_STR_COPY(§ion, _6);
} else {
- ZVAL_LONG(&optionValue, _2);
- }
- ZEPHIR_INIT_NVAR(&optionText);
- ZVAL_COPY(&optionText, _0);
- ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 224, &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
", &_5$$4, &_6$$4, "\t ", &_8$$4);
- zephir_concat_self(&code, &_9$$4);
- continue;
+ ZVAL_LONG(§ion, _5);
}
- 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
", &optionText, &closeOption);
- zephir_concat_self(&code, &_10$$6);
+ ZEPHIR_INIT_NVAR(&directives);
+ ZVAL_COPY(&directives, _3);
+ if (Z_TYPE_P(&directives) == IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(§ions);
+ array_init(§ions);
+ zephir_is_iterable(&directives, 0, "phalcon/Config/Adapter/Ini.zep", 94);
+ if (Z_TYPE_P(&directives) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&directives), _9$$6, _10$$6, _7$$6)
+ {
+ ZEPHIR_INIT_NVAR(&path);
+ if (_10$$6 != NULL) {
+ ZVAL_STR_COPY(&path, _10$$6);
+ } else {
+ ZVAL_LONG(&path, _9$$6);
+ }
+ ZEPHIR_INIT_NVAR(&lastValue);
+ ZVAL_COPY(&lastValue, _7$$6);
+ zephir_cast_to_string(&_12$$7, &path);
+ ZEPHIR_CALL_METHOD(&_11$$7, this_ptr, "parseinistring", &_13, 0, &_12$$7, &lastValue);
+ zephir_check_call_status();
+ zephir_array_append(§ions, &_11$$7, PH_SEPARATE, "phalcon/Config/Adapter/Ini.zep", 91);
+ } ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_INIT_NVAR(&_11$$7);
- ZEPHIR_CONCAT_SVSVV(&_11$$7, "\t ", &optionText, &closeOption);
- zephir_concat_self(&code, &_11$$7);
+ ZEPHIR_CALL_METHOD(NULL, &directives, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_8$$6, &directives, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_8$$6)) {
+ 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(&_15$$8, &path);
+ ZEPHIR_CALL_METHOD(&_14$$8, this_ptr, "parseinistring", &_13, 0, &_15$$8, &lastValue);
+ zephir_check_call_status();
+ zephir_array_append(§ions, &_14$$8, PH_SEPARATE, "phalcon/Config/Adapter/Ini.zep", 91);
+ ZEPHIR_CALL_METHOD(NULL, &directives, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- } else {
- zephir_cast_to_string(&_12$$8, &optionValue);
- ZEPHIR_CPY_WRT(&strOptionValue, &_12$$8);
- zephir_cast_to_string(&_13$$8, value);
- ZEPHIR_CPY_WRT(&strValue, &_13$$8);
- if (ZEPHIR_IS_IDENTICAL(&strOptionValue, &strValue)) {
- ZEPHIR_INIT_NVAR(&_14$$9);
- ZEPHIR_CONCAT_SVSVV(&_14$$9, "\t ", &optionText, &closeOption);
- zephir_concat_self(&code, &_14$$9);
- } else {
- ZEPHIR_INIT_NVAR(&_15$$10);
- ZEPHIR_CONCAT_SVSVV(&_15$$10, "\t ", &optionText, &closeOption);
- zephir_concat_self(&code, &_15$$10);
+ ZEPHIR_INIT_NVAR(&lastValue);
+ ZEPHIR_INIT_NVAR(&path);
+ if (zephir_fast_count_int(§ions)) {
+ ZEPHIR_INIT_NVAR(&_16$$9);
+ ZEPHIR_INIT_NVAR(&_17$$9);
+ ZVAL_STRING(&_17$$9, "array_replace_recursive");
+ ZEPHIR_CALL_USER_FUNC_ARRAY(&_16$$9, &_17$$9, §ions);
+ zephir_check_call_status();
+ zephir_array_update_zval(&config, §ion, &_16$$9, PH_COPY | PH_SEPARATE);
}
+ } else {
+ ZEPHIR_CALL_METHOD(&_18$$10, this_ptr, "cast", &_19, 0, &directives);
+ zephir_check_call_status();
+ zephir_array_update_zval(&config, §ion, &_18$$10, PH_COPY | PH_SEPARATE);
}
} ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_CALL_METHOD(NULL, &data, "rewind", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &iniConfig, "rewind", NULL, 0);
zephir_check_call_status();
while (1) {
- ZEPHIR_CALL_METHOD(&_1, &data, "valid", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_4, &iniConfig, "valid", NULL, 0);
zephir_check_call_status();
- if (!zend_is_true(&_1)) {
+ if (!zend_is_true(&_4)) {
break;
}
- ZEPHIR_CALL_METHOD(&optionValue, &data, "key", NULL, 0);
+ ZEPHIR_CALL_METHOD(§ion, &iniConfig, "key", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&optionText, &data, "current", NULL, 0);
+ ZEPHIR_CALL_METHOD(&directives, &iniConfig, "current", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 224, &optionValue);
- zephir_check_call_status();
- if (Z_TYPE_P(&optionText) == IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&_16$$12);
- ZEPHIR_GET_CONSTANT(&_16$$12, "PHP_EOL");
- ZEPHIR_CALL_SELF(&_17$$12, "optionsfromarray", &_7, 0, &optionText, value, &closeOption);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_18$$12);
- ZEPHIR_GET_CONSTANT(&_18$$12, "PHP_EOL");
- ZEPHIR_INIT_NVAR(&_19$$12);
- ZEPHIR_CONCAT_SVSVVSV(&_19$$12, "\t ", &_16$$12, &_17$$12, "\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
", &optionText, &closeOption);
- zephir_concat_self(&code, &_20$$14);
+ if (Z_TYPE_P(&directives) == IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(§ions);
+ array_init(§ions);
+ zephir_is_iterable(&directives, 0, "phalcon/Config/Adapter/Ini.zep", 94);
+ if (Z_TYPE_P(&directives) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&directives), _22$$12, _23$$12, _20$$12)
+ {
+ ZEPHIR_INIT_NVAR(&path);
+ if (_23$$12 != NULL) {
+ ZVAL_STR_COPY(&path, _23$$12);
+ } else {
+ ZVAL_LONG(&path, _22$$12);
+ }
+ ZEPHIR_INIT_NVAR(&lastValue);
+ ZVAL_COPY(&lastValue, _20$$12);
+ zephir_cast_to_string(&_25$$13, &path);
+ ZEPHIR_CALL_METHOD(&_24$$13, this_ptr, "parseinistring", &_13, 0, &_25$$13, &lastValue);
+ zephir_check_call_status();
+ zephir_array_append(§ions, &_24$$13, PH_SEPARATE, "phalcon/Config/Adapter/Ini.zep", 91);
+ } ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_INIT_NVAR(&_21$$15);
- ZEPHIR_CONCAT_SVSVV(&_21$$15, "\t ", &optionText, &closeOption);
- zephir_concat_self(&code, &_21$$15);
+ ZEPHIR_CALL_METHOD(NULL, &directives, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_21$$12, &directives, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_21$$12)) {
+ 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(&_27$$14, &path);
+ ZEPHIR_CALL_METHOD(&_26$$14, this_ptr, "parseinistring", &_13, 0, &_27$$14, &lastValue);
+ zephir_check_call_status();
+ zephir_array_append(§ions, &_26$$14, PH_SEPARATE, "phalcon/Config/Adapter/Ini.zep", 91);
+ ZEPHIR_CALL_METHOD(NULL, &directives, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- } else {
- zephir_cast_to_string(&_22$$16, &optionValue);
- ZEPHIR_CPY_WRT(&strOptionValue, &_22$$16);
- zephir_cast_to_string(&_23$$16, value);
- ZEPHIR_CPY_WRT(&strValue, &_23$$16);
- if (ZEPHIR_IS_IDENTICAL(&strOptionValue, &strValue)) {
- ZEPHIR_INIT_NVAR(&_24$$17);
- ZEPHIR_CONCAT_SVSVV(&_24$$17, "\t ", &optionText, &closeOption);
- zephir_concat_self(&code, &_24$$17);
- } else {
- ZEPHIR_INIT_NVAR(&_25$$18);
- ZEPHIR_CONCAT_SVSVV(&_25$$18, "\t ", &optionText, &closeOption);
- zephir_concat_self(&code, &_25$$18);
+ ZEPHIR_INIT_NVAR(&lastValue);
+ ZEPHIR_INIT_NVAR(&path);
+ if (zephir_fast_count_int(§ions)) {
+ ZEPHIR_INIT_NVAR(&_28$$15);
+ ZEPHIR_INIT_NVAR(&_29$$15);
+ ZVAL_STRING(&_29$$15, "array_replace_recursive");
+ ZEPHIR_CALL_USER_FUNC_ARRAY(&_28$$15, &_29$$15, §ions);
+ zephir_check_call_status();
+ zephir_array_update_zval(&config, §ion, &_28$$15, PH_COPY | PH_SEPARATE);
}
+ } else {
+ ZEPHIR_CALL_METHOD(&_30$$16, this_ptr, "cast", &_19, 0, &directives);
+ zephir_check_call_status();
+ zephir_array_update_zval(&config, §ion, &_30$$16, PH_COPY | PH_SEPARATE);
}
- ZEPHIR_CALL_METHOD(NULL, &data, "next", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &iniConfig, "next", NULL, 0);
zephir_check_call_status();
}
}
- ZEPHIR_INIT_NVAR(&optionText);
- ZEPHIR_INIT_NVAR(&optionValue);
- RETURN_CCTOR(&code);
+ ZEPHIR_INIT_NVAR(&directives);
+ ZEPHIR_INIT_NVAR(§ion);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_ini_ce, getThis(), "__construct", &_31, 0, &config);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Tag_Select, optionsFromResultset)
+static PHP_METHOD(Phalcon_Config_Adapter_Ini, cast)
{
- zend_object_iterator *_2;
+ zend_string *_3$$3;
+ zend_ulong _2$$3;
+ zend_bool _8;
+ zval _7;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_5 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_1 = NULL, *_4 = NULL, *_5 = NULL;
- zval closeOption, _8$$15, _9$$15;
- zval *resultset, resultset_sub, *using, using_sub, *value, value_sub, *closeOption_param = NULL, code, params, option, usingZero, usingOne, escaper, optionValue, optionText, strValue, strOptionValue, _0, _3$$6, _6$$13, _7$$14, _10$$16, _11$$17, _12$$19;
+ zval *ini = NULL, ini_sub, key, lowerIni, value, *_0$$3, _1$$3, _4$$4, _6$$5, _9$$9, _10$$9, _11$$9, _12$$9;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&resultset_sub);
- ZVAL_UNDEF(&using_sub);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&code);
- ZVAL_UNDEF(¶ms);
- ZVAL_UNDEF(&option);
- ZVAL_UNDEF(&usingZero);
- ZVAL_UNDEF(&usingOne);
- ZVAL_UNDEF(&escaper);
- ZVAL_UNDEF(&optionValue);
- ZVAL_UNDEF(&optionText);
- ZVAL_UNDEF(&strValue);
- ZVAL_UNDEF(&strOptionValue);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_3$$6);
- ZVAL_UNDEF(&_6$$13);
- ZVAL_UNDEF(&_7$$14);
- ZVAL_UNDEF(&_10$$16);
- ZVAL_UNDEF(&_11$$17);
- ZVAL_UNDEF(&_12$$19);
- ZVAL_UNDEF(&closeOption);
- ZVAL_UNDEF(&_8$$15);
- ZVAL_UNDEF(&_9$$15);
+ ZVAL_UNDEF(&ini_sub);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&lowerIni);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_9$$9);
+ ZVAL_UNDEF(&_10$$9);
+ ZVAL_UNDEF(&_11$$9);
+ ZVAL_UNDEF(&_12$$9);
+ ZVAL_UNDEF(&_7);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(4, 4)
- Z_PARAM_OBJECT_OF_CLASS(resultset, phalcon_mvc_model_resultsetinterface_ce)
- Z_PARAM_ZVAL(using)
- Z_PARAM_ZVAL(value)
- Z_PARAM_STR(closeOption)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(ini)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 4, 0, &resultset, &using, &value, &closeOption_param);
- zephir_get_strval(&closeOption, closeOption_param);
+ zephir_fetch_params(1, 1, 0, &ini);
+ ZEPHIR_SEPARATE_PARAM(ini);
- ZEPHIR_INIT_VAR(&code);
- ZVAL_STRING(&code, "");
- ZEPHIR_INIT_VAR(¶ms);
- ZVAL_NULL(¶ms);
- if (Z_TYPE_P(using) == IS_ARRAY) {
- if (UNEXPECTED(zephir_fast_count_int(using) != 2)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "Parameter 'using' requires two values", "phalcon/Tag/Select.zep", 209);
- return;
- }
- ZEPHIR_OBS_VAR(&usingZero);
- zephir_array_fetch_long(&usingZero, using, 0, PH_NOISY, "phalcon/Tag/Select.zep", 212);
- ZEPHIR_OBS_VAR(&usingOne);
- zephir_array_fetch_long(&usingOne, using, 1, PH_NOISY, "phalcon/Tag/Select.zep", 213);
- }
- ZEPHIR_CALL_CE_STATIC(&_0, phalcon_tag_ce, "getescaperservice", &_1, 0);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&escaper, &_0);
- _2 = zephir_get_iterator(resultset);
- _2->funcs->rewind(_2);
- for (;_2->funcs->valid(_2) == SUCCESS && !EG(exception); _2->funcs->move_forward(_2)) {
- {
- ZEPHIR_ITERATOR_COPY(&option, _2);
- }
- if (Z_TYPE_P(using) == IS_ARRAY) {
- if (Z_TYPE_P(&option) == IS_OBJECT) {
- if ((zephir_method_exists_ex(&option, ZEND_STRL("readattribute")) == SUCCESS)) {
- ZEPHIR_CALL_METHOD(&optionValue, &option, "readattribute", NULL, 0, &usingZero);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&optionText, &option, "readattribute", NULL, 0, &usingOne);
- zephir_check_call_status();
- } else {
- ZEPHIR_OBS_NVAR(&optionValue);
- zephir_read_property(&optionValue, &option, ZEND_STRL("usingZero"), PH_NOISY_CC);
- ZEPHIR_OBS_NVAR(&optionText);
- zephir_read_property(&optionText, &option, ZEND_STRL("usingOne"), PH_NOISY_CC);
- }
- } else {
- if (UNEXPECTED(Z_TYPE_P(&option) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "Resultset returned an invalid value", "phalcon/Tag/Select.zep", 232);
- return;
- }
- ZEPHIR_OBS_NVAR(&optionValue);
- zephir_array_fetch(&optionValue, &option, &usingZero, PH_NOISY, "phalcon/Tag/Select.zep", 235);
- ZEPHIR_OBS_NVAR(&optionText);
- zephir_array_fetch(&optionText, &option, &usingOne, PH_NOISY, "phalcon/Tag/Select.zep", 236);
- }
- ZEPHIR_CALL_METHOD(&_3$$6, &escaper, "escapehtmlattr", &_4, 0, &optionValue);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&optionValue, &_3$$6);
- ZEPHIR_CALL_METHOD(&_3$$6, &escaper, "escapehtml", &_5, 0, &optionText);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&optionText, &_3$$6);
- if (Z_TYPE_P(value) == IS_ARRAY) {
- if (zephir_fast_in_array(&optionValue, value)) {
- ZEPHIR_INIT_NVAR(&_6$$13);
- ZEPHIR_CONCAT_SVSVV(&_6$$13, "\t ", &optionText, &closeOption);
- zephir_concat_self(&code, &_6$$13);
- } else {
- ZEPHIR_INIT_NVAR(&_7$$14);
- ZEPHIR_CONCAT_SVSVV(&_7$$14, "\t ", &optionText, &closeOption);
- zephir_concat_self(&code, &_7$$14);
- }
- } else {
- zephir_cast_to_string(&_8$$15, &optionValue);
- ZEPHIR_CPY_WRT(&strOptionValue, &_8$$15);
- zephir_cast_to_string(&_9$$15, value);
- ZEPHIR_CPY_WRT(&strValue, &_9$$15);
- if (ZEPHIR_IS_IDENTICAL(&strOptionValue, &strValue)) {
- ZEPHIR_INIT_NVAR(&_10$$16);
- ZEPHIR_CONCAT_SVSVV(&_10$$16, "\t ", &optionText, &closeOption);
- zephir_concat_self(&code, &_10$$16);
+ if (Z_TYPE_P(ini) == IS_ARRAY) {
+ zephir_is_iterable(ini, 1, "phalcon/Config/Adapter/Ini.zep", 121);
+ if (Z_TYPE_P(ini) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(ini), _2$$3, _3$$3, _0$$3)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ if (_3$$3 != NULL) {
+ ZVAL_STR_COPY(&key, _3$$3);
} else {
- ZEPHIR_INIT_NVAR(&_11$$17);
- ZEPHIR_CONCAT_SVSVV(&_11$$17, "\t ", &optionText, &closeOption);
- zephir_concat_self(&code, &_11$$17);
+ ZVAL_LONG(&key, _2$$3);
}
- }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _0$$3);
+ ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "cast", &_5, 178, &value);
+ zephir_check_call_status();
+ zephir_array_update_zval(ini, &key, &_4$$4, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
} else {
- if (Z_TYPE_P(using) == IS_OBJECT) {
- if (Z_TYPE_P(¶ms) == IS_NULL) {
- ZEPHIR_INIT_NVAR(¶ms);
- array_init(¶ms);
+ ZEPHIR_CALL_METHOD(NULL, ini, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1$$3, ini, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1$$3)) {
+ break;
}
- zephir_array_update_long(¶ms, 0, &option, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
- ZEPHIR_INIT_NVAR(&_12$$19);
- ZEPHIR_CALL_USER_FUNC_ARRAY(&_12$$19, using, ¶ms);
+ 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$$5, this_ptr, "cast", &_5, 178, &value);
+ zephir_check_call_status();
+ zephir_array_update_zval(ini, &key, &_6$$5, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, ini, "next", NULL, 0);
zephir_check_call_status();
- zephir_concat_self(&code, &_12$$19);
}
}
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&key);
+ RETVAL_ZVAL(ini, 1, 0);
+ RETURN_MM();
}
- zend_iterator_dtor(_2);
- RETURN_CCTOR(&code);
-}
-
+ zephir_cast_to_string(&_7, ini);
+ ZEPHIR_CPY_WRT(ini, &_7);
+ ZEPHIR_INIT_VAR(&lowerIni);
+ zephir_fast_strtolower(&lowerIni, ini);
+ do {
+ if (ZEPHIR_IS_STRING(&lowerIni, "true") || ZEPHIR_IS_STRING(&lowerIni, "yes") || ZEPHIR_IS_STRING(&lowerIni, "on")) {
+ RETURN_MM_BOOL(1);
+ }
+ if (ZEPHIR_IS_STRING(&lowerIni, "false") || ZEPHIR_IS_STRING(&lowerIni, "no") || ZEPHIR_IS_STRING(&lowerIni, "off")) {
+ RETURN_MM_BOOL(0);
+ }
+ if (ZEPHIR_IS_STRING(&lowerIni, "null")) {
+ RETURN_MM_NULL();
+ }
+ } while(0);
+ _8 = Z_TYPE_P(ini) == IS_STRING;
+ if (_8) {
+ _8 = zephir_is_numeric(ini);
+ }
+ if (_8) {
+ ZEPHIR_INIT_VAR(&_9$$9);
+ ZEPHIR_INIT_VAR(&_10$$9);
+ ZVAL_STRING(&_10$$9, "/[.]+/");
+ ZEPHIR_INIT_VAR(&_11$$9);
+ ZEPHIR_INIT_VAR(&_12$$9);
+ ZVAL_STRING(&_12$$9, "/[.]+/");
+ zephir_preg_match(&_11$$9, &_12$$9, ini, &_9$$9, 0, 0 , 0 );
+ if (zephir_is_true(&_11$$9)) {
+ RETURN_MM_DOUBLE(zephir_get_doubleval(ini));
+ } else {
+ RETURN_MM_LONG(zephir_get_intval(ini));
+ }
+ }
+ RETVAL_ZVAL(ini, 1, 0);
+ RETURN_MM();
+}
+static PHP_METHOD(Phalcon_Config_Adapter_Ini, parseIniString)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *path_param = NULL, *value = NULL, value_sub, key, position, _0, _1, _2, _3, _4;
+ zval path;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&path);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&position);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(path)
+ Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &path_param, &value);
+ 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(path_param) == IS_STRING)) {
+ zephir_get_strval(&path, path_param);
+ } else {
+ ZEPHIR_INIT_VAR(&path);
+ }
+ ZEPHIR_SEPARATE_PARAM(value);
-
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Exception)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Translate, Exception, phalcon, translate_exception, phalcon_exception_ce, NULL, 0);
-
- return SUCCESS;
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "cast", NULL, 0, value);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(value, &_0);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, ".");
+ ZEPHIR_INIT_VAR(&position);
+ zephir_fast_strpos(&position, &path, &_1, 0 );
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&position)) {
+ zephir_create_array(return_value, 1, 0);
+ zephir_array_update_zval(return_value, &path, value, PH_COPY);
+ RETURN_MM();
+ }
+ ZVAL_LONG(&_2, 0);
+ ZEPHIR_INIT_VAR(&key);
+ zephir_substr(&key, &path, 0 , zephir_get_intval(&position), 0);
+ ZVAL_LONG(&_3, (zephir_get_numberval(&position) + 1));
+ ZEPHIR_INIT_VAR(&_4);
+ zephir_substr(&_4, &path, zephir_get_intval(&_3), 0, ZEPHIR_SUBSTR_NO_LENGTH);
+ zephir_get_strval(&path, &_4);
+ zephir_create_array(return_value, 1, 0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "parseinistring", NULL, 179, &path, value);
+ zephir_check_call_status();
+ zephir_array_update_zval(return_value, &key, &_0, PH_COPY);
+ RETURN_MM();
}
@@ -207420,95 +207796,113 @@ ZEPHIR_INIT_CLASS(Phalcon_Translate_Exception)
-ZEPHIR_INIT_CLASS(Phalcon_Translate_InterpolatorFactory)
+ZEPHIR_INIT_CLASS(Phalcon_Config_Adapter_Json)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Translate, InterpolatorFactory, phalcon, translate_interpolatorfactory, phalcon_factory_abstractfactory_ce, phalcon_translate_interpolatorfactory_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Config\\Adapter, Json, phalcon, config_adapter_json, phalcon_config_ce, phalcon_config_adapter_json_method_entry, 0);
- zend_declare_property_string(phalcon_translate_interpolatorfactory_ce, SL("exception"), "Phalcon\\Translate\\Exception", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Translate_InterpolatorFactory, __construct)
+static PHP_METHOD(Phalcon_Config_Adapter_Json, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *services_param = NULL;
- zval services;
+ zephir_fcall_cache_entry *_0 = NULL, *_2 = NULL;
+ zval *filePath_param = NULL, _1, _3, _4;
+ zval filePath;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&services);
+ ZVAL_UNDEF(&filePath);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(services)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(filePath)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &services_param);
- if (!services_param) {
- ZEPHIR_INIT_VAR(&services);
- array_init(&services);
+ 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_OBS_COPY_OR_DUP(&services, services_param);
+ ZEPHIR_INIT_VAR(&filePath);
}
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
+ ZEPHIR_INIT_VAR(&_3);
+ zephir_file_get_contents(&_3, &filePath);
+ ZVAL_BOOL(&_4, 1);
+ ZEPHIR_CALL_CE_STATIC(&_1, phalcon_helper_json_ce, "decode", &_2, 180, &_3, &_4);
+ zephir_check_call_status();
+ ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_json_ce, getThis(), "__construct", &_0, 0, &_1);
zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Translate_InterpolatorFactory, newInstance)
+
+
+
+#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_ce, phalcon_config_adapter_php_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Config_Adapter_Php, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, definition;
- zval name;
+ zephir_fcall_cache_entry *_0 = NULL;
+ zval *filePath_param = NULL, _1;
+ zval filePath;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&filePath);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ Z_PARAM_STR(filePath)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, &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(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+ if (EXPECTED(Z_TYPE_P(filePath_param) == IS_STRING)) {
+ zephir_get_strval(&filePath, filePath_param);
} else {
- ZEPHIR_INIT_VAR(&name);
+ ZEPHIR_INIT_VAR(&filePath);
}
- 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_OBSERVE_OR_NULLIFY_PPZV(&_1);
+ if (zephir_require_zval_ret(&_1, &filePath) == FAILURE) {
+ RETURN_MM_NULL();
+ }
+ ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_php_ce, getThis(), "__construct", &_0, 0, &_1);
zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Translate_InterpolatorFactory, getAdapters)
-{
- zval *this_ptr = getThis();
-
-
-
- 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;
+ ZEPHIR_MM_RESTORE();
}
@@ -207521,733 +207915,1074 @@ static PHP_METHOD(Phalcon_Translate_InterpolatorFactory, getAdapters)
-ZEPHIR_INIT_CLASS(Phalcon_Translate_TranslateFactory)
+ZEPHIR_INIT_CLASS(Phalcon_Config_Adapter_Yaml)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Translate, TranslateFactory, phalcon, translate_translatefactory, phalcon_factory_abstractfactory_ce, phalcon_translate_translatefactory_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Config\\Adapter, Yaml, phalcon, config_adapter_yaml, phalcon_config_ce, phalcon_config_adapter_yaml_method_entry, 0);
- zend_declare_property_string(phalcon_translate_translatefactory_ce, SL("exception"), "Phalcon\\Translate\\Exception", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_translate_translatefactory_ce, SL("interpolator"), ZEND_ACC_PRIVATE);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Translate_TranslateFactory, __construct)
+static PHP_METHOD(Phalcon_Config_Adapter_Yaml, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval services;
- zval *interpolator, interpolator_sub, *services_param = NULL;
+ zephir_fcall_cache_entry *_7 = 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();
- ZVAL_UNDEF(&interpolator_sub);
- ZVAL_UNDEF(&services);
+ 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);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
+ Z_PARAM_STR(filePath)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(services)
+ Z_PARAM_ARRAY_OR_NULL(callbacks)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 1, &interpolator, &services_param);
- if (!services_param) {
- ZEPHIR_INIT_VAR(&services);
- array_init(&services);
+ 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_OBS_COPY_OR_DUP(&services, services_param);
+ ZEPHIR_INIT_VAR(&filePath);
+ }
+ if (!callbacks_param) {
+ ZEPHIR_INIT_VAR(&callbacks);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&callbacks, callbacks_param);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("interpolator"), interpolator);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
+ ndocs = 0;
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "yaml");
+ ZEPHIR_CALL_FUNCTION(&_1, "extension_loaded", NULL, 181, &_0);
+ zephir_check_call_status();
+ if (UNEXPECTED(!zephir_is_true(&_1))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_config_exception_ce, "Yaml extension not loaded", "phalcon/Config/Adapter/Yaml.zep", 64);
+ return;
+ }
+ if (ZEPHIR_IS_EMPTY(&callbacks)) {
+ ZEPHIR_CALL_FUNCTION(&yamlConfig, "yaml_parse_file", NULL, 182, &filePath);
+ zephir_check_call_status();
+ } else {
+ ZVAL_LONG(&_2$$5, 0);
+ ZVAL_LONG(&_3$$5, ndocs);
+ ZEPHIR_MAKE_REF(&_3$$5);
+ ZEPHIR_CALL_FUNCTION(&yamlConfig, "yaml_parse_file", NULL, 182, &filePath, &_2$$5, &_3$$5, &callbacks);
+ ZEPHIR_UNREF(&_3$$5);
+ 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, 8, &_6$$6);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_4$$6, "phalcon/Config/Adapter/Yaml.zep", 76);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_yaml_ce, getThis(), "__construct", &_7, 0, &yamlConfig);
zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Translate_TranslateFactory, load)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Events_Event)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Events, Event, phalcon, events_event, phalcon_events_event_method_entry, 0);
+
+ zend_declare_property_null(phalcon_events_event_ce, SL("cancelable"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_events_event_ce, SL("data"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_events_event_ce, SL("source"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_events_event_ce, SL("stopped"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_events_event_ce, SL("type"), ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_events_event_ce, 1, phalcon_events_eventinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Events_Event, getData)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_1 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *config = NULL, config_sub, name, options, _0, _2, _3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&config_sub);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(config)
- ZEND_PARSE_PARAMETERS_END();
-#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &config);
- ZEPHIR_SEPARATE_PARAM(config);
+ RETURN_MEMBER(getThis(), "data");
+}
+static PHP_METHOD(Phalcon_Events_Event, getSource)
+{
+ zval *this_ptr = getThis();
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkconfig", NULL, 0, config);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(config, &_0);
- ZEPHIR_OBS_VAR(&name);
- zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Translate/TranslateFactory.zep", 59);
- ZEPHIR_INIT_VAR(&_2);
- array_init(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "options");
- ZEPHIR_CALL_CE_STATIC(&options, phalcon_helper_arr_ce, "get", &_1, 16, config, &_3, &_2);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &options);
- zephir_check_call_status();
- RETURN_MM();
+
+
+ RETURN_MEMBER(getThis(), "source");
}
-static PHP_METHOD(Phalcon_Translate_TranslateFactory, newInstance)
+static PHP_METHOD(Phalcon_Events_Event, getType)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "type");
+}
+
+static PHP_METHOD(Phalcon_Events_Event, __construct)
{
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;
+ zend_bool cancelable;
+ zval *type_param = NULL, *source, source_sub, *data = NULL, data_sub, *cancelable_param = NULL, __$true, __$false, __$null, _0$$3, _1$$3, _2$$3;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&definition);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&source_sub);
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_START(2, 4)
+ Z_PARAM_STR(type)
+ Z_PARAM_OBJECT(source)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_ZVAL_OR_NULL(data)
+ Z_PARAM_BOOL(cancelable)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ zephir_fetch_params(1, 2, 2, &type_param, &source, &data, &cancelable_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(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+ if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) {
+ zephir_get_strval(&type, type_param);
} else {
- ZEPHIR_INIT_VAR(&name);
+ ZEPHIR_INIT_VAR(&type);
}
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ if (!data) {
+ data = &data_sub;
+ data = &__$null;
+ }
+ if (!cancelable_param) {
+ cancelable = 1;
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ cancelable = zephir_get_boolval(cancelable_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_OBS_VAR(&_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_check_call_status();
- RETURN_MM();
+ if (UNEXPECTED(Z_TYPE_P(source) != IS_OBJECT)) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ object_init_ex(&_0$$3, phalcon_events_exception_ce);
+ ZEPHIR_INIT_VAR(&_1$$3);
+ zephir_gettype(&_1$$3, source);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_SVSV(&_2$$3, "The source of ", &type, " event must be an object, got ", &_1$$3);
+ ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 8, &_2$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_0$$3, "phalcon/Events/Event.zep", 75);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &type);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("source"), source);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
+ if (cancelable) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("cancelable"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("cancelable"), &__$false);
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Translate_TranslateFactory, getAdapters)
+static PHP_METHOD(Phalcon_Events_Event, isCancelable)
{
zval *this_ptr = getThis();
- 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;
+ RETURN_MEMBER(getThis(), "cancelable");
}
+static PHP_METHOD(Phalcon_Events_Event, isStopped)
+{
+ zval *this_ptr = getThis();
-#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;
+ RETURN_MEMBER(getThis(), "stopped");
}
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, __construct)
+static PHP_METHOD(Phalcon_Events_Event, setData)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_1 = NULL;
- zval options;
- zval *interpolator, interpolator_sub, *options_param = NULL, _0, _2, _3;
+ zval *data = NULL, data_sub, __$null;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&interpolator_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_NULL(&__$null);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
- Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(data)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &interpolator, &options_param);
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_fetch_params_without_memory_grow(0, 1, &data);
+ if (!data) {
+ data = &data_sub;
+ data = &__$null;
+ }
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "defaultInterpolator");
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "associativeArray");
- ZEPHIR_CALL_CE_STATIC(&_0, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultInterpolator"), &_0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("interpolatorFactory"), interpolator);
- ZEPHIR_MM_RESTORE();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, _)
+static PHP_METHOD(Phalcon_Events_Event, setType)
{
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 *type_param = NULL;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&translateKey);
- ZVAL_UNDEF(&placeholders);
+ ZVAL_UNDEF(&type);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translateKey)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(type)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ 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(translateKey_param) == IS_STRING)) {
- zephir_get_strval(&translateKey, translateKey_param);
+ if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) {
+ zephir_get_strval(&type, type_param);
} else {
- ZEPHIR_INIT_VAR(&translateKey);
+ ZEPHIR_INIT_VAR(&type);
}
- if (!placeholders_param) {
- ZEPHIR_INIT_VAR(&placeholders);
- array_init(&placeholders);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &type);
+ RETURN_THIS();
+}
+
+static PHP_METHOD(Phalcon_Events_Event, stop)
+{
+ zval __$true, __$false, _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&_0);
+
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("cancelable"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(!zephir_is_true(&_0))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_events_exception_ce, "Trying to cancel a non-cancelable event", "phalcon/Events/Event.zep", 137);
+ return;
+ }
+ if (1) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("stopped"), &__$true);
} else {
- zephir_get_arrval(&placeholders, placeholders_param);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("stopped"), &__$false);
}
+ RETURN_THISW();
+}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "query", NULL, 0, &translateKey, &placeholders);
- zephir_check_call_status();
- RETURN_MM();
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Events_EventInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Events, EventInterface, phalcon, events_eventinterface, phalcon_events_eventinterface_method_entry);
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, offsetExists)
+ZEPHIR_DOC_METHOD(Phalcon_Events_EventInterface, getData);
+ZEPHIR_DOC_METHOD(Phalcon_Events_EventInterface, getType);
+ZEPHIR_DOC_METHOD(Phalcon_Events_EventInterface, isCancelable);
+ZEPHIR_DOC_METHOD(Phalcon_Events_EventInterface, isStopped);
+ZEPHIR_DOC_METHOD(Phalcon_Events_EventInterface, setData);
+ZEPHIR_DOC_METHOD(Phalcon_Events_EventInterface, setType);
+ZEPHIR_DOC_METHOD(Phalcon_Events_EventInterface, stop);
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Events_EventsAwareInterface)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *translateKey, translateKey_sub;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Events, EventsAwareInterface, phalcon, events_eventsawareinterface, phalcon_events_eventsawareinterface_method_entry);
- ZVAL_UNDEF(&translateKey_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(translateKey)
- ZEND_PARSE_PARAMETERS_END();
+ return SUCCESS;
+}
+
+ZEPHIR_DOC_METHOD(Phalcon_Events_EventsAwareInterface, getEventsManager);
+ZEPHIR_DOC_METHOD(Phalcon_Events_EventsAwareInterface, setEventsManager);
+
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &translateKey);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "exists", NULL, 0, translateKey);
- zephir_check_call_status();
- RETURN_MM();
+
+ZEPHIR_INIT_CLASS(Phalcon_Events_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Events, Exception, phalcon, events_exception, phalcon_exception_ce, NULL, 0);
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, offsetGet)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Events_Manager)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Events, Manager, phalcon, events_manager, phalcon_events_manager_method_entry, 0);
+
+ zend_declare_property_bool(phalcon_events_manager_ce, SL("collect"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_events_manager_ce, SL("enablePriorities"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_events_manager_ce, SL("events"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_events_manager_ce, SL("responses"), ZEND_ACC_PROTECTED);
+ phalcon_events_manager_ce->create_object = zephir_init_properties_Phalcon_Events_Manager;
+ zephir_declare_class_constant_long(phalcon_events_manager_ce, SL("DEFAULT_PRIORITY"), 100);
+
+ zend_class_implements(phalcon_events_manager_ce, 1, phalcon_events_managerinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Events_Manager, attach)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *translateKey, translateKey_sub;
+ zend_long priority, ZEPHIR_LAST_CALL_STATUS;
+ zval *eventType_param = NULL, *handler, handler_sub, *priority_param = NULL, priorityQueue, _0, _1, _3, _4, _2$$4;
+ zval eventType;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&translateKey_sub);
+ ZVAL_UNDEF(&eventType);
+ ZVAL_UNDEF(&handler_sub);
+ ZVAL_UNDEF(&priorityQueue);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_2$$4);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(translateKey)
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(eventType)
+ Z_PARAM_ZVAL(handler)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(priority)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &translateKey);
+ zephir_fetch_params(1, 2, 1, &eventType_param, &handler, &priority_param);
+ if (UNEXPECTED(Z_TYPE_P(eventType_param) != IS_STRING && Z_TYPE_P(eventType_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventType' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(eventType_param) == IS_STRING)) {
+ zephir_get_strval(&eventType, eventType_param);
+ } else {
+ ZEPHIR_INIT_VAR(&eventType);
+ }
+ if (!priority_param) {
+ priority = 100;
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(priority_param) != IS_LONG)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'priority' must be of the type int"));
+ RETURN_MM_NULL();
+ }
+ priority = Z_LVAL_P(priority_param);
+ }
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "query", NULL, 0, translateKey);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "isvalidhandler", NULL, 0, handler);
+ zephir_check_call_status();
+ if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&_0))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "Event handler must be an Object or Callable", "phalcon/Events/Manager.zep", 58);
+ return;
+ }
+ ZEPHIR_OBS_VAR(&priorityQueue);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("events"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&priorityQueue, &_1, &eventType, 0))) {
+ ZEPHIR_INIT_NVAR(&priorityQueue);
+ object_init_ex(&priorityQueue, spl_ce_SplPriorityQueue);
+ if (zephir_has_constructor(&priorityQueue)) {
+ ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "__construct", NULL, 0);
+ zephir_check_call_status();
+ }
+
+ ZVAL_LONG(&_2$$4, 1);
+ ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "setextractflags", NULL, 230, &_2$$4);
+ zephir_check_call_status();
+ zephir_update_property_array(this_ptr, SL("events"), &eventType, &priorityQueue);
+ }
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("enablePriorities"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_3))) {
+ priority = 100;
+ }
+ ZVAL_LONG(&_4, priority);
+ ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "insert", NULL, 231, handler, &_4);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, offsetSet)
+static PHP_METHOD(Phalcon_Events_Manager, arePrioritiesEnabled)
{
- zval *offset, offset_sub, *value, value_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&offset_sub);
- ZVAL_UNDEF(&value_sub);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(offset)
- Z_PARAM_ZVAL(value)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- 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", 73);
- return;
+ RETURN_MEMBER(getThis(), "enablePriorities");
}
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, offsetUnset)
+static PHP_METHOD(Phalcon_Events_Manager, collectResponses)
{
- zval *offset, offset_sub;
+ zval *collect_param = NULL, __$true, __$false;
+ zend_bool collect;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&offset_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(offset)
+ Z_PARAM_BOOL(collect)
ZEND_PARSE_PARAMETERS_END();
#endif
- zephir_fetch_params_without_memory_grow(1, 0, &offset);
+ zephir_fetch_params_without_memory_grow(1, 0, &collect_param);
+ collect = zephir_get_boolval(collect_param);
- ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_translate_exception_ce, "Translate is an immutable ArrayAccess object", "phalcon/Translate/Adapter/AbstractAdapter.zep", 81);
- return;
+ if (collect) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("collect"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("collect"), &__$false);
+ }
}
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, t)
+static PHP_METHOD(Phalcon_Events_Manager, detach)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_4 = NULL, *_5 = NULL, *_9 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval placeholders;
- zval *translateKey_param = NULL, *placeholders_param = NULL;
- zval translateKey;
+ zval *eventType_param = NULL, *handler, handler_sub, priorityQueue, newPriorityQueue, data, _0, _1, _2$$4, _3$$4, _6$$5, _7$$6, _8$$6;
+ zval eventType;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&translateKey);
- ZVAL_UNDEF(&placeholders);
+ ZVAL_UNDEF(&eventType);
+ ZVAL_UNDEF(&handler_sub);
+ ZVAL_UNDEF(&priorityQueue);
+ ZVAL_UNDEF(&newPriorityQueue);
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_8$$6);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translateKey)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(eventType)
+ Z_PARAM_ZVAL(handler)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ zephir_fetch_params(1, 2, 0, &eventType_param, &handler);
+ if (UNEXPECTED(Z_TYPE_P(eventType_param) != IS_STRING && Z_TYPE_P(eventType_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventType' 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);
+ if (EXPECTED(Z_TYPE_P(eventType_param) == IS_STRING)) {
+ zephir_get_strval(&eventType, eventType_param);
} else {
- zephir_get_arrval(&placeholders, placeholders_param);
+ ZEPHIR_INIT_VAR(&eventType);
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "query", NULL, 0, &translateKey, &placeholders);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "isvalidhandler", NULL, 0, handler);
zephir_check_call_status();
- RETURN_MM();
+ if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&_0))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "Event handler must be an Object or Callable", "phalcon/Events/Manager.zep", 109);
+ return;
+ }
+ ZEPHIR_OBS_VAR(&priorityQueue);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("events"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset_fetch(&priorityQueue, &_1, &eventType, 0)) {
+ ZEPHIR_INIT_VAR(&newPriorityQueue);
+ object_init_ex(&newPriorityQueue, spl_ce_SplPriorityQueue);
+ if (zephir_has_constructor(&newPriorityQueue)) {
+ ZEPHIR_CALL_METHOD(NULL, &newPriorityQueue, "__construct", NULL, 0);
+ zephir_check_call_status();
+ }
+
+ ZVAL_LONG(&_2$$4, 1);
+ ZEPHIR_CALL_METHOD(NULL, &newPriorityQueue, "setextractflags", NULL, 230, &_2$$4);
+ zephir_check_call_status();
+ ZVAL_LONG(&_2$$4, 3);
+ ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "setextractflags", NULL, 0, &_2$$4);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "top", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3$$4, &priorityQueue, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_3$$4))) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&data, &priorityQueue, "current", &_4, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "next", &_5, 0);
+ zephir_check_call_status();
+ zephir_array_fetch_string(&_6$$5, &data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 134);
+ if (!ZEPHIR_IS_IDENTICAL(&_6$$5, handler)) {
+ zephir_array_fetch_string(&_7$$6, &data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 136);
+ zephir_array_fetch_string(&_8$$6, &data, SL("priority"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 138);
+ ZEPHIR_CALL_METHOD(NULL, &newPriorityQueue, "insert", &_9, 231, &_7$$6, &_8$$6);
+ zephir_check_call_status();
+ }
+ }
+ zephir_update_property_array(this_ptr, SL("events"), &eventType, &newPriorityQueue);
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, replacePlaceholders)
+static PHP_METHOD(Phalcon_Events_Manager, detachAll)
{
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 *type_param = NULL, __$null, _0$$4, _1$$5;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&translation);
- ZVAL_UNDEF(&interpolator);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&placeholders);
+ ZVAL_UNDEF(&type);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0$$4);
+ ZVAL_UNDEF(&_1$$5);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translation)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
+ Z_PARAM_STR_OR_NULL(type)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ zephir_fetch_params(1, 0, 1, &type_param);
+ if (!type_param) {
+ ZEPHIR_INIT_VAR(&type);
+ } else {
+ 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(translation_param) == IS_STRING)) {
- zephir_get_strval(&translation, translation_param);
+ if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) {
+ zephir_get_strval(&type, type_param);
} else {
- ZEPHIR_INIT_VAR(&translation);
+ ZEPHIR_INIT_VAR(&type);
}
- 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();
+ if (ZEPHIR_IS_NULL(&type)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("events"), &__$null);
+ } else {
+ zephir_read_property(&_0$$4, this_ptr, ZEND_STRL("events"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset(&_0$$4, &type)) {
+ zephir_unset_property_array(this_ptr, ZEND_STRL("events"), &type);
+ zephir_read_property(&_1$$5, this_ptr, ZEND_STRL("events"), PH_NOISY_CC | PH_READONLY);
+ zephir_array_unset(&_1$$5, &type, PH_SEPARATE);
+ }
+ }
+ ZEPHIR_MM_RESTORE();
}
+static PHP_METHOD(Phalcon_Events_Manager, enablePriorities)
+{
+ zval *enablePriorities_param = NULL, __$true, __$false;
+ zend_bool enablePriorities;
+ zval *this_ptr = getThis();
-
-
-#ifdef HAVE_CONFIG_H
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(enablePriorities)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ zephir_fetch_params_without_memory_grow(1, 0, &enablePriorities_param);
+ enablePriorities = zephir_get_boolval(enablePriorities_param);
-
-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;
+ if (enablePriorities) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("enablePriorities"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("enablePriorities"), &__$false);
+ }
}
-ZEPHIR_DOC_METHOD(Phalcon_Translate_Adapter_AdapterInterface, exists);
-ZEPHIR_DOC_METHOD(Phalcon_Translate_Adapter_AdapterInterface, query);
-ZEPHIR_DOC_METHOD(Phalcon_Translate_Adapter_AdapterInterface, t);
-
-
+static PHP_METHOD(Phalcon_Events_Manager, fire)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool cancelable;
+ zval *eventType_param = NULL, *source, source_sub, *data = NULL, data_sub, *cancelable_param = NULL, __$null, events, eventParts, type, eventName, event, status, fireEvents, _0, _4, _1$$4, _3$$5;
+ zval eventType, _2$$4;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&eventType);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&source_sub);
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&events);
+ ZVAL_UNDEF(&eventParts);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&eventName);
+ ZVAL_UNDEF(&event);
+ ZVAL_UNDEF(&status);
+ ZVAL_UNDEF(&fireEvents);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_3$$5);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 4)
+ Z_PARAM_STR(eventType)
+ Z_PARAM_OBJECT(source)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(data)
+ Z_PARAM_BOOL(cancelable)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 2, &eventType_param, &source, &data, &cancelable_param);
+ if (UNEXPECTED(Z_TYPE_P(eventType_param) != IS_STRING && Z_TYPE_P(eventType_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventType' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(eventType_param) == IS_STRING)) {
+ zephir_get_strval(&eventType, eventType_param);
+ } else {
+ ZEPHIR_INIT_VAR(&eventType);
+ }
+ if (!data) {
+ data = &data_sub;
+ data = &__$null;
+ }
+ if (!cancelable_param) {
+ cancelable = 1;
+ } else {
+ cancelable = zephir_get_boolval(cancelable_param);
+ }
-
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Adapter_Csv)
-{
- 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_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;
-
- zend_class_implements(phalcon_translate_adapter_csv_ce, 1, zend_ce_arrayaccess);
- return SUCCESS;
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("events"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&events, &_0);
+ if (ZEPHIR_IS_EMPTY(&events)) {
+ RETURN_MM_NULL();
+ }
+ if (UNEXPECTED(!(zephir_memnstr_str(&eventType, SL(":"), "phalcon/Events/Manager.zep", 199)))) {
+ ZEPHIR_INIT_VAR(&_1$$4);
+ object_init_ex(&_1$$4, phalcon_events_exception_ce);
+ ZEPHIR_INIT_VAR(&_2$$4);
+ ZEPHIR_CONCAT_SV(&_2$$4, "Invalid event type ", &eventType);
+ ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 8, &_2$$4);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_1$$4, "phalcon/Events/Manager.zep", 200);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_INIT_VAR(&eventParts);
+ zephir_fast_explode_str(&eventParts, SL(":"), &eventType, LONG_MAX);
+ ZEPHIR_OBS_VAR(&type);
+ zephir_array_fetch_long(&type, &eventParts, 0, PH_NOISY, "phalcon/Events/Manager.zep", 204);
+ ZEPHIR_OBS_VAR(&eventName);
+ zephir_array_fetch_long(&eventName, &eventParts, 1, PH_NOISY, "phalcon/Events/Manager.zep", 205);
+ ZEPHIR_INIT_VAR(&status);
+ ZVAL_NULL(&status);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("collect"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_is_true(&_0)) {
+ ZEPHIR_INIT_VAR(&_3$$5);
+ array_init(&_3$$5);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("responses"), &_3$$5);
+ }
+ ZEPHIR_INIT_VAR(&event);
+ object_init_ex(&event, phalcon_events_event_ce);
+ if (cancelable) {
+ ZVAL_BOOL(&_4, 1);
+ } else {
+ ZVAL_BOOL(&_4, 0);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &event, "__construct", NULL, 232, &eventName, source, data, &_4);
+ zephir_check_call_status();
+ ZEPHIR_OBS_VAR(&fireEvents);
+ if (zephir_array_isset_fetch(&fireEvents, &events, &type, 0)) {
+ if (Z_TYPE_P(&fireEvents) == IS_OBJECT) {
+ ZEPHIR_CALL_METHOD(&status, this_ptr, "firequeue", NULL, 233, &fireEvents, &event);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_OBS_NVAR(&fireEvents);
+ if (zephir_array_isset_fetch(&fireEvents, &events, &eventType, 0)) {
+ if (Z_TYPE_P(&fireEvents) == IS_OBJECT) {
+ ZEPHIR_CALL_METHOD(&status, this_ptr, "firequeue", NULL, 233, &fireEvents, &event);
+ zephir_check_call_status();
+ }
+ }
+ RETURN_CCTOR(&status);
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Csv, __construct)
+static PHP_METHOD(Phalcon_Events_Manager, fireQueue)
{
+ zval _8$$6;
+ zend_bool collect = 0, cancelable = 0, _7$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_2 = NULL, *_3 = NULL, *_4 = NULL, *_6 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval options;
- zval *interpolator, interpolator_sub, *options_param = NULL, delimiter, enclosure, _1, _2;
+ zval *queue, queue_sub, *event, event_sub, status, eventName, data, iterator, source, handler, _0, _1, _5$$4, _9$$10;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&interpolator_sub);
- ZVAL_UNDEF(&delimiter);
- ZVAL_UNDEF(&enclosure);
+ ZVAL_UNDEF(&queue_sub);
+ ZVAL_UNDEF(&event_sub);
+ ZVAL_UNDEF(&status);
+ ZVAL_UNDEF(&eventName);
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&iterator);
+ ZVAL_UNDEF(&source);
+ ZVAL_UNDEF(&handler);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_9$$10);
+ ZVAL_UNDEF(&_8$$6);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
- Z_PARAM_ARRAY(options)
+ Z_PARAM_OBJECT_OF_CLASS(queue, spl_ce_SplPriorityQueue)
+ Z_PARAM_OBJECT_OF_CLASS(event, phalcon_events_eventinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &interpolator, &options_param);
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_fetch_params(1, 2, 0, &queue, &event);
- ZEPHIR_CALL_PARENT(NULL, phalcon_translate_adapter_csv_ce, getThis(), "__construct", &_0, 0, interpolator, &options);
+ ZEPHIR_INIT_VAR(&status);
+ ZVAL_NULL(&status);
+ ZEPHIR_CALL_METHOD(&eventName, event, "gettype", NULL, 0);
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", 45);
+ if (UNEXPECTED(Z_TYPE_P(&eventName) != IS_STRING)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "The event type not valid", "phalcon/Events/Manager.zep", 252);
return;
}
- if (zephir_array_isset_string(&options, SL("delimiter"))) {
- ZEPHIR_OBS_VAR(&delimiter);
- zephir_array_fetch_string(&delimiter, &options, SL("delimiter"), PH_NOISY, "phalcon/Translate/Adapter/Csv.zep", 49);
- } else {
- ZEPHIR_INIT_NVAR(&delimiter);
- ZVAL_STRING(&delimiter, ";");
- }
- if (zephir_array_isset_string(&options, SL("enclosure"))) {
- ZEPHIR_OBS_VAR(&enclosure);
- zephir_array_fetch_string(&enclosure, &options, SL("enclosure"), PH_NOISY, "phalcon/Translate/Adapter/Csv.zep", 55);
- } else {
- ZEPHIR_INIT_NVAR(&enclosure);
- ZVAL_STRING(&enclosure, "\"");
+ ZEPHIR_CALL_METHOD(&source, event, "getsource", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&data, event, "getdata", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_0, event, "iscancelable", NULL, 0);
+ zephir_check_call_status();
+ cancelable = zephir_get_boolval(&_0);
+ ZEPHIR_OBS_VAR(&_1);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("collect"), PH_NOISY_CC);
+ collect = zephir_get_boolval(&_1);
+ ZEPHIR_INIT_VAR(&iterator);
+ if (zephir_clone(&iterator, queue) == FAILURE) {
+ RETURN_MM();
}
- zephir_array_fetch_string(&_1, &options, SL("content"), PH_NOISY | PH_READONLY, "phalcon/Translate/Adapter/Csv.zep", 60);
- ZVAL_LONG(&_2, 0);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "load", NULL, 0, &_1, &_2, &delimiter, &enclosure);
+ ZEPHIR_CALL_METHOD(NULL, &iterator, "top", NULL, 0);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_0, &iterator, "valid", &_2, 0);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_0))) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&handler, &iterator, "current", &_3, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &iterator, "next", &_4, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "isvalidhandler", &_6, 0, &handler);
+ zephir_check_call_status();
+ if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&_5$$4))) {
+ continue;
+ }
+ _7$$4 = zephir_is_instance_of(&handler, SL("Closure"));
+ if (!(_7$$4)) {
+ _7$$4 = zephir_is_callable(&handler);
+ }
+ if (_7$$4) {
+ ZEPHIR_INIT_NVAR(&_8$$6);
+ zephir_create_array(&_8$$6, 3, 0);
+ zephir_array_fast_append(&_8$$6, event);
+ zephir_array_fast_append(&_8$$6, &source);
+ zephir_array_fast_append(&_8$$6, &data);
+ ZEPHIR_INIT_NVAR(&status);
+ ZEPHIR_CALL_USER_FUNC_ARRAY(&status, &handler, &_8$$6);
+ zephir_check_call_status();
+ } else {
+ if (!((zephir_method_exists(&handler, &eventName) == SUCCESS))) {
+ continue;
+ }
+ ZEPHIR_CALL_METHOD_ZVAL(&status, &handler, &eventName, NULL, 0, event, &source, &data);
+ zephir_check_call_status();
+ }
+ if (collect) {
+ zephir_update_property_array_append(this_ptr, SL("responses"), &status);
+ }
+ if (cancelable) {
+ ZEPHIR_CALL_METHOD(&_9$$10, event, "isstopped", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_9$$10)) {
+ break;
+ }
+ }
+ }
+ RETURN_CCTOR(&status);
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Csv, exists)
+static PHP_METHOD(Phalcon_Events_Manager, getListeners)
{
+ zval listeners;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *index_param = NULL, _0;
- zval index;
+ zephir_fcall_cache_entry *_3 = NULL, *_4 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *type_param = NULL, fireEvents, priorityQueue, _0, _1, _2$$4;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&fireEvents);
+ ZVAL_UNDEF(&priorityQueue);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&listeners);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(index)
+ Z_PARAM_STR(type)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ 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(index_param) == IS_STRING)) {
- zephir_get_strval(&index, index_param);
+ if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) {
+ zephir_get_strval(&type, type_param);
} else {
- ZEPHIR_INIT_VAR(&index);
+ ZEPHIR_INIT_VAR(&type);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("translate"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL(zephir_array_isset(&_0, &index));
+ ZEPHIR_OBS_VAR(&fireEvents);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("events"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&fireEvents, &_0, &type, 0))) {
+ array_init(return_value);
+ RETURN_MM();
+ }
+ ZEPHIR_INIT_VAR(&listeners);
+ array_init(&listeners);
+ ZEPHIR_INIT_VAR(&priorityQueue);
+ if (zephir_clone(&priorityQueue, &fireEvents) == FAILURE) {
+ RETURN_MM();
+ }
+ ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "top", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &priorityQueue, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_1))) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&_2$$4, &priorityQueue, "current", &_3, 0);
+ zephir_check_call_status();
+ zephir_array_append(&listeners, &_2$$4, PH_SEPARATE, "phalcon/Events/Manager.zep", 335);
+ ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "next", &_4, 0);
+ zephir_check_call_status();
+ }
+ RETURN_CTOR(&listeners);
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Csv, query)
+static PHP_METHOD(Phalcon_Events_Manager, getResponses)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "responses");
+}
+
+static PHP_METHOD(Phalcon_Events_Manager, hasListeners)
{
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 *type_param = NULL, _0;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&translateKey);
- ZVAL_UNDEF(&translation);
+ ZVAL_UNDEF(&type);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&placeholders);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translateKey)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(type)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ 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(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);
+ if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) {
+ zephir_get_strval(&type, type_param);
} else {
- zephir_get_arrval(&placeholders, placeholders_param);
+ ZEPHIR_INIT_VAR(&type);
}
- ZEPHIR_OBS_VAR(&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);
- }
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "replaceplaceholders", NULL, 0, &translation, &placeholders);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("events"), PH_NOISY_CC | PH_READONLY);
+ RETURN_MM_BOOL(zephir_array_isset(&_0, &type));
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Csv, load)
+static PHP_METHOD(Phalcon_Events_Manager, isCollecting)
{
- 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 *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);
+
+
+ RETURN_MEMBER(getThis(), "collect");
+}
+
+static PHP_METHOD(Phalcon_Events_Manager, isValidHandler)
+{
+ zend_bool _0;
+ zval *handler, handler_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&handler_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(4, 4)
- Z_PARAM_STR(file)
- Z_PARAM_LONG(length)
- Z_PARAM_STR(delimiter)
- Z_PARAM_STR(enclosure)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(handler)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 4, 0, &file_param, &length_param, &delimiter_param, &enclosure_param);
- zephir_get_strval(&file, file_param);
- length = zephir_get_intval(length_param);
- zephir_get_strval(&delimiter, delimiter_param);
- zephir_get_strval(&enclosure, enclosure_param);
+ zephir_fetch_params_without_memory_grow(1, 0, &handler);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "rb");
- ZEPHIR_CALL_FUNCTION(&fileHandler, "fopen", NULL, 89, &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, 8, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Translate/Adapter/Csv.zep", 97);
- ZEPHIR_MM_RESTORE();
- return;
+ _0 = Z_TYPE_P(handler) != IS_OBJECT;
+ if (_0) {
+ _0 = !(zephir_is_callable(handler));
}
- 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", 107);
- 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", 111);
- ZEPHIR_OBS_NVAR(&_10$$4);
- zephir_array_fetch_long(&_10$$4, &data, 0, PH_NOISY, "phalcon/Translate/Adapter/Csv.zep", 111);
- zephir_update_property_array(this_ptr, SL("translate"), &_10$$4, &_9$$4);
+ if (UNEXPECTED(_0)) {
+ RETURN_BOOL(0);
}
- zephir_fclose(&fileHandler);
- ZEPHIR_MM_RESTORE();
+ RETURN_BOOL(1);
}
-zend_object *zephir_init_properties_Phalcon_Translate_Adapter_Csv(zend_class_entry *class_type)
+zend_object *zephir_init_properties_Phalcon_Events_Manager(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_MM_GROW();
@@ -208255,11 +208990,17 @@ zend_object *zephir_init_properties_Phalcon_Translate_Adapter_Csv(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("translate"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("responses"), 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_update_property_zval_ex(this_ptr, ZEND_STRL("responses"), &_1$$3);
+ }
+ zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("events"), 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("events"), &_3$$4);
}
ZEPHIR_MM_RESTORE();
return Z_OBJ_P(this_ptr);
@@ -208276,557 +209017,673 @@ zend_object *zephir_init_properties_Phalcon_Translate_Adapter_Csv(zend_class_ent
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Adapter_Gettext)
+ZEPHIR_INIT_CLASS(Phalcon_Events_ManagerInterface)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Translate\\Adapter, Gettext, phalcon, translate_adapter_gettext, phalcon_translate_adapter_abstractadapter_ce, phalcon_translate_adapter_gettext_method_entry, 0);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Events, ManagerInterface, phalcon, events_managerinterface, phalcon_events_managerinterface_method_entry);
- 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;
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getCategory)
-{
- zval *this_ptr = getThis();
+ZEPHIR_DOC_METHOD(Phalcon_Events_ManagerInterface, attach);
+ZEPHIR_DOC_METHOD(Phalcon_Events_ManagerInterface, detach);
+ZEPHIR_DOC_METHOD(Phalcon_Events_ManagerInterface, detachAll);
+ZEPHIR_DOC_METHOD(Phalcon_Events_ManagerInterface, fire);
+ZEPHIR_DOC_METHOD(Phalcon_Events_ManagerInterface, getListeners);
+ZEPHIR_DOC_METHOD(Phalcon_Events_ManagerInterface, hasListeners);
- RETURN_MEMBER(getThis(), "category");
-}
+#ifdef HAVE_CONFIG_H
+#endif
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getDefaultDomain)
-{
- zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "defaultDomain");
-}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getDirectory)
+ZEPHIR_INIT_CLASS(Phalcon_Tag_Exception)
{
- zval *this_ptr = getThis();
-
-
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Tag, Exception, phalcon, tag_exception, phalcon_exception_ce, NULL, 0);
- RETURN_MEMBER(getThis(), "directory");
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getLocale)
-{
- zval *this_ptr = getThis();
-
- RETURN_MEMBER(getThis(), "locale");
-}
-
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, __construct)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval options;
- zval *interpolator, interpolator_sub, *options_param = NULL;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&interpolator_sub);
- ZVAL_UNDEF(&options);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &interpolator, &options_param);
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- if (UNEXPECTED(!((zephir_function_exists_ex(ZEND_STRL("gettext")) == SUCCESS)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_translate_exception_ce, "This class requires the gettext extension for PHP", "phalcon/Translate/Adapter/Gettext.zep", 72);
- return;
- }
- ZEPHIR_CALL_PARENT(NULL, phalcon_translate_adapter_gettext_ce, getThis(), "__construct", &_0, 0, interpolator, &options);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "prepareoptions", NULL, 0, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, exists)
+ZEPHIR_INIT_CLASS(Phalcon_Tag_Select)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *index_param = NULL, result;
- zval index;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&index);
- ZVAL_UNDEF(&result);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(index)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- 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_REGISTER_CLASS(Phalcon\\Tag, Select, phalcon, tag_select, phalcon_tag_select_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
- ZEPHIR_CALL_METHOD(&result, this_ptr, "query", NULL, 0, &index);
- zephir_check_call_status();
- RETURN_MM_BOOL(!ZEPHIR_IS_IDENTICAL(&result, &index));
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, nquery)
+static PHP_METHOD(Phalcon_Tag_Select, selectField)
{
+ zend_bool _2$$19;
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;
+ zephir_fcall_cache_entry *_1 = NULL, *_4 = NULL, *_9 = NULL, *_13 = NULL;
+ zval *parameters, parameters_sub, *data = NULL, data_sub, __$null, params, name, id, value, useEmpty, code, emptyValue, emptyText, options, using, _3, _5, _0$$5, _6$$22, _7$$22, _8$$23, _10$$23, _11$$23, _12$$25, _14$$25, _15$$25;
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);
+ ZVAL_UNDEF(¶meters_sub);
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_NULL(&__$null);
+ 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(&_3);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_0$$5);
+ ZVAL_UNDEF(&_6$$22);
+ ZVAL_UNDEF(&_7$$22);
+ ZVAL_UNDEF(&_8$$23);
+ ZVAL_UNDEF(&_10$$23);
+ ZVAL_UNDEF(&_11$$23);
+ ZVAL_UNDEF(&_12$$25);
+ ZVAL_UNDEF(&_14$$25);
+ ZVAL_UNDEF(&_15$$25);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(3, 5)
- Z_PARAM_STR(msgid1)
- Z_PARAM_STR(msgid2)
- Z_PARAM_LONG(count)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ZVAL(parameters)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
- Z_PARAM_STR_OR_NULL(domain)
+ Z_PARAM_ZVAL_OR_NULL(data)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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();
+ zephir_fetch_params(1, 1, 1, ¶meters, &data);
+ if (!data) {
+ data = &data_sub;
+ data = &__$null;
}
- if (EXPECTED(Z_TYPE_P(msgid1_param) == IS_STRING)) {
- zephir_get_strval(&msgid1, msgid1_param);
+
+
+ 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_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();
+ ZEPHIR_CPY_WRT(¶ms, parameters);
}
- if (EXPECTED(Z_TYPE_P(msgid2_param) == IS_STRING)) {
- zephir_get_strval(&msgid2, msgid2_param);
- } else {
- ZEPHIR_INIT_VAR(&msgid2);
+ ZEPHIR_OBS_VAR(&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 (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();
+ 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);
+ }
}
- count = Z_LVAL_P(count_param);
- if (!placeholders_param) {
- ZEPHIR_INIT_VAR(&placeholders);
- array_init(&placeholders);
+ ZEPHIR_OBS_VAR(&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 {
- zephir_get_arrval(&placeholders, placeholders_param);
+ if (!(zephir_is_true(&name))) {
+ zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE);
+ }
}
- if (!domain_param) {
- ZEPHIR_INIT_VAR(&domain);
+ ZEPHIR_OBS_VAR(&value);
+ if (!(zephir_array_isset_string_fetch(&value, ¶ms, SL("value"), 0))) {
+ ZEPHIR_CALL_CE_STATIC(&value, phalcon_tag_ce, "getvalue", &_1, 0, &id, ¶ms);
+ zephir_check_call_status();
} 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();
+ zephir_array_unset_string(¶ms, SL("value"), PH_SEPARATE);
}
- if (EXPECTED(Z_TYPE_P(domain_param) == IS_STRING)) {
- zephir_get_strval(&domain, domain_param);
- } else {
- ZEPHIR_INIT_VAR(&domain);
+ ZEPHIR_OBS_VAR(&useEmpty);
+ if (zephir_array_isset_string_fetch(&useEmpty, ¶ms, SL("useEmpty"), 0)) {
+ ZEPHIR_OBS_VAR(&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_OBS_VAR(&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_OBS_VAR(&options);
+ if (!(zephir_array_isset_long_fetch(&options, ¶ms, 1, 0))) {
+ ZEPHIR_CPY_WRT(&options, data);
}
-
-
- 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();
- } else {
- ZVAL_LONG(&_1$$4, count);
- ZEPHIR_CALL_FUNCTION(&translation, "dngettext", NULL, 0, &domain, &msgid1, &msgid2, &_1$$4);
- zephir_check_call_status();
+ if (Z_TYPE_P(&options) == IS_OBJECT) {
+ ZEPHIR_OBS_VAR(&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;
+ }
+ _2$$19 = Z_TYPE_P(&using) != IS_ARRAY;
+ if (_2$$19) {
+ _2$$19 = Z_TYPE_P(&using) != IS_OBJECT;
+ }
+ if (UNEXPECTED(_2$$19)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "The 'using' parameter should be an array", "phalcon/Tag/Select.zep", 107);
+ return;
+ }
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "replaceplaceholders", NULL, 0, &translation, &placeholders);
+ zephir_array_unset_string(¶ms, SL("using"), PH_SEPARATE);
+ ZEPHIR_INIT_VAR(&_5);
+ ZVAL_STRING(&_5, "= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translateKey)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- 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);
+ ZEPHIR_INIT_NVAR(&_5);
+ ZEPHIR_GET_CONSTANT(&_5, "PHP_EOL");
+ ZEPHIR_INIT_VAR(&code);
+ ZEPHIR_CONCAT_VSV(&code, &_3, ">", &_5);
+ if (zephir_is_true(&useEmpty)) {
+ ZEPHIR_INIT_VAR(&_6$$22);
+ ZEPHIR_GET_CONSTANT(&_6$$22, "PHP_EOL");
+ ZEPHIR_INIT_VAR(&_7$$22);
+ ZEPHIR_CONCAT_SVSVSV(&_7$$22, "\t", &emptyText, " ", &_6$$22);
+ zephir_concat_self(&code, &_7$$22);
}
- if (!placeholders_param) {
- ZEPHIR_INIT_VAR(&placeholders);
- array_init(&placeholders);
+ if (Z_TYPE_P(&options) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_10$$23);
+ ZEPHIR_GET_CONSTANT(&_10$$23, "PHP_EOL");
+ ZEPHIR_INIT_VAR(&_11$$23);
+ ZEPHIR_CONCAT_SV(&_11$$23, " ", &_10$$23);
+ ZEPHIR_CALL_SELF(&_8$$23, "optionsfromresultset", &_9, 0, &options, &using, &value, &_11$$23);
+ zephir_check_call_status();
+ zephir_concat_self(&code, &_8$$23);
} else {
- zephir_get_arrval(&placeholders, placeholders_param);
+ if (Z_TYPE_P(&options) == IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&_14$$25);
+ ZEPHIR_GET_CONSTANT(&_14$$25, "PHP_EOL");
+ ZEPHIR_INIT_VAR(&_15$$25);
+ ZEPHIR_CONCAT_SV(&_15$$25, "", &_14$$25);
+ ZEPHIR_CALL_SELF(&_12$$25, "optionsfromarray", &_13, 0, &options, &value, &_15$$25);
+ zephir_check_call_status();
+ zephir_concat_self(&code, &_12$$25);
+ }
}
-
-
- ZEPHIR_CALL_FUNCTION(&_0, "gettext", NULL, 0, &translateKey);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "replaceplaceholders", NULL, 0, &_0, &placeholders);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_concat_self_str(&code, SL(""));
+ RETURN_CCTOR(&code);
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, resetDomain)
+static PHP_METHOD(Phalcon_Tag_Select, optionsFromArray)
{
- zval _0;
+ 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 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 *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
-
-
- ZEPHIR_MM_GROW();
-
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdefaultdomain", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_FUNCTION("textdomain", NULL, 0, &_0);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setDefaultDomain)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *domain_param = NULL;
- zval domain;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&domain);
+ 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(&_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);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(domain)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_ARRAY(data)
+ Z_PARAM_ZVAL(value)
+ Z_PARAM_STR(closeOption)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_fetch_params(1, 3, 0, &data_param, &value, &closeOption_param);
+ zephir_get_arrval(&data, data_param);
+ zephir_get_strval(&closeOption, closeOption_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultDomain"), &domain);
- ZEPHIR_MM_RESTORE();
+ 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(&optionValue);
+ if (_3 != NULL) {
+ ZVAL_STR_COPY(&optionValue, _3);
+ } else {
+ ZVAL_LONG(&optionValue, _2);
+ }
+ ZEPHIR_INIT_NVAR(&optionText);
+ ZVAL_COPY(&optionText, _0);
+ ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 224, &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
", &_5$$4, &_6$$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
", &optionText, &closeOption);
+ zephir_concat_self(&code, &_10$$6);
+ } else {
+ ZEPHIR_INIT_NVAR(&_11$$7);
+ ZEPHIR_CONCAT_SVSVV(&_11$$7, "\t ", &optionText, &closeOption);
+ zephir_concat_self(&code, &_11$$7);
+ }
+ } else {
+ zephir_cast_to_string(&_12$$8, &optionValue);
+ ZEPHIR_CPY_WRT(&strOptionValue, &_12$$8);
+ zephir_cast_to_string(&_13$$8, value);
+ ZEPHIR_CPY_WRT(&strValue, &_13$$8);
+ if (ZEPHIR_IS_IDENTICAL(&strOptionValue, &strValue)) {
+ ZEPHIR_INIT_NVAR(&_14$$9);
+ ZEPHIR_CONCAT_SVSVV(&_14$$9, "\t ", &optionText, &closeOption);
+ zephir_concat_self(&code, &_14$$9);
+ } else {
+ ZEPHIR_INIT_NVAR(&_15$$10);
+ ZEPHIR_CONCAT_SVSVV(&_15$$10, "\t ", &optionText, &closeOption);
+ zephir_concat_self(&code, &_15$$10);
+ }
+ }
+ } 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(&optionValue, &data, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&optionText, &data, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 224, &optionValue);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&optionText) == IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(&_16$$12);
+ ZEPHIR_GET_CONSTANT(&_16$$12, "PHP_EOL");
+ ZEPHIR_CALL_SELF(&_17$$12, "optionsfromarray", &_7, 0, &optionText, value, &closeOption);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_18$$12);
+ ZEPHIR_GET_CONSTANT(&_18$$12, "PHP_EOL");
+ ZEPHIR_INIT_NVAR(&_19$$12);
+ ZEPHIR_CONCAT_SVSVVSV(&_19$$12, "\t ", &_16$$12, &_17$$12, "\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
", &optionText, &closeOption);
+ zephir_concat_self(&code, &_20$$14);
+ } else {
+ ZEPHIR_INIT_NVAR(&_21$$15);
+ ZEPHIR_CONCAT_SVSVV(&_21$$15, "\t ", &optionText, &closeOption);
+ zephir_concat_self(&code, &_21$$15);
+ }
+ } else {
+ zephir_cast_to_string(&_22$$16, &optionValue);
+ ZEPHIR_CPY_WRT(&strOptionValue, &_22$$16);
+ zephir_cast_to_string(&_23$$16, value);
+ ZEPHIR_CPY_WRT(&strValue, &_23$$16);
+ if (ZEPHIR_IS_IDENTICAL(&strOptionValue, &strValue)) {
+ ZEPHIR_INIT_NVAR(&_24$$17);
+ ZEPHIR_CONCAT_SVSVV(&_24$$17, "\t ", &optionText, &closeOption);
+ zephir_concat_self(&code, &_24$$17);
+ } else {
+ ZEPHIR_INIT_NVAR(&_25$$18);
+ ZEPHIR_CONCAT_SVSVV(&_25$$18, "\t ", &optionText, &closeOption);
+ zephir_concat_self(&code, &_25$$18);
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &data, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&optionText);
+ ZEPHIR_INIT_NVAR(&optionValue);
+ RETURN_CCTOR(&code);
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setDirectory)
+static PHP_METHOD(Phalcon_Tag_Select, optionsFromResultset)
{
- zend_string *_3$$4;
- zend_ulong _2$$4;
+ zend_object_iterator *_2;
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 *_1 = NULL, *_4 = NULL, *_5 = NULL;
+ zval closeOption, _8$$15, _9$$15;
+ zval *resultset, resultset_sub, *using, using_sub, *value, value_sub, *closeOption_param = NULL, code, params, option, usingZero, usingOne, escaper, optionValue, optionText, strValue, strOptionValue, _0, _3$$6, _6$$13, _7$$14, _10$$16, _11$$17, _12$$19;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&directory_sub);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_5$$7);
+ ZVAL_UNDEF(&resultset_sub);
+ ZVAL_UNDEF(&using_sub);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&code);
+ ZVAL_UNDEF(¶ms);
+ ZVAL_UNDEF(&option);
+ ZVAL_UNDEF(&usingZero);
+ ZVAL_UNDEF(&usingOne);
+ ZVAL_UNDEF(&escaper);
+ ZVAL_UNDEF(&optionValue);
+ ZVAL_UNDEF(&optionText);
+ ZVAL_UNDEF(&strValue);
+ ZVAL_UNDEF(&strOptionValue);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_3$$6);
+ ZVAL_UNDEF(&_6$$13);
+ ZVAL_UNDEF(&_7$$14);
+ ZVAL_UNDEF(&_10$$16);
+ ZVAL_UNDEF(&_11$$17);
+ ZVAL_UNDEF(&_12$$19);
+ ZVAL_UNDEF(&closeOption);
+ ZVAL_UNDEF(&_8$$15);
+ ZVAL_UNDEF(&_9$$15);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(directory)
+ ZEND_PARSE_PARAMETERS_START(4, 4)
+ Z_PARAM_OBJECT_OF_CLASS(resultset, phalcon_mvc_model_resultsetinterface_ce)
+ Z_PARAM_ZVAL(using)
+ Z_PARAM_ZVAL(value)
+ Z_PARAM_STR(closeOption)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &directory);
+ zephir_fetch_params(1, 4, 0, &resultset, &using, &value, &closeOption_param);
+ zephir_get_strval(&closeOption, closeOption_param);
- if (ZEPHIR_IS_EMPTY(directory)) {
- RETURN_MM_NULL();
+ ZEPHIR_INIT_VAR(&code);
+ ZVAL_STRING(&code, "");
+ ZEPHIR_INIT_VAR(¶ms);
+ ZVAL_NULL(¶ms);
+ if (Z_TYPE_P(using) == IS_ARRAY) {
+ if (UNEXPECTED(zephir_fast_count_int(using) != 2)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "Parameter 'using' requires two values", "phalcon/Tag/Select.zep", 209);
+ return;
+ }
+ ZEPHIR_OBS_VAR(&usingZero);
+ zephir_array_fetch_long(&usingZero, using, 0, PH_NOISY, "phalcon/Tag/Select.zep", 212);
+ ZEPHIR_OBS_VAR(&usingOne);
+ zephir_array_fetch_long(&usingOne, using, 1, PH_NOISY, "phalcon/Tag/Select.zep", 213);
}
- 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", 180);
- 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);
+ ZEPHIR_CALL_CE_STATIC(&_0, phalcon_tag_ce, "getescaperservice", &_1, 0);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&escaper, &_0);
+ _2 = zephir_get_iterator(resultset);
+ _2->funcs->rewind(_2);
+ for (;_2->funcs->valid(_2) == SUCCESS && !EG(exception); _2->funcs->move_forward(_2)) {
+ {
+ ZEPHIR_ITERATOR_COPY(&option, _2);
+ }
+ if (Z_TYPE_P(using) == IS_ARRAY) {
+ if (Z_TYPE_P(&option) == IS_OBJECT) {
+ if ((zephir_method_exists_ex(&option, ZEND_STRL("readattribute")) == SUCCESS)) {
+ ZEPHIR_CALL_METHOD(&optionValue, &option, "readattribute", NULL, 0, &usingZero);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&optionText, &option, "readattribute", NULL, 0, &usingOne);
+ zephir_check_call_status();
} else {
- ZVAL_LONG(&key, _2$$4);
+ ZEPHIR_OBS_NVAR(&optionValue);
+ zephir_read_property(&optionValue, &option, ZEND_STRL("usingZero"), PH_NOISY_CC);
+ ZEPHIR_OBS_NVAR(&optionText);
+ zephir_read_property(&optionText, &option, ZEND_STRL("usingOne"), PH_NOISY_CC);
}
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _0$$4);
- ZEPHIR_CALL_FUNCTION(NULL, "bindtextdomain", &_4, 0, &key, &value);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, directory, "rewind", NULL, 0);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(&option) != IS_ARRAY)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "Resultset returned an invalid value", "phalcon/Tag/Select.zep", 232);
+ return;
+ }
+ ZEPHIR_OBS_NVAR(&optionValue);
+ zephir_array_fetch(&optionValue, &option, &usingZero, PH_NOISY, "phalcon/Tag/Select.zep", 235);
+ ZEPHIR_OBS_NVAR(&optionText);
+ zephir_array_fetch(&optionText, &option, &usingOne, PH_NOISY, "phalcon/Tag/Select.zep", 236);
+ }
+ ZEPHIR_CALL_METHOD(&_3$$6, &escaper, "escapehtmlattr", &_4, 0, &optionValue);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1$$4, directory, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1$$4)) {
- break;
+ ZEPHIR_CPY_WRT(&optionValue, &_3$$6);
+ ZEPHIR_CALL_METHOD(&_3$$6, &escaper, "escapehtml", &_5, 0, &optionText);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&optionText, &_3$$6);
+ if (Z_TYPE_P(value) == IS_ARRAY) {
+ if (zephir_fast_in_array(&optionValue, value)) {
+ ZEPHIR_INIT_NVAR(&_6$$13);
+ ZEPHIR_CONCAT_SVSVV(&_6$$13, "\t ", &optionText, &closeOption);
+ zephir_concat_self(&code, &_6$$13);
+ } else {
+ ZEPHIR_INIT_NVAR(&_7$$14);
+ ZEPHIR_CONCAT_SVSVV(&_7$$14, "\t ", &optionText, &closeOption);
+ zephir_concat_self(&code, &_7$$14);
}
- 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);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, directory, "next", NULL, 0);
+ } else {
+ zephir_cast_to_string(&_8$$15, &optionValue);
+ ZEPHIR_CPY_WRT(&strOptionValue, &_8$$15);
+ zephir_cast_to_string(&_9$$15, value);
+ ZEPHIR_CPY_WRT(&strValue, &_9$$15);
+ if (ZEPHIR_IS_IDENTICAL(&strOptionValue, &strValue)) {
+ ZEPHIR_INIT_NVAR(&_10$$16);
+ ZEPHIR_CONCAT_SVSVV(&_10$$16, "\t ", &optionText, &closeOption);
+ zephir_concat_self(&code, &_10$$16);
+ } else {
+ ZEPHIR_INIT_NVAR(&_11$$17);
+ ZEPHIR_CONCAT_SVSVV(&_11$$17, "\t ", &optionText, &closeOption);
+ zephir_concat_self(&code, &_11$$17);
+ }
+ }
+ } else {
+ if (Z_TYPE_P(using) == IS_OBJECT) {
+ if (Z_TYPE_P(¶ms) == IS_NULL) {
+ ZEPHIR_INIT_NVAR(¶ms);
+ array_init(¶ms);
+ }
+ zephir_array_update_long(¶ms, 0, &option, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
+ ZEPHIR_INIT_NVAR(&_12$$19);
+ ZEPHIR_CALL_USER_FUNC_ARRAY(&_12$$19, using, ¶ms);
zephir_check_call_status();
+ zephir_concat_self(&code, &_12$$19);
}
}
- 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_MM_RESTORE();
+ zend_iterator_dtor(_2);
+ RETURN_CCTOR(&code);
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setDomain)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Logger_AdapterFactory)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Logger, AdapterFactory, phalcon, logger_adapterfactory, phalcon_factory_abstractfactory_ce, phalcon_logger_adapterfactory_method_entry, 0);
+
+ zend_declare_property_string(phalcon_logger_adapterfactory_ce, SL("exception"), "Phalcon\\Logger\\Exception", ZEND_ACC_PROTECTED);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Logger_AdapterFactory, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *domain, domain_sub;
+ zval *services_param = NULL;
+ zval services;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&domain_sub);
+ ZVAL_UNDEF(&services);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(domain)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(services)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &domain);
+ 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_RETURN_CALL_FUNCTION("textdomain", NULL, 0, domain);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setLocale)
+static PHP_METHOD(Phalcon_Logger_AdapterFactory, newInstance)
{
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;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval options, _0;
+ zval *name_param = NULL, *fileName_param = NULL, *options_param = NULL, definition;
+ zval name, fileName;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&fileName);
+ ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&options);
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);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_LONG(category)
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(name)
+ Z_PARAM_STR(fileName)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(localeArray)
+ Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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, 2, 1, &name_param, &fileName_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();
}
- category = Z_LVAL_P(category_param);
- if (!localeArray_param) {
- ZEPHIR_INIT_VAR(&localeArray);
- array_init(&localeArray);
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
} else {
- zephir_get_arrval(&localeArray, localeArray_param);
+ ZEPHIR_INIT_VAR(&name);
+ }
+ if (UNEXPECTED(Z_TYPE_P(fileName_param) != IS_STRING && Z_TYPE_P(fileName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'fileName' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(fileName_param) == IS_STRING)) {
+ zephir_get_strval(&fileName, fileName_param);
+ } else {
+ ZEPHIR_INIT_VAR(&fileName);
+ }
+ if (!options_param) {
+ ZEPHIR_INIT_VAR(&options);
+ array_init(&options);
+ } else {
+ zephir_get_arrval(&options, options_param);
}
- 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);
- ZEPHIR_INIT_ZVAL_NREF(_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);
- 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_CALL_METHOD(&definition, this_ptr, "getservice", NULL, 0, &name);
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);
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_create_array(&_0, 2, 0);
+ zephir_array_fast_append(&_0, &fileName);
+ zephir_array_fast_append(&_0, &options);
+ ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(return_value, &definition, &_0);
zephir_check_call_status();
- RETURN_MM_MEMBER(getThis(), "locale");
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getOptionsDefault)
+static PHP_METHOD(Phalcon_Logger_AdapterFactory, getAdapters)
{
zval *this_ptr = getThis();
- 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"));
+ zephir_create_array(return_value, 3, 0);
+ add_assoc_stringl_ex(return_value, SL("noop"), SL("Phalcon\\Logger\\Adapter\\Noop"));
+ add_assoc_stringl_ex(return_value, SL("stream"), SL("Phalcon\\Logger\\Adapter\\Stream"));
+ add_assoc_stringl_ex(return_value, SL("syslog"), SL("Phalcon\\Logger\\Adapter\\Syslog"));
return;
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, prepareOptions)
-{
- 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(&options);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- 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", 237);
- 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", 241);
- return;
- }
- 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", 250);
- zephir_array_fetch_string(&_3, &options, SL("locale"), PH_NOISY | PH_READONLY, "phalcon/Translate/Adapter/Gettext.zep", 252);
- 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", 256);
- 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", 260);
- 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", 264);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdomain", NULL, 0, &_6);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+
+ZEPHIR_INIT_CLASS(Phalcon_Logger_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Logger, Exception, phalcon, logger_exception, phalcon_exception_ce, NULL, 0);
+
+ return SUCCESS;
}
@@ -208839,228 +209696,111 @@ static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, prepareOptions)
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Adapter_NativeArray)
+ZEPHIR_INIT_CLASS(Phalcon_Logger_Item)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Translate\\Adapter, NativeArray, phalcon, translate_adapter_nativearray, phalcon_translate_adapter_abstractadapter_ce, phalcon_translate_adapter_nativearray_method_entry, 0);
-
- 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_REGISTER_CLASS(Phalcon\\Logger, Item, phalcon, logger_item, phalcon_logger_item_method_entry, 0);
- zend_class_implements(phalcon_translate_adapter_nativearray_ce, 1, zend_ce_arrayaccess);
+ zend_declare_property_null(phalcon_logger_item_ce, SL("context"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_logger_item_ce, SL("message"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_logger_item_ce, SL("level"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_logger_item_ce, SL("levelName"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_logger_item_ce, SL("time"), ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, __construct)
+static PHP_METHOD(Phalcon_Logger_Item, getContext)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- 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);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- 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", &_0, 0, interpolator, &options);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(&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", 49);
- return;
- }
- ZEPHIR_OBS_VAR(&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", 57);
- return;
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("translate"), &data);
- ZEPHIR_MM_RESTORE();
+ RETURN_MEMBER(getThis(), "context");
}
-static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, exists)
+static PHP_METHOD(Phalcon_Logger_Item, getMessage)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *index_param = NULL, _0;
- zval index;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&index);
- ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(index)
- ZEND_PARSE_PARAMETERS_END();
-#endif
- ZEPHIR_MM_GROW();
- 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);
- }
+ RETURN_MEMBER(getThis(), "message");
+}
+static PHP_METHOD(Phalcon_Logger_Item, getLevel)
+{
+ zval *this_ptr = getThis();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("translate"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL(zephir_array_isset(&_0, &index));
+
+
+ RETURN_MEMBER(getThis(), "level");
}
-static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, notFound)
+static PHP_METHOD(Phalcon_Logger_Item, getLevelName)
{
- 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();
- ZVAL_UNDEF(&index);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(index)
- ZEND_PARSE_PARAMETERS_END();
-#endif
- ZEPHIR_MM_GROW();
- 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);
- }
+ RETURN_MEMBER(getThis(), "levelName");
+}
+static PHP_METHOD(Phalcon_Logger_Item, getTime)
+{
+ zval *this_ptr = getThis();
- 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, 8, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Translate/Adapter/NativeArray.zep", 77);
- ZEPHIR_MM_RESTORE();
- return;
- }
- RETURN_CTOR(&index);
+
+
+ RETURN_MEMBER(getThis(), "time");
}
-static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, query)
+static PHP_METHOD(Phalcon_Logger_Item, __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 context;
+ zend_long level;
+ zval *message_param = NULL, *levelName_param = NULL, *level_param = NULL, *time, time_sub, *context_param = NULL, _0;
+ zval message, levelName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&translateKey);
- ZVAL_UNDEF(&translation);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&levelName);
+ ZVAL_UNDEF(&time_sub);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&placeholders);
+ ZVAL_UNDEF(&context);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translateKey)
+ ZEND_PARSE_PARAMETERS_START(4, 5)
+ Z_PARAM_STR(message)
+ Z_PARAM_STR(levelName)
+ Z_PARAM_LONG(level)
+ Z_PARAM_OBJECT_OF_CLASS(time, php_date_get_immutable_ce())
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
+ Z_PARAM_ARRAY(context)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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);
+ zephir_fetch_params(1, 4, 1, &message_param, &levelName_param, &level_param, &time, &context_param);
+ zephir_get_strval(&message, message_param);
+ zephir_get_strval(&levelName, levelName_param);
+ level = zephir_get_intval(level_param);
+ if (!context_param) {
+ ZEPHIR_INIT_VAR(&context);
+ array_init(&context);
} else {
- zephir_get_arrval(&placeholders, placeholders_param);
- }
-
-
- ZEPHIR_OBS_VAR(&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_check_call_status();
- RETURN_MM();
+ zephir_get_arrval(&context, context_param);
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "replaceplaceholders", NULL, 0, &translation, &placeholders);
- zephir_check_call_status();
- RETURN_MM();
-}
-zend_object *zephir_init_properties_Phalcon_Translate_Adapter_NativeArray(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_MM_GROW();
-
- {
- 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);
- }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("message"), &message);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("levelName"), &levelName);
+ ZEPHIR_INIT_ZVAL_NREF(_0);
+ ZVAL_LONG(&_0, level);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("level"), &_0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("time"), time);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("context"), &context);
+ ZEPHIR_MM_RESTORE();
}
@@ -209073,138 +209813,220 @@ zend_object *zephir_init_properties_Phalcon_Translate_Adapter_NativeArray(zend_c
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Interpolator_AssociativeArray)
+ZEPHIR_INIT_CLASS(Phalcon_Logger_LoggerFactory)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Translate\\Interpolator, AssociativeArray, phalcon, translate_interpolator_associativearray, phalcon_translate_interpolator_associativearray_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Logger, LoggerFactory, phalcon, logger_loggerfactory, phalcon_logger_loggerfactory_method_entry, 0);
- zend_class_implements(phalcon_translate_interpolator_associativearray_ce, 1, phalcon_translate_interpolator_interpolatorinterface_ce);
+ zend_declare_property_null(phalcon_logger_loggerfactory_ce, SL("adapterFactory"), ZEND_ACC_PRIVATE);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Translate_Interpolator_AssociativeArray, replacePlaceholders)
+static PHP_METHOD(Phalcon_Logger_LoggerFactory, __construct)
{
- 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;
+ zval *factory, factory_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&translation);
- ZVAL_UNDEF(&interpolate);
- ZVAL_UNDEF(&placeholders);
+ ZVAL_UNDEF(&factory_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translation)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_logger_adapterfactory_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- 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_fetch_params_without_memory_grow(1, 0, &factory);
- 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, 418, &translation, &placeholders);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("adapterFactory"), factory);
}
+static PHP_METHOD(Phalcon_Logger_LoggerFactory, load)
+{
+ zend_bool _0;
+ zval data;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_2 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *config = NULL, config_sub, adapter, adapterClass, adapterFileName, adapterOptions, adapters, name, options, _3, _4, _5, *_6, _7, _1$$3, _8$$6, _9$$6, _10$$6, _11$$6, _12$$7, _13$$7, _14$$7, _15$$7;
+ zval *this_ptr = getThis();
-
-
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&config_sub);
+ ZVAL_UNDEF(&adapter);
+ ZVAL_UNDEF(&adapterClass);
+ ZVAL_UNDEF(&adapterFileName);
+ ZVAL_UNDEF(&adapterOptions);
+ ZVAL_UNDEF(&adapters);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_8$$6);
+ ZVAL_UNDEF(&_9$$6);
+ ZVAL_UNDEF(&_10$$6);
+ ZVAL_UNDEF(&_11$$6);
+ ZVAL_UNDEF(&_12$$7);
+ ZVAL_UNDEF(&_13$$7);
+ ZVAL_UNDEF(&_14$$7);
+ ZVAL_UNDEF(&_15$$7);
+ ZVAL_UNDEF(&data);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(config)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &config);
+ ZEPHIR_SEPARATE_PARAM(config);
-
-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;
+ _0 = Z_TYPE_P(config) == IS_OBJECT;
+ if (_0) {
+ _0 = zephir_instance_of_ev(config, phalcon_config_configinterface_ce);
+ }
+ if (_0) {
+ ZEPHIR_CALL_METHOD(&_1$$3, config, "toarray", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(config, &_1$$3);
+ }
+ if (UNEXPECTED(Z_TYPE_P(config) != IS_ARRAY)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Config must be array or Phalcon\\Config object", "phalcon/Logger/LoggerFactory.zep", 64);
+ return;
+ }
+ if (UNEXPECTED(!(zephir_array_isset_string(config, SL("name"))))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "You must provide 'name' option in factory config parameter.", "phalcon/Logger/LoggerFactory.zep", 70);
+ return;
+ }
+ ZEPHIR_OBS_VAR(&name);
+ zephir_array_fetch_string(&name, config, SL("name"), PH_NOISY, "phalcon/Logger/LoggerFactory.zep", 73);
+ ZEPHIR_INIT_VAR(&_3);
+ array_init(&_3);
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_STRING(&_4, "options");
+ ZEPHIR_CALL_CE_STATIC(&options, phalcon_helper_arr_ce, "get", &_2, 16, config, &_4, &_3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_4);
+ array_init(&_4);
+ ZEPHIR_INIT_VAR(&_5);
+ ZVAL_STRING(&_5, "adapters");
+ ZEPHIR_CALL_CE_STATIC(&adapters, phalcon_helper_arr_ce, "get", &_2, 16, config, &_5, &_4);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&data);
+ array_init(&data);
+ zephir_is_iterable(&adapters, 0, "phalcon/Logger/LoggerFactory.zep", 90);
+ if (Z_TYPE_P(&adapters) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&adapters), _6)
+ {
+ ZEPHIR_INIT_NVAR(&adapter);
+ ZVAL_COPY(&adapter, _6);
+ ZEPHIR_INIT_NVAR(&_8$$6);
+ ZVAL_STRING(&_8$$6, "adapter");
+ ZEPHIR_CALL_CE_STATIC(&adapterClass, phalcon_helper_arr_ce, "get", &_2, 16, &adapter, &_8$$6);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_8$$6);
+ ZVAL_STRING(&_8$$6, "name");
+ ZEPHIR_CALL_CE_STATIC(&adapterFileName, phalcon_helper_arr_ce, "get", &_2, 16, &adapter, &_8$$6);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_8$$6);
+ array_init(&_8$$6);
+ ZEPHIR_INIT_NVAR(&_9$$6);
+ ZVAL_STRING(&_9$$6, "options");
+ ZEPHIR_CALL_CE_STATIC(&adapterOptions, phalcon_helper_arr_ce, "get", &_2, 16, &adapter, &_9$$6, &_8$$6);
+ zephir_check_call_status();
+ zephir_read_property(&_10$$6, this_ptr, ZEND_STRL("adapterFactory"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_11$$6, &_10$$6, "newinstance", NULL, 0, &adapterClass, &adapterFileName, &adapterOptions);
+ zephir_check_call_status();
+ zephir_array_append(&data, &_11$$6, PH_SEPARATE, "phalcon/Logger/LoggerFactory.zep", 87);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &adapters, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_7, &adapters, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_7)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&adapter, &adapters, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_12$$7);
+ ZVAL_STRING(&_12$$7, "adapter");
+ ZEPHIR_CALL_CE_STATIC(&adapterClass, phalcon_helper_arr_ce, "get", &_2, 16, &adapter, &_12$$7);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_12$$7);
+ ZVAL_STRING(&_12$$7, "name");
+ ZEPHIR_CALL_CE_STATIC(&adapterFileName, phalcon_helper_arr_ce, "get", &_2, 16, &adapter, &_12$$7);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_12$$7);
+ array_init(&_12$$7);
+ ZEPHIR_INIT_NVAR(&_13$$7);
+ ZVAL_STRING(&_13$$7, "options");
+ ZEPHIR_CALL_CE_STATIC(&adapterOptions, phalcon_helper_arr_ce, "get", &_2, 16, &adapter, &_13$$7, &_12$$7);
+ zephir_check_call_status();
+ zephir_read_property(&_14$$7, this_ptr, ZEND_STRL("adapterFactory"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_15$$7, &_14$$7, "newinstance", NULL, 0, &adapterClass, &adapterFileName, &adapterOptions);
+ zephir_check_call_status();
+ zephir_array_append(&data, &_15$$7, PH_SEPARATE, "phalcon/Logger/LoggerFactory.zep", 87);
+ ZEPHIR_CALL_METHOD(NULL, &adapters, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&adapter);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &data);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Translate_Interpolator_IndexedArray, replacePlaceholders)
+static PHP_METHOD(Phalcon_Logger_LoggerFactory, newInstance)
{
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 *this_ptr = getThis();
-
- ZVAL_UNDEF(&translation);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&placeholders);
+ zval adapters;
+ zval *name_param = NULL, *adapters_param = NULL;
+ zval name;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&adapters);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translation)
+ Z_PARAM_STR(name)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
+ Z_PARAM_ARRAY(adapters)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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"));
+ zephir_fetch_params(1, 1, 1, &name_param, &adapters_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(translation_param) == IS_STRING)) {
- zephir_get_strval(&translation, translation_param);
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
} else {
- ZEPHIR_INIT_VAR(&translation);
+ ZEPHIR_INIT_VAR(&name);
}
- if (!placeholders_param) {
- ZEPHIR_INIT_VAR(&placeholders);
- array_init(&placeholders);
+ if (!adapters_param) {
+ ZEPHIR_INIT_VAR(&adapters);
+ array_init(&adapters);
} else {
- zephir_get_arrval(&placeholders, placeholders_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&adapters, adapters_param);
}
- if (zephir_fast_count_int(&placeholders)) {
- ZEPHIR_MAKE_REF(&placeholders);
- ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 0, &placeholders, &translation);
- ZEPHIR_UNREF(&placeholders);
- 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_check_call_status();
- RETURN_MM();
- }
- RETURN_CTOR(&translation);
+ object_init_ex(return_value, phalcon_logger_ce);
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 419, &name, &adapters);
+ zephir_check_call_status();
+ RETURN_MM();
}
@@ -209217,29 +210039,47 @@ static PHP_METHOD(Phalcon_Translate_Interpolator_IndexedArray, replacePlaceholde
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Interpolator_InterpolatorInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Logger_Formatter_AbstractFormatter)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Translate\\Interpolator, InterpolatorInterface, phalcon, translate_interpolator_interpolatorinterface, phalcon_translate_interpolator_interpolatorinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Logger\\Formatter, AbstractFormatter, phalcon, logger_formatter_abstractformatter, phalcon_logger_formatter_abstractformatter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ zend_declare_property_null(phalcon_logger_formatter_abstractformatter_ce, SL("dateFormat"), ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_logger_formatter_abstractformatter_ce, 1, phalcon_logger_formatter_formatterinterface_ce);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Translate_Interpolator_InterpolatorInterface, replacePlaceholders);
+static PHP_METHOD(Phalcon_Logger_Formatter_AbstractFormatter, getDateFormat)
+{
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
+ RETURN_MEMBER(getThis(), "dateFormat");
+}
+static PHP_METHOD(Phalcon_Logger_Formatter_AbstractFormatter, setDateFormat)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *dateFormat_param = NULL;
+ zval dateFormat;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&dateFormat);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(dateFormat)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &dateFormat_param);
+ zephir_get_strval(&dateFormat, dateFormat_param);
-ZEPHIR_INIT_CLASS(Phalcon_Url_Exception)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Url, Exception, phalcon, url_exception, phalcon_exception_ce, NULL, 0);
- return SUCCESS;
+ zephir_update_property_zval(this_ptr, ZEND_STRL("dateFormat"), &dateFormat);
+ RETURN_THIS();
}
@@ -209252,20 +210092,14 @@ ZEPHIR_INIT_CLASS(Phalcon_Url_Exception)
-ZEPHIR_INIT_CLASS(Phalcon_Url_UrlInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Logger_Formatter_FormatterInterface)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Url, UrlInterface, phalcon, url_urlinterface, phalcon_url_urlinterface_method_entry);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Logger\\Formatter, FormatterInterface, phalcon, logger_formatter_formatterinterface, phalcon_logger_formatter_formatterinterface_method_entry);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Url_UrlInterface, get);
-ZEPHIR_DOC_METHOD(Phalcon_Url_UrlInterface, getBasePath);
-ZEPHIR_DOC_METHOD(Phalcon_Url_UrlInterface, getBaseUri);
-ZEPHIR_DOC_METHOD(Phalcon_Url_UrlInterface, setBasePath);
-ZEPHIR_DOC_METHOD(Phalcon_Url_UrlInterface, setBaseUri);
-ZEPHIR_DOC_METHOD(Phalcon_Url_UrlInterface, path);
-
+ZEPHIR_DOC_METHOD(Phalcon_Logger_Formatter_FormatterInterface, format);
@@ -209276,277 +210110,107 @@ ZEPHIR_DOC_METHOD(Phalcon_Url_UrlInterface, path);
-static void phalcon_get_uri(zval *return_value, zval *path)
+ZEPHIR_INIT_CLASS(Phalcon_Logger_Formatter_Json)
{
- int i, found = 0, mark = 0;
- char *cursor, *str, ch;
-
- if (Z_TYPE_P(path) != IS_STRING) {
- RETURN_EMPTY_STRING();
- }
-
- if (Z_STRLEN_P(path) > 0) {
- cursor = Z_STRVAL_P(path) + Z_STRLEN_P(path) - 1;
- for (i = Z_STRLEN_P(path); i > 0; i--) {
- ch = *cursor;
- if (ch == '/' || ch == '\\') {
- found++;
- if (found == 1) {
- mark = i - 1;
- } else {
- str = emalloc(mark - i + 1);
- memcpy(str, Z_STRVAL_P(path) + i, mark - i);
- str[mark - i] = '\0';
- ZVAL_STRINGL(return_value, str, mark - i);
- return;
- }
- }
- cursor--;
- }
- }
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Logger\\Formatter, Json, phalcon, logger_formatter_json, phalcon_logger_formatter_abstractformatter_ce, phalcon_logger_formatter_json_method_entry, 0);
- RETURN_EMPTY_STRING();
+ return SUCCESS;
}
-zval *phalcon_replace_marker(int named, zval *paths, zval *replacements, unsigned long *position, char *cursor, char *marker)
+static PHP_METHOD(Phalcon_Logger_Formatter_Json, __construct)
{
- unsigned int length = 0, variable_length, ch, j;
- char *item = NULL, *cursor_var, *variable = NULL;
- int not_valid = 0;
- zval *zv, *tmp;
-
- if (named) {
- length = cursor - marker - 1;
- item = estrndup(marker + 1, length);
- cursor_var = item;
- marker = item;
- for (j = 0; j < length; j++) {
- ch = *cursor_var;
- if (ch == '\0') {
- not_valid = 1;
- break;
- }
- if (j == 0 && !((ch >= 'a' && ch <='z') || (ch >= 'A' && ch <= 'Z'))){
- not_valid = 1;
- break;
- }
- if ((ch >= 'a' && ch <='z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || ch == '-' || ch == '_' || ch == ':') {
- if (ch == ':') {
- variable_length = cursor_var - marker;
- variable = estrndup(marker, variable_length);
- break;
- }
- } else {
- not_valid = 1;
- break;
- }
- cursor_var++;
- }
- }
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *dateFormat_param = NULL;
+ zval dateFormat;
+ zval *this_ptr = getThis();
- if (!not_valid) {
+ ZVAL_UNDEF(&dateFormat);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(dateFormat)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
- if (zend_hash_index_exists(Z_ARRVAL_P(paths), *position)) {
- if (named) {
- if (variable) {
- efree(item);
- item = variable;
- length = variable_length;
- }
- if (zend_hash_str_exists(Z_ARRVAL_P(replacements), item, length)) {
- if ((zv = zend_hash_str_find(Z_ARRVAL_P(replacements), item, length)) != NULL) {
- efree(item);
- (*position)++;
- return zv;
- }
- }
- } else {
- if ((zv = zend_hash_index_find(Z_ARRVAL_P(paths), *position)) != NULL) {
- if (Z_TYPE_P(zv) == IS_STRING) {
- if (zend_hash_str_exists(Z_ARRVAL_P(replacements), Z_STRVAL_P(zv), Z_STRLEN_P(zv))) {
- if ((tmp = zend_hash_str_find(Z_ARRVAL_P(replacements), Z_STRVAL_P(zv), Z_STRLEN_P(zv))) != NULL) {
- (*position)++;
- return tmp;
- }
- }
- }
- }
- }
- }
- (*position)++;
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 0, 1, &dateFormat_param);
+ if (!dateFormat_param) {
+ ZEPHIR_INIT_VAR(&dateFormat);
+ ZVAL_STRING(&dateFormat, "c");
+ } else {
+ zephir_get_strval(&dateFormat, dateFormat_param);
}
- if (item) {
- efree(item);
- }
- return NULL;
+ zephir_update_property_zval(this_ptr, ZEND_STRL("dateFormat"), &dateFormat);
+ ZEPHIR_MM_RESTORE();
}
-static void phalcon_replace_paths(zval *return_value, zval *pattern, zval *paths, zval *replacements)
+static PHP_METHOD(Phalcon_Logger_Formatter_Json, format)
{
+ zval _3;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_2 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *item, item_sub, interpolate, message, time, _0, _1, _4, _5;
+ zval *this_ptr = getThis();
- char *cursor, *marker = NULL;
- unsigned int bracket_count = 0, parentheses_count = 0, intermediate = 0;
- unsigned char ch;
- smart_str route_str = {0};
- zend_ulong position = 1;
- int i;
- zval *replace, replace_copy;
- int use_copy, looking_placeholder = 0;
-
- if (Z_TYPE_P(pattern) != IS_STRING || Z_TYPE_P(replacements) != IS_ARRAY || Z_TYPE_P(paths) != IS_ARRAY) {
- ZVAL_NULL(return_value);
- php_error_docref(NULL, E_WARNING, "Invalid arguments supplied for phalcon_replace_paths()");
- return;
- }
-
- if (Z_STRLEN_P(pattern) <= 0) {
- ZVAL_FALSE(return_value);
- return;
- }
-
- cursor = Z_STRVAL_P(pattern);
- if (*cursor == '/') {
- ++cursor;
- i = 1;
- }
- else {
- i = 0;
- }
-
- if (!zend_hash_num_elements(Z_ARRVAL_P(paths))) {
- ZVAL_STRINGL(return_value, Z_STRVAL_P(pattern) + i, Z_STRLEN_P(pattern) - i);
- return;
- }
-
- for (; i < Z_STRLEN_P(pattern); ++i) {
-
- ch = *cursor;
- if (ch == '\0') {
- break;
- }
-
- if (parentheses_count == 0 && !looking_placeholder) {
- if (ch == '{') {
- if (bracket_count == 0) {
- marker = cursor;
- intermediate = 0;
- }
- bracket_count++;
- } else {
- if (ch == '}') {
- bracket_count--;
- if (intermediate > 0) {
- if (bracket_count == 0) {
- replace = phalcon_replace_marker(1, paths, replacements, &position, cursor, marker);
- if (replace) {
- use_copy = 0;
- if (Z_TYPE_P(replace) != IS_STRING) {
- use_copy = zend_make_printable_zval(replace, &replace_copy);
- if (use_copy) {
- replace = &replace_copy;
- }
- }
- smart_str_appendl(&route_str, Z_STRVAL_P(replace), Z_STRLEN_P(replace));
- if (use_copy) {
- zval_dtor(&replace_copy);
- }
- }
- cursor++;
- continue;
- }
- }
- }
- }
- }
+ ZVAL_UNDEF(&item_sub);
+ ZVAL_UNDEF(&interpolate);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&time);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(item, phalcon_logger_item_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
- if (bracket_count == 0 && !looking_placeholder) {
- if (ch == '(') {
- if (parentheses_count == 0) {
- marker = cursor;
- intermediate = 0;
- }
- parentheses_count++;
- } else {
- if (ch == ')') {
- parentheses_count--;
- if (intermediate > 0) {
- if (parentheses_count == 0) {
- replace = phalcon_replace_marker(0, paths, replacements, &position, cursor, marker);
- if (replace) {
- use_copy = 0;
- if (Z_TYPE_P(replace) != IS_STRING) {
- use_copy = zend_make_printable_zval(replace, &replace_copy);
- if (use_copy) {
- replace = &replace_copy;
- }
- }
- smart_str_appendl(&route_str, Z_STRVAL_P(replace), Z_STRLEN_P(replace));
- if (use_copy) {
- zval_dtor(&replace_copy);
- }
- }
- cursor++;
- continue;
- }
- }
- }
- }
- }
- if (bracket_count == 0 && parentheses_count == 0) {
- if (looking_placeholder) {
- if (intermediate > 0) {
- if (ch < 'a' || ch > 'z' || i == (Z_STRLEN_P(pattern) - 1)) {
- replace = phalcon_replace_marker(0, paths, replacements, &position, cursor, marker);
- if (replace) {
- use_copy = 0;
- if (Z_TYPE_P(replace) != IS_STRING) {
- use_copy = zend_make_printable_zval(replace, &replace_copy);
- if (use_copy) {
- replace = &replace_copy;
- }
- }
- smart_str_appendl(&route_str, Z_STRVAL_P(replace), Z_STRLEN_P(replace));
- if (use_copy) {
- zval_dtor(&replace_copy);
- }
- }
- looking_placeholder = 0;
- continue;
- }
- }
- } else {
- if (ch == ':') {
- looking_placeholder = 1;
- marker = cursor;
- intermediate = 0;
- }
- }
- }
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &item);
- if (bracket_count > 0 || parentheses_count > 0 || looking_placeholder) {
- intermediate++;
- } else {
- smart_str_appendc(&route_str, ch);
- }
- cursor++;
+ ZEPHIR_CALL_METHOD(&time, item, "gettime", NULL, 0);
+ zephir_check_call_status();
+ 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();
}
- smart_str_0(&route_str);
- if (route_str.s) {
- RETURN_STR(route_str.s);
- } else {
- smart_str_free(&route_str);
- RETURN_EMPTY_STRING();
- }
+ ZEPHIR_CALL_METHOD(&_0, item, "getmessage", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_1, item, "getcontext", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&message, &interpolate, "__invoke", NULL, 418, &_0, &_1);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_3);
+ zephir_create_array(&_3, 3, 0);
+ ZEPHIR_CALL_METHOD(&_4, item, "getlevelname", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_update_string(&_3, SL("level"), &_4, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_3, SL("message"), &message, PH_COPY | PH_SEPARATE);
+ zephir_read_property(&_5, this_ptr, ZEND_STRL("dateFormat"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_4, &time, "format", NULL, 0, &_5);
+ zephir_check_call_status();
+ zephir_array_update_string(&_3, SL("timestamp"), &_4, PH_COPY | PH_SEPARATE);
+ ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_helper_json_ce, "encode", &_2, 14, &_3);
+ zephir_check_call_status();
+ RETURN_MM();
}
+
#ifdef HAVE_CONFIG_H
#endif
@@ -209554,734 +210218,459 @@ static void phalcon_replace_paths(zval *return_value, zval *pattern, zval *paths
-ZEPHIR_INIT_CLASS(Phalcon_Validation_AbstractCombinedFieldsValidator)
+ZEPHIR_INIT_CLASS(Phalcon_Logger_Formatter_Line)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation, AbstractCombinedFieldsValidator, phalcon, validation_abstractcombinedfieldsvalidator, phalcon_validation_abstractvalidator_ce, NULL, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Logger\\Formatter, Line, phalcon, logger_formatter_line, phalcon_logger_formatter_abstractformatter_ce, phalcon_logger_formatter_line_method_entry, 0);
+ zend_declare_property_null(phalcon_logger_formatter_line_ce, SL("format"), ZEND_ACC_PROTECTED);
return SUCCESS;
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Validation_AbstractValidator)
+static PHP_METHOD(Phalcon_Logger_Formatter_Line, getFormat)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Validation, AbstractValidator, phalcon, validation_abstractvalidator, phalcon_validation_abstractvalidator_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ zval *this_ptr = getThis();
- zend_declare_property_null(phalcon_validation_abstractvalidator_ce, SL("template"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_validation_abstractvalidator_ce, SL("templates"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_validation_abstractvalidator_ce, SL("options"), ZEND_ACC_PROTECTED);
- phalcon_validation_abstractvalidator_ce->create_object = zephir_init_properties_Phalcon_Validation_AbstractValidator;
- zend_class_implements(phalcon_validation_abstractvalidator_ce, 1, phalcon_validation_validatorinterface_ce);
- return SUCCESS;
+
+ RETURN_MEMBER(getThis(), "format");
}
-static PHP_METHOD(Phalcon_Validation_AbstractValidator, __construct)
+static PHP_METHOD(Phalcon_Logger_Formatter_Line, setFormat)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_1 = NULL;
- zval *options_param = NULL, template, _0, _3;
- zval options, _2;
+ zval *format_param = NULL;
+ zval format;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&template);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&format);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(format)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &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, &format_param);
+ zephir_get_strval(&format, format_param);
- ZEPHIR_INIT_VAR(&_2);
- zephir_create_array(&_2, 3, 0);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "template");
- zephir_array_fast_append(&_2, &_3);
- ZEPHIR_INIT_NVAR(&_3);
- ZVAL_STRING(&_3, "message");
- zephir_array_fast_append(&_2, &_3);
- ZEPHIR_INIT_NVAR(&_3);
- ZVAL_LONG(&_3, 0);
- zephir_array_fast_append(&_2, &_3);
- ZEPHIR_CALL_CE_STATIC(&_0, phalcon_helper_arr_ce, "whitelist", &_1, 3, &options, &_2);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&template, "current", NULL, 4, &_0);
- zephir_check_call_status();
- if (Z_TYPE_P(&template) == IS_ARRAY) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "settemplates", NULL, 0, &template);
- zephir_check_call_status();
- } else if (Z_TYPE_P(&template) == IS_STRING) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "settemplate", NULL, 0, &template);
- zephir_check_call_status();
- }
- if (zephir_is_true(&template)) {
- zephir_array_update_string(&options, SL("message"), &template, PH_COPY | PH_SEPARATE);
- zephir_array_unset_string(&options, SL("template"), PH_SEPARATE);
- zephir_array_unset_long(&options, 0, PH_SEPARATE);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
- ZEPHIR_MM_RESTORE();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("format"), &format);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Validation_AbstractValidator, getTemplate)
+static PHP_METHOD(Phalcon_Logger_Formatter_Line, __construct)
{
- zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *field_param = NULL, _1, _4, _5, _2$$3, _3$$3;
- zval field;
+ zval *format_param = NULL, *dateFormat_param = NULL;
+ zval format, dateFormat;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&field);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&format);
+ ZVAL_UNDEF(&dateFormat);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
- Z_PARAM_STR_OR_NULL(field)
+ Z_PARAM_STR(format)
+ Z_PARAM_STR(dateFormat)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &field_param);
- if (!field_param) {
- ZEPHIR_INIT_VAR(&field);
+ zephir_fetch_params(1, 0, 2, &format_param, &dateFormat_param);
+ if (!format_param) {
+ ZEPHIR_INIT_VAR(&format);
+ ZVAL_STRING(&format, "[%date%][%level%] %message%");
} else {
- if (UNEXPECTED(Z_TYPE_P(field_param) != IS_STRING && Z_TYPE_P(field_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'field' must be of the type string"));
- RETURN_MM_NULL();
+ zephir_get_strval(&format, format_param);
}
- if (EXPECTED(Z_TYPE_P(field_param) == IS_STRING)) {
- zephir_get_strval(&field, field_param);
+ if (!dateFormat_param) {
+ ZEPHIR_INIT_VAR(&dateFormat);
+ ZVAL_STRING(&dateFormat, "c");
} else {
- ZEPHIR_INIT_VAR(&field);
- }
- }
-
-
- _0 = !ZEPHIR_IS_NULL(&field);
- if (_0) {
- zephir_read_property(&_1, this_ptr, ZEND_STRL("templates"), PH_NOISY_CC | PH_READONLY);
- _0 = zephir_array_isset(&_1, &field);
- }
- if (_0) {
- zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("templates"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_3$$3, &_2$$3, &field, PH_NOISY | PH_READONLY, "phalcon/Validation/AbstractValidator.zep", 77);
- RETURN_CTOR(&_3$$3);
- }
- zephir_read_property(&_4, this_ptr, ZEND_STRL("template"), PH_NOISY_CC | PH_READONLY);
- if (zephir_is_true(&_4)) {
- RETURN_MM_MEMBER(getThis(), "template");
+ zephir_get_strval(&dateFormat, dateFormat_param);
}
- ZEPHIR_INIT_VAR(&_5);
- zephir_get_class(&_5, this_ptr, 0);
- ZEPHIR_CONCAT_SV(return_value, "The field :field is not valid for ", &_5);
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Validation_AbstractValidator, getTemplates)
-{
- zval *this_ptr = getThis();
-
- RETURN_MEMBER(getThis(), "templates");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("format"), &format);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("dateFormat"), &dateFormat);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_AbstractValidator, setTemplates)
+static PHP_METHOD(Phalcon_Logger_Formatter_Line, format)
{
- zval _5$$3, _6$$3, _7$$4, _8$$4;
- zend_string *_4;
- zend_ulong _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *templates_param = NULL, field, template, _0, *_1, _2;
- zval templates;
+ zval *item, item_sub, context, format, interpolate, time, _0, _1, _2, _3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&templates);
- ZVAL_UNDEF(&field);
- ZVAL_UNDEF(&template);
+ ZVAL_UNDEF(&item_sub);
+ ZVAL_UNDEF(&context);
+ ZVAL_UNDEF(&format);
+ ZVAL_UNDEF(&interpolate);
+ ZVAL_UNDEF(&time);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_6$$3);
- ZVAL_UNDEF(&_7$$4);
- ZVAL_UNDEF(&_8$$4);
+ ZVAL_UNDEF(&_3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(templates)
+ Z_PARAM_OBJECT_OF_CLASS(item, phalcon_logger_item_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &templates_param);
- ZEPHIR_OBS_COPY_OR_DUP(&templates, templates_param);
+ zephir_fetch_params(1, 1, 0, &item);
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("templates"), &_0);
- zephir_is_iterable(&templates, 0, "phalcon/Validation/AbstractValidator.zep", 116);
- if (Z_TYPE_P(&templates) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&templates), _3, _4, _1)
- {
- ZEPHIR_INIT_NVAR(&field);
- if (_4 != NULL) {
- ZVAL_STR_COPY(&field, _4);
- } else {
- ZVAL_LONG(&field, _3);
- }
- ZEPHIR_INIT_NVAR(&template);
- ZVAL_COPY(&template, _1);
- zephir_cast_to_string(&_5$$3, &field);
- ZEPHIR_CPY_WRT(&field, &_5$$3);
- zephir_cast_to_string(&_6$$3, &template);
- ZEPHIR_CPY_WRT(&template, &_6$$3);
- zephir_update_property_array(this_ptr, SL("templates"), &field, &template);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &templates, "rewind", NULL, 0);
+ ZEPHIR_CALL_METHOD(&context, item, "getcontext", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("format"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&format, &_0);
+ ZEPHIR_CALL_METHOD(&time, item, "gettime", NULL, 0);
+ zephir_check_call_status();
+ 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();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2, &templates, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_2)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&field, &templates, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&template, &templates, "current", NULL, 0);
- zephir_check_call_status();
- zephir_cast_to_string(&_7$$4, &field);
- ZEPHIR_CPY_WRT(&field, &_7$$4);
- zephir_cast_to_string(&_8$$4, &template);
- ZEPHIR_CPY_WRT(&template, &_8$$4);
- zephir_update_property_array(this_ptr, SL("templates"), &field, &template);
- ZEPHIR_CALL_METHOD(NULL, &templates, "next", NULL, 0);
- zephir_check_call_status();
- }
}
- ZEPHIR_INIT_NVAR(&template);
- ZEPHIR_INIT_NVAR(&field);
- RETURN_THIS();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("dateFormat"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, &time, "format", NULL, 0, &_0);
+ zephir_check_call_status();
+ zephir_array_update_string(&context, SL("date"), &_1, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(&_2, item, "getlevelname", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_update_string(&context, SL("level"), &_2, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(&_3, item, "getmessage", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_update_string(&context, SL("message"), &_3, PH_COPY | PH_SEPARATE);
+ ZEPHIR_RETURN_CALL_METHOD(&interpolate, "__invoke", NULL, 418, &format, &context);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Validation_AbstractValidator, setTemplate)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *template_param = NULL;
- zval template;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&template);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(template)
- ZEND_PARSE_PARAMETERS_END();
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &template_param);
- if (UNEXPECTED(Z_TYPE_P(template_param) != IS_STRING && Z_TYPE_P(template_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'template' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(template_param) == IS_STRING)) {
- zephir_get_strval(&template, template_param);
- } else {
- ZEPHIR_INIT_VAR(&template);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("template"), &template);
- RETURN_THIS();
+
+ZEPHIR_INIT_CLASS(Phalcon_Logger_Adapter_AbstractAdapter)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Logger\\Adapter, AbstractAdapter, phalcon, logger_adapter_abstractadapter, phalcon_logger_adapter_abstractadapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+
+ zend_declare_property_string(phalcon_logger_adapter_abstractadapter_ce, SL("defaultFormatter"), "Line", ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_logger_adapter_abstractadapter_ce, SL("formatter"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_logger_adapter_abstractadapter_ce, SL("inTransaction"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_logger_adapter_abstractadapter_ce, SL("queue"), ZEND_ACC_PROTECTED);
+ phalcon_logger_adapter_abstractadapter_ce->create_object = zephir_init_properties_Phalcon_Logger_Adapter_AbstractAdapter;
+
+ zend_class_implements(phalcon_logger_adapter_abstractadapter_ce, 1, phalcon_logger_adapter_adapterinterface_ce);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_AbstractValidator, getOption)
+static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, __destruct)
{
- zend_bool _1;
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, value, fieldValue, _0;
- zval key;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&fieldValue);
ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- 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();
-#endif
ZEPHIR_MM_GROW();
- 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_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&value, &_0, &key, 1))) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
- }
- _1 = ZEPHIR_IS_STRING(&key, "attribute");
- if (_1) {
- _1 = Z_TYPE_P(&value) == IS_ARRAY;
- }
- if (_1) {
- if (zephir_array_isset_fetch(&fieldValue, &value, &key, 1)) {
- RETURN_CTOR(&fieldValue);
- }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("inTransaction"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_is_true(&_0)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "There is an active transaction", "phalcon/Logger/Adapter/AbstractAdapter.zep", 54);
+ return;
}
- RETURN_CTOR(&value);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "close", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_AbstractValidator, hasOption)
+static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, __serialize)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key_param = NULL, _0;
- zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- 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("options"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL(zephir_array_isset(&_0, &key));
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_logger_exception_ce, "This object cannot be serialized", "phalcon/Logger/Adapter/AbstractAdapter.zep", 65);
+ return;
}
-static PHP_METHOD(Phalcon_Validation_AbstractValidator, setOption)
+static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, __unserialize)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key_param = NULL, *value, value_sub;
- zval key;
+ zval *data_param = NULL;
+ zval data;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&data);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(data)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- 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_fetch_params(1, 1, 0, &data_param);
+ zephir_get_arrval(&data, data_param);
- zephir_update_property_array(this_ptr, SL("options"), &key, value);
- ZEPHIR_MM_RESTORE();
-}
-static PHP_METHOD(Phalcon_Validation_AbstractValidator, validate)
-{
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "This object cannot be unserialized", "phalcon/Logger/Adapter/AbstractAdapter.zep", 73);
+ return;
}
-static PHP_METHOD(Phalcon_Validation_AbstractValidator, prepareCode)
+static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, add)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *field_param = NULL, code, _0, _1$$3;
- zval field;
+ zval *item, item_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&field);
- ZVAL_UNDEF(&code);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&item_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(field)
+ Z_PARAM_OBJECT_OF_CLASS(item, phalcon_logger_item_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &field_param);
- if (UNEXPECTED(Z_TYPE_P(field_param) != IS_STRING && Z_TYPE_P(field_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'field' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(field_param) == IS_STRING)) {
- zephir_get_strval(&field, field_param);
- } else {
- ZEPHIR_INIT_VAR(&field);
- }
+ zephir_fetch_params_without_memory_grow(1, 0, &item);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "code");
- ZEPHIR_CALL_METHOD(&code, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (Z_TYPE_P(&code) == IS_ARRAY) {
- zephir_array_fetch(&_1$$3, &code, &field, PH_NOISY | PH_READONLY, "phalcon/Validation/AbstractValidator.zep", 187);
- ZEPHIR_CPY_WRT(&code, &_1$$3);
- }
- RETURN_CCTOR(&code);
+ zephir_update_property_array_append(this_ptr, SL("queue"), item);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Validation_AbstractValidator, prepareLabel)
+static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, begin)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval field;
- zval *validation, validation_sub, *field_param = NULL, label, _0, _1$$3;
+ zval __$true, __$false;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&label);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&field);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_STR(field)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field_param);
- if (UNEXPECTED(Z_TYPE_P(field_param) != IS_STRING && Z_TYPE_P(field_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'field' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(field_param) == IS_STRING)) {
- zephir_get_strval(&field, field_param);
- } else {
- ZEPHIR_INIT_VAR(&field);
- }
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "label");
- ZEPHIR_CALL_METHOD(&label, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (Z_TYPE_P(&label) == IS_ARRAY) {
- zephir_array_fetch(&_1$$3, &label, &field, PH_NOISY | PH_READONLY, "phalcon/Validation/AbstractValidator.zep", 203);
- ZEPHIR_CPY_WRT(&label, &_1$$3);
- }
- if (ZEPHIR_IS_EMPTY(&label)) {
- ZEPHIR_CALL_METHOD(&label, validation, "getlabel", NULL, 0, &field);
- zephir_check_call_status();
+ if (1) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("inTransaction"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("inTransaction"), &__$false);
}
- RETURN_CCTOR(&label);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Validation_AbstractValidator, messageFactory)
+static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, commit)
{
+ zval inTransaction, item, queue, _0, *_1, _2, _4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_3 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval replacements, _1;
- zval *validation, validation_sub, *field, field_sub, *replacements_param = NULL, singleField, _0, _2, _3, _4, _5;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&singleField);
+ ZVAL_UNDEF(&inTransaction);
+ ZVAL_UNDEF(&item);
+ ZVAL_UNDEF(&queue);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&replacements);
- ZVAL_UNDEF(&_1);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(replacements)
- ZEND_PARSE_PARAMETERS_END();
-#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 1, &validation, &field, &replacements_param);
- if (!replacements_param) {
- ZEPHIR_INIT_VAR(&replacements);
- array_init(&replacements);
- } else {
- ZEPHIR_OBS_COPY_OR_DUP(&replacements, replacements_param);
- }
-
- if (Z_TYPE_P(field) == IS_ARRAY) {
- ZEPHIR_INIT_VAR(&singleField);
- zephir_fast_join_str(&singleField, SL(", "), field);
- } else if (Z_TYPE_P(field) == IS_STRING) {
- ZEPHIR_CPY_WRT(&singleField, field);
- } else {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "The field can not be printed", "phalcon/Validation/AbstractValidator.zep", 229);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("inTransaction"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&inTransaction, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("queue"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&queue, &_0);
+ if (!(zephir_is_true(&inTransaction))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "There is no active transaction", "phalcon/Logger/Adapter/AbstractAdapter.zep", 107);
return;
}
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_INIT_VAR(&_1);
- zephir_create_array(&_1, 1, 0);
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "preparelabel", NULL, 0, validation, &singleField);
- zephir_check_call_status();
- zephir_array_update_string(&_1, SL(":field"), &_2, PH_COPY | PH_SEPARATE);
- zephir_fast_array_merge(&_0, &_1, &replacements);
- ZEPHIR_CPY_WRT(&replacements, &_0);
- object_init_ex(return_value, phalcon_messages_message_ce);
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "gettemplate", NULL, 0, &singleField);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&_3, "strtr", NULL, 5, &_2, &replacements);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_4);
- zephir_get_class(&_4, this_ptr, 0);
- ZEPHIR_CALL_METHOD(&_5, this_ptr, "preparecode", NULL, 0, &singleField);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 6, &_3, field, &_4, &_5);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-zend_object *zephir_init_properties_Phalcon_Validation_AbstractValidator(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_MM_GROW();
-
- {
- 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_ex(&_2, this_ptr, ZEND_STRL("templates"), 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("templates"), &_3$$4);
+ zephir_is_iterable(&queue, 0, "phalcon/Logger/Adapter/AbstractAdapter.zep", 118);
+ if (Z_TYPE_P(&queue) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&queue), _1)
+ {
+ ZEPHIR_INIT_NVAR(&item);
+ ZVAL_COPY(&item, _1);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "process", &_3, 0, &item);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &queue, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, &queue, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&item, &queue, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "process", &_3, 0, &item);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &queue, "next", NULL, 0);
+ zephir_check_call_status();
}
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
}
+ ZEPHIR_INIT_NVAR(&item);
+ ZEPHIR_INIT_NVAR(&inTransaction);
+ ZVAL_BOOL(&inTransaction, 0);
+ ZEPHIR_INIT_VAR(&_4);
+ array_init(&_4);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("queue"), &_4);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("inTransaction"), &inTransaction);
+ RETURN_THIS();
}
+static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, getFormatter)
+{
+ zval _0, _1$$3, _2$$3, _3$$3;
+ zval className;
+ 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(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZEPHIR_MM_GROW();
-#ifdef HAVE_CONFIG_H
-#endif
+ ZEPHIR_OBS_VAR(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("formatter"), PH_NOISY_CC);
+ if (Z_TYPE_P(&_0) != IS_OBJECT) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("defaultFormatter"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_SV(&_2$$3, "Phalcon\\Logger\\Formatter\\", &_1$$3);
+ zephir_get_strval(&className, &_2$$3);
+ ZEPHIR_INIT_VAR(&_3$$3);
+ ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&_3$$3, &className);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("formatter"), &_3$$3);
+ }
+ RETURN_MM_MEMBER(getThis(), "formatter");
+}
+static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, inTransaction)
+{
+ zval *this_ptr = getThis();
+ RETURN_MEMBER(getThis(), "inTransaction");
+}
-ZEPHIR_INIT_CLASS(Phalcon_Validation_AbstractValidatorComposite)
+static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, process)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation, AbstractValidatorComposite, phalcon, validation_abstractvalidatorcomposite, phalcon_validation_abstractvalidator_ce, phalcon_validation_abstractvalidatorcomposite_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+}
- zend_declare_property_null(phalcon_validation_abstractvalidatorcomposite_ce, SL("validators"), ZEND_ACC_PROTECTED);
- phalcon_validation_abstractvalidatorcomposite_ce->create_object = zephir_init_properties_Phalcon_Validation_AbstractValidatorComposite;
+static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, rollback)
+{
+ zval inTransaction, _0, _1;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *this_ptr = getThis();
- zend_class_implements(phalcon_validation_abstractvalidatorcomposite_ce, 1, phalcon_validation_validatorcompositeinterface_ce);
- return SUCCESS;
+ ZVAL_UNDEF(&inTransaction);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+
+
+ ZEPHIR_MM_GROW();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("inTransaction"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&inTransaction, &_0);
+ if (!(zephir_is_true(&inTransaction))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "There is no active transaction", "phalcon/Logger/Adapter/AbstractAdapter.zep", 161);
+ return;
+ }
+ ZEPHIR_INIT_VAR(&_1);
+ array_init(&_1);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("queue"), &_1);
+ ZEPHIR_INIT_NVAR(&inTransaction);
+ ZVAL_BOOL(&inTransaction, 0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("inTransaction"), &inTransaction);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Validation_AbstractValidatorComposite, getValidators)
+static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, setFormatter)
{
+ zval *formatter, formatter_sub;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&formatter_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(formatter, phalcon_logger_formatter_formatterinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
- RETURN_MEMBER(getThis(), "validators");
+ zephir_fetch_params_without_memory_grow(1, 0, &formatter);
+
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("formatter"), formatter);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Validation_AbstractValidatorComposite, validate)
+static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, getFormattedItem)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, validator, _0, _4, *_5, _6, _1$$3, _2$$3, _3$$3, _7$$4, _8$$6;
+ zval *item, item_sub, formatter, _0, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&validator);
+ ZVAL_UNDEF(&item_sub);
+ ZVAL_UNDEF(&formatter);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_7$$4);
- ZVAL_UNDEF(&_8$$6);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(item, phalcon_logger_item_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ zephir_fetch_params(1, 1, 0, &item);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getvalidators", NULL, 0);
+ ZEPHIR_CALL_METHOD(&formatter, this_ptr, "getformatter", NULL, 0);
zephir_check_call_status();
- if (UNEXPECTED(zephir_fast_count_int(&_0) == 0)) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_validation_exception_ce);
- ZEPHIR_INIT_VAR(&_2$$3);
- zephir_get_class(&_2$$3, this_ptr, 0);
- ZEPHIR_INIT_VAR(&_3$$3);
- ZEPHIR_CONCAT_VS(&_3$$3, &_2$$3, " does not have any validator added");
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 8, &_3$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Validation/AbstractValidatorComposite.zep", 33);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_CALL_METHOD(&_4, this_ptr, "getvalidators", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_0, &formatter, "format", NULL, 0, item);
zephir_check_call_status();
- zephir_is_iterable(&_4, 0, "phalcon/Validation/AbstractValidatorComposite.zep", 42);
- if (Z_TYPE_P(&_4) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_4), _5)
- {
- ZEPHIR_INIT_NVAR(&validator);
- ZVAL_COPY(&validator, _5);
- ZEPHIR_CALL_METHOD(&_7$$4, &validator, "validate", NULL, 0, validation, field);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_7$$4)) {
- RETURN_MM_BOOL(0);
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_4, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_6, &_4, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_6)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&validator, &_4, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_8$$6, &validator, "validate", NULL, 0, validation, field);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_8$$6)) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_CALL_METHOD(NULL, &_4, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&validator);
- RETURN_MM_BOOL(1);
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_GET_CONSTANT(&_1, "PHP_EOL");
+ ZEPHIR_CONCAT_VV(return_value, &_0, &_1);
+ RETURN_MM();
}
-zend_object *zephir_init_properties_Phalcon_Validation_AbstractValidatorComposite(zend_class_entry *class_type)
+zend_object *zephir_init_properties_Phalcon_Logger_Adapter_AbstractAdapter(zend_class_entry *class_type)
{
- zval _0, _2, _4, _1$$3, _3$$4, _5$$5;
+ zval _0, _1$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_4);
ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_5$$5);
ZEPHIR_MM_GROW();
@@ -210289,23 +210678,11 @@ zend_object *zephir_init_properties_Phalcon_Validation_AbstractValidatorComposit
{
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("queue"), 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("templates"), 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("templates"), &_3$$4);
- }
- zephir_read_property_ex(&_4, this_ptr, ZEND_STRL("validators"), 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("validators"), &_5$$5);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("queue"), &_1$$3);
}
ZEPHIR_MM_RESTORE();
return Z_OBJ_P(this_ptr);
@@ -210322,13 +210699,22 @@ zend_object *zephir_init_properties_Phalcon_Validation_AbstractValidatorComposit
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Exception)
+ZEPHIR_INIT_CLASS(Phalcon_Logger_Adapter_AdapterInterface)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation, Exception, phalcon, validation_exception, phalcon_exception_ce, NULL, 0);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Logger\\Adapter, AdapterInterface, phalcon, logger_adapter_adapterinterface, phalcon_logger_adapter_adapterinterface_method_entry);
return SUCCESS;
}
+ZEPHIR_DOC_METHOD(Phalcon_Logger_Adapter_AdapterInterface, add);
+ZEPHIR_DOC_METHOD(Phalcon_Logger_Adapter_AdapterInterface, begin);
+ZEPHIR_DOC_METHOD(Phalcon_Logger_Adapter_AdapterInterface, close);
+ZEPHIR_DOC_METHOD(Phalcon_Logger_Adapter_AdapterInterface, commit);
+ZEPHIR_DOC_METHOD(Phalcon_Logger_Adapter_AdapterInterface, getFormatter);
+ZEPHIR_DOC_METHOD(Phalcon_Logger_Adapter_AdapterInterface, inTransaction);
+ZEPHIR_DOC_METHOD(Phalcon_Logger_Adapter_AdapterInterface, process);
+ZEPHIR_DOC_METHOD(Phalcon_Logger_Adapter_AdapterInterface, rollback);
+ZEPHIR_DOC_METHOD(Phalcon_Logger_Adapter_AdapterInterface, setFormatter);
@@ -210339,46 +210725,41 @@ ZEPHIR_INIT_CLASS(Phalcon_Validation_Exception)
-ZEPHIR_INIT_CLASS(Phalcon_Validation_ValidationInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Logger_Adapter_Noop)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Validation, ValidationInterface, phalcon, validation_validationinterface, phalcon_validation_validationinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Logger\\Adapter, Noop, phalcon, logger_adapter_noop, phalcon_logger_adapter_abstractadapter_ce, phalcon_logger_adapter_noop_method_entry, 0);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidationInterface, add);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidationInterface, appendMessage);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidationInterface, bind);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidationInterface, getEntity);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidationInterface, getFilters);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidationInterface, getLabel);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidationInterface, getMessages);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidationInterface, getValidators);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidationInterface, getValue);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidationInterface, rule);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidationInterface, rules);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidationInterface, setFilters);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidationInterface, setLabels);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidationInterface, validate);
+static PHP_METHOD(Phalcon_Logger_Adapter_Noop, close)
+{
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
+ RETURN_BOOL(1);
+}
+static PHP_METHOD(Phalcon_Logger_Adapter_Noop, process)
+{
+ zval *item, item_sub;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&item_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(item, phalcon_logger_item_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+ zephir_fetch_params_without_memory_grow(1, 0, &item);
-ZEPHIR_INIT_CLASS(Phalcon_Validation_ValidatorCompositeInterface)
-{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Validation, ValidatorCompositeInterface, phalcon, validation_validatorcompositeinterface, phalcon_validation_validatorcompositeinterface_method_entry);
- return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidatorCompositeInterface, getValidators);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidatorCompositeInterface, validate);
@@ -210389,67 +210770,49 @@ ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidatorCompositeInterface, validate);
-ZEPHIR_INIT_CLASS(Phalcon_Validation_ValidatorFactory)
+ZEPHIR_INIT_CLASS(Phalcon_Logger_Adapter_Stream)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation, ValidatorFactory, phalcon, validation_validatorfactory, phalcon_factory_abstractfactory_ce, phalcon_validation_validatorfactory_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Logger\\Adapter, Stream, phalcon, logger_adapter_stream, phalcon_logger_adapter_abstractadapter_ce, phalcon_logger_adapter_stream_method_entry, 0);
- zend_declare_property_string(phalcon_validation_validatorfactory_ce, SL("exception"), "Phalcon\\Validation\\Exception", ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_logger_adapter_stream_ce, SL("handler"), ZEND_ACC_PROTECTED);
+ zend_declare_property_string(phalcon_logger_adapter_stream_ce, SL("mode"), "ab", ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_logger_adapter_stream_ce, SL("name"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_logger_adapter_stream_ce, SL("options"), ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_ValidatorFactory, __construct)
+static PHP_METHOD(Phalcon_Logger_Adapter_Stream, getName)
{
- 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);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(services)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- 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();
+ RETURN_MEMBER(getThis(), "name");
}
-static PHP_METHOD(Phalcon_Validation_ValidatorFactory, newInstance)
+static PHP_METHOD(Phalcon_Logger_Adapter_Stream, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, definition;
+ zval options;
+ zval *name_param = NULL, *options_param = NULL, mode;
zval name;
zval *this_ptr = getThis();
ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&mode);
+ ZVAL_UNDEF(&options);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(name)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &name_param);
+ 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();
@@ -210459,70 +210822,117 @@ static PHP_METHOD(Phalcon_Validation_ValidatorFactory, newInstance)
} else {
ZEPHIR_INIT_VAR(&name);
}
+ if (!options_param) {
+ ZEPHIR_INIT_VAR(&options);
+ array_init(&options);
+ } else {
+ zephir_get_arrval(&options, options_param);
+ }
- 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_check_call_status();
- RETURN_MM();
+ ZEPHIR_OBS_VAR(&mode);
+ if (zephir_array_isset_string_fetch(&mode, &options, SL("mode"), 0)) {
+ if (zephir_memnstr_str(&mode, SL("r"), "phalcon/Logger/Adapter/Stream.zep", 79)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Adapter cannot be opened in read mode", "phalcon/Logger/Adapter/Stream.zep", 80);
+ return;
+ }
+ }
+ if (Z_TYPE_P(&mode) == IS_NULL) {
+ ZEPHIR_INIT_NVAR(&mode);
+ ZVAL_STRING(&mode, "ab");
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mode"), &mode);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_ValidatorFactory, getAdapters)
+static PHP_METHOD(Phalcon_Logger_Adapter_Stream, close)
{
+ zend_bool result;
+ zval __$null, _0, _1$$3;
zval *this_ptr = getThis();
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
- zephir_create_array(return_value, 21, 0);
- add_assoc_stringl_ex(return_value, SL("alnum"), SL("Phalcon\\Validation\\Validator\\Alnum"));
- add_assoc_stringl_ex(return_value, SL("alpha"), SL("Phalcon\\Validation\\Validator\\Alpha"));
- add_assoc_stringl_ex(return_value, SL("between"), SL("Phalcon\\Validation\\Validator\\Between"));
- add_assoc_stringl_ex(return_value, SL("callback"), SL("Phalcon\\Validation\\Validator\\Callback"));
- add_assoc_stringl_ex(return_value, SL("confirmation"), SL("Phalcon\\Validation\\Validator\\Confirmation"));
- add_assoc_stringl_ex(return_value, SL("creditCard"), SL("Phalcon\\Validation\\Validator\\CreditCard"));
- add_assoc_stringl_ex(return_value, SL("date"), SL("Phalcon\\Validation\\Validator\\Date"));
- add_assoc_stringl_ex(return_value, SL("digit"), SL("Phalcon\\Validation\\Validator\\Digit"));
- add_assoc_stringl_ex(return_value, SL("email"), SL("Phalcon\\Validation\\Validator\\Email"));
- add_assoc_stringl_ex(return_value, SL("exception"), SL("Phalcon\\Validation\\Validator\\Exception"));
- add_assoc_stringl_ex(return_value, SL("exclusionIn"), SL("Phalcon\\Validation\\Validator\\ExclusionIn"));
- add_assoc_stringl_ex(return_value, SL("file"), SL("Phalcon\\Validation\\Validator\\File"));
- add_assoc_stringl_ex(return_value, SL("identical"), SL("Phalcon\\Validation\\Validator\\Identical"));
- add_assoc_stringl_ex(return_value, SL("inclusionIn"), SL("Phalcon\\Validation\\Validator\\InclusionIn"));
- add_assoc_stringl_ex(return_value, SL("ip"), SL("Phalcon\\Validation\\Validator\\Ip"));
- add_assoc_stringl_ex(return_value, SL("numericality"), SL("Phalcon\\Validation\\Validator\\Numericality"));
- add_assoc_stringl_ex(return_value, SL("presenceOf"), SL("Phalcon\\Validation\\Validator\\PresenceOf"));
- add_assoc_stringl_ex(return_value, SL("regex"), SL("Phalcon\\Validation\\Validator\\Regex"));
- add_assoc_stringl_ex(return_value, SL("stringLength"), SL("Phalcon\\Validation\\Validator\\StringLength"));
- add_assoc_stringl_ex(return_value, SL("uniqueness"), SL("Phalcon\\Validation\\Validator\\Uniqueness"));
- add_assoc_stringl_ex(return_value, SL("url"), SL("Phalcon\\Validation\\Validator\\Url"));
- return;
-}
-
+ result = 1;
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("handler"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) == IS_RESOURCE) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("handler"), PH_NOISY_CC | PH_READONLY);
+ result = zephir_fclose(&_1$$3);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("handler"), &__$null);
+ RETURN_BOOL(result);
+}
+static PHP_METHOD(Phalcon_Logger_Adapter_Stream, process)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *item, item_sub, __$null, message, _0, _10, _1$$3, _2$$3, _3$$3, _4$$3, _5$$4, _6$$4, _7$$4, _8$$4, _9$$4;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&item_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$4);
+ ZVAL_UNDEF(&_9$$4);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(item, phalcon_logger_item_ce)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &item);
-
-ZEPHIR_INIT_CLASS(Phalcon_Validation_ValidatorInterface)
-{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Validation, ValidatorInterface, phalcon, validation_validatorinterface, phalcon_validation_validatorinterface_method_entry);
-
- return SUCCESS;
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("handler"), PH_NOISY_CC | PH_READONLY);
+ if (!(Z_TYPE_P(&_0) == IS_RESOURCE)) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("mode"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_3$$3, "fopen", NULL, 89, &_1$$3, &_2$$3);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("handler"), &_3$$3);
+ zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("handler"), PH_NOISY_CC | PH_READONLY);
+ if (!(Z_TYPE_P(&_4$$3) == IS_RESOURCE)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("handler"), &__$null);
+ ZEPHIR_INIT_VAR(&_5$$4);
+ object_init_ex(&_5$$4, spl_ce_UnexpectedValueException);
+ zephir_read_property(&_6$$4, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_7$$4, this_ptr, ZEND_STRL("mode"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_8$$4);
+ ZVAL_STRING(&_8$$4, "The file '%s' cannot be opened with mode '%s'");
+ ZEPHIR_CALL_FUNCTION(&_9$$4, "sprintf", NULL, 194, &_8$$4, &_6$$4, &_7$$4);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_5$$4, "__construct", NULL, 345, &_9$$4);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_5$$4, "phalcon/Logger/Adapter/Stream.zep", 127);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ }
+ ZEPHIR_CALL_METHOD(&message, this_ptr, "getformatteditem", NULL, 0, item);
+ zephir_check_call_status();
+ zephir_read_property(&_10, this_ptr, ZEND_STRL("handler"), PH_NOISY_CC | PH_READONLY);
+ zephir_fwrite(NULL, &_10, &message);
+ ZEPHIR_MM_RESTORE();
}
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidatorInterface, getOption);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidatorInterface, hasOption);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidatorInterface, validate);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidatorInterface, getTemplate);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidatorInterface, getTemplates);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidatorInterface, setTemplates);
-ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidatorInterface, setTemplate);
@@ -210533,27 +210943,38 @@ ZEPHIR_DOC_METHOD(Phalcon_Validation_ValidatorInterface, setTemplate);
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Alnum)
+ZEPHIR_INIT_CLASS(Phalcon_Logger_Adapter_Syslog)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Alnum, phalcon, validation_validator_alnum, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_alnum_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Logger\\Adapter, Syslog, phalcon, logger_adapter_syslog, phalcon_logger_adapter_abstractadapter_ce, phalcon_logger_adapter_syslog_method_entry, 0);
- zend_declare_property_string(phalcon_validation_validator_alnum_ce, SL("template"), "Field :field must contain only letters and numbers", ZEND_ACC_PROTECTED);
+ zend_declare_property_string(phalcon_logger_adapter_syslog_ce, SL("defaultFormatter"), "Line", ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_logger_adapter_syslog_ce, SL("facility"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_string(phalcon_logger_adapter_syslog_ce, SL("name"), "", ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_logger_adapter_syslog_ce, SL("opened"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_logger_adapter_syslog_ce, SL("option"), 0, ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_Validator_Alnum, __construct)
+static PHP_METHOD(Phalcon_Logger_Adapter_Syslog, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
+ zephir_fcall_cache_entry *_1 = NULL;
zval options;
+ zval *name_param = NULL, *options_param = NULL, _0, _2, _3, _4;
+ zval name;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
ZVAL_UNDEF(&options);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(name)
Z_PARAM_OPTIONAL
Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
@@ -210561,57 +210982,171 @@ static PHP_METHOD(Phalcon_Validation_Validator_Alnum, __construct)
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
+ 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_get_arrval(&options, options_param);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_alnum_ce, getThis(), "__construct", &_0, 0, &options);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "facility");
+ ZVAL_LONG(&_3, 8);
+ ZEPHIR_CALL_CE_STATIC(&_0, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("facility"), &_0);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "option");
+ ZVAL_LONG(&_3, 4);
+ ZEPHIR_CALL_CE_STATIC(&_4, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3);
zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("option"), &_4);
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_Validator_Alnum, validate)
+static PHP_METHOD(Phalcon_Logger_Adapter_Syslog, close)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, value, _0, _1$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&value);
ZVAL_UNDEF(&_0);
+
+
+ ZEPHIR_MM_GROW();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("opened"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_0))) {
+ RETURN_MM_BOOL(1);
+ }
+ ZEPHIR_RETURN_CALL_FUNCTION("closelog", NULL, 413);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Logger_Adapter_Syslog, process)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *item, item_sub, __$true, __$false, name, facility, level, message, option, result, _0, _4, _1$$3, _2$$3, _3$$3;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&item_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&facility);
+ ZVAL_UNDEF(&level);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&option);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_4);
ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(item, phalcon_logger_item_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ zephir_fetch_params(1, 1, 0, &item);
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
+ ZEPHIR_CALL_METHOD(&message, this_ptr, "getformatteditem", NULL, 0, item);
zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&_0, "ctype_alnum", NULL, 0, &value);
+ 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("facility"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&facility, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("option"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&option, &_0);
+ ZEPHIR_CALL_FUNCTION(&result, "openlog", NULL, 414, &name, &option, &facility);
zephir_check_call_status();
- if (!(zephir_is_true(&_0))) {
- ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "messagefactory", NULL, 0, validation, field);
+ if (!zephir_is_true(&result)) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ object_init_ex(&_1$$3, spl_ce_LogicException);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZVAL_STRING(&_2$$3, "Cannot open syslog for name [%s] and facility [%s]");
+ ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 194, &_2$$3, &name, &facility);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_1$$3);
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 415, &_3$$3);
zephir_check_call_status();
- RETURN_MM_BOOL(0);
+ zephir_throw_exception_debug(&_1$$3, "phalcon/Logger/Adapter/Syslog.zep", 120);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- RETURN_MM_BOOL(1);
+ if (1) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("opened"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("opened"), &__$false);
+ }
+ ZEPHIR_CALL_METHOD(&_4, item, "getlevel", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&level, this_ptr, "logleveltosyslog", NULL, 416, &_4);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(NULL, "syslog", NULL, 417, &level, &message);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Logger_Adapter_Syslog, logLevelToSyslog)
+{
+ zval levels;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *level_param = NULL, result;
+ zend_long level;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&levels);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(level)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &level_param);
+ level = zephir_get_intval(level_param);
+
+
+ ZEPHIR_INIT_VAR(&levels);
+ zephir_create_array(&levels, 9, 0);
+ add_index_long(&levels, 2, 1);
+ add_index_long(&levels, 1, 2);
+ add_index_long(&levels, 8, 3);
+ add_index_long(&levels, 7, 7);
+ add_index_long(&levels, 0, 0);
+ add_index_long(&levels, 3, 3);
+ add_index_long(&levels, 6, 6);
+ add_index_long(&levels, 5, 5);
+ add_index_long(&levels, 4, 4);
+ ZEPHIR_OBS_VAR(&result);
+ if (!(zephir_array_isset_long_fetch(&result, &levels, level, 0))) {
+ ZEPHIR_INIT_NVAR(&result);
+ ZVAL_LONG(&result, 3);
+ }
+ RETURN_CCTOR(&result);
}
@@ -210624,95 +211159,107 @@ static PHP_METHOD(Phalcon_Validation_Validator_Alnum, validate)
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Alpha)
+ZEPHIR_INIT_CLASS(Phalcon_Acl_Component)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Alpha, phalcon, validation_validator_alpha, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_alpha_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Acl, Component, phalcon, acl_component, phalcon_acl_component_method_entry, 0);
- zend_declare_property_string(phalcon_validation_validator_alpha_ce, SL("template"), "Field :field must contain only letters", ZEND_ACC_PROTECTED);
+ 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_Validation_Validator_Alpha, __construct)
+static PHP_METHOD(Phalcon_Acl_Component, getDescription)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "description");
+}
+
+static PHP_METHOD(Phalcon_Acl_Component, getName)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "name");
+}
+
+static PHP_METHOD(Phalcon_Acl_Component, __toString)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "name");
+}
+
+static PHP_METHOD(Phalcon_Acl_Component, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *name_param = NULL, *description_param = NULL;
+ zval name, description;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&description);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(name)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_STR_OR_NULL(description)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ 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_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_INIT_VAR(&name);
+ }
+ if (!description_param) {
+ ZEPHIR_INIT_VAR(&description);
+ } else {
+ zephir_get_strval(&description, description_param);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_alpha_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
+ if (UNEXPECTED(ZEPHIR_IS_STRING(&name, "*"))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Component name cannot be '*'", "phalcon/Acl/Component.zep", 38);
+ return;
+ }
+ 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_Validation_Validator_Alpha, validate)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, value, _0, _1, _2, _3, _4$$3;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4$$3);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
- ZEND_PARSE_PARAMETERS_END();
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "/[^[:alpha:]]/imu");
- ZEPHIR_INIT_VAR(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "/[^[:alpha:]]/imu");
- zephir_preg_match(&_2, &_3, &value, &_0, 0, 0 , 0 );
- if (zephir_is_true(&_2)) {
- ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "messagefactory", NULL, 0, validation, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_4$$3);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+
+ZEPHIR_INIT_CLASS(Phalcon_Acl_ComponentAware)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Acl, ComponentAware, phalcon, acl_componentaware, phalcon_acl_componentaware_method_entry);
+
+ return SUCCESS;
}
+ZEPHIR_DOC_METHOD(Phalcon_Acl_ComponentAware, getComponentName);
@@ -210723,113 +211270,52 @@ static PHP_METHOD(Phalcon_Validation_Validator_Alpha, validate)
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Between)
+ZEPHIR_INIT_CLASS(Phalcon_Acl_ComponentInterface)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Between, phalcon, validation_validator_between, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_between_method_entry, 0);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Acl, ComponentInterface, phalcon, acl_componentinterface, phalcon_acl_componentinterface_method_entry);
- zend_declare_property_string(phalcon_validation_validator_between_ce, SL("template"), "Field :field must be within the range of :min to :max", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_Validator_Between, __construct)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
- zval *this_ptr = getThis();
+ZEPHIR_DOC_METHOD(Phalcon_Acl_ComponentInterface, getDescription);
+ZEPHIR_DOC_METHOD(Phalcon_Acl_ComponentInterface, getName);
+ZEPHIR_DOC_METHOD(Phalcon_Acl_ComponentInterface, __toString);
- ZVAL_UNDEF(&options);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &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_validation_validator_between_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-static PHP_METHOD(Phalcon_Validation_Validator_Between, validate)
+ZEPHIR_INIT_CLASS(Phalcon_Acl_Enum)
{
- zend_bool _3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, value, minimum, maximum, replacePairs, _0, _1$$3, _2$$4, _4$$5;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Acl, Enum, phalcon, acl_enum, NULL, 0);
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&minimum);
- ZVAL_UNDEF(&maximum);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_4$$5);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
- ZEND_PARSE_PARAMETERS_END();
+ zephir_declare_class_constant_long(phalcon_acl_enum_ce, SL("ALLOW"), 1);
+
+ zephir_declare_class_constant_long(phalcon_acl_enum_ce, SL("DENY"), 0);
+
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "minimum");
- ZEPHIR_CALL_METHOD(&minimum, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "maximum");
- ZEPHIR_CALL_METHOD(&maximum, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (Z_TYPE_P(&minimum) == IS_ARRAY) {
- zephir_array_fetch(&_1$$3, &minimum, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Between.zep", 94);
- ZEPHIR_CPY_WRT(&minimum, &_1$$3);
- }
- if (Z_TYPE_P(&maximum) == IS_ARRAY) {
- zephir_array_fetch(&_2$$4, &maximum, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Between.zep", 98);
- ZEPHIR_CPY_WRT(&maximum, &_2$$4);
- }
- _3 = ZEPHIR_LT(&value, &minimum);
- if (!(_3)) {
- _3 = ZEPHIR_GT(&value, &maximum);
- }
- if (_3) {
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 2, 0);
- zephir_array_update_string(&replacePairs, SL(":min"), &minimum, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&replacePairs, SL(":max"), &maximum, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_4$$5, this_ptr, "messagefactory", NULL, 0, validation, field, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_4$$5);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+
+ZEPHIR_INIT_CLASS(Phalcon_Acl_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Acl, Exception, phalcon, acl_exception, phalcon_exception_ce, NULL, 0);
+
+ return SUCCESS;
}
@@ -210842,113 +211328,127 @@ static PHP_METHOD(Phalcon_Validation_Validator_Between, validate)
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Callback)
+ZEPHIR_INIT_CLASS(Phalcon_Acl_Role)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Callback, phalcon, validation_validator_callback, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_callback_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Acl, Role, phalcon, acl_role, phalcon_acl_role_method_entry, 0);
- zend_declare_property_string(phalcon_validation_validator_callback_ce, SL("template"), "Field :field must match the callback function", ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_acl_role_ce, SL("name"), ZEND_ACC_PRIVATE);
+ zend_declare_property_null(phalcon_acl_role_ce, SL("description"), ZEND_ACC_PRIVATE);
+ zend_class_implements(phalcon_acl_role_ce, 1, phalcon_acl_roleinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_Validator_Callback, __construct)
+static PHP_METHOD(Phalcon_Acl_Role, getName)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "name");
+}
+
+static PHP_METHOD(Phalcon_Acl_Role, __toString)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "name");
+}
+
+static PHP_METHOD(Phalcon_Acl_Role, getDescription)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "description");
+}
+
+static PHP_METHOD(Phalcon_Acl_Role, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *name_param = NULL, *description_param = NULL;
+ zval name, description;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&description);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(name)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_STR_OR_NULL(description)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ 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_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_INIT_VAR(&name);
+ }
+ if (!description_param) {
+ ZEPHIR_INIT_VAR(&description);
+ } else {
+ zephir_get_strval(&description, description_param);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_callback_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
+ if (UNEXPECTED(ZEPHIR_IS_STRING(&name, "*"))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Role name cannot be '*'", "phalcon/Acl/Role.zep", 38);
+ return;
+ }
+ 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_Validation_Validator_Callback, validate)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Acl_RoleAware)
{
- zend_bool _1$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, callback, returnedValue, data, _0, _2$$6;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Acl, RoleAware, phalcon, acl_roleaware, phalcon_acl_roleaware_method_entry);
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&callback);
- ZVAL_UNDEF(&returnedValue);
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2$$6);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
- ZEND_PARSE_PARAMETERS_END();
+ return SUCCESS;
+}
+
+ZEPHIR_DOC_METHOD(Phalcon_Acl_RoleAware, getRoleName);
+
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "callback");
- ZEPHIR_CALL_METHOD(&callback, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (zephir_is_callable(&callback)) {
- ZEPHIR_CALL_METHOD(&data, validation, "getentity", NULL, 0);
- zephir_check_call_status();
- if (ZEPHIR_IS_EMPTY(&data)) {
- ZEPHIR_CALL_METHOD(&data, validation, "getdata", NULL, 0);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_FUNCTION(&returnedValue, "call_user_func", NULL, 255, &callback, &data);
- zephir_check_call_status();
- _1$$3 = Z_TYPE_P(&returnedValue) == IS_OBJECT;
- if (_1$$3) {
- _1$$3 = zephir_instance_of_ev(&returnedValue, phalcon_validation_validatorinterface_ce);
- }
- if (((Z_TYPE_P(&returnedValue) == IS_TRUE || Z_TYPE_P(&returnedValue) == IS_FALSE) == 1)) {
- if (!(zephir_is_true(&returnedValue))) {
- ZEPHIR_CALL_METHOD(&_2$$6, this_ptr, "messagefactory", NULL, 0, validation, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_2$$6);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
- } else if (_1$$3) {
- ZEPHIR_RETURN_CALL_METHOD(&returnedValue, "validate", NULL, 0, validation, field);
- zephir_check_call_status();
- RETURN_MM();
- }
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_validator_exception_ce, "Callback must return bool or Phalcon\\Validation\\Validator object", "phalcon/Validation/Validator/Callback.zep", 115);
- return;
- }
- RETURN_MM_BOOL(1);
+
+ZEPHIR_INIT_CLASS(Phalcon_Acl_RoleInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Acl, RoleInterface, phalcon, acl_roleinterface, phalcon_acl_roleinterface_method_entry);
+
+ return SUCCESS;
}
+ZEPHIR_DOC_METHOD(Phalcon_Acl_RoleInterface, getName);
+ZEPHIR_DOC_METHOD(Phalcon_Acl_RoleInterface, getDescription);
+ZEPHIR_DOC_METHOD(Phalcon_Acl_RoleInterface, __toString);
@@ -210959,370 +211459,146 @@ static PHP_METHOD(Phalcon_Validation_Validator_Callback, validate)
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Confirmation)
+ZEPHIR_INIT_CLASS(Phalcon_Acl_Adapter_AbstractAdapter)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Confirmation, phalcon, validation_validator_confirmation, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_confirmation_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Acl\\Adapter, AbstractAdapter, phalcon, acl_adapter_abstractadapter, phalcon_acl_adapter_abstractadapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
- zend_declare_property_string(phalcon_validation_validator_confirmation_ce, SL("template"), "Field :field must be the same as :with", ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_acl_adapter_abstractadapter_ce, SL("activeAccess"), ZEND_ACC_PROTECTED);
+ 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("activeRole"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_acl_adapter_abstractadapter_ce, SL("activeComponent"), ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_acl_adapter_abstractadapter_ce, SL("defaultAccess"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_acl_adapter_abstractadapter_ce, SL("eventsManager"), 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_Validation_Validator_Confirmation, __construct)
+static PHP_METHOD(Phalcon_Acl_Adapter_AbstractAdapter, getActiveAccess)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &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_validation_validator_confirmation_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_MEMBER(getThis(), "activeAccess");
}
-static PHP_METHOD(Phalcon_Validation_Validator_Confirmation, validate)
+static PHP_METHOD(Phalcon_Acl_Adapter_AbstractAdapter, getActiveRole)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, fieldWith, value, valueWith, labelWith, replacePairs, _0, _2, _1$$3, _3$$4, _5$$4, _4$$5;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&fieldWith);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&valueWith);
- ZVAL_UNDEF(&labelWith);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_5$$4);
- ZVAL_UNDEF(&_4$$5);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
-
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "with");
- ZEPHIR_CALL_METHOD(&fieldWith, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (Z_TYPE_P(&fieldWith) == IS_ARRAY) {
- zephir_array_fetch(&_1$$3, &fieldWith, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Confirmation.zep", 88);
- ZEPHIR_CPY_WRT(&fieldWith, &_1$$3);
- }
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&valueWith, validation, "getvalue", NULL, 0, &fieldWith);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "compare", NULL, 0, &value, &valueWith);
- zephir_check_call_status();
- if (!(zephir_is_true(&_2))) {
- ZEPHIR_INIT_VAR(&_3$$4);
- ZVAL_STRING(&_3$$4, "labelWith");
- ZEPHIR_CALL_METHOD(&labelWith, this_ptr, "getoption", NULL, 0, &_3$$4);
- zephir_check_call_status();
- if (Z_TYPE_P(&labelWith) == IS_ARRAY) {
- zephir_array_fetch(&_4$$5, &labelWith, &fieldWith, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Confirmation.zep", 98);
- ZEPHIR_CPY_WRT(&labelWith, &_4$$5);
- }
- if (ZEPHIR_IS_EMPTY(&labelWith)) {
- ZEPHIR_CALL_METHOD(&labelWith, validation, "getlabel", NULL, 0, &fieldWith);
- zephir_check_call_status();
- }
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- zephir_array_update_string(&replacePairs, SL(":with"), &labelWith, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "messagefactory", NULL, 0, validation, field, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_5$$4);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+ RETURN_MEMBER(getThis(), "activeRole");
}
-static PHP_METHOD(Phalcon_Validation_Validator_Confirmation, compare)
+static PHP_METHOD(Phalcon_Acl_Adapter_AbstractAdapter, getActiveComponent)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *a_param = NULL, *b_param = NULL, _0, _1, _2, _6, _3$$3, _4$$3, _5$$3;
- zval a, b;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&a);
- ZVAL_UNDEF(&b);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_5$$3);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(a)
- Z_PARAM_STR(b)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &a_param, &b_param);
- zephir_get_strval(&a, a_param);
- zephir_get_strval(&b, b_param);
-
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "ignoreCase");
- ZVAL_BOOL(&_2, 0);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getoption", NULL, 0, &_1, &_2);
- zephir_check_call_status();
- if (zephir_is_true(&_0)) {
- if (UNEXPECTED(!((zephir_function_exists_ex(ZEND_STRL("mb_strtolower")) == SUCCESS)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Extension 'mbstring' is required", "phalcon/Validation/Validator/Confirmation.zep", 129);
- return;
- }
- ZEPHIR_INIT_VAR(&_3$$3);
- ZVAL_STRING(&_3$$3, "utf-8");
- ZEPHIR_CALL_FUNCTION(&_4$$3, "mb_strtolower", NULL, 25, &a, &_3$$3);
- zephir_check_call_status();
- zephir_get_strval(&a, &_4$$3);
- ZEPHIR_INIT_NVAR(&_3$$3);
- ZVAL_STRING(&_3$$3, "utf-8");
- ZEPHIR_CALL_FUNCTION(&_5$$3, "mb_strtolower", NULL, 25, &b, &_3$$3);
- zephir_check_call_status();
- zephir_get_strval(&b, &_5$$3);
- }
- ZEPHIR_CALL_FUNCTION(&_6, "strcmp", NULL, 389, &a, &b);
- zephir_check_call_status();
- RETURN_MM_BOOL(ZEPHIR_IS_LONG_IDENTICAL(&_6, 0));
+ RETURN_MEMBER(getThis(), "activeComponent");
}
+static PHP_METHOD(Phalcon_Acl_Adapter_AbstractAdapter, getDefaultAction)
+{
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
-
-
+ RETURN_MEMBER(getThis(), "defaultAccess");
+}
+static PHP_METHOD(Phalcon_Acl_Adapter_AbstractAdapter, getEventsManager)
+{
+ zval *this_ptr = getThis();
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_CreditCard)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, CreditCard, phalcon, validation_validator_creditcard, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_creditcard_method_entry, 0);
- zend_declare_property_string(phalcon_validation_validator_creditcard_ce, SL("template"), "Field :field is not valid for a credit card number", ZEND_ACC_PROTECTED);
- return SUCCESS;
+ RETURN_MEMBER(getThis(), "eventsManager");
}
-static PHP_METHOD(Phalcon_Validation_Validator_CreditCard, __construct)
+static PHP_METHOD(Phalcon_Acl_Adapter_AbstractAdapter, setDefaultAction)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *defaultAccess_param = NULL, _0;
+ zend_long defaultAccess;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(defaultAccess)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
- } else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- }
+ zephir_fetch_params_without_memory_grow(1, 0, &defaultAccess_param);
+ defaultAccess = zephir_get_intval(defaultAccess_param);
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_creditcard_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_INIT_ZVAL_NREF(_0);
+ ZVAL_LONG(&_0, defaultAccess);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("defaultAccess"), &_0);
}
-static PHP_METHOD(Phalcon_Validation_Validator_CreditCard, validate)
+static PHP_METHOD(Phalcon_Acl_Adapter_AbstractAdapter, setEventsManager)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, value, valid, _0$$3;
+ zval *eventsManager, eventsManager_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&valid);
- ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&eventsManager_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(eventsManager, phalcon_events_managerinterface_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ zephir_fetch_params_without_memory_grow(1, 0, &eventsManager);
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&valid, this_ptr, "verifybyluhnalgorithm", NULL, 0, &value);
- zephir_check_call_status();
- if (!(zephir_is_true(&valid))) {
- ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "messagefactory", NULL, 0, validation, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_0$$3);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("eventsManager"), eventsManager);
}
-static PHP_METHOD(Phalcon_Validation_Validator_CreditCard, verifyByLuhnAlgorithm)
-{
- zend_string *_7;
- zend_ulong _6;
- zval digits, _1;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *number_param = NULL, digit, position, hash, result, _0, _2, _3, *_4, _5, _10, _8$$3, _9$$4;
- zval number;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&number);
- ZVAL_UNDEF(&digit);
- ZVAL_UNDEF(&position);
- ZVAL_UNDEF(&hash);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_10);
- ZVAL_UNDEF(&_8$$3);
- ZVAL_UNDEF(&_9$$4);
- ZVAL_UNDEF(&digits);
- ZVAL_UNDEF(&_1);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(number)
- ZEND_PARSE_PARAMETERS_END();
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &number_param);
- zephir_get_strval(&number, number_param);
- ZEPHIR_INIT_VAR(&hash);
- ZVAL_STRING(&hash, "");
- ZEPHIR_CALL_FUNCTION(&_0, "str_split", NULL, 108, &number);
- zephir_check_call_status();
- zephir_get_arrval(&_1, &_0);
- ZEPHIR_CPY_WRT(&digits, &_1);
- ZEPHIR_CALL_FUNCTION(&_3, "array_reverse", NULL, 0, &digits);
- zephir_check_call_status();
- zephir_is_iterable(&_3, 0, "phalcon/Validation/Validator/CreditCard.zep", 106);
- if (Z_TYPE_P(&_3) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_3), _6, _7, _4)
- {
- ZEPHIR_INIT_NVAR(&position);
- if (_7 != NULL) {
- ZVAL_STR_COPY(&position, _7);
- } else {
- ZVAL_LONG(&position, _6);
- }
- ZEPHIR_INIT_NVAR(&digit);
- ZVAL_COPY(&digit, _4);
- ZEPHIR_INIT_NVAR(&_8$$3);
- if (zephir_safe_mod_zval_long(&position, 2)) {
- ZEPHIR_INIT_NVAR(&_8$$3);
- ZVAL_LONG(&_8$$3, (zephir_get_numberval(&digit) * 2));
- } else {
- ZEPHIR_CPY_WRT(&_8$$3, &digit);
- }
- zephir_concat_self(&hash, &_8$$3);
- } 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(&position, &_3, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&digit, &_3, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_9$$4);
- if (zephir_safe_mod_zval_long(&position, 2)) {
- ZEPHIR_INIT_NVAR(&_9$$4);
- ZVAL_LONG(&_9$$4, (zephir_get_numberval(&digit) * 2));
- } else {
- ZEPHIR_CPY_WRT(&_9$$4, &digit);
- }
- zephir_concat_self(&hash, &_9$$4);
- ZEPHIR_CALL_METHOD(NULL, &_3, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&digit);
- ZEPHIR_INIT_NVAR(&position);
- ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 108, &hash);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&result, "array_sum", NULL, 0, &_10);
- zephir_check_call_status();
- RETURN_MM_BOOL((zephir_safe_mod_zval_long(&result, 10) == 0));
+
+ZEPHIR_INIT_CLASS(Phalcon_Acl_Adapter_AdapterInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Acl\\Adapter, AdapterInterface, phalcon, acl_adapter_adapterinterface, phalcon_acl_adapter_adapterinterface_method_entry);
+
+ return SUCCESS;
}
+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, getDefaultAction);
+ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, getNoArgumentsDefaultAction);
+ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, getRoles);
+ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, getComponents);
+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);
@@ -211333,1211 +211609,1895 @@ static PHP_METHOD(Phalcon_Validation_Validator_CreditCard, verifyByLuhnAlgorithm
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Date)
+ZEPHIR_INIT_CLASS(Phalcon_Acl_Adapter_Memory)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Date, phalcon, validation_validator_date, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_date_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Acl\\Adapter, Memory, phalcon, acl_adapter_memory, phalcon_acl_adapter_abstractadapter_ce, phalcon_acl_adapter_memory_method_entry, 0);
- zend_declare_property_string(phalcon_validation_validator_date_ce, SL("template"), "Field :field is not a valid date", ZEND_ACC_PROTECTED);
+ 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);
+ zend_declare_property_null(phalcon_acl_adapter_memory_ce, SL("rolesNames"), ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_Validator_Date, __construct)
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, getActiveFunction)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "activeFunction");
+}
+
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, getActiveFunctionCustomArgumentsCount)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "activeFunctionCustomArgumentsCount");
+}
+
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, getActiveKey)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "activeKey");
+}
+
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, __construct)
{
+ zval _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval __$true;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
-#endif
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &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_validation_validator_date_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
+ 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_Validation_Validator_Date, validate)
+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 *validation, validation_sub, *field, field_sub, value, format, _0, _2, _1$$3, _3$$5;
+ zval *componentValue, componentValue_sub, *accessList, accessList_sub, __$true, componentName, componentObject, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&format);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&componentValue_sub);
+ ZVAL_UNDEF(&accessList_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&componentName);
+ ZVAL_UNDEF(&componentObject);
+ ZVAL_UNDEF(&_1);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ Z_PARAM_ZVAL(componentValue)
+ Z_PARAM_ZVAL(accessList)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ zephir_fetch_params(1, 2, 0, &componentValue, &accessList);
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "format");
- ZEPHIR_CALL_METHOD(&format, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (Z_TYPE_P(&format) == IS_ARRAY) {
- zephir_array_fetch(&_1$$3, &format, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Date.zep", 87);
- ZEPHIR_CPY_WRT(&format, &_1$$3);
+ _0 = Z_TYPE_P(componentValue) == IS_OBJECT;
+ if (_0) {
+ _0 = zephir_instance_of_ev(componentValue, phalcon_acl_componentinterface_ce);
}
- if (ZEPHIR_IS_EMPTY(&format)) {
- ZEPHIR_INIT_NVAR(&format);
- ZVAL_STRING(&format, "Y-m-d");
+ 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, 144, componentValue);
+ zephir_check_call_status();
}
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkdate", NULL, 0, &value, &format);
+ ZEPHIR_CALL_METHOD(&componentName, &componentObject, "getname", NULL, 145);
zephir_check_call_status();
- if (!(zephir_is_true(&_2))) {
- ZEPHIR_CALL_METHOD(&_3$$5, this_ptr, "messagefactory", NULL, 0, validation, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_3$$5);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("componentsNames"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset(&_1, &componentName))) {
+ zephir_update_property_array_append(this_ptr, SL("components"), &componentObject);
+ zephir_update_property_array(this_ptr, SL("componentsNames"), &componentName, &__$true);
}
- RETURN_MM_BOOL(1);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addcomponentaccess", NULL, 0, &componentName, accessList);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Validation_Validator_Date, checkDate)
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addComponentAccess)
{
- zend_bool _3;
- zend_class_entry *_0, *_1;
+ zend_bool exists = 0, _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *value, value_sub, *format, format_sub, date, errors, _2, _4;
+ zval *componentName_param = NULL, *accessList, accessList_sub, accessName, _0, _1$$3, *_4$$5, _5$$5, _6$$6, _7$$6, _8$$7, _9$$8, _10$$8, _11$$9, _12$$10, _13$$10, _14$$11;
+ zval componentName, accessKey, _2$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&format_sub);
- ZVAL_UNDEF(&date);
- ZVAL_UNDEF(&errors);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&componentName);
+ ZVAL_UNDEF(&accessKey);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&accessList_sub);
+ ZVAL_UNDEF(&accessName);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_6$$6);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_8$$7);
+ ZVAL_UNDEF(&_9$$8);
+ ZVAL_UNDEF(&_10$$8);
+ ZVAL_UNDEF(&_11$$9);
+ ZVAL_UNDEF(&_12$$10);
+ ZVAL_UNDEF(&_13$$10);
+ ZVAL_UNDEF(&_14$$11);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(value)
- Z_PARAM_ZVAL(format)
+ Z_PARAM_STR(componentName)
+ Z_PARAM_ZVAL(accessList)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &value, &format);
+ zephir_fetch_params(1, 2, 0, &componentName_param, &accessList);
+ zephir_get_strval(&componentName, componentName_param);
- if (!(Z_TYPE_P(value) == IS_STRING)) {
- RETURN_MM_BOOL(0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("componentsNames"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(!(zephir_array_isset(&_0, &componentName)))) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ object_init_ex(&_1$$3, phalcon_acl_exception_ce);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_SVS(&_2$$3, "Component '", &componentName, "' does not exist in ACL");
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 8, &_2$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_1$$3, "phalcon/Acl/Adapter/Memory.zep", 248);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- _0 = zephir_fetch_class_str_ex(SL("DateTime"), ZEND_FETCH_CLASS_AUTO);
- ZEPHIR_CALL_CE_STATIC(&date, _0, "createfromformat", NULL, 0, format, value);
- zephir_check_call_status();
- _1 = zephir_fetch_class_str_ex(SL("DateTime"), ZEND_FETCH_CLASS_AUTO);
- ZEPHIR_CALL_CE_STATIC(&errors, _1, "getlasterrors", NULL, 0);
- zephir_check_call_status();
- zephir_array_fetch_string(&_2, &errors, SL("warning_count"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Date.zep", 116);
- _3 = ZEPHIR_IS_LONG(&_2, 0);
+ _3 = Z_TYPE_P(accessList) != IS_ARRAY;
if (_3) {
- zephir_array_fetch_string(&_4, &errors, SL("error_count"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Date.zep", 116);
- _3 = ZEPHIR_IS_LONG(&_4, 0);
+ _3 = Z_TYPE_P(accessList) != IS_STRING;
}
- RETURN_MM_BOOL(_3);
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Digit)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Digit, phalcon, validation_validator_digit, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_digit_method_entry, 0);
-
- zend_declare_property_string(phalcon_validation_validator_digit_ce, SL("template"), "Field :field must be numeric", ZEND_ACC_PROTECTED);
- return SUCCESS;
+ if (UNEXPECTED(_3)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Invalid value for accessList", "phalcon/Acl/Adapter/Memory.zep", 252);
+ return;
+ }
+ exists = 1;
+ if (Z_TYPE_P(accessList) == IS_ARRAY) {
+ zephir_is_iterable(accessList, 0, "phalcon/Acl/Adapter/Memory.zep", 265);
+ if (Z_TYPE_P(accessList) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(accessList), _4$$5)
+ {
+ ZEPHIR_INIT_NVAR(&accessName);
+ ZVAL_COPY(&accessName, _4$$5);
+ ZEPHIR_INIT_NVAR(&_6$$6);
+ ZEPHIR_CONCAT_VSV(&_6$$6, &componentName, "!", &accessName);
+ zephir_get_strval(&accessKey, &_6$$6);
+ zephir_read_property(&_7$$6, this_ptr, ZEND_STRL("accessList"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset(&_7$$6, &accessKey))) {
+ ZEPHIR_INIT_NVAR(&_8$$7);
+ ZVAL_BOOL(&_8$$7, exists);
+ zephir_update_property_array(this_ptr, SL("accessList"), &accessKey, &_8$$7);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, accessList, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5$$5, accessList, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5$$5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&accessName, accessList, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_9$$8);
+ ZEPHIR_CONCAT_VSV(&_9$$8, &componentName, "!", &accessName);
+ zephir_get_strval(&accessKey, &_9$$8);
+ zephir_read_property(&_10$$8, this_ptr, ZEND_STRL("accessList"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset(&_10$$8, &accessKey))) {
+ ZEPHIR_INIT_NVAR(&_11$$9);
+ ZVAL_BOOL(&_11$$9, exists);
+ zephir_update_property_array(this_ptr, SL("accessList"), &accessKey, &_11$$9);
+ }
+ ZEPHIR_CALL_METHOD(NULL, accessList, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&accessName);
+ } else {
+ ZEPHIR_INIT_VAR(&_12$$10);
+ ZEPHIR_CONCAT_VSV(&_12$$10, &componentName, "!", accessList);
+ zephir_get_strval(&accessKey, &_12$$10);
+ zephir_read_property(&_13$$10, this_ptr, ZEND_STRL("accessList"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset(&_13$$10, &accessKey))) {
+ ZEPHIR_INIT_VAR(&_14$$11);
+ ZVAL_BOOL(&_14$$11, exists);
+ zephir_update_property_array(this_ptr, SL("accessList"), &accessKey, &_14$$11);
+ }
+ }
+ RETURN_MM_BOOL(1);
}
-static PHP_METHOD(Phalcon_Validation_Validator_Digit, __construct)
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit)
{
+ zend_bool _6$$7, _25$$22;
+ zval checkRoleToInherits, usedRoleToInherits;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_16 = NULL, *_17 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *roleName_param = NULL, *roleToInherits, roleToInherits_sub, __$true, roleInheritName, rolesNames, roleToInherit, checkRoleToInherit, roleToInheritList, usedRoleToInherit, _0, *_4, _5, _1$$3, _3$$4, _7$$7, _8$$7, _11$$7, _9$$11, _10$$11, _12$$13, _13$$13, *_14$$13, _15$$13, _18$$18, _19$$18, _20$$16, _21$$19, _22$$19, *_23$$19, _24$$19, _26$$22, _27$$22, _30$$22, _28$$26, _29$$26, _31$$28, _32$$28, *_33$$28, _34$$28, _35$$33, _36$$33, _37$$31, _38$$34, _39$$34, *_40$$34, _41$$34;
+ zval roleName, _2$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&roleName);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&roleToInherits_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&roleInheritName);
+ ZVAL_UNDEF(&rolesNames);
+ ZVAL_UNDEF(&roleToInherit);
+ ZVAL_UNDEF(&checkRoleToInherit);
+ ZVAL_UNDEF(&roleToInheritList);
+ ZVAL_UNDEF(&usedRoleToInherit);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_7$$7);
+ ZVAL_UNDEF(&_8$$7);
+ ZVAL_UNDEF(&_11$$7);
+ ZVAL_UNDEF(&_9$$11);
+ ZVAL_UNDEF(&_10$$11);
+ ZVAL_UNDEF(&_12$$13);
+ ZVAL_UNDEF(&_13$$13);
+ ZVAL_UNDEF(&_15$$13);
+ ZVAL_UNDEF(&_18$$18);
+ ZVAL_UNDEF(&_19$$18);
+ ZVAL_UNDEF(&_20$$16);
+ ZVAL_UNDEF(&_21$$19);
+ ZVAL_UNDEF(&_22$$19);
+ ZVAL_UNDEF(&_24$$19);
+ ZVAL_UNDEF(&_26$$22);
+ ZVAL_UNDEF(&_27$$22);
+ ZVAL_UNDEF(&_30$$22);
+ ZVAL_UNDEF(&_28$$26);
+ ZVAL_UNDEF(&_29$$26);
+ ZVAL_UNDEF(&_31$$28);
+ ZVAL_UNDEF(&_32$$28);
+ ZVAL_UNDEF(&_34$$28);
+ ZVAL_UNDEF(&_35$$33);
+ ZVAL_UNDEF(&_36$$33);
+ ZVAL_UNDEF(&_37$$31);
+ ZVAL_UNDEF(&_38$$34);
+ ZVAL_UNDEF(&_39$$34);
+ ZVAL_UNDEF(&_41$$34);
+ ZVAL_UNDEF(&checkRoleToInherits);
+ ZVAL_UNDEF(&usedRoleToInherits);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(roleName)
+ Z_PARAM_ZVAL(roleToInherits)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 2, 0, &roleName_param, &roleToInherits);
+ zephir_get_strval(&roleName, roleName_param);
+
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("rolesNames"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&rolesNames, &_0);
+ if (UNEXPECTED(!(zephir_array_isset(&rolesNames, &roleName)))) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ object_init_ex(&_1$$3, phalcon_acl_exception_ce);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_SVS(&_2$$3, "Role '", &roleName, "' does not exist in the role list");
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 8, &_2$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_1$$3, "phalcon/Acl/Adapter/Memory.zep", 295);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset(&_0, &roleName))) {
+ ZEPHIR_INIT_VAR(&_3$$4);
+ array_init(&_3$$4);
+ zephir_update_property_array(this_ptr, SL("roleInherits"), &roleName, &_3$$4);
+ }
+ 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_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_CPY_WRT(&roleToInheritList, roleToInherits);
+ }
+ zephir_is_iterable(&roleToInheritList, 0, "phalcon/Acl/Adapter/Memory.zep", 384);
+ if (Z_TYPE_P(&roleToInheritList) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&roleToInheritList), _4)
+ {
+ ZEPHIR_INIT_NVAR(&roleToInherit);
+ ZVAL_COPY(&roleToInherit, _4);
+ _6$$7 = Z_TYPE_P(&roleToInherit) == IS_OBJECT;
+ if (_6$$7) {
+ _6$$7 = zephir_instance_of_ev(&roleToInherit, phalcon_acl_roleinterface_ce);
+ }
+ if (_6$$7) {
+ ZEPHIR_CALL_METHOD(&roleInheritName, &roleToInherit, "getname", NULL, 0);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CPY_WRT(&roleInheritName, &roleToInherit);
+ }
+ zephir_read_property(&_7$$7, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
+ zephir_array_fetch(&_8$$7, &_7$$7, &roleName, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 324);
+ if (zephir_fast_in_array(&roleInheritName, &_8$$7)) {
+ continue;
+ }
+ if (UNEXPECTED(!(zephir_array_isset(&rolesNames, &roleInheritName)))) {
+ ZEPHIR_INIT_NVAR(&_9$$11);
+ object_init_ex(&_9$$11, phalcon_acl_exception_ce);
+ ZEPHIR_INIT_NVAR(&_10$$11);
+ ZEPHIR_CONCAT_SVS(&_10$$11, "Role '", &roleInheritName, "' (to inherit) does not exist in the role list");
+ ZEPHIR_CALL_METHOD(NULL, &_9$$11, "__construct", NULL, 8, &_10$$11);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_9$$11, "phalcon/Acl/Adapter/Memory.zep", 335);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ if (ZEPHIR_IS_EQUAL(&roleName, &roleInheritName)) {
+ RETURN_MM_BOOL(0);
+ }
+ zephir_read_property(&_11$$7, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset(&_11$$7, &roleInheritName)) {
+ ZEPHIR_INIT_NVAR(&checkRoleToInherits);
+ array_init(&checkRoleToInherits);
+ zephir_read_property(&_12$$13, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
+ zephir_array_fetch(&_13$$13, &_12$$13, &roleInheritName, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 348);
+ zephir_is_iterable(&_13$$13, 0, "phalcon/Acl/Adapter/Memory.zep", 352);
+ if (Z_TYPE_P(&_13$$13) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_13$$13), _14$$13)
+ {
+ ZEPHIR_INIT_NVAR(&usedRoleToInherit);
+ ZVAL_COPY(&usedRoleToInherit, _14$$13);
+ ZEPHIR_MAKE_REF(&checkRoleToInherits);
+ ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_16, 146, &checkRoleToInherits, &usedRoleToInherit);
+ ZEPHIR_UNREF(&checkRoleToInherits);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_13$$13, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_15$$13, &_13$$13, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_15$$13)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_13$$13, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_MAKE_REF(&checkRoleToInherits);
+ ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_16, 146, &checkRoleToInherits, &usedRoleToInherit);
+ ZEPHIR_UNREF(&checkRoleToInherits);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_13$$13, "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", &_17, 24, &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(&_18$$18);
+ object_init_ex(&_18$$18, phalcon_acl_exception_ce);
+ ZEPHIR_INIT_NVAR(&_19$$18);
+ ZEPHIR_CONCAT_SVS(&_19$$18, "Role '", &roleInheritName, "' (to inherit) produces an infinite loop");
+ ZEPHIR_CALL_METHOD(NULL, &_18$$18, "__construct", NULL, 8, &_19$$18);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_18$$18, "phalcon/Acl/Adapter/Memory.zep", 367);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ zephir_read_property(&_20$$16, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset(&_20$$16, &checkRoleToInherit)) {
+ zephir_read_property(&_21$$19, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
+ zephir_array_fetch(&_22$$19, &_21$$19, &checkRoleToInherit, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 374);
+ zephir_is_iterable(&_22$$19, 0, "phalcon/Acl/Adapter/Memory.zep", 377);
+ if (Z_TYPE_P(&_22$$19) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_22$$19), _23$$19)
+ {
+ ZEPHIR_INIT_NVAR(&usedRoleToInherit);
+ ZVAL_COPY(&usedRoleToInherit, _23$$19);
+ ZEPHIR_MAKE_REF(&checkRoleToInherits);
+ ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_16, 146, &checkRoleToInherits, &usedRoleToInherit);
+ ZEPHIR_UNREF(&checkRoleToInherits);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_22$$19, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_24$$19, &_22$$19, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_24$$19)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_22$$19, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_MAKE_REF(&checkRoleToInherits);
+ ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_16, 146, &checkRoleToInherits, &usedRoleToInherit);
+ ZEPHIR_UNREF(&checkRoleToInherits);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_22$$19, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&usedRoleToInherit);
+ }
+ }
+ }
+ 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_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5, &roleToInheritList, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&roleToInherit, &roleToInheritList, "current", NULL, 0);
+ zephir_check_call_status();
+ _25$$22 = Z_TYPE_P(&roleToInherit) == IS_OBJECT;
+ if (_25$$22) {
+ _25$$22 = zephir_instance_of_ev(&roleToInherit, phalcon_acl_roleinterface_ce);
+ }
+ if (_25$$22) {
+ ZEPHIR_CALL_METHOD(&roleInheritName, &roleToInherit, "getname", NULL, 0);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CPY_WRT(&roleInheritName, &roleToInherit);
+ }
+ zephir_read_property(&_26$$22, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
+ zephir_array_fetch(&_27$$22, &_26$$22, &roleName, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 324);
+ if (zephir_fast_in_array(&roleInheritName, &_27$$22)) {
+ continue;
+ }
+ if (UNEXPECTED(!(zephir_array_isset(&rolesNames, &roleInheritName)))) {
+ ZEPHIR_INIT_NVAR(&_28$$26);
+ object_init_ex(&_28$$26, phalcon_acl_exception_ce);
+ ZEPHIR_INIT_NVAR(&_29$$26);
+ ZEPHIR_CONCAT_SVS(&_29$$26, "Role '", &roleInheritName, "' (to inherit) does not exist in the role list");
+ ZEPHIR_CALL_METHOD(NULL, &_28$$26, "__construct", NULL, 8, &_29$$26);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_28$$26, "phalcon/Acl/Adapter/Memory.zep", 335);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ if (ZEPHIR_IS_EQUAL(&roleName, &roleInheritName)) {
+ RETURN_MM_BOOL(0);
+ }
+ zephir_read_property(&_30$$22, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset(&_30$$22, &roleInheritName)) {
+ ZEPHIR_INIT_NVAR(&checkRoleToInherits);
+ array_init(&checkRoleToInherits);
+ zephir_read_property(&_31$$28, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
+ zephir_array_fetch(&_32$$28, &_31$$28, &roleInheritName, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 348);
+ zephir_is_iterable(&_32$$28, 0, "phalcon/Acl/Adapter/Memory.zep", 352);
+ if (Z_TYPE_P(&_32$$28) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_32$$28), _33$$28)
+ {
+ ZEPHIR_INIT_NVAR(&usedRoleToInherit);
+ ZVAL_COPY(&usedRoleToInherit, _33$$28);
+ ZEPHIR_MAKE_REF(&checkRoleToInherits);
+ ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_16, 146, &checkRoleToInherits, &usedRoleToInherit);
+ ZEPHIR_UNREF(&checkRoleToInherits);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_32$$28, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_34$$28, &_32$$28, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_34$$28)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_32$$28, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_MAKE_REF(&checkRoleToInherits);
+ ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_16, 146, &checkRoleToInherits, &usedRoleToInherit);
+ ZEPHIR_UNREF(&checkRoleToInherits);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_32$$28, "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", &_17, 24, &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(&_35$$33);
+ object_init_ex(&_35$$33, phalcon_acl_exception_ce);
+ ZEPHIR_INIT_NVAR(&_36$$33);
+ ZEPHIR_CONCAT_SVS(&_36$$33, "Role '", &roleInheritName, "' (to inherit) produces an infinite loop");
+ ZEPHIR_CALL_METHOD(NULL, &_35$$33, "__construct", NULL, 8, &_36$$33);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_35$$33, "phalcon/Acl/Adapter/Memory.zep", 367);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ zephir_read_property(&_37$$31, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset(&_37$$31, &checkRoleToInherit)) {
+ zephir_read_property(&_38$$34, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
+ zephir_array_fetch(&_39$$34, &_38$$34, &checkRoleToInherit, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 374);
+ zephir_is_iterable(&_39$$34, 0, "phalcon/Acl/Adapter/Memory.zep", 377);
+ if (Z_TYPE_P(&_39$$34) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_39$$34), _40$$34)
+ {
+ ZEPHIR_INIT_NVAR(&usedRoleToInherit);
+ ZVAL_COPY(&usedRoleToInherit, _40$$34);
+ ZEPHIR_MAKE_REF(&checkRoleToInherits);
+ ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_16, 146, &checkRoleToInherits, &usedRoleToInherit);
+ ZEPHIR_UNREF(&checkRoleToInherits);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_39$$34, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_41$$34, &_39$$34, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_41$$34)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_39$$34, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_MAKE_REF(&checkRoleToInherits);
+ ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_16, 146, &checkRoleToInherits, &usedRoleToInherit);
+ ZEPHIR_UNREF(&checkRoleToInherits);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_39$$34, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&usedRoleToInherit);
+ }
+ }
+ }
+ zephir_update_property_array_multi(this_ptr, SL("roleInherits"), &roleInheritName, SL("za"), 2, &roleName);
+ ZEPHIR_CALL_METHOD(NULL, &roleToInheritList, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
-
-
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_digit_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_INIT_NVAR(&roleToInherit);
+ RETURN_MM_BOOL(1);
}
-static PHP_METHOD(Phalcon_Validation_Validator_Digit, validate)
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addRole)
{
zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, value, _1, _2;
+ zval *role, role_sub, *accessInherits = NULL, accessInherits_sub, __$true, __$null, roleName, roleObject, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&role_sub);
+ ZVAL_UNDEF(&accessInherits_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&roleName);
+ ZVAL_UNDEF(&roleObject);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ZVAL(role)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(accessInherits)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ zephir_fetch_params(1, 1, 1, &role, &accessInherits);
+ if (!accessInherits) {
+ accessInherits = &accessInherits_sub;
+ accessInherits = &__$null;
+ }
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- _0 = Z_TYPE_P(&value) == IS_LONG;
- if (!(_0)) {
- ZEPHIR_CALL_FUNCTION(&_1, "ctype_digit", NULL, 0, &value);
- zephir_check_call_status();
- _0 = zephir_is_true(&_1);
+ _0 = Z_TYPE_P(role) == IS_OBJECT;
+ if (_0) {
+ _0 = zephir_instance_of_ev(role, phalcon_acl_roleinterface_ce);
}
if (_0) {
- RETURN_MM_BOOL(1);
+ 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();
+ } else {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Role must be either a string or implement RoleInterface", "phalcon/Acl/Adapter/Memory.zep", 411);
+ return;
}
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "messagefactory", NULL, 0, validation, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_2);
+ ZEPHIR_CALL_METHOD(&roleName, &roleObject, "getname", NULL, 148);
zephir_check_call_status();
- RETURN_MM_BOOL(0);
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Email)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Email, phalcon, validation_validator_email, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_email_method_entry, 0);
-
- zend_declare_property_string(phalcon_validation_validator_email_ce, SL("template"), "Field :field must be an email address", ZEND_ACC_PROTECTED);
- return SUCCESS;
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("rolesNames"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset(&_1, &roleName)) {
+ RETURN_MM_BOOL(0);
+ }
+ zephir_update_property_array_append(this_ptr, SL("roles"), &roleObject);
+ zephir_update_property_array(this_ptr, SL("rolesNames"), &roleName, &__$true);
+ 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);
}
-static PHP_METHOD(Phalcon_Validation_Validator_Email, __construct)
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, allow)
{
+ zend_string *_6$$4;
+ zend_ulong _5$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *roleName_param = NULL, *componentName_param = NULL, *access, access_sub, *func = NULL, func_sub, __$null, innerRoleName, _0$$3, _1$$4, _2$$4, *_3$$4, _4$$4, _7$$5, _8$$6;
+ zval roleName, componentName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&roleName);
+ ZVAL_UNDEF(&componentName);
+ ZVAL_UNDEF(&access_sub);
+ ZVAL_UNDEF(&func_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&innerRoleName);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$6);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(3, 4)
+ Z_PARAM_STR(roleName)
+ Z_PARAM_STR(componentName)
+ Z_PARAM_ZVAL(access)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_ZVAL_OR_NULL(func)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &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, 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_CALL_PARENT(NULL, phalcon_validation_validator_email_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
+ if (!ZEPHIR_IS_STRING(&roleName, "*")) {
+ ZVAL_LONG(&_0$$3, 1);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", NULL, 149, &roleName, &componentName, access, &_0$$3, func);
+ zephir_check_call_status();
+ } else {
+ zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("rolesNames"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_2$$4);
+ zephir_is_iterable(&_1$$4, 0, "phalcon/Acl/Adapter/Memory.zep", 468);
+ if (Z_TYPE_P(&_1$$4) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_1$$4), _5$$4, _6$$4, _3$$4)
+ {
+ ZEPHIR_INIT_NVAR(&innerRoleName);
+ if (_6$$4 != NULL) {
+ ZVAL_STR_COPY(&innerRoleName, _6$$4);
+ } else {
+ ZVAL_LONG(&innerRoleName, _5$$4);
+ }
+ ZEPHIR_INIT_NVAR(&_2$$4);
+ ZVAL_COPY(&_2$$4, _3$$4);
+ ZVAL_LONG(&_7$$5, 1);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", NULL, 149, &innerRoleName, &componentName, access, &_7$$5, func);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_1$$4, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_4$$4, &_1$$4, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_4$$4)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&innerRoleName, &_1$$4, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_2$$4, &_1$$4, "current", NULL, 0);
+ zephir_check_call_status();
+ ZVAL_LONG(&_8$$6, 1);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", NULL, 149, &innerRoleName, &componentName, access, &_8$$6, func);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_1$$4, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&_2$$4);
+ ZEPHIR_INIT_NVAR(&innerRoleName);
+ }
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_Validator_Email, validate)
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, deny)
{
+ zend_string *_7$$4;
+ zend_ulong _6$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, value, _0, _1, _2$$3;
+ zval *roleName_param = NULL, *componentName_param = NULL, *access, access_sub, *func = NULL, func_sub, __$null, innerRoleName, _0, _1$$3, _2$$4, _3$$4, *_4$$4, _5$$4, _8$$5, _9$$6;
+ zval roleName, componentName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&roleName);
+ ZVAL_UNDEF(&componentName);
+ ZVAL_UNDEF(&access_sub);
+ ZVAL_UNDEF(&func_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&innerRoleName);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$6);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ 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)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
-
-
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZVAL_LONG(&_0, 274);
- ZEPHIR_CALL_FUNCTION(&_1, "filter_var", NULL, 237, &value, &_0);
- zephir_check_call_status();
- if (!(zephir_is_true(&_1))) {
- ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "messagefactory", NULL, 0, validation, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_2$$3);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
+ 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;
}
- RETURN_MM_BOOL(1);
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Exception)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Exception, phalcon, validation_validator_exception, phalcon_exception_ce, NULL, 0);
-
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_ExclusionIn)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, ExclusionIn, phalcon, validation_validator_exclusionin, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_exclusionin_method_entry, 0);
-
- zend_declare_property_string(phalcon_validation_validator_exclusionin_ce, SL("template"), "Field :field must not be a part of list: :domain", ZEND_ACC_PROTECTED);
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Validation_Validator_ExclusionIn, __construct)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&options);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
-#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "*");
+ if (!ZEPHIR_IS_IDENTICAL(&_0, &roleName)) {
+ ZVAL_LONG(&_1$$3, 0);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", NULL, 149, &roleName, &componentName, access, &_1$$3, func);
+ zephir_check_call_status();
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("rolesNames"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_3$$4);
+ zephir_is_iterable(&_2$$4, 0, "phalcon/Acl/Adapter/Memory.zep", 504);
+ if (Z_TYPE_P(&_2$$4) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_2$$4), _6$$4, _7$$4, _4$$4)
+ {
+ ZEPHIR_INIT_NVAR(&innerRoleName);
+ if (_7$$4 != NULL) {
+ ZVAL_STR_COPY(&innerRoleName, _7$$4);
+ } else {
+ ZVAL_LONG(&innerRoleName, _6$$4);
+ }
+ ZEPHIR_INIT_NVAR(&_3$$4);
+ ZVAL_COPY(&_3$$4, _4$$4);
+ ZVAL_LONG(&_8$$5, 0);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", NULL, 149, &innerRoleName, &componentName, access, &_8$$5, func);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_2$$4, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5$$4, &_2$$4, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5$$4)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&innerRoleName, &_2$$4, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_3$$4, &_2$$4, "current", NULL, 0);
+ zephir_check_call_status();
+ ZVAL_LONG(&_9$$6, 0);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", NULL, 149, &innerRoleName, &componentName, access, &_9$$6, func);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_2$$4, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&_3$$4);
+ ZEPHIR_INIT_NVAR(&innerRoleName);
}
-
-
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_exclusionin_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_Validator_ExclusionIn, validate)
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, dropComponentAccess)
{
+ zval localAccess;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, value, domain, replacePairs, strict, fieldDomain, _0, _1, _4, _2$$6, _3$$7, _5$$9, _6$$9;
+ 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 *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&domain);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&strict);
- ZVAL_UNDEF(&fieldDomain);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_2$$6);
- ZVAL_UNDEF(&_3$$7);
- ZVAL_UNDEF(&_5$$9);
- ZVAL_UNDEF(&_6$$9);
+ 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);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ Z_PARAM_STR(componentName)
+ Z_PARAM_ZVAL(accessList)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ zephir_fetch_params(1, 2, 0, &componentName_param, &accessList);
+ zephir_get_strval(&componentName, componentName_param);
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "domain");
- ZEPHIR_CALL_METHOD(&domain, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(&fieldDomain);
- if (zephir_array_isset_fetch(&fieldDomain, &domain, field, 0)) {
- if (Z_TYPE_P(&fieldDomain) == IS_ARRAY) {
- ZEPHIR_CPY_WRT(&domain, &fieldDomain);
- }
- }
- if (UNEXPECTED(Z_TYPE_P(&domain) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Option 'domain' must be an array", "phalcon/Validation/Validator/ExclusionIn.zep", 104);
- return;
+ 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);
}
- ZEPHIR_INIT_VAR(&strict);
- ZVAL_BOOL(&strict, 0);
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "strict");
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "hasoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (zephir_is_true(&_1)) {
- ZEPHIR_INIT_VAR(&_2$$6);
- ZVAL_STRING(&_2$$6, "strict");
- ZEPHIR_CALL_METHOD(&strict, this_ptr, "getoption", NULL, 0, &_2$$6);
- zephir_check_call_status();
- if (Z_TYPE_P(&strict) == IS_ARRAY) {
- zephir_array_fetch(&_3$$7, &strict, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/ExclusionIn.zep", 113);
- ZEPHIR_CPY_WRT(&strict, &_3$$7);
- }
- if (UNEXPECTED(((Z_TYPE_P(&strict) == IS_TRUE || Z_TYPE_P(&strict) == IS_FALSE) != 1))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Option 'strict' must be a bool", "phalcon/Validation/Validator/ExclusionIn.zep", 117);
- return;
+ if (Z_TYPE_P(accessList) == IS_ARRAY) {
+ zephir_is_iterable(&localAccess, 0, "phalcon/Acl/Adapter/Memory.zep", 530);
+ 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_CALL_FUNCTION(&_4, "in_array", NULL, 0, &value, &domain, &strict);
- zephir_check_call_status();
- if (zephir_is_true(&_4)) {
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- ZEPHIR_INIT_VAR(&_5$$9);
- zephir_fast_join_str(&_5$$9, SL(", "), &domain);
- zephir_array_update_string(&replacePairs, SL(":domain"), &_5$$9, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_6$$9, this_ptr, "messagefactory", NULL, 0, validation, field, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_6$$9);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+ ZEPHIR_MM_RESTORE();
}
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, getNoArgumentsDefaultAction)
+{
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
+ RETURN_MEMBER(getThis(), "noArgumentsDefaultAction");
+}
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, getRoles)
+{
+ zval *this_ptr = getThis();
+ RETURN_MEMBER(getThis(), "roles");
+}
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_File)
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, getComponents)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, File, phalcon, validation_validator_file, phalcon_validation_abstractvalidatorcomposite_ce, phalcon_validation_validator_file_method_entry, 0);
+ zval *this_ptr = getThis();
- return SUCCESS;
+
+
+ RETURN_MEMBER(getThis(), "components");
}
-static PHP_METHOD(Phalcon_Validation_Validator_File, __construct)
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed)
{
- zend_string *_3;
- zend_ulong _2;
+ zend_bool hasComponent, hasRole, _10, _14$$18, _18$$20, _20$$20, _21$$20, _23$$20, _24$$20, _26$$20, _35$$26, _37$$26, _38$$26, _40$$26, _41$$26, _43$$26, _55$$33, _57$$32, _59$$34;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_6 = NULL, *_13 = NULL, *_16 = NULL, *_19 = NULL, *_22 = NULL, *_25 = NULL, *_28 = NULL, *_31 = NULL, *_34 = NULL, *_57 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *options_param = NULL, included, key, message, validator, value, *_0, _1, _4$$3, _5$$3, _7$$3, _8$$3, _9$$3, _10$$3, _11$$3, _12$$3, _14$$4, _17$$5, _20$$6, _23$$7, _26$$8, _29$$9, _32$$10, _35$$12, _36$$12, _37$$12, _38$$12, _39$$12, _40$$12, _41$$12, _42$$12, _43$$13, _45$$14, _47$$15, _49$$16, _51$$17, _53$$18, _55$$19;
- zval options, _15$$4, _18$$5, _21$$6, _24$$7, _27$$8, _30$$9, _33$$10, _44$$13, _46$$14, _48$$15, _50$$16, _52$$17, _54$$18, _56$$19;
+ 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, componentObject, haveAccess, eventsManager, funcAccess, funcList, numberOfRequiredParameters, reflectionFunction, reflectionParameters, parameterNumber, parameterToCheck, parametersForFunction, reflectionClass, reflectionParameter, rolesNames, roleObject, userParametersSizeShouldBe, _6, _0$$5, _1$$6, _3$$9, _4$$10, _7$$11, _8$$11, _9$$13, _11$$15, _12$$16, _13$$16, _15$$18, *_16$$17, _17$$17, _61$$17, _62$$17, _19$$20, _22$$20, _25$$20, _27$$20, _28$$20, _29$$23, _30$$23, _31$$23, _32$$23, _33$$23, _34$$24, _36$$26, _39$$26, _42$$26, _44$$26, _45$$26, _46$$29, _47$$29, _48$$29, _49$$29, _50$$29, _51$$30, _52$$31, _53$$31, _54$$33, _56$$33, _58$$32, _60$$34;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&_15$$4);
- ZVAL_UNDEF(&_18$$5);
- ZVAL_UNDEF(&_21$$6);
- ZVAL_UNDEF(&_24$$7);
- ZVAL_UNDEF(&_27$$8);
- ZVAL_UNDEF(&_30$$9);
- ZVAL_UNDEF(&_33$$10);
- ZVAL_UNDEF(&_44$$13);
- ZVAL_UNDEF(&_46$$14);
- ZVAL_UNDEF(&_48$$15);
- ZVAL_UNDEF(&_50$$16);
- ZVAL_UNDEF(&_52$$17);
- ZVAL_UNDEF(&_54$$18);
- ZVAL_UNDEF(&_56$$19);
- ZVAL_UNDEF(&included);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&message);
- ZVAL_UNDEF(&validator);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_7$$3);
- ZVAL_UNDEF(&_8$$3);
- ZVAL_UNDEF(&_9$$3);
- ZVAL_UNDEF(&_10$$3);
- ZVAL_UNDEF(&_11$$3);
- ZVAL_UNDEF(&_12$$3);
- ZVAL_UNDEF(&_14$$4);
- ZVAL_UNDEF(&_17$$5);
- ZVAL_UNDEF(&_20$$6);
- ZVAL_UNDEF(&_23$$7);
- ZVAL_UNDEF(&_26$$8);
- ZVAL_UNDEF(&_29$$9);
- ZVAL_UNDEF(&_32$$10);
- ZVAL_UNDEF(&_35$$12);
- ZVAL_UNDEF(&_36$$12);
- ZVAL_UNDEF(&_37$$12);
- ZVAL_UNDEF(&_38$$12);
- ZVAL_UNDEF(&_39$$12);
- ZVAL_UNDEF(&_40$$12);
- ZVAL_UNDEF(&_41$$12);
- ZVAL_UNDEF(&_42$$12);
- ZVAL_UNDEF(&_43$$13);
- ZVAL_UNDEF(&_45$$14);
- ZVAL_UNDEF(&_47$$15);
- ZVAL_UNDEF(&_49$$16);
- ZVAL_UNDEF(&_51$$17);
- ZVAL_UNDEF(&_53$$18);
- ZVAL_UNDEF(&_55$$19);
+ ZVAL_UNDEF(&roleName_sub);
+ ZVAL_UNDEF(&componentName_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&accessKey);
+ ZVAL_UNDEF(&accessList);
+ ZVAL_UNDEF(&componentObject);
+ ZVAL_UNDEF(&haveAccess);
+ ZVAL_UNDEF(&eventsManager);
+ ZVAL_UNDEF(&funcAccess);
+ ZVAL_UNDEF(&funcList);
+ ZVAL_UNDEF(&numberOfRequiredParameters);
+ ZVAL_UNDEF(&reflectionFunction);
+ ZVAL_UNDEF(&reflectionParameters);
+ ZVAL_UNDEF(¶meterNumber);
+ ZVAL_UNDEF(¶meterToCheck);
+ ZVAL_UNDEF(¶metersForFunction);
+ ZVAL_UNDEF(&reflectionClass);
+ ZVAL_UNDEF(&reflectionParameter);
+ ZVAL_UNDEF(&rolesNames);
+ ZVAL_UNDEF(&roleObject);
+ ZVAL_UNDEF(&userParametersSizeShouldBe);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_0$$5);
+ ZVAL_UNDEF(&_1$$6);
+ ZVAL_UNDEF(&_3$$9);
+ ZVAL_UNDEF(&_4$$10);
+ ZVAL_UNDEF(&_7$$11);
+ ZVAL_UNDEF(&_8$$11);
+ ZVAL_UNDEF(&_9$$13);
+ ZVAL_UNDEF(&_11$$15);
+ ZVAL_UNDEF(&_12$$16);
+ ZVAL_UNDEF(&_13$$16);
+ ZVAL_UNDEF(&_15$$18);
+ ZVAL_UNDEF(&_17$$17);
+ ZVAL_UNDEF(&_61$$17);
+ ZVAL_UNDEF(&_62$$17);
+ ZVAL_UNDEF(&_19$$20);
+ ZVAL_UNDEF(&_22$$20);
+ ZVAL_UNDEF(&_25$$20);
+ ZVAL_UNDEF(&_27$$20);
+ ZVAL_UNDEF(&_28$$20);
+ ZVAL_UNDEF(&_29$$23);
+ ZVAL_UNDEF(&_30$$23);
+ ZVAL_UNDEF(&_31$$23);
+ ZVAL_UNDEF(&_32$$23);
+ ZVAL_UNDEF(&_33$$23);
+ ZVAL_UNDEF(&_34$$24);
+ ZVAL_UNDEF(&_36$$26);
+ ZVAL_UNDEF(&_39$$26);
+ ZVAL_UNDEF(&_42$$26);
+ ZVAL_UNDEF(&_44$$26);
+ ZVAL_UNDEF(&_45$$26);
+ ZVAL_UNDEF(&_46$$29);
+ ZVAL_UNDEF(&_47$$29);
+ ZVAL_UNDEF(&_48$$29);
+ ZVAL_UNDEF(&_49$$29);
+ ZVAL_UNDEF(&_50$$29);
+ ZVAL_UNDEF(&_51$$30);
+ ZVAL_UNDEF(&_52$$31);
+ ZVAL_UNDEF(&_53$$31);
+ ZVAL_UNDEF(&_54$$33);
+ ZVAL_UNDEF(&_56$$33);
+ ZVAL_UNDEF(&_58$$32);
+ ZVAL_UNDEF(&_60$$34);
+ ZVAL_UNDEF(&access);
+ ZVAL_UNDEF(&_2$$6);
+ ZVAL_UNDEF(&_5$$10);
+ ZVAL_UNDEF(¶meters);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(3, 4)
+ Z_PARAM_ZVAL(roleName)
+ Z_PARAM_ZVAL(componentName)
+ Z_PARAM_STR(access)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_ARRAY_OR_NULL(parameters)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ 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_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_get_arrval(¶meters, parameters_param);
}
- ZEPHIR_INIT_VAR(&included);
- ZVAL_NULL(&included);
- ZEPHIR_INIT_VAR(&message);
- ZVAL_NULL(&message);
- zephir_is_iterable(&options, 1, "phalcon/Validation/Validator/File.zep", 246);
- if (Z_TYPE_P(&options) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&options), _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_INIT_NVAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "minSize");
- ZEPHIR_CALL_FUNCTION(&_5$$3, "strcasecmp", &_6, 47, &key, &_4$$3);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "maxSize");
- ZEPHIR_CALL_FUNCTION(&_7$$3, "strcasecmp", &_6, 47, &key, &_4$$3);
+ 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_roleaware_ce)) {
+ ZEPHIR_CPY_WRT(&roleObject, roleName);
+ ZEPHIR_CALL_METHOD(roleName, &roleObject, "getrolename", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "equalSize");
- ZEPHIR_CALL_FUNCTION(&_8$$3, "strcasecmp", &_6, 47, &key, &_4$$3);
+ } 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_INIT_NVAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "allowedTypes");
- ZEPHIR_CALL_FUNCTION(&_9$$3, "strcasecmp", &_6, 47, &key, &_4$$3);
+ 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\\RoleAware or Phalcon\\Acl\\RoleInterface");
+ ZEPHIR_CALL_METHOD(NULL, &_1$$6, "__construct", NULL, 8, &_2$$6);
zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "maxResolution");
- ZEPHIR_CALL_FUNCTION(&_10$$3, "strcasecmp", &_6, 47, &key, &_4$$3);
+ zephir_throw_exception_debug(&_1$$6, "phalcon/Acl/Adapter/Memory.zep", 590);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ }
+ if (Z_TYPE_P(componentName) == IS_OBJECT) {
+ if (zephir_instance_of_ev(componentName, phalcon_acl_componentaware_ce)) {
+ ZEPHIR_CPY_WRT(&componentObject, componentName);
+ ZEPHIR_CALL_METHOD(componentName, &componentObject, "getcomponentname", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "minResolution");
- ZEPHIR_CALL_FUNCTION(&_11$$3, "strcasecmp", &_6, 47, &key, &_4$$3);
+ } 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_INIT_NVAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "equalResolution");
- ZEPHIR_CALL_FUNCTION(&_12$$3, "strcasecmp", &_6, 47, &key, &_4$$3);
+ 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\\ComponentAware or Phalcon\\Acl\\ComponentInterface");
+ ZEPHIR_CALL_METHOD(NULL, &_4$$10, "__construct", NULL, 8, &_5$$10);
zephir_check_call_status();
- if (ZEPHIR_IS_LONG_IDENTICAL(&_5$$3, 0)) {
- ZEPHIR_INIT_NVAR(&_14$$4);
- ZVAL_STRING(&_14$$4, "messageMinSize");
- ZEPHIR_CALL_CE_STATIC(&message, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_14$$4);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_14$$4);
- ZVAL_STRING(&_14$$4, "includedMinSize");
- ZEPHIR_CALL_CE_STATIC(&included, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_14$$4);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_file_size_min_ce);
- ZEPHIR_INIT_NVAR(&_15$$4);
- zephir_create_array(&_15$$4, 3, 0);
- zephir_array_update_string(&_15$$4, SL("size"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_15$$4, SL("message"), &message, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_15$$4, SL("included"), &included, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_16, 0, &_15$$4);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("messageMinSize"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("includedMinSize"), PH_SEPARATE);
- } else if (ZEPHIR_IS_LONG_IDENTICAL(&_7$$3, 0)) {
- ZEPHIR_INIT_NVAR(&_17$$5);
- ZVAL_STRING(&_17$$5, "messageSize");
- ZEPHIR_CALL_CE_STATIC(&message, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_17$$5);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_17$$5);
- ZVAL_STRING(&_17$$5, "includedSize");
- ZEPHIR_CALL_CE_STATIC(&included, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_17$$5);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_file_size_max_ce);
- ZEPHIR_INIT_NVAR(&_18$$5);
- zephir_create_array(&_18$$5, 3, 0);
- zephir_array_update_string(&_18$$5, SL("size"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_18$$5, SL("message"), &message, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_18$$5, SL("included"), &included, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_19, 0, &_18$$5);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("maxSize"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageSize"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("includedSize"), PH_SEPARATE);
- } else if (ZEPHIR_IS_LONG_IDENTICAL(&_8$$3, 0)) {
- ZEPHIR_INIT_NVAR(&_20$$6);
- ZVAL_STRING(&_20$$6, "messageEqualSize");
- ZEPHIR_CALL_CE_STATIC(&message, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_20$$6);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_file_size_equal_ce);
- ZEPHIR_INIT_NVAR(&_21$$6);
- zephir_create_array(&_21$$6, 2, 0);
- zephir_array_update_string(&_21$$6, SL("size"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_21$$6, SL("message"), &message, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_22, 0, &_21$$6);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("equalSize"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageEqualSize"), PH_SEPARATE);
- } else if (ZEPHIR_IS_LONG_IDENTICAL(&_9$$3, 0)) {
- ZEPHIR_INIT_NVAR(&_23$$7);
- ZVAL_STRING(&_23$$7, "messageType");
- ZEPHIR_CALL_CE_STATIC(&message, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_23$$7);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_file_mimetype_ce);
- ZEPHIR_INIT_NVAR(&_24$$7);
- zephir_create_array(&_24$$7, 2, 0);
- zephir_array_update_string(&_24$$7, SL("types"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_24$$7, SL("message"), &message, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_25, 0, &_24$$7);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("allowedTypes"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageType"), PH_SEPARATE);
- } else if (ZEPHIR_IS_LONG_IDENTICAL(&_10$$3, 0)) {
- ZEPHIR_INIT_NVAR(&_26$$8);
- ZVAL_STRING(&_26$$8, "messageMaxResolution");
- ZEPHIR_CALL_CE_STATIC(&message, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_26$$8);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_26$$8);
- ZVAL_STRING(&_26$$8, "includedMaxResolution");
- ZEPHIR_CALL_CE_STATIC(&included, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_26$$8);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_file_resolution_max_ce);
- ZEPHIR_INIT_NVAR(&_27$$8);
- zephir_create_array(&_27$$8, 3, 0);
- zephir_array_update_string(&_27$$8, SL("resolution"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_27$$8, SL("included"), &included, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_27$$8, SL("message"), &message, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_28, 0, &_27$$8);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("maxResolution"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("includedMaxResolution"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageMaxResolution"), PH_SEPARATE);
- } else if (ZEPHIR_IS_LONG_IDENTICAL(&_11$$3, 0)) {
- ZEPHIR_INIT_NVAR(&_29$$9);
- ZVAL_STRING(&_29$$9, "messageMinResolution");
- ZEPHIR_CALL_CE_STATIC(&message, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_29$$9);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_29$$9);
- ZVAL_STRING(&_29$$9, "includedMinResolution");
- ZEPHIR_CALL_CE_STATIC(&included, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_29$$9);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_file_resolution_min_ce);
- ZEPHIR_INIT_NVAR(&_30$$9);
- zephir_create_array(&_30$$9, 3, 0);
- zephir_array_update_string(&_30$$9, SL("resolution"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_30$$9, SL("included"), &included, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_30$$9, SL("message"), &message, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_31, 0, &_30$$9);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("minResolution"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("includedMinResolution"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageMinResolution"), PH_SEPARATE);
- } else if (ZEPHIR_IS_LONG_IDENTICAL(&_12$$3, 0)) {
- ZEPHIR_INIT_NVAR(&_32$$10);
- ZVAL_STRING(&_32$$10, "messageEqualResolution");
- ZEPHIR_CALL_CE_STATIC(&message, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_32$$10);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_file_resolution_equal_ce);
- ZEPHIR_INIT_NVAR(&_33$$10);
- zephir_create_array(&_33$$10, 2, 0);
- zephir_array_update_string(&_33$$10, SL("resolution"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_33$$10, SL("message"), &message, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_34, 0, &_33$$10);
+ zephir_throw_exception_debug(&_4$$10, "phalcon/Acl/Adapter/Memory.zep", 604);
+ 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_OBS_VAR(&accessList);
+ zephir_read_property(&accessList, this_ptr, ZEND_STRL("access"), PH_NOISY_CC);
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&eventsManager, &_6);
+ ZEPHIR_OBS_VAR(&funcList);
+ zephir_read_property(&funcList, this_ptr, ZEND_STRL("func"), PH_NOISY_CC);
+ ZEPHIR_INIT_ZVAL_NREF(_6);
+ ZVAL_LONG(&_6, 0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("activeFunctionCustomArgumentsCount"), &_6);
+ if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_8$$11);
+ ZVAL_STRING(&_8$$11, "acl:beforeCheckAccess");
+ ZEPHIR_CALL_METHOD(&_7$$11, &eventsManager, "fire", NULL, 0, &_8$$11, this_ptr);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_7$$11)) {
+ RETURN_MM_BOOL(0);
+ }
+ }
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("rolesNames"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&rolesNames, &_6);
+ if (!(zephir_array_isset(&rolesNames, roleName))) {
+ zephir_read_property(&_9$$13, this_ptr, ZEND_STRL("defaultAccess"), PH_NOISY_CC | PH_READONLY);
+ RETURN_MM_BOOL((ZEPHIR_IS_LONG(&_9$$13, 1)));
+ }
+ ZEPHIR_CALL_METHOD(&accessKey, this_ptr, "canaccess", NULL, 150, roleName, componentName, &access);
+ zephir_check_call_status();
+ _10 = !ZEPHIR_IS_FALSE(&accessKey);
+ 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", 641);
+ ZEPHIR_OBS_NVAR(&funcAccess);
+ zephir_array_isset_fetch(&funcAccess, &funcList, &accessKey, 0);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("accessGranted"), &haveAccess);
+ if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_11$$15);
+ ZVAL_STRING(&_11$$15, "acl:afterCheckAccess");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_11$$15, 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(&_12$$16);
+ ZEPHIR_CONCAT_VSVSV(&_12$$16, roleName, "!", componentName, "!", &access);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("activeKey"), &_12$$16);
+ zephir_read_property(&_13$$16, this_ptr, ZEND_STRL("defaultAccess"), PH_NOISY_CC | PH_READONLY);
+ RETURN_MM_BOOL(ZEPHIR_IS_LONG(&_13$$16, 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)) {
+ _14$$18 = ZEPHIR_IS_LONG(&haveAccess, 1);
+ if (_14$$18) {
+ ZEPHIR_INIT_VAR(&_15$$18);
+ ZEPHIR_CALL_USER_FUNC(&_15$$18, &funcAccess);
zephir_check_call_status();
- zephir_array_unset_string(&options, SL("equalResolution"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageEqualResolution"), PH_SEPARATE);
- } else {
- continue;
+ _14$$18 = zephir_is_true(&_15$$18);
}
- zephir_update_property_array_append(this_ptr, SL("validators"), &validator);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &options, "rewind", NULL, 0);
+ RETURN_MM_BOOL(_14$$18);
+ }
+ ZEPHIR_INIT_VAR(¶metersForFunction);
+ array_init(¶metersForFunction);
+ ZEPHIR_CALL_METHOD(&numberOfRequiredParameters, &reflectionFunction, "getnumberofrequiredparameters", NULL, 153);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1, &options, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&key, &options, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &options, "current", NULL, 0);
+ ZEPHIR_CPY_WRT(&userParametersSizeShouldBe, ¶meterNumber);
+ zephir_is_iterable(&reflectionParameters, 0, "phalcon/Acl/Adapter/Memory.zep", 746);
+ if (Z_TYPE_P(&reflectionParameters) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&reflectionParameters), _16$$17)
+ {
+ ZEPHIR_INIT_NVAR(&reflectionParameter);
+ ZVAL_COPY(&reflectionParameter, _16$$17);
+ ZEPHIR_CALL_METHOD(&reflectionClass, &reflectionParameter, "getclass", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(¶meterToCheck, &reflectionParameter, "getname", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&reflectionClass) != IS_NULL) {
+ _18$$20 = Z_TYPE_P(&roleObject) != IS_NULL;
+ if (_18$$20) {
+ ZEPHIR_CALL_METHOD(&_19$$20, &reflectionClass, "isinstance", NULL, 0, &roleObject);
+ zephir_check_call_status();
+ _18$$20 = zephir_is_true(&_19$$20);
+ }
+ _20$$20 = _18$$20;
+ if (_20$$20) {
+ _20$$20 = !hasRole;
+ }
+ if (_20$$20) {
+ hasRole = 1;
+ zephir_array_append(¶metersForFunction, &roleObject, PH_SEPARATE, "phalcon/Acl/Adapter/Memory.zep", 699);
+ ZEPHIR_SEPARATE(&userParametersSizeShouldBe);
+ zephir_decrement(&userParametersSizeShouldBe);
+ continue;
+ }
+ _21$$20 = Z_TYPE_P(&componentObject) != IS_NULL;
+ if (_21$$20) {
+ ZEPHIR_CALL_METHOD(&_22$$20, &reflectionClass, "isinstance", NULL, 0, &componentObject);
+ zephir_check_call_status();
+ _21$$20 = zephir_is_true(&_22$$20);
+ }
+ _23$$20 = _21$$20;
+ if (_23$$20) {
+ _23$$20 = !hasComponent;
+ }
+ if (_23$$20) {
+ hasComponent = 1;
+ zephir_array_append(¶metersForFunction, &componentObject, PH_SEPARATE, "phalcon/Acl/Adapter/Memory.zep", 711);
+ ZEPHIR_SEPARATE(&userParametersSizeShouldBe);
+ zephir_decrement(&userParametersSizeShouldBe);
+ continue;
+ }
+ _24$$20 = zephir_array_isset(¶meters, ¶meterToCheck);
+ if (_24$$20) {
+ zephir_array_fetch(&_25$$20, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 722);
+ _24$$20 = Z_TYPE_P(&_25$$20) == IS_OBJECT;
+ }
+ _26$$20 = _24$$20;
+ if (_26$$20) {
+ zephir_array_fetch(&_28$$20, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 723);
+ ZEPHIR_CALL_METHOD(&_27$$20, &reflectionClass, "isinstance", NULL, 0, &_28$$20);
+ zephir_check_call_status();
+ _26$$20 = !zephir_is_true(&_27$$20);
+ }
+ if (UNEXPECTED(_26$$20)) {
+ ZEPHIR_INIT_NVAR(&_29$$23);
+ object_init_ex(&_29$$23, phalcon_acl_exception_ce);
+ ZEPHIR_INIT_NVAR(&_30$$23);
+ zephir_array_fetch(&_31$$23, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 730);
+ zephir_get_class(&_30$$23, &_31$$23, 0);
+ ZEPHIR_CALL_METHOD(&_32$$23, &reflectionClass, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_33$$23);
+ ZEPHIR_CONCAT_SSSVSVSVSVSVS(&_33$$23, "Your passed parameter doesn't have the ", "same class as the parameter in defined function ", "when checking if ", roleName, " can ", &access, " ", componentName, ". Class passed: ", &_30$$23, " , Class in defined function: ", &_32$$23, ".");
+ ZEPHIR_CALL_METHOD(NULL, &_29$$23, "__construct", NULL, 8, &_33$$23);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_29$$23, "phalcon/Acl/Adapter/Memory.zep", 733);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ }
+ if (zephir_array_isset(¶meters, ¶meterToCheck)) {
+ zephir_array_fetch(&_34$$24, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 742);
+ zephir_array_append(¶metersForFunction, &_34$$24, PH_SEPARATE, "phalcon/Acl/Adapter/Memory.zep", 742);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &reflectionParameters, "rewind", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_35$$12);
- ZVAL_STRING(&_35$$12, "minSize");
- ZEPHIR_CALL_FUNCTION(&_36$$12, "strcasecmp", &_6, 47, &key, &_35$$12);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_35$$12);
- ZVAL_STRING(&_35$$12, "maxSize");
- ZEPHIR_CALL_FUNCTION(&_37$$12, "strcasecmp", &_6, 47, &key, &_35$$12);
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_17$$17, &reflectionParameters, "valid", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_35$$12);
- ZVAL_STRING(&_35$$12, "equalSize");
- ZEPHIR_CALL_FUNCTION(&_38$$12, "strcasecmp", &_6, 47, &key, &_35$$12);
+ if (!zend_is_true(&_17$$17)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&reflectionParameter, &reflectionParameters, "current", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_35$$12);
- ZVAL_STRING(&_35$$12, "allowedTypes");
- ZEPHIR_CALL_FUNCTION(&_39$$12, "strcasecmp", &_6, 47, &key, &_35$$12);
+ ZEPHIR_CALL_METHOD(&reflectionClass, &reflectionParameter, "getclass", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(¶meterToCheck, &reflectionParameter, "getname", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&reflectionClass) != IS_NULL) {
+ _35$$26 = Z_TYPE_P(&roleObject) != IS_NULL;
+ if (_35$$26) {
+ ZEPHIR_CALL_METHOD(&_36$$26, &reflectionClass, "isinstance", NULL, 0, &roleObject);
+ zephir_check_call_status();
+ _35$$26 = zephir_is_true(&_36$$26);
+ }
+ _37$$26 = _35$$26;
+ if (_37$$26) {
+ _37$$26 = !hasRole;
+ }
+ if (_37$$26) {
+ hasRole = 1;
+ zephir_array_append(¶metersForFunction, &roleObject, PH_SEPARATE, "phalcon/Acl/Adapter/Memory.zep", 699);
+ ZEPHIR_SEPARATE(&userParametersSizeShouldBe);
+ zephir_decrement(&userParametersSizeShouldBe);
+ continue;
+ }
+ _38$$26 = Z_TYPE_P(&componentObject) != IS_NULL;
+ if (_38$$26) {
+ ZEPHIR_CALL_METHOD(&_39$$26, &reflectionClass, "isinstance", NULL, 0, &componentObject);
+ zephir_check_call_status();
+ _38$$26 = zephir_is_true(&_39$$26);
+ }
+ _40$$26 = _38$$26;
+ if (_40$$26) {
+ _40$$26 = !hasComponent;
+ }
+ if (_40$$26) {
+ hasComponent = 1;
+ zephir_array_append(¶metersForFunction, &componentObject, PH_SEPARATE, "phalcon/Acl/Adapter/Memory.zep", 711);
+ ZEPHIR_SEPARATE(&userParametersSizeShouldBe);
+ zephir_decrement(&userParametersSizeShouldBe);
+ continue;
+ }
+ _41$$26 = zephir_array_isset(¶meters, ¶meterToCheck);
+ if (_41$$26) {
+ zephir_array_fetch(&_42$$26, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 722);
+ _41$$26 = Z_TYPE_P(&_42$$26) == IS_OBJECT;
+ }
+ _43$$26 = _41$$26;
+ if (_43$$26) {
+ zephir_array_fetch(&_45$$26, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 723);
+ ZEPHIR_CALL_METHOD(&_44$$26, &reflectionClass, "isinstance", NULL, 0, &_45$$26);
+ zephir_check_call_status();
+ _43$$26 = !zephir_is_true(&_44$$26);
+ }
+ if (UNEXPECTED(_43$$26)) {
+ ZEPHIR_INIT_NVAR(&_46$$29);
+ object_init_ex(&_46$$29, phalcon_acl_exception_ce);
+ ZEPHIR_INIT_NVAR(&_47$$29);
+ zephir_array_fetch(&_48$$29, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 730);
+ zephir_get_class(&_47$$29, &_48$$29, 0);
+ ZEPHIR_CALL_METHOD(&_49$$29, &reflectionClass, "getname", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_50$$29);
+ ZEPHIR_CONCAT_SSSVSVSVSVSVS(&_50$$29, "Your passed parameter doesn't have the ", "same class as the parameter in defined function ", "when checking if ", roleName, " can ", &access, " ", componentName, ". Class passed: ", &_47$$29, " , Class in defined function: ", &_49$$29, ".");
+ ZEPHIR_CALL_METHOD(NULL, &_46$$29, "__construct", NULL, 8, &_50$$29);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_46$$29, "phalcon/Acl/Adapter/Memory.zep", 733);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ }
+ if (zephir_array_isset(¶meters, ¶meterToCheck)) {
+ zephir_array_fetch(&_51$$30, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 742);
+ zephir_array_append(¶metersForFunction, &_51$$30, PH_SEPARATE, "phalcon/Acl/Adapter/Memory.zep", 742);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &reflectionParameters, "next", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_35$$12);
- ZVAL_STRING(&_35$$12, "maxResolution");
- ZEPHIR_CALL_FUNCTION(&_40$$12, "strcasecmp", &_6, 47, &key, &_35$$12);
+ }
+ }
+ 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(&_52$$31);
+ ZEPHIR_CONCAT_SSVSVSVS(&_52$$31, "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(&_53$$31, 512);
+ ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 7, &_52$$31, &_53$$31);
+ zephir_check_call_status();
+ }
+ if (zephir_fast_count_int(¶metersForFunction) == 0) {
+ if (UNEXPECTED(ZEPHIR_GT_LONG(&numberOfRequiredParameters, 0))) {
+ ZEPHIR_INIT_VAR(&_54$$33);
+ ZEPHIR_CONCAT_SVSVSVS(&_54$$33, "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, &_54$$33);
zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_35$$12);
- ZVAL_STRING(&_35$$12, "minResolution");
- ZEPHIR_CALL_FUNCTION(&_41$$12, "strcasecmp", &_6, 47, &key, &_35$$12);
+ _55$$33 = ZEPHIR_IS_LONG(&haveAccess, 1);
+ if (_55$$33) {
+ zephir_read_property(&_56$$33, this_ptr, ZEND_STRL("noArgumentsDefaultAction"), PH_NOISY_CC | PH_READONLY);
+ _55$$33 = ZEPHIR_IS_LONG(&_56$$33, 1);
+ }
+ RETURN_MM_BOOL(_55$$33);
+ }
+ _57$$32 = ZEPHIR_IS_LONG(&haveAccess, 1);
+ if (_57$$32) {
+ ZEPHIR_INIT_VAR(&_58$$32);
+ ZEPHIR_CALL_USER_FUNC(&_58$$32, &funcAccess);
zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_35$$12);
- ZVAL_STRING(&_35$$12, "equalResolution");
- ZEPHIR_CALL_FUNCTION(&_42$$12, "strcasecmp", &_6, 47, &key, &_35$$12);
+ _57$$32 = zephir_is_true(&_58$$32);
+ }
+ RETURN_MM_BOOL(_57$$32);
+ }
+ if (ZEPHIR_LE_LONG(&numberOfRequiredParameters, zephir_fast_count_int(¶metersForFunction))) {
+ _59$$34 = ZEPHIR_IS_LONG(&haveAccess, 1);
+ if (_59$$34) {
+ ZEPHIR_INIT_VAR(&_60$$34);
+ ZEPHIR_CALL_USER_FUNC_ARRAY(&_60$$34, &funcAccess, ¶metersForFunction);
zephir_check_call_status();
- if (ZEPHIR_IS_LONG_IDENTICAL(&_36$$12, 0)) {
- ZEPHIR_INIT_NVAR(&_43$$13);
- ZVAL_STRING(&_43$$13, "messageMinSize");
- ZEPHIR_CALL_CE_STATIC(&message, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_43$$13);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_43$$13);
- ZVAL_STRING(&_43$$13, "includedMinSize");
- ZEPHIR_CALL_CE_STATIC(&included, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_43$$13);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_file_size_min_ce);
- ZEPHIR_INIT_NVAR(&_44$$13);
- zephir_create_array(&_44$$13, 3, 0);
- zephir_array_update_string(&_44$$13, SL("size"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_44$$13, SL("message"), &message, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_44$$13, SL("included"), &included, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_34, 0, &_44$$13);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("messageMinSize"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("includedMinSize"), PH_SEPARATE);
- } else if (ZEPHIR_IS_LONG_IDENTICAL(&_37$$12, 0)) {
- ZEPHIR_INIT_NVAR(&_45$$14);
- ZVAL_STRING(&_45$$14, "messageSize");
- ZEPHIR_CALL_CE_STATIC(&message, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_45$$14);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_45$$14);
- ZVAL_STRING(&_45$$14, "includedSize");
- ZEPHIR_CALL_CE_STATIC(&included, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_45$$14);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_file_size_max_ce);
- ZEPHIR_INIT_NVAR(&_46$$14);
- zephir_create_array(&_46$$14, 3, 0);
- zephir_array_update_string(&_46$$14, SL("size"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_46$$14, SL("message"), &message, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_46$$14, SL("included"), &included, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_34, 0, &_46$$14);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("maxSize"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageSize"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("includedSize"), PH_SEPARATE);
- } else if (ZEPHIR_IS_LONG_IDENTICAL(&_38$$12, 0)) {
- ZEPHIR_INIT_NVAR(&_47$$15);
- ZVAL_STRING(&_47$$15, "messageEqualSize");
- ZEPHIR_CALL_CE_STATIC(&message, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_47$$15);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_file_size_equal_ce);
- ZEPHIR_INIT_NVAR(&_48$$15);
- zephir_create_array(&_48$$15, 2, 0);
- zephir_array_update_string(&_48$$15, SL("size"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_48$$15, SL("message"), &message, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_34, 0, &_48$$15);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("equalSize"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageEqualSize"), PH_SEPARATE);
- } else if (ZEPHIR_IS_LONG_IDENTICAL(&_39$$12, 0)) {
- ZEPHIR_INIT_NVAR(&_49$$16);
- ZVAL_STRING(&_49$$16, "messageType");
- ZEPHIR_CALL_CE_STATIC(&message, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_49$$16);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_file_mimetype_ce);
- ZEPHIR_INIT_NVAR(&_50$$16);
- zephir_create_array(&_50$$16, 2, 0);
- zephir_array_update_string(&_50$$16, SL("types"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_50$$16, SL("message"), &message, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_34, 0, &_50$$16);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("allowedTypes"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageType"), PH_SEPARATE);
- } else if (ZEPHIR_IS_LONG_IDENTICAL(&_40$$12, 0)) {
- ZEPHIR_INIT_NVAR(&_51$$17);
- ZVAL_STRING(&_51$$17, "messageMaxResolution");
- ZEPHIR_CALL_CE_STATIC(&message, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_51$$17);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_51$$17);
- ZVAL_STRING(&_51$$17, "includedMaxResolution");
- ZEPHIR_CALL_CE_STATIC(&included, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_51$$17);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_file_resolution_max_ce);
- ZEPHIR_INIT_NVAR(&_52$$17);
- zephir_create_array(&_52$$17, 3, 0);
- zephir_array_update_string(&_52$$17, SL("resolution"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_52$$17, SL("included"), &included, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_52$$17, SL("message"), &message, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_34, 0, &_52$$17);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("maxResolution"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("includedMaxResolution"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageMaxResolution"), PH_SEPARATE);
- } else if (ZEPHIR_IS_LONG_IDENTICAL(&_41$$12, 0)) {
- ZEPHIR_INIT_NVAR(&_53$$18);
- ZVAL_STRING(&_53$$18, "messageMinResolution");
- ZEPHIR_CALL_CE_STATIC(&message, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_53$$18);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_53$$18);
- ZVAL_STRING(&_53$$18, "includedMinResolution");
- ZEPHIR_CALL_CE_STATIC(&included, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_53$$18);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_file_resolution_min_ce);
- ZEPHIR_INIT_NVAR(&_54$$18);
- zephir_create_array(&_54$$18, 3, 0);
- zephir_array_update_string(&_54$$18, SL("resolution"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_54$$18, SL("included"), &included, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_54$$18, SL("message"), &message, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_34, 0, &_54$$18);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("minResolution"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("includedMinResolution"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageMinResolution"), PH_SEPARATE);
- } else if (ZEPHIR_IS_LONG_IDENTICAL(&_42$$12, 0)) {
- ZEPHIR_INIT_NVAR(&_55$$19);
- ZVAL_STRING(&_55$$19, "messageEqualResolution");
- ZEPHIR_CALL_CE_STATIC(&message, phalcon_helper_arr_ce, "get", &_13, 16, &options, &_55$$19);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_file_resolution_equal_ce);
- ZEPHIR_INIT_NVAR(&_56$$19);
- zephir_create_array(&_56$$19, 2, 0);
- zephir_array_update_string(&_56$$19, SL("resolution"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_56$$19, SL("message"), &message, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_34, 0, &_56$$19);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("equalResolution"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageEqualResolution"), PH_SEPARATE);
- } else {
- continue;
- }
- zephir_update_property_array_append(this_ptr, SL("validators"), &validator);
- ZEPHIR_CALL_METHOD(NULL, &options, "next", NULL, 0);
- zephir_check_call_status();
+ _59$$34 = zephir_is_true(&_60$$34);
+ }
+ RETURN_MM_BOOL(_59$$34);
}
+ ZEPHIR_INIT_VAR(&_61$$17);
+ object_init_ex(&_61$$17, phalcon_acl_exception_ce);
+ ZEPHIR_INIT_VAR(&_62$$17);
+ ZEPHIR_CONCAT_SSVSVSVS(&_62$$17, "You did not provide all necessary parameters for the ", "defined function when checking if '", roleName, "' can '", &access, "' for '", componentName, "'.");
+ ZEPHIR_CALL_METHOD(NULL, &_61$$17, "__construct", NULL, 8, &_62$$17);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_61$$17, "phalcon/Acl/Adapter/Memory.zep", 787);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_file_ce, getThis(), "__construct", &_57, 0, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Identical)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Identical, phalcon, validation_validator_identical, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_identical_method_entry, 0);
-
- zend_declare_property_string(phalcon_validation_validator_identical_ce, SL("template"), "Field :field does not have the expected value", ZEND_ACC_PROTECTED);
- return SUCCESS;
+ RETURN_MM_BOOL(ZEPHIR_IS_LONG(&haveAccess, 1));
}
-static PHP_METHOD(Phalcon_Validation_Validator_Identical, __construct)
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, isRole)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *roleName_param = NULL, _0;
+ zval roleName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&roleName);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(roleName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &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, &roleName_param);
+ zephir_get_strval(&roleName, roleName_param);
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_identical_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("rolesNames"), PH_NOISY_CC | PH_READONLY);
+ RETURN_MM_BOOL(zephir_array_isset(&_0, &roleName));
}
-static PHP_METHOD(Phalcon_Validation_Validator_Identical, validate)
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, isComponent)
{
- zend_bool valid = 0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, value, accepted, _0, _1, _2, _3$$3, _4$$4, _5$$6, _6$$7;
+ zval *componentName_param = NULL, _0;
+ zval componentName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&accepted);
+ ZVAL_UNDEF(&componentName);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$4);
- ZVAL_UNDEF(&_5$$6);
- ZVAL_UNDEF(&_6$$7);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(componentName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ zephir_fetch_params(1, 1, 0, &componentName_param);
+ zephir_get_strval(&componentName, componentName_param);
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "accepted");
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasoption", NULL, 0, &_1);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "value");
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "hasoption", NULL, 0, &_1);
- zephir_check_call_status();
- if (zephir_is_true(&_0)) {
- ZEPHIR_INIT_VAR(&_3$$3);
- ZVAL_STRING(&_3$$3, "accepted");
- ZEPHIR_CALL_METHOD(&accepted, this_ptr, "getoption", NULL, 0, &_3$$3);
- zephir_check_call_status();
- } else if (zephir_is_true(&_2)) {
- ZEPHIR_INIT_VAR(&_4$$4);
- ZVAL_STRING(&_4$$4, "value");
- ZEPHIR_CALL_METHOD(&accepted, this_ptr, "getoption", NULL, 0, &_4$$4);
- zephir_check_call_status();
- }
- if (zephir_is_true(&accepted)) {
- if (Z_TYPE_P(&accepted) == IS_ARRAY) {
- zephir_array_fetch(&_5$$6, &accepted, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Identical.zep", 94);
- ZEPHIR_CPY_WRT(&accepted, &_5$$6);
- }
- valid = ZEPHIR_IS_EQUAL(&value, &accepted);
- }
- if (!(valid)) {
- ZEPHIR_CALL_METHOD(&_6$$7, this_ptr, "messagefactory", NULL, 0, validation, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_6$$7);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("componentsNames"), PH_NOISY_CC | PH_READONLY);
+ RETURN_MM_BOOL(zephir_array_isset(&_0, &componentName));
}
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, setNoArgumentsDefaultAction)
+{
+ zval *defaultAccess_param = NULL, _0;
+ zend_long defaultAccess;
+ zval *this_ptr = getThis();
-
-
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(defaultAccess)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ zephir_fetch_params_without_memory_grow(1, 0, &defaultAccess_param);
+ defaultAccess = zephir_get_intval(defaultAccess_param);
-
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_InclusionIn)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, InclusionIn, phalcon, validation_validator_inclusionin, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_inclusionin_method_entry, 0);
-
- zend_declare_property_string(phalcon_validation_validator_inclusionin_ce, SL("template"), "Field :field must be a part of list: :domain", ZEND_ACC_PROTECTED);
- return SUCCESS;
+ ZEPHIR_INIT_ZVAL_NREF(_0);
+ ZVAL_LONG(&_0, defaultAccess);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("noArgumentsDefaultAction"), &_0);
}
-static PHP_METHOD(Phalcon_Validation_Validator_InclusionIn, __construct)
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, allowOrDeny)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *roleName_param = NULL, *componentName_param = NULL, *access, access_sub, *action, action_sub, *func = NULL, func_sub, __$null, accessList, accessName, accessKey, _0, _3, _6, _1$$3, _4$$4, *_7$$5, _8$$5, *_13$$5, _14$$5, _9$$7, _10$$7, _11$$9, _12$$9, _15$$16, _16$$16;
+ zval roleName, componentName, _2$$3, _5$$4;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&roleName);
+ ZVAL_UNDEF(&componentName);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_5$$4);
+ 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(&_3);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_14$$5);
+ ZVAL_UNDEF(&_9$$7);
+ ZVAL_UNDEF(&_10$$7);
+ ZVAL_UNDEF(&_11$$9);
+ ZVAL_UNDEF(&_12$$9);
+ ZVAL_UNDEF(&_15$$16);
+ ZVAL_UNDEF(&_16$$16);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(4, 5)
+ Z_PARAM_STR(roleName)
+ Z_PARAM_STR(componentName)
+ Z_PARAM_ZVAL(access)
+ Z_PARAM_ZVAL(action)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_ZVAL_OR_NULL(func)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &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, 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_CALL_PARENT(NULL, phalcon_validation_validator_inclusionin_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("rolesNames"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(!(zephir_array_isset(&_0, &roleName)))) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ object_init_ex(&_1$$3, phalcon_acl_exception_ce);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_SVS(&_2$$3, "Role '", &roleName, "' does not exist in the ACL");
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 8, &_2$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_1$$3, "phalcon/Acl/Adapter/Memory.zep", 829);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("componentsNames"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(!(zephir_array_isset(&_3, &componentName)))) {
+ ZEPHIR_INIT_VAR(&_4$$4);
+ object_init_ex(&_4$$4, phalcon_acl_exception_ce);
+ ZEPHIR_INIT_VAR(&_5$$4);
+ ZEPHIR_CONCAT_SVS(&_5$$4, "Component '", &componentName, "' does not exist in the ACL");
+ ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", NULL, 8, &_5$$4);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_4$$4, "phalcon/Acl/Adapter/Memory.zep", 835);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("accessList"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&accessList, &_6);
+ if (Z_TYPE_P(access) == IS_ARRAY) {
+ zephir_is_iterable(access, 0, "phalcon/Acl/Adapter/Memory.zep", 852);
+ if (Z_TYPE_P(access) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(access), _7$$5)
+ {
+ ZEPHIR_INIT_NVAR(&accessName);
+ ZVAL_COPY(&accessName, _7$$5);
+ 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", NULL, 8, &_10$$7);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_9$$7, "phalcon/Acl/Adapter/Memory.zep", 848);
+ 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(&_8$$5, access, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_8$$5)) {
+ 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(&_11$$9);
+ object_init_ex(&_11$$9, phalcon_acl_exception_ce);
+ ZEPHIR_INIT_NVAR(&_12$$9);
+ ZEPHIR_CONCAT_SVSVS(&_12$$9, "Access '", &accessName, "' does not exist in component '", &componentName, "'");
+ ZEPHIR_CALL_METHOD(NULL, &_11$$9, "__construct", NULL, 8, &_12$$9);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_11$$9, "phalcon/Acl/Adapter/Memory.zep", 848);
+ 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", 860);
+ if (Z_TYPE_P(access) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(access), _13$$5)
+ {
+ ZEPHIR_INIT_NVAR(&accessName);
+ ZVAL_COPY(&accessName, _13$$5);
+ 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(&_14$$5, access, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_14$$5)) {
+ 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);
+ } 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(&_15$$16);
+ object_init_ex(&_15$$16, phalcon_acl_exception_ce);
+ ZEPHIR_INIT_VAR(&_16$$16);
+ ZEPHIR_CONCAT_SVSVS(&_16$$16, "Access '", access, "' does not exist in component '", &componentName, "'");
+ ZEPHIR_CALL_METHOD(NULL, &_15$$16, "__construct", NULL, 8, &_16$$16);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_15$$16, "phalcon/Acl/Adapter/Memory.zep", 868);
+ 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_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_Validator_InclusionIn, validate)
+static PHP_METHOD(Phalcon_Acl_Adapter_Memory, canAccess)
{
+ zval usedRoleToInherits, checkRoleToInherits;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_5 = NULL, *_6 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, value, domain, replacePairs, strict, fieldDomain, _0, _1, _4, _2$$6, _3$$7, _5$$9, _6$$9;
+ 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(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&domain);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&strict);
- ZVAL_UNDEF(&fieldDomain);
+ 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(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_1$$6);
ZVAL_UNDEF(&_2$$6);
- ZVAL_UNDEF(&_3$$7);
- ZVAL_UNDEF(&_5$$9);
- ZVAL_UNDEF(&_6$$9);
+ 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);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(roleName)
+ Z_PARAM_STR(componentName)
+ Z_PARAM_STR(access)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ 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_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "domain");
- ZEPHIR_CALL_METHOD(&domain, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(&fieldDomain);
- if (zephir_array_isset_fetch(&fieldDomain, &domain, field, 0)) {
- if (Z_TYPE_P(&fieldDomain) == IS_ARRAY) {
- ZEPHIR_CPY_WRT(&domain, &fieldDomain);
- }
+ ZEPHIR_OBS_VAR(&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);
}
- if (UNEXPECTED(Z_TYPE_P(&domain) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Option 'domain' must be an array", "phalcon/Validation/Validator/InclusionIn.zep", 98);
- return;
+ ZEPHIR_INIT_NVAR(&accessKey);
+ ZEPHIR_CONCAT_VSVS(&accessKey, &roleName, "!", &componentName, "!*");
+ if (zephir_array_isset(&accessList, &accessKey)) {
+ RETURN_CTOR(&accessKey);
}
- ZEPHIR_INIT_VAR(&strict);
- ZVAL_BOOL(&strict, 0);
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "strict");
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "hasoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (zephir_is_true(&_1)) {
- ZEPHIR_INIT_VAR(&_2$$6);
- ZVAL_STRING(&_2$$6, "strict");
- ZEPHIR_CALL_METHOD(&strict, this_ptr, "getoption", NULL, 0, &_2$$6);
- zephir_check_call_status();
- if (Z_TYPE_P(&strict) == IS_ARRAY) {
- zephir_array_fetch(&_3$$7, &strict, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/InclusionIn.zep", 107);
- ZEPHIR_CPY_WRT(&strict, &_3$$7);
+ ZEPHIR_INIT_NVAR(&accessKey);
+ ZEPHIR_CONCAT_VS(&accessKey, &roleName, "!*!*");
+ if (zephir_array_isset(&accessList, &accessKey)) {
+ RETURN_CTOR(&accessKey);
+ }
+ 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", 929);
+ zephir_is_iterable(&_2$$6, 0, "phalcon/Acl/Adapter/Memory.zep", 933);
+ 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();
+ }
}
- if (UNEXPECTED(((Z_TYPE_P(&strict) == IS_TRUE || Z_TYPE_P(&strict) == IS_FALSE) != 1))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Option 'strict' must be a bool", "phalcon/Validation/Validator/InclusionIn.zep", 111);
- return;
+ ZEPHIR_INIT_NVAR(&usedRoleToInherit);
+ ZEPHIR_INIT_VAR(&usedRoleToInherits);
+ array_init(&usedRoleToInherits);
+ while (1) {
+ if (!(!(ZEPHIR_IS_EMPTY(&checkRoleToInherits)))) {
+ break;
+ }
+ ZEPHIR_MAKE_REF(&checkRoleToInherits);
+ ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_6, 24, &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);
+ 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", 976);
+ zephir_is_iterable(&_12$$14, 0, "phalcon/Acl/Adapter/Memory.zep", 979);
+ 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);
+ }
}
}
- ZEPHIR_CALL_FUNCTION(&_4, "in_array", NULL, 0, &value, &domain, &strict);
- zephir_check_call_status();
- if (!(zephir_is_true(&_4))) {
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- ZEPHIR_INIT_VAR(&_5$$9);
- zephir_fast_join_str(&_5$$9, SL(", "), &domain);
- zephir_array_update_string(&replacePairs, SL(":domain"), &_5$$9, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_6$$9, this_ptr, "messagefactory", NULL, 0, validation, field, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_6$$9);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+ RETURN_MM_BOOL(0);
}
@@ -212550,182 +213510,112 @@ static PHP_METHOD(Phalcon_Validation_Validator_InclusionIn, validate)
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Ip)
+ZEPHIR_INIT_CLASS(Phalcon_Translate_Exception)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Ip, phalcon, validation_validator_ip, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_ip_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Translate, Exception, phalcon, translate_exception, phalcon_exception_ce, NULL, 0);
- zend_declare_property_string(phalcon_validation_validator_ip_ce, SL("template"), "Field :field must be a valid IP address", ZEND_ACC_PROTECTED);
- zephir_declare_class_constant_long(phalcon_validation_validator_ip_ce, SL("VERSION_4"), 1048576);
+ return SUCCESS;
+}
- zephir_declare_class_constant_long(phalcon_validation_validator_ip_ce, SL("VERSION_6"), 2097152);
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+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_string(phalcon_translate_interpolatorfactory_ce, SL("exception"), "Phalcon\\Translate\\Exception", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_Validator_Ip, __construct)
+static PHP_METHOD(Phalcon_Translate_InterpolatorFactory, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *services_param = NULL;
+ zval services;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&services);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_ARRAY(services)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 0, 1, &services_param);
+ if (!services_param) {
+ ZEPHIR_INIT_VAR(&services);
+ array_init(&services);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&services, services_param);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_ip_ce, getThis(), "__construct", &_0, 0, &options);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_Validator_Ip, validate)
+static PHP_METHOD(Phalcon_Translate_InterpolatorFactory, newInstance)
{
- zval _9;
- zend_bool _8;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, __$false, value, version, allowPrivate, allowReserved, allowEmpty, options, _0, _1, _3, _5, _10, _11, _12, _2$$3, _4$$4, _6$$5, _7$$6, _13$$8;
+ zval *name_param = NULL, definition;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&version);
- ZVAL_UNDEF(&allowPrivate);
- ZVAL_UNDEF(&allowReserved);
- ZVAL_UNDEF(&allowEmpty);
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_10);
- ZVAL_UNDEF(&_11);
- ZVAL_UNDEF(&_12);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_4$$4);
- ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&_7$$6);
- ZVAL_UNDEF(&_13$$8);
- ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&definition);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
-
-
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "version");
- ZVAL_LONG(&_1, (1048576 | 2097152));
- ZEPHIR_CALL_METHOD(&version, this_ptr, "getoption", NULL, 0, &_0, &_1);
- zephir_check_call_status();
- if (Z_TYPE_P(&version) == IS_ARRAY) {
- zephir_array_fetch(&_2$$3, &version, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Ip.zep", 102);
- ZEPHIR_CPY_WRT(&version, &_2$$3);
- }
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "allowPrivate");
- ZEPHIR_CALL_METHOD(&_3, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (zephir_is_true(&_3)) {
- ZEPHIR_INIT_VAR(&allowPrivate);
- ZVAL_LONG(&allowPrivate, 0);
- } else {
- ZEPHIR_INIT_NVAR(&allowPrivate);
- ZVAL_LONG(&allowPrivate, 8388608);
- }
- if (Z_TYPE_P(&allowPrivate) == IS_ARRAY) {
- zephir_array_fetch(&_4$$4, &allowPrivate, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Ip.zep", 108);
- ZEPHIR_CPY_WRT(&allowPrivate, &_4$$4);
- }
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "allowReserved");
- ZEPHIR_CALL_METHOD(&_5, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (zephir_is_true(&_5)) {
- ZEPHIR_INIT_VAR(&allowReserved);
- ZVAL_LONG(&allowReserved, 0);
- } else {
- ZEPHIR_INIT_NVAR(&allowReserved);
- ZVAL_LONG(&allowReserved, 4194304);
- }
- if (Z_TYPE_P(&allowReserved) == IS_ARRAY) {
- zephir_array_fetch(&_6$$5, &allowReserved, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Ip.zep", 114);
- ZEPHIR_CPY_WRT(&allowReserved, &_6$$5);
- }
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "allowEmpty");
- ZVAL_BOOL(&_1, 0);
- ZEPHIR_CALL_METHOD(&allowEmpty, this_ptr, "getoption", NULL, 0, &_0, &_1);
- zephir_check_call_status();
- if (Z_TYPE_P(&allowEmpty) == IS_ARRAY) {
- ZEPHIR_INIT_VAR(&_7$$6);
- if (zephir_array_isset(&allowEmpty, field)) {
- ZEPHIR_OBS_NVAR(&_7$$6);
- zephir_array_fetch(&_7$$6, &allowEmpty, field, PH_NOISY, "phalcon/Validation/Validator/Ip.zep", 120);
- } else {
- ZEPHIR_INIT_NVAR(&_7$$6);
- ZVAL_BOOL(&_7$$6, 0);
- }
- ZEPHIR_CPY_WRT(&allowEmpty, &_7$$6);
- }
- _8 = zephir_is_true(&allowEmpty);
- if (_8) {
- _8 = ZEPHIR_IS_EMPTY(&value);
- }
- if (_8) {
- RETURN_MM_BOOL(1);
- }
- ZEPHIR_INIT_VAR(&options);
- zephir_create_array(&options, 2, 0);
- ZEPHIR_INIT_VAR(&_9);
- zephir_create_array(&_9, 1, 0);
- zephir_array_update_string(&_9, SL("default"), &__$false, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&options, SL("options"), &_9, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_VAR(&_10);
- zephir_bitwise_or_function(&_10, &version, &allowPrivate);
- ZEPHIR_INIT_VAR(&_11);
- zephir_bitwise_or_function(&_11, &_10, &allowReserved);
- zephir_array_update_string(&options, SL("flags"), &_11, PH_COPY | PH_SEPARATE);
- ZVAL_LONG(&_1, 275);
- ZEPHIR_CALL_FUNCTION(&_12, "filter_var", NULL, 237, &value, &_1, &options);
- zephir_check_call_status();
- if (!(zephir_is_true(&_12))) {
- ZEPHIR_CALL_METHOD(&_13$$8, this_ptr, "messagefactory", NULL, 0, validation, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_13$$8);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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();
}
- RETURN_MM_BOOL(1);
+ 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_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Translate_InterpolatorFactory, getAdapters)
+{
+ zval *this_ptr = getThis();
+
+
+
+ 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;
}
@@ -212738,136 +213628,112 @@ static PHP_METHOD(Phalcon_Validation_Validator_Ip, validate)
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Numericality)
+ZEPHIR_INIT_CLASS(Phalcon_Translate_TranslateFactory)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Numericality, phalcon, validation_validator_numericality, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_numericality_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Translate, TranslateFactory, phalcon, translate_translatefactory, phalcon_factory_abstractfactory_ce, phalcon_translate_translatefactory_method_entry, 0);
- zend_declare_property_string(phalcon_validation_validator_numericality_ce, SL("template"), "Field :field does not have a valid numeric format", ZEND_ACC_PROTECTED);
+ zend_declare_property_string(phalcon_translate_translatefactory_ce, SL("exception"), "Phalcon\\Translate\\Exception", ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_translate_translatefactory_ce, SL("interpolator"), ZEND_ACC_PRIVATE);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_Validator_Numericality, __construct)
+static PHP_METHOD(Phalcon_Translate_TranslateFactory, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval services;
+ zval *interpolator, interpolator_sub, *services_param = NULL;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&interpolator_sub);
+ ZVAL_UNDEF(&services);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_ARRAY(services)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 1, 1, &interpolator, &services_param);
+ if (!services_param) {
+ ZEPHIR_INIT_VAR(&services);
+ array_init(&services);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&services, services_param);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_numericality_ce, getThis(), "__construct", &_0, 0, &options);
+ 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();
}
-static PHP_METHOD(Phalcon_Validation_Validator_Numericality, validate)
+static PHP_METHOD(Phalcon_Translate_TranslateFactory, load)
{
- zval pattern, _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_1 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, value, _1, _2, _3, _4, _5$$3;
+ zval *config = NULL, config_sub, name, options, _0, _2, _3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&config_sub);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(config)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ zephir_fetch_params(1, 1, 0, &config);
+ ZEPHIR_SEPARATE_PARAM(config);
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkconfig", NULL, 0, config);
zephir_check_call_status();
- zephir_cast_to_string(&_0, &value);
- ZEPHIR_CPY_WRT(&value, &_0);
- ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_CPY_WRT(config, &_0);
+ ZEPHIR_OBS_VAR(&name);
+ zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Translate/TranslateFactory.zep", 59);
ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, " ");
+ array_init(&_2);
ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "");
- zephir_fast_str_replace(&_1, &_2, &_3, &value);
- ZEPHIR_CPY_WRT(&value, &_1);
- ZEPHIR_INIT_VAR(&pattern);
- ZVAL_STRING(&pattern, "/((^[-]?[0-9,]+(.[0-9]+)?$)|(^[-]?[0-9.]+(,[0-9]+)?$))/");
- ZEPHIR_INIT_VAR(&_4);
- ZEPHIR_INIT_NVAR(&_1);
- zephir_preg_match(&_1, &pattern, &value, &_4, 0, 0 , 0 );
- if (!(zephir_is_true(&_1))) {
- ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "messagefactory", NULL, 0, validation, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_5$$3);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_PresenceOf)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, PresenceOf, phalcon, validation_validator_presenceof, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_presenceof_method_entry, 0);
-
- zend_declare_property_string(phalcon_validation_validator_presenceof_ce, SL("template"), "Field :field is required", ZEND_ACC_PROTECTED);
- return SUCCESS;
+ ZVAL_STRING(&_3, "options");
+ ZEPHIR_CALL_CE_STATIC(&options, phalcon_helper_arr_ce, "get", &_1, 16, config, &_3, &_2);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &options);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Validation_Validator_PresenceOf, __construct)
+static PHP_METHOD(Phalcon_Translate_TranslateFactory, newInstance)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ 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);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(name)
Z_PARAM_OPTIONAL
Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
@@ -212875,7 +213741,16 @@ static PHP_METHOD(Phalcon_Validation_Validator_PresenceOf, __construct)
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
+ 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);
@@ -212884,50 +213759,30 @@ static PHP_METHOD(Phalcon_Validation_Validator_PresenceOf, __construct)
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_presenceof_ce, getThis(), "__construct", &_0, 0, &options);
+ ZEPHIR_CALL_METHOD(&definition, this_ptr, "getservice", NULL, 0, &name);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_create_array(&_0, 2, 0);
+ ZEPHIR_OBS_VAR(&_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_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Validation_Validator_PresenceOf, validate)
+static PHP_METHOD(Phalcon_Translate_TranslateFactory, getAdapters)
{
- zend_bool _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, value, _1$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1$$3);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
- ZEND_PARSE_PARAMETERS_END();
-#endif
-
-
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- _0 = Z_TYPE_P(&value) == IS_NULL;
- if (!(_0)) {
- _0 = ZEPHIR_IS_STRING_IDENTICAL(&value, "");
- }
- if (_0) {
- ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "messagefactory", NULL, 0, validation, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_1$$3);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+ 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;
}
@@ -212940,106 +213795,138 @@ static PHP_METHOD(Phalcon_Validation_Validator_PresenceOf, validate)
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Regex)
+ZEPHIR_INIT_CLASS(Phalcon_Translate_Interpolator_AssociativeArray)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Regex, phalcon, validation_validator_regex, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_regex_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Translate\\Interpolator, AssociativeArray, phalcon, translate_interpolator_associativearray, phalcon_translate_interpolator_associativearray_method_entry, 0);
- zend_declare_property_string(phalcon_validation_validator_regex_ce, SL("template"), "Field :field does not match the required format", ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_translate_interpolator_associativearray_ce, 1, phalcon_translate_interpolator_interpolatorinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_Validator_Regex, __construct)
+static PHP_METHOD(Phalcon_Translate_Interpolator_AssociativeArray, replacePlaceholders)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval placeholders;
+ zval *translation_param = NULL, *placeholders_param = NULL, interpolate;
+ zval translation;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&translation);
+ ZVAL_UNDEF(&interpolate);
+ ZVAL_UNDEF(&placeholders);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(translation)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_ARRAY(placeholders)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ 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_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_INIT_VAR(&translation);
+ }
+ if (!placeholders_param) {
+ ZEPHIR_INIT_VAR(&placeholders);
+ array_init(&placeholders);
+ } else {
+ zephir_get_arrval(&placeholders, placeholders_param);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_regex_ce, getThis(), "__construct", &_0, 0, &options);
+ 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, 418, &translation, &placeholders);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Validation_Validator_Regex, validate)
+
+
+
+#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)
{
- zend_bool failed = 0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, matches, value, pattern, _0, _1$$3, _2$$4, _3$$6;
+ zval placeholders;
+ zval *translation_param = NULL, *placeholders_param = NULL, _0$$3;
+ zval translation;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&matches);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$6);
+ ZVAL_UNDEF(&translation);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&placeholders);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(translation)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(placeholders)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
-
-
- ZEPHIR_INIT_VAR(&matches);
- ZVAL_NULL(&matches);
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "pattern");
- ZEPHIR_CALL_METHOD(&pattern, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (Z_TYPE_P(&pattern) == IS_ARRAY) {
- zephir_array_fetch(&_1$$3, &pattern, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Regex.zep", 91);
- ZEPHIR_CPY_WRT(&pattern, &_1$$3);
+ 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();
}
- ZEPHIR_INIT_NVAR(&_0);
- zephir_preg_match(&_0, &pattern, &value, &matches, 0, 0 , 0 );
- if (zephir_is_true(&_0)) {
- zephir_array_fetch_long(&_2$$4, &matches, 0, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Regex.zep", 95);
- failed = !ZEPHIR_IS_EQUAL(&_2$$4, &value);
+ if (EXPECTED(Z_TYPE_P(translation_param) == IS_STRING)) {
+ zephir_get_strval(&translation, translation_param);
} else {
- failed = 1;
+ ZEPHIR_INIT_VAR(&translation);
}
- if (failed) {
- ZEPHIR_CALL_METHOD(&_3$$6, this_ptr, "messagefactory", NULL, 0, validation, field);
+ if (!placeholders_param) {
+ ZEPHIR_INIT_VAR(&placeholders);
+ array_init(&placeholders);
+ } else {
+ zephir_get_arrval(&placeholders, placeholders_param);
+ }
+
+
+ if (zephir_fast_count_int(&placeholders)) {
+ ZEPHIR_MAKE_REF(&placeholders);
+ ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 0, &placeholders, &translation);
+ ZEPHIR_UNREF(&placeholders);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_3$$6);
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZVAL_STRING(&_0$$3, "sprintf");
+ ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &_0$$3, &placeholders);
zephir_check_call_status();
- RETURN_MM_BOOL(0);
+ RETURN_MM();
}
- RETURN_MM_BOOL(1);
+ RETURN_CTOR(&translation);
}
@@ -213052,1615 +213939,600 @@ static PHP_METHOD(Phalcon_Validation_Validator_Regex, validate)
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_StringLength)
+ZEPHIR_INIT_CLASS(Phalcon_Translate_Interpolator_InterpolatorInterface)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, StringLength, phalcon, validation_validator_stringlength, phalcon_validation_abstractvalidatorcomposite_ce, phalcon_validation_validator_stringlength_method_entry, 0);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Translate\\Interpolator, InterpolatorInterface, phalcon, translate_interpolator_interpolatorinterface, phalcon_translate_interpolator_interpolatorinterface_method_entry);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_Validator_StringLength, __construct)
+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)
{
- zend_string *_3;
- zend_ulong _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_6 = NULL, *_9 = NULL, *_11 = NULL, *_17 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *options_param = NULL, included, key, message, validator, value, *_0, _1, _4$$3, _5$$3, _7$$3, _12$$15, _13$$15, _14$$15;
- zval options, _8$$4, _10$$9, _15$$16, _16$$21;
+ zephir_fcall_cache_entry *_1 = NULL;
+ zval options;
+ zval *interpolator, interpolator_sub, *options_param = NULL, _0, _2, _3;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&interpolator_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&_8$$4);
- ZVAL_UNDEF(&_10$$9);
- ZVAL_UNDEF(&_15$$16);
- ZVAL_UNDEF(&_16$$21);
- ZVAL_UNDEF(&included);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&message);
- ZVAL_UNDEF(&validator);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_7$$3);
- ZVAL_UNDEF(&_12$$15);
- ZVAL_UNDEF(&_13$$15);
- ZVAL_UNDEF(&_14$$15);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
- } else {
+ zephir_fetch_params(1, 2, 0, &interpolator, &options_param);
ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- }
- ZEPHIR_INIT_VAR(&included);
- ZVAL_NULL(&included);
- ZEPHIR_INIT_VAR(&message);
- ZVAL_NULL(&message);
- zephir_is_iterable(&options, 1, "phalcon/Validation/Validator/StringLength.zep", 167);
- if (Z_TYPE_P(&options) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&options), _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_INIT_NVAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "min");
- ZEPHIR_CALL_FUNCTION(&_5$$3, "strcasecmp", &_6, 47, &key, &_4$$3);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "max");
- ZEPHIR_CALL_FUNCTION(&_7$$3, "strcasecmp", &_6, 47, &key, &_4$$3);
- zephir_check_call_status();
- if (ZEPHIR_IS_LONG_IDENTICAL(&_5$$3, 0)) {
- if (zephir_array_isset_string(&options, SL("message"))) {
- ZEPHIR_OBS_NVAR(&message);
- zephir_array_fetch_string(&message, &options, SL("message"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 107);
- } else if (zephir_array_isset_string(&options, SL("messageMinimum"))) {
- ZEPHIR_OBS_NVAR(&message);
- zephir_array_fetch_string(&message, &options, SL("messageMinimum"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 109);
- }
- if (zephir_array_isset_string(&options, SL("included"))) {
- ZEPHIR_OBS_NVAR(&included);
- zephir_array_fetch_string(&included, &options, SL("included"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 114);
- } else if (zephir_array_isset_string(&options, SL("includedMinimum"))) {
- ZEPHIR_OBS_NVAR(&included);
- zephir_array_fetch_string(&included, &options, SL("includedMinimum"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 116);
- }
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_stringlength_min_ce);
- ZEPHIR_INIT_NVAR(&_8$$4);
- zephir_create_array(&_8$$4, 3, 0);
- zephir_array_update_string(&_8$$4, SL("min"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_8$$4, SL("message"), &message, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_8$$4, SL("included"), &included, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_9, 0, &_8$$4);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("min"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("message"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageMinimum"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("included"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("includedMinimum"), PH_SEPARATE);
- } else if (ZEPHIR_IS_LONG_IDENTICAL(&_7$$3, 0)) {
- if (zephir_array_isset_string(&options, SL("message"))) {
- ZEPHIR_OBS_NVAR(&message);
- zephir_array_fetch_string(&message, &options, SL("message"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 135);
- } else if (zephir_array_isset_string(&options, SL("messageMaximum"))) {
- ZEPHIR_OBS_NVAR(&message);
- zephir_array_fetch_string(&message, &options, SL("messageMaximum"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 137);
- }
- if (zephir_array_isset_string(&options, SL("included"))) {
- ZEPHIR_OBS_NVAR(&included);
- zephir_array_fetch_string(&included, &options, SL("included"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 142);
- } else if (zephir_array_isset_string(&options, SL("includedMaximum"))) {
- ZEPHIR_OBS_NVAR(&included);
- zephir_array_fetch_string(&included, &options, SL("includedMaximum"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 144);
- }
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_stringlength_max_ce);
- ZEPHIR_INIT_NVAR(&_10$$9);
- zephir_create_array(&_10$$9, 3, 0);
- zephir_array_update_string(&_10$$9, SL("max"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_10$$9, SL("message"), &message, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_10$$9, SL("included"), &included, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 0, &_10$$9);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("max"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("message"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageMaximum"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("included"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("includedMaximum"), PH_SEPARATE);
- } else {
- continue;
- }
- zephir_update_property_array_append(this_ptr, SL("validators"), &validator);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &options, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1, &options, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&key, &options, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &options, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_12$$15);
- ZVAL_STRING(&_12$$15, "min");
- ZEPHIR_CALL_FUNCTION(&_13$$15, "strcasecmp", &_6, 47, &key, &_12$$15);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_12$$15);
- ZVAL_STRING(&_12$$15, "max");
- ZEPHIR_CALL_FUNCTION(&_14$$15, "strcasecmp", &_6, 47, &key, &_12$$15);
- zephir_check_call_status();
- if (ZEPHIR_IS_LONG_IDENTICAL(&_13$$15, 0)) {
- if (zephir_array_isset_string(&options, SL("message"))) {
- ZEPHIR_OBS_NVAR(&message);
- zephir_array_fetch_string(&message, &options, SL("message"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 107);
- } else if (zephir_array_isset_string(&options, SL("messageMinimum"))) {
- ZEPHIR_OBS_NVAR(&message);
- zephir_array_fetch_string(&message, &options, SL("messageMinimum"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 109);
- }
- if (zephir_array_isset_string(&options, SL("included"))) {
- ZEPHIR_OBS_NVAR(&included);
- zephir_array_fetch_string(&included, &options, SL("included"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 114);
- } else if (zephir_array_isset_string(&options, SL("includedMinimum"))) {
- ZEPHIR_OBS_NVAR(&included);
- zephir_array_fetch_string(&included, &options, SL("includedMinimum"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 116);
- }
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_stringlength_min_ce);
- ZEPHIR_INIT_NVAR(&_15$$16);
- zephir_create_array(&_15$$16, 3, 0);
- zephir_array_update_string(&_15$$16, SL("min"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_15$$16, SL("message"), &message, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_15$$16, SL("included"), &included, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 0, &_15$$16);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("min"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("message"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageMinimum"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("included"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("includedMinimum"), PH_SEPARATE);
- } else if (ZEPHIR_IS_LONG_IDENTICAL(&_14$$15, 0)) {
- if (zephir_array_isset_string(&options, SL("message"))) {
- ZEPHIR_OBS_NVAR(&message);
- zephir_array_fetch_string(&message, &options, SL("message"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 135);
- } else if (zephir_array_isset_string(&options, SL("messageMaximum"))) {
- ZEPHIR_OBS_NVAR(&message);
- zephir_array_fetch_string(&message, &options, SL("messageMaximum"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 137);
- }
- if (zephir_array_isset_string(&options, SL("included"))) {
- ZEPHIR_OBS_NVAR(&included);
- zephir_array_fetch_string(&included, &options, SL("included"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 142);
- } else if (zephir_array_isset_string(&options, SL("includedMaximum"))) {
- ZEPHIR_OBS_NVAR(&included);
- zephir_array_fetch_string(&included, &options, SL("includedMaximum"), PH_NOISY, "phalcon/Validation/Validator/StringLength.zep", 144);
- }
- ZEPHIR_INIT_NVAR(&validator);
- object_init_ex(&validator, phalcon_validation_validator_stringlength_max_ce);
- ZEPHIR_INIT_NVAR(&_16$$21);
- zephir_create_array(&_16$$21, 3, 0);
- zephir_array_update_string(&_16$$21, SL("max"), &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_16$$21, SL("message"), &message, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_16$$21, SL("included"), &included, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 0, &_16$$21);
- zephir_check_call_status();
- zephir_array_unset_string(&options, SL("max"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("message"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("messageMaximum"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("included"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("includedMaximum"), PH_SEPARATE);
- } else {
- continue;
- }
- zephir_update_property_array_append(this_ptr, SL("validators"), &validator);
- ZEPHIR_CALL_METHOD(NULL, &options, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_stringlength_ce, getThis(), "__construct", &_17, 0, &options);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "defaultInterpolator");
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "associativeArray");
+ ZEPHIR_CALL_CE_STATIC(&_0, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_3);
zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("defaultInterpolator"), &_0);
+ 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();
-
-
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&translateKey);
+ ZVAL_UNDEF(&placeholders);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(translateKey)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(placeholders)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ 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_INIT_CLASS(Phalcon_Validation_Validator_Uniqueness)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Uniqueness, phalcon, validation_validator_uniqueness, phalcon_validation_abstractcombinedfieldsvalidator_ce, phalcon_validation_validator_uniqueness_method_entry, 0);
-
- zend_declare_property_string(phalcon_validation_validator_uniqueness_ce, SL("template"), "Field :field must be unique", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_validation_validator_uniqueness_ce, SL("columnMap"), ZEND_ACC_PRIVATE);
- return SUCCESS;
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "query", NULL, 0, &translateKey, &placeholders);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Validation_Validator_Uniqueness, __construct)
+static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, offsetExists)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *translateKey, translateKey_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&translateKey_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(translateKey)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &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, &translateKey);
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_uniqueness_ce, getThis(), "__construct", &_0, 0, &options);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "exists", NULL, 0, translateKey);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Validation_Validator_Uniqueness, validate)
+static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, offsetGet)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, _0, _1$$3;
+ zval *translateKey, translateKey_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&translateKey_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(translateKey)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ zephir_fetch_params(1, 1, 0, &translateKey);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "isuniqueness", NULL, 0, validation, field);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "query", NULL, 0, translateKey);
zephir_check_call_status();
- if (!(zephir_is_true(&_0))) {
- ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "messagefactory", NULL, 0, validation, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_1$$3);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Validation_Validator_Uniqueness, getColumnNameReal)
+static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, offsetSet)
+{
+ zval *offset, offset_sub, *value, value_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&offset_sub);
+ ZVAL_UNDEF(&value_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ZVAL(offset)
+ Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ 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", 73);
+ return;
+}
+
+static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, offsetUnset)
+{
+ zval *offset, offset_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&offset_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(offset)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ 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", 81);
+ return;
+}
+
+static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, t)
{
- zend_bool _0, _7;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval field;
- zval *record, record_sub, *field_param = NULL, _1, _6, _8, _2$$3, _3$$3, _4$$3, _5$$3, _9$$4, _10$$4;
+ zval placeholders;
+ zval *translateKey_param = NULL, *placeholders_param = NULL;
+ zval translateKey;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&record_sub);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_9$$4);
- ZVAL_UNDEF(&_10$$4);
- ZVAL_UNDEF(&field);
+ ZVAL_UNDEF(&translateKey);
+ ZVAL_UNDEF(&placeholders);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(record)
- Z_PARAM_STR(field)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(translateKey)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(placeholders)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &record, &field_param);
- if (UNEXPECTED(Z_TYPE_P(field_param) != IS_STRING && Z_TYPE_P(field_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'field' must be of the type string"));
+ 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(field_param) == IS_STRING)) {
- zephir_get_strval(&field, field_param);
+ if (EXPECTED(Z_TYPE_P(translateKey_param) == IS_STRING)) {
+ zephir_get_strval(&translateKey, translateKey_param);
} else {
- ZEPHIR_INIT_VAR(&field);
+ ZEPHIR_INIT_VAR(&translateKey);
+ }
+ if (!placeholders_param) {
+ ZEPHIR_INIT_VAR(&placeholders);
+ array_init(&placeholders);
+ } else {
+ zephir_get_arrval(&placeholders, placeholders_param);
}
- _0 = ZEPHIR_GLOBAL(orm).column_renaming;
- if (_0) {
- zephir_read_property(&_1, this_ptr, ZEND_STRL("columnMap"), PH_NOISY_CC | PH_READONLY);
- _0 = !zephir_is_true(&_1);
- }
- if (_0) {
- ZEPHIR_CALL_METHOD(&_2$$3, record, "getdi", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "modelsMetadata");
- ZEPHIR_CALL_METHOD(&_3$$3, &_2$$3, "getshared", NULL, 0, &_4$$3);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_5$$3, &_3$$3, "getcolumnmap", NULL, 0, record);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("columnMap"), &_5$$3);
- }
- ZEPHIR_OBS_VAR(&_6);
- zephir_read_property(&_6, this_ptr, ZEND_STRL("columnMap"), PH_NOISY_CC);
- _7 = Z_TYPE_P(&_6) == IS_ARRAY;
- if (_7) {
- zephir_read_property(&_8, this_ptr, ZEND_STRL("columnMap"), PH_NOISY_CC | PH_READONLY);
- _7 = zephir_array_isset(&_8, &field);
- }
- if (_7) {
- zephir_read_property(&_9$$4, this_ptr, ZEND_STRL("columnMap"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_10$$4, &_9$$4, &field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Uniqueness.zep", 147);
- RETURN_CTOR(&_10$$4);
- }
- RETURN_CTOR(&field);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "query", NULL, 0, &translateKey, &placeholders);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Validation_Validator_Uniqueness, isUniqueness)
+static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, replacePlaceholders)
{
- zend_class_entry *_9;
- zend_bool isModel = 0, _7;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_4 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field = NULL, field_sub, values, convert, record, params, className, singleField, _0, *_1, _2, _8, _3$$4, _5$$5, _6$$6;
+ zval placeholders;
+ zval *translation_param = NULL, *placeholders_param = NULL, interpolator, _0, _1;
+ zval translation;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&values);
- ZVAL_UNDEF(&convert);
- ZVAL_UNDEF(&record);
- ZVAL_UNDEF(¶ms);
- ZVAL_UNDEF(&className);
- ZVAL_UNDEF(&singleField);
+ ZVAL_UNDEF(&translation);
+ ZVAL_UNDEF(&interpolator);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_6$$6);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&placeholders);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(translation)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(placeholders)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
- ZEPHIR_SEPARATE_PARAM(field);
-
-
- if (Z_TYPE_P(field) != IS_ARRAY) {
- ZEPHIR_CPY_WRT(&singleField, field);
- ZEPHIR_INIT_NVAR(field);
- array_init(field);
- zephir_array_append(field, &singleField, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 165);
+ 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();
}
- ZEPHIR_INIT_VAR(&values);
- array_init(&values);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "convert");
- ZEPHIR_CALL_METHOD(&convert, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- zephir_is_iterable(field, 0, "phalcon/Validation/Validator/Uniqueness.zep", 175);
- if (Z_TYPE_P(field) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(field), _1)
- {
- ZEPHIR_INIT_NVAR(&singleField);
- ZVAL_COPY(&singleField, _1);
- ZEPHIR_CALL_METHOD(&_3$$4, validation, "getvalue", &_4, 0, &singleField);
- zephir_check_call_status();
- zephir_array_update_zval(&values, &singleField, &_3$$4, PH_COPY | PH_SEPARATE);
- } ZEND_HASH_FOREACH_END();
+ if (EXPECTED(Z_TYPE_P(translation_param) == IS_STRING)) {
+ zephir_get_strval(&translation, translation_param);
} else {
- ZEPHIR_CALL_METHOD(NULL, field, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2, field, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_2)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleField, field, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_5$$5, validation, "getvalue", &_4, 0, &singleField);
- zephir_check_call_status();
- zephir_array_update_zval(&values, &singleField, &_5$$5, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, field, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&singleField);
- if (Z_TYPE_P(&convert) != IS_NULL) {
- ZEPHIR_CALL_ZVAL_FUNCTION(&_6$$6, &convert, NULL, 0, &values);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&values, &_6$$6);
- if (UNEXPECTED(!(Z_TYPE_P(&values) == IS_ARRAY))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Value conversion must return an array", "phalcon/Validation/Validator/Uniqueness.zep", 179);
- return;
- }
- }
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "model");
- ZEPHIR_CALL_METHOD(&record, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- _7 = ZEPHIR_IS_EMPTY(&record);
- if (!(_7)) {
- _7 = Z_TYPE_P(&record) != IS_OBJECT;
- }
- if (_7) {
- ZEPHIR_CALL_METHOD(&record, validation, "getentity", NULL, 0);
- zephir_check_call_status();
- if (UNEXPECTED(ZEPHIR_IS_EMPTY(&record))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Model of record must be set to property \"model\"", "phalcon/Validation/Validator/Uniqueness.zep", 192);
- return;
- }
+ ZEPHIR_INIT_VAR(&translation);
}
- isModel = zephir_instance_of_ev(&record, phalcon_mvc_modelinterface_ce);
- if (isModel) {
- ZEPHIR_CALL_METHOD(¶ms, this_ptr, "isuniquenessmodel", NULL, 0, &record, field, &values);
- zephir_check_call_status();
+ if (!placeholders_param) {
+ ZEPHIR_INIT_VAR(&placeholders);
+ array_init(&placeholders);
} else {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "The uniqueness validator works only with Phalcon\\Mvc\\Model", "phalcon/Validation/Validator/Uniqueness.zep", 212);
- return;
+ zephir_get_arrval(&placeholders, placeholders_param);
}
- ZEPHIR_INIT_VAR(&className);
- zephir_get_class(&className, &record, 0);
- _9 = zephir_fetch_class(&className);
- ZEPHIR_CALL_CE_STATIC(&_8, _9, "count", NULL, 0, ¶ms);
+
+
+ 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();
- RETURN_MM_BOOL(ZEPHIR_IS_LONG(&_8, 0));
+ ZEPHIR_RETURN_CALL_METHOD(&interpolator, "replaceplaceholders", NULL, 0, &translation, &placeholders);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Validation_Validator_Uniqueness, isUniquenessModel)
+
+
+
+#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_DOC_METHOD(Phalcon_Translate_Adapter_AdapterInterface, exists);
+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)
+{
+ 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_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;
+
+ zend_class_implements(phalcon_translate_adapter_csv_ce, 1, zend_ce_arrayaccess);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Translate_Adapter_Csv, __construct)
{
- zval _24$$10, _26$$11, _36$$15, _38$$16, _49$$20, _51$$21, _63$$26, _65$$27, _75$$31, _77$$32, _101$$41, _103$$42, _113$$46, _115$$47, _126$$51, _128$$52, _140$$57, _142$$58, _152$$62, _154$$63;
- zend_string *_18$$7, *_95$$38;
- zend_ulong _17$$7, _94$$38;
- zend_bool _9$$6, _87$$37;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_5 = NULL, *_14 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS, index = 0;
- zval field, values;
- zval *record, record_sub, *field_param = NULL, *values_param = NULL, params, attribute, metaData, primaryField, singleField, fieldExcept, singleExcept, notInValues, exceptConditions, value, except, _0, *_1, _2, _159, _177, _3$$3, _4$$3, _6$$4, _7$$4, _8$$5, _10$$6, _11$$6, _12$$6, _13$$6, *_15$$7, _16$$7, _19$$8, _20$$8, *_21$$9, _22$$9, _27$$9, _28$$9, _23$$10, _25$$11, _29$$12, _30$$12, _31$$13, _32$$13, *_33$$14, _34$$14, _39$$14, _40$$14, _35$$15, _37$$16, _41$$17, _42$$17, _43$$18, _44$$18, _45$$18, *_46$$19, _47$$19, _52$$19, _53$$19, _48$$20, _50$$21, _54$$22, _55$$22, *_56$$23, _57$$23, _58$$24, _59$$24, *_60$$25, _61$$25, _66$$25, _67$$25, _62$$26, _64$$27, _68$$28, _69$$28, _70$$29, _71$$29, *_72$$30, _73$$30, _78$$30, _79$$30, _74$$31, _76$$32, _80$$33, _81$$33, _82$$34, _83$$34, _84$$35, _85$$35, _86$$36, _88$$37, _89$$37, _90$$37, _91$$37, *_92$$38, _93$$38, _96$$39, _97$$39, *_98$$40, _99$$40, _104$$40, _105$$40, _100$$41, _102$$42, _106$$43, _107$$43, _108$$44, _109$$44, *_110$$45, _111$$45, _116$$45, _117$$45, _112$$46, _114$$47, _118$$48, _119$$48, _120$$49, _121$$49, _122$$49, *_123$$50, _124$$50, _129$$50, _130$$50, _125$$51, _127$$52, _131$$53, _132$$53, *_133$$54, _134$$54, _135$$55, _136$$55, *_137$$56, _138$$56, _143$$56, _144$$56, _139$$57, _141$$58, _145$$59, _146$$59, _147$$60, _148$$60, *_149$$61, _150$$61, _155$$61, _156$$61, _151$$62, _153$$63, _157$$64, _158$$64, _160$$65, _161$$65, _162$$65, *_163$$65, _164$$65, _165$$66, _166$$66, _167$$66, _168$$66, _169$$66, _170$$67, _171$$67, _172$$67, _173$$67, _174$$67, _175$$68, _176$$68;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_0 = NULL;
+ zval options;
+ zval *interpolator, interpolator_sub, *options_param = NULL, delimiter, enclosure, _1, _2;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&record_sub);
- ZVAL_UNDEF(¶ms);
- ZVAL_UNDEF(&attribute);
- ZVAL_UNDEF(&metaData);
- ZVAL_UNDEF(&primaryField);
- ZVAL_UNDEF(&singleField);
- ZVAL_UNDEF(&fieldExcept);
- ZVAL_UNDEF(&singleExcept);
- ZVAL_UNDEF(¬InValues);
- ZVAL_UNDEF(&exceptConditions);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&except);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&interpolator_sub);
+ ZVAL_UNDEF(&delimiter);
+ ZVAL_UNDEF(&enclosure);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_159);
- ZVAL_UNDEF(&_177);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_6$$4);
- ZVAL_UNDEF(&_7$$4);
- ZVAL_UNDEF(&_8$$5);
- ZVAL_UNDEF(&_10$$6);
- ZVAL_UNDEF(&_11$$6);
- ZVAL_UNDEF(&_12$$6);
- ZVAL_UNDEF(&_13$$6);
- ZVAL_UNDEF(&_16$$7);
- ZVAL_UNDEF(&_19$$8);
- ZVAL_UNDEF(&_20$$8);
- ZVAL_UNDEF(&_22$$9);
- ZVAL_UNDEF(&_27$$9);
- ZVAL_UNDEF(&_28$$9);
- ZVAL_UNDEF(&_23$$10);
- ZVAL_UNDEF(&_25$$11);
- ZVAL_UNDEF(&_29$$12);
- ZVAL_UNDEF(&_30$$12);
- ZVAL_UNDEF(&_31$$13);
- ZVAL_UNDEF(&_32$$13);
- ZVAL_UNDEF(&_34$$14);
- ZVAL_UNDEF(&_39$$14);
- ZVAL_UNDEF(&_40$$14);
- ZVAL_UNDEF(&_35$$15);
- ZVAL_UNDEF(&_37$$16);
- ZVAL_UNDEF(&_41$$17);
- ZVAL_UNDEF(&_42$$17);
- ZVAL_UNDEF(&_43$$18);
- ZVAL_UNDEF(&_44$$18);
- ZVAL_UNDEF(&_45$$18);
- ZVAL_UNDEF(&_47$$19);
- ZVAL_UNDEF(&_52$$19);
- ZVAL_UNDEF(&_53$$19);
- ZVAL_UNDEF(&_48$$20);
- ZVAL_UNDEF(&_50$$21);
- ZVAL_UNDEF(&_54$$22);
- ZVAL_UNDEF(&_55$$22);
- ZVAL_UNDEF(&_57$$23);
- ZVAL_UNDEF(&_58$$24);
- ZVAL_UNDEF(&_59$$24);
- ZVAL_UNDEF(&_61$$25);
- ZVAL_UNDEF(&_66$$25);
- ZVAL_UNDEF(&_67$$25);
- ZVAL_UNDEF(&_62$$26);
- ZVAL_UNDEF(&_64$$27);
- ZVAL_UNDEF(&_68$$28);
- ZVAL_UNDEF(&_69$$28);
- ZVAL_UNDEF(&_70$$29);
- ZVAL_UNDEF(&_71$$29);
- ZVAL_UNDEF(&_73$$30);
- ZVAL_UNDEF(&_78$$30);
- ZVAL_UNDEF(&_79$$30);
- ZVAL_UNDEF(&_74$$31);
- ZVAL_UNDEF(&_76$$32);
- ZVAL_UNDEF(&_80$$33);
- ZVAL_UNDEF(&_81$$33);
- ZVAL_UNDEF(&_82$$34);
- ZVAL_UNDEF(&_83$$34);
- ZVAL_UNDEF(&_84$$35);
- ZVAL_UNDEF(&_85$$35);
- ZVAL_UNDEF(&_86$$36);
- ZVAL_UNDEF(&_88$$37);
- ZVAL_UNDEF(&_89$$37);
- ZVAL_UNDEF(&_90$$37);
- ZVAL_UNDEF(&_91$$37);
- ZVAL_UNDEF(&_93$$38);
- ZVAL_UNDEF(&_96$$39);
- ZVAL_UNDEF(&_97$$39);
- ZVAL_UNDEF(&_99$$40);
- ZVAL_UNDEF(&_104$$40);
- ZVAL_UNDEF(&_105$$40);
- ZVAL_UNDEF(&_100$$41);
- ZVAL_UNDEF(&_102$$42);
- ZVAL_UNDEF(&_106$$43);
- ZVAL_UNDEF(&_107$$43);
- ZVAL_UNDEF(&_108$$44);
- ZVAL_UNDEF(&_109$$44);
- ZVAL_UNDEF(&_111$$45);
- ZVAL_UNDEF(&_116$$45);
- ZVAL_UNDEF(&_117$$45);
- ZVAL_UNDEF(&_112$$46);
- ZVAL_UNDEF(&_114$$47);
- ZVAL_UNDEF(&_118$$48);
- ZVAL_UNDEF(&_119$$48);
- ZVAL_UNDEF(&_120$$49);
- ZVAL_UNDEF(&_121$$49);
- ZVAL_UNDEF(&_122$$49);
- ZVAL_UNDEF(&_124$$50);
- ZVAL_UNDEF(&_129$$50);
- ZVAL_UNDEF(&_130$$50);
- ZVAL_UNDEF(&_125$$51);
- ZVAL_UNDEF(&_127$$52);
- ZVAL_UNDEF(&_131$$53);
- ZVAL_UNDEF(&_132$$53);
- ZVAL_UNDEF(&_134$$54);
- ZVAL_UNDEF(&_135$$55);
- ZVAL_UNDEF(&_136$$55);
- ZVAL_UNDEF(&_138$$56);
- ZVAL_UNDEF(&_143$$56);
- ZVAL_UNDEF(&_144$$56);
- ZVAL_UNDEF(&_139$$57);
- ZVAL_UNDEF(&_141$$58);
- ZVAL_UNDEF(&_145$$59);
- ZVAL_UNDEF(&_146$$59);
- ZVAL_UNDEF(&_147$$60);
- ZVAL_UNDEF(&_148$$60);
- ZVAL_UNDEF(&_150$$61);
- ZVAL_UNDEF(&_155$$61);
- ZVAL_UNDEF(&_156$$61);
- ZVAL_UNDEF(&_151$$62);
- ZVAL_UNDEF(&_153$$63);
- ZVAL_UNDEF(&_157$$64);
- ZVAL_UNDEF(&_158$$64);
- ZVAL_UNDEF(&_160$$65);
- ZVAL_UNDEF(&_161$$65);
- ZVAL_UNDEF(&_162$$65);
- ZVAL_UNDEF(&_164$$65);
- ZVAL_UNDEF(&_165$$66);
- ZVAL_UNDEF(&_166$$66);
- ZVAL_UNDEF(&_167$$66);
- ZVAL_UNDEF(&_168$$66);
- ZVAL_UNDEF(&_169$$66);
- ZVAL_UNDEF(&_170$$67);
- ZVAL_UNDEF(&_171$$67);
- ZVAL_UNDEF(&_172$$67);
- ZVAL_UNDEF(&_173$$67);
- ZVAL_UNDEF(&_174$$67);
- ZVAL_UNDEF(&_175$$68);
- ZVAL_UNDEF(&_176$$68);
- ZVAL_UNDEF(&field);
- ZVAL_UNDEF(&values);
- ZVAL_UNDEF(&_24$$10);
- ZVAL_UNDEF(&_26$$11);
- ZVAL_UNDEF(&_36$$15);
- ZVAL_UNDEF(&_38$$16);
- ZVAL_UNDEF(&_49$$20);
- ZVAL_UNDEF(&_51$$21);
- ZVAL_UNDEF(&_63$$26);
- ZVAL_UNDEF(&_65$$27);
- ZVAL_UNDEF(&_75$$31);
- ZVAL_UNDEF(&_77$$32);
- ZVAL_UNDEF(&_101$$41);
- ZVAL_UNDEF(&_103$$42);
- ZVAL_UNDEF(&_113$$46);
- ZVAL_UNDEF(&_115$$47);
- ZVAL_UNDEF(&_126$$51);
- ZVAL_UNDEF(&_128$$52);
- ZVAL_UNDEF(&_140$$57);
- ZVAL_UNDEF(&_142$$58);
- ZVAL_UNDEF(&_152$$62);
- ZVAL_UNDEF(&_154$$63);
+ ZVAL_UNDEF(&options);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(3, 3)
- Z_PARAM_ZVAL(record)
- Z_PARAM_ARRAY(field)
- Z_PARAM_ARRAY(values)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
+ Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 3, 0, &record, &field_param, &values_param);
- zephir_get_arrval(&field, field_param);
- zephir_get_arrval(&values, values_param);
+ zephir_fetch_params(1, 2, 0, &interpolator, &options_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- ZEPHIR_INIT_VAR(&exceptConditions);
- array_init(&exceptConditions);
- index = 0;
- ZEPHIR_INIT_VAR(¶ms);
- zephir_create_array(¶ms, 2, 0);
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- zephir_array_update_string(¶ms, SL("conditions"), &_0, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_0);
- array_init(&_0);
- zephir_array_update_string(¶ms, SL("bind"), &_0, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "except");
- ZEPHIR_CALL_METHOD(&except, this_ptr, "getoption", NULL, 0, &_0);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_translate_adapter_csv_ce, getThis(), "__construct", &_0, 0, interpolator, &options);
zephir_check_call_status();
- zephir_is_iterable(&field, 0, "phalcon/Validation/Validator/Uniqueness.zep", 405);
- if (Z_TYPE_P(&field) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&field), _1)
- {
- ZEPHIR_INIT_NVAR(&singleField);
- ZVAL_COPY(&singleField, _1);
- ZEPHIR_INIT_NVAR(&fieldExcept);
- ZVAL_NULL(&fieldExcept);
- ZEPHIR_INIT_NVAR(¬InValues);
- array_init(¬InValues);
- ZEPHIR_OBS_NVAR(&value);
- zephir_array_fetch(&value, &values, &singleField, PH_NOISY, "phalcon/Validation/Validator/Uniqueness.zep", 322);
- ZEPHIR_INIT_NVAR(&_3$$3);
- ZVAL_STRING(&_3$$3, "attribute");
- ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getoption", NULL, 0, &_3$$3, &singleField);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "getcolumnnamereal", &_5, 0, record, &attribute);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&attribute, &_4$$3);
- if (Z_TYPE_P(&value) != IS_NULL) {
- ZEPHIR_INIT_NVAR(&_6$$4);
- ZVAL_LONG(&_6$$4, index);
- ZEPHIR_INIT_NVAR(&_7$$4);
- ZEPHIR_CONCAT_VSV(&_7$$4, &attribute, " = ?", &_6$$4);
- zephir_array_update_multi(¶ms, &_7$$4, SL("sa"), 3, SL("conditions"));
- zephir_array_update_multi(¶ms, &value, SL("sa"), 3, SL("bind"));
- index++;
- } else {
- ZEPHIR_INIT_NVAR(&_8$$5);
- ZEPHIR_CONCAT_VS(&_8$$5, &attribute, " IS NULL");
- zephir_array_update_multi(¶ms, &_8$$5, SL("sa"), 3, SL("conditions"));
- }
- if (zephir_is_true(&except)) {
- _9$$6 = Z_TYPE_P(&except) == IS_ARRAY;
- if (_9$$6) {
- ZEPHIR_INIT_NVAR(&_10$$6);
- zephir_array_keys(&_10$$6, &except);
- ZVAL_LONG(&_11$$6, 0);
- ZVAL_LONG(&_12$$6, (zephir_fast_count_int(&except) - 1));
- ZEPHIR_CALL_FUNCTION(&_13$$6, "range", &_14, 276, &_11$$6, &_12$$6);
- zephir_check_call_status();
- _9$$6 = !ZEPHIR_IS_IDENTICAL(&_10$$6, &_13$$6);
- }
- if (_9$$6) {
- zephir_is_iterable(&except, 0, "phalcon/Validation/Validator/Uniqueness.zep", 358);
- if (Z_TYPE_P(&except) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&except), _17$$7, _18$$7, _15$$7)
- {
- ZEPHIR_INIT_NVAR(&singleField);
- if (_18$$7 != NULL) {
- ZVAL_STR_COPY(&singleField, _18$$7);
- } else {
- ZVAL_LONG(&singleField, _17$$7);
- }
- ZEPHIR_INIT_NVAR(&fieldExcept);
- ZVAL_COPY(&fieldExcept, _15$$7);
- ZEPHIR_INIT_NVAR(¬InValues);
- array_init(¬InValues);
- ZEPHIR_INIT_NVAR(&_20$$8);
- ZVAL_STRING(&_20$$8, "attribute");
- ZEPHIR_CALL_METHOD(&_19$$8, this_ptr, "getoption", NULL, 0, &_20$$8, &singleField);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_5, 0, record, &_19$$8);
- zephir_check_call_status();
- if (Z_TYPE_P(&fieldExcept) == IS_ARRAY) {
- zephir_is_iterable(&fieldExcept, 0, "phalcon/Validation/Validator/Uniqueness.zep", 351);
- if (Z_TYPE_P(&fieldExcept) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&fieldExcept), _21$$9)
- {
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZVAL_COPY(&singleExcept, _21$$9);
- ZEPHIR_INIT_NVAR(&_23$$10);
- ZVAL_LONG(&_23$$10, index);
- ZEPHIR_INIT_NVAR(&_24$$10);
- ZEPHIR_CONCAT_SV(&_24$$10, "?", &_23$$10);
- zephir_array_append(¬InValues, &_24$$10, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 346);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &fieldExcept, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_22$$9, &fieldExcept, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_22$$9)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleExcept, &fieldExcept, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_25$$11);
- ZVAL_LONG(&_25$$11, index);
- ZEPHIR_INIT_NVAR(&_26$$11);
- ZEPHIR_CONCAT_SV(&_26$$11, "?", &_25$$11);
- zephir_array_append(¬InValues, &_26$$11, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 346);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- ZEPHIR_CALL_METHOD(NULL, &fieldExcept, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZEPHIR_INIT_NVAR(&_27$$9);
- zephir_fast_join_str(&_27$$9, SL(","), ¬InValues);
- ZEPHIR_INIT_NVAR(&_28$$9);
- ZEPHIR_CONCAT_VSVS(&_28$$9, &attribute, " NOT IN (", &_27$$9, ")");
- zephir_array_append(&exceptConditions, &_28$$9, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 351);
- } else {
- ZEPHIR_INIT_NVAR(&_29$$12);
- ZVAL_LONG(&_29$$12, index);
- ZEPHIR_INIT_NVAR(&_30$$12);
- ZEPHIR_CONCAT_VSV(&_30$$12, &attribute, " <> ?", &_29$$12);
- zephir_array_append(&exceptConditions, &_30$$12, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 353);
- zephir_array_update_multi(¶ms, &fieldExcept, SL("sa"), 3, SL("bind"));
- index++;
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &except, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_16$$7, &except, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_16$$7)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleField, &except, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&fieldExcept, &except, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(¬InValues);
- array_init(¬InValues);
- ZEPHIR_INIT_NVAR(&_32$$13);
- ZVAL_STRING(&_32$$13, "attribute");
- ZEPHIR_CALL_METHOD(&_31$$13, this_ptr, "getoption", NULL, 0, &_32$$13, &singleField);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_5, 0, record, &_31$$13);
- zephir_check_call_status();
- if (Z_TYPE_P(&fieldExcept) == IS_ARRAY) {
- zephir_is_iterable(&fieldExcept, 0, "phalcon/Validation/Validator/Uniqueness.zep", 351);
- if (Z_TYPE_P(&fieldExcept) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&fieldExcept), _33$$14)
- {
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZVAL_COPY(&singleExcept, _33$$14);
- ZEPHIR_INIT_NVAR(&_35$$15);
- ZVAL_LONG(&_35$$15, index);
- ZEPHIR_INIT_NVAR(&_36$$15);
- ZEPHIR_CONCAT_SV(&_36$$15, "?", &_35$$15);
- zephir_array_append(¬InValues, &_36$$15, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 346);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &fieldExcept, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_34$$14, &fieldExcept, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_34$$14)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleExcept, &fieldExcept, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_37$$16);
- ZVAL_LONG(&_37$$16, index);
- ZEPHIR_INIT_NVAR(&_38$$16);
- ZEPHIR_CONCAT_SV(&_38$$16, "?", &_37$$16);
- zephir_array_append(¬InValues, &_38$$16, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 346);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- ZEPHIR_CALL_METHOD(NULL, &fieldExcept, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZEPHIR_INIT_NVAR(&_39$$14);
- zephir_fast_join_str(&_39$$14, SL(","), ¬InValues);
- ZEPHIR_INIT_NVAR(&_40$$14);
- ZEPHIR_CONCAT_VSVS(&_40$$14, &attribute, " NOT IN (", &_39$$14, ")");
- zephir_array_append(&exceptConditions, &_40$$14, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 351);
- } else {
- ZEPHIR_INIT_NVAR(&_41$$17);
- ZVAL_LONG(&_41$$17, index);
- ZEPHIR_INIT_NVAR(&_42$$17);
- ZEPHIR_CONCAT_VSV(&_42$$17, &attribute, " <> ?", &_41$$17);
- zephir_array_append(&exceptConditions, &_42$$17, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 353);
- zephir_array_update_multi(¶ms, &fieldExcept, SL("sa"), 3, SL("bind"));
- index++;
- }
- ZEPHIR_CALL_METHOD(NULL, &except, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&fieldExcept);
- ZEPHIR_INIT_NVAR(&singleField);
- } else if (zephir_fast_count_int(&field) == 1) {
- zephir_array_fetch_long(&_44$$18, &field, 0, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Uniqueness.zep", 361);
- ZEPHIR_INIT_NVAR(&_45$$18);
- ZVAL_STRING(&_45$$18, "attribute");
- ZEPHIR_CALL_METHOD(&_43$$18, this_ptr, "getoption", NULL, 0, &_45$$18, &_44$$18);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_5, 0, record, &_43$$18);
- zephir_check_call_status();
- if (Z_TYPE_P(&except) == IS_ARRAY) {
- zephir_is_iterable(&except, 0, "phalcon/Validation/Validator/Uniqueness.zep", 371);
- if (Z_TYPE_P(&except) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&except), _46$$19)
- {
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZVAL_COPY(&singleExcept, _46$$19);
- ZEPHIR_INIT_NVAR(&_48$$20);
- ZVAL_LONG(&_48$$20, index);
- ZEPHIR_INIT_NVAR(&_49$$20);
- ZEPHIR_CONCAT_SV(&_49$$20, "?", &_48$$20);
- zephir_array_append(¬InValues, &_49$$20, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 366);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &except, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_47$$19, &except, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_47$$19)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleExcept, &except, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_50$$21);
- ZVAL_LONG(&_50$$21, index);
- ZEPHIR_INIT_NVAR(&_51$$21);
- ZEPHIR_CONCAT_SV(&_51$$21, "?", &_50$$21);
- zephir_array_append(¬InValues, &_51$$21, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 366);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- ZEPHIR_CALL_METHOD(NULL, &except, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZEPHIR_INIT_NVAR(&_52$$19);
- zephir_fast_join_str(&_52$$19, SL(","), ¬InValues);
- ZEPHIR_INIT_NVAR(&_53$$19);
- ZEPHIR_CONCAT_VSVS(&_53$$19, &attribute, " NOT IN (", &_52$$19, ")");
- zephir_array_append(&exceptConditions, &_53$$19, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 371);
- } else {
- ZEPHIR_INIT_NVAR(&_54$$22);
- ZVAL_LONG(&_54$$22, index);
- ZEPHIR_INIT_NVAR(&_55$$22);
- ZEPHIR_CONCAT_VSV(&_55$$22, &attribute, " <> ?", &_54$$22);
- zephir_array_update_multi(¶ms, &_55$$22, SL("sa"), 3, SL("conditions"));
- zephir_array_update_multi(¶ms, &except, SL("sa"), 3, SL("bind"));
- index++;
- }
- } else if (zephir_fast_count_int(&field) > 1) {
- zephir_is_iterable(&field, 0, "phalcon/Validation/Validator/Uniqueness.zep", 398);
- if (Z_TYPE_P(&field) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&field), _56$$23)
- {
- ZEPHIR_INIT_NVAR(&singleField);
- ZVAL_COPY(&singleField, _56$$23);
- ZEPHIR_INIT_NVAR(&_59$$24);
- ZVAL_STRING(&_59$$24, "attribute");
- ZEPHIR_CALL_METHOD(&_58$$24, this_ptr, "getoption", NULL, 0, &_59$$24, &singleField);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_5, 0, record, &_58$$24);
- zephir_check_call_status();
- if (Z_TYPE_P(&except) == IS_ARRAY) {
- zephir_is_iterable(&except, 0, "phalcon/Validation/Validator/Uniqueness.zep", 391);
- if (Z_TYPE_P(&except) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&except), _60$$25)
- {
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZVAL_COPY(&singleExcept, _60$$25);
- ZEPHIR_INIT_NVAR(&_62$$26);
- ZVAL_LONG(&_62$$26, index);
- ZEPHIR_INIT_NVAR(&_63$$26);
- ZEPHIR_CONCAT_SV(&_63$$26, "?", &_62$$26);
- zephir_array_append(¬InValues, &_63$$26, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 386);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &except, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_61$$25, &except, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_61$$25)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleExcept, &except, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_64$$27);
- ZVAL_LONG(&_64$$27, index);
- ZEPHIR_INIT_NVAR(&_65$$27);
- ZEPHIR_CONCAT_SV(&_65$$27, "?", &_64$$27);
- zephir_array_append(¬InValues, &_65$$27, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 386);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- ZEPHIR_CALL_METHOD(NULL, &except, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZEPHIR_INIT_NVAR(&_66$$25);
- zephir_fast_join_str(&_66$$25, SL(","), ¬InValues);
- ZEPHIR_INIT_NVAR(&_67$$25);
- ZEPHIR_CONCAT_VSVS(&_67$$25, &attribute, " NOT IN (", &_66$$25, ")");
- zephir_array_append(&exceptConditions, &_67$$25, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 391);
- } else {
- ZEPHIR_INIT_NVAR(&_68$$28);
- ZVAL_LONG(&_68$$28, index);
- ZEPHIR_INIT_NVAR(&_69$$28);
- ZEPHIR_CONCAT_VSV(&_69$$28, &attribute, " <> ?", &_68$$28);
- zephir_array_update_multi(¶ms, &_69$$28, SL("sa"), 3, SL("conditions"));
- zephir_array_update_multi(¶ms, &except, SL("sa"), 3, SL("bind"));
- index++;
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &field, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_57$$23, &field, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_57$$23)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleField, &field, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_71$$29);
- ZVAL_STRING(&_71$$29, "attribute");
- ZEPHIR_CALL_METHOD(&_70$$29, this_ptr, "getoption", NULL, 0, &_71$$29, &singleField);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_5, 0, record, &_70$$29);
- zephir_check_call_status();
- if (Z_TYPE_P(&except) == IS_ARRAY) {
- zephir_is_iterable(&except, 0, "phalcon/Validation/Validator/Uniqueness.zep", 391);
- if (Z_TYPE_P(&except) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&except), _72$$30)
- {
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZVAL_COPY(&singleExcept, _72$$30);
- ZEPHIR_INIT_NVAR(&_74$$31);
- ZVAL_LONG(&_74$$31, index);
- ZEPHIR_INIT_NVAR(&_75$$31);
- ZEPHIR_CONCAT_SV(&_75$$31, "?", &_74$$31);
- zephir_array_append(¬InValues, &_75$$31, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 386);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &except, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_73$$30, &except, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_73$$30)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleExcept, &except, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_76$$32);
- ZVAL_LONG(&_76$$32, index);
- ZEPHIR_INIT_NVAR(&_77$$32);
- ZEPHIR_CONCAT_SV(&_77$$32, "?", &_76$$32);
- zephir_array_append(¬InValues, &_77$$32, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 386);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- ZEPHIR_CALL_METHOD(NULL, &except, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZEPHIR_INIT_NVAR(&_78$$30);
- zephir_fast_join_str(&_78$$30, SL(","), ¬InValues);
- ZEPHIR_INIT_NVAR(&_79$$30);
- ZEPHIR_CONCAT_VSVS(&_79$$30, &attribute, " NOT IN (", &_78$$30, ")");
- zephir_array_append(&exceptConditions, &_79$$30, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 391);
- } else {
- ZEPHIR_INIT_NVAR(&_80$$33);
- ZVAL_LONG(&_80$$33, index);
- ZEPHIR_INIT_NVAR(&_81$$33);
- ZEPHIR_CONCAT_VSV(&_81$$33, &attribute, " <> ?", &_80$$33);
- zephir_array_update_multi(¶ms, &_81$$33, SL("sa"), 3, SL("conditions"));
- zephir_array_update_multi(¶ms, &except, SL("sa"), 3, SL("bind"));
- index++;
- }
- ZEPHIR_CALL_METHOD(NULL, &field, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&singleField);
- }
- }
- } ZEND_HASH_FOREACH_END();
+ 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", 45);
+ return;
+ }
+ if (zephir_array_isset_string(&options, SL("delimiter"))) {
+ ZEPHIR_OBS_VAR(&delimiter);
+ zephir_array_fetch_string(&delimiter, &options, SL("delimiter"), PH_NOISY, "phalcon/Translate/Adapter/Csv.zep", 49);
} else {
- ZEPHIR_CALL_METHOD(NULL, &field, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2, &field, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_2)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleField, &field, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&fieldExcept);
- ZVAL_NULL(&fieldExcept);
- ZEPHIR_INIT_NVAR(¬InValues);
- array_init(¬InValues);
- ZEPHIR_OBS_NVAR(&value);
- zephir_array_fetch(&value, &values, &singleField, PH_NOISY, "phalcon/Validation/Validator/Uniqueness.zep", 322);
- ZEPHIR_INIT_NVAR(&_82$$34);
- ZVAL_STRING(&_82$$34, "attribute");
- ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getoption", NULL, 0, &_82$$34, &singleField);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_83$$34, this_ptr, "getcolumnnamereal", &_5, 0, record, &attribute);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&attribute, &_83$$34);
- if (Z_TYPE_P(&value) != IS_NULL) {
- ZEPHIR_INIT_NVAR(&_84$$35);
- ZVAL_LONG(&_84$$35, index);
- ZEPHIR_INIT_NVAR(&_85$$35);
- ZEPHIR_CONCAT_VSV(&_85$$35, &attribute, " = ?", &_84$$35);
- zephir_array_update_multi(¶ms, &_85$$35, SL("sa"), 3, SL("conditions"));
- zephir_array_update_multi(¶ms, &value, SL("sa"), 3, SL("bind"));
- index++;
- } else {
- ZEPHIR_INIT_NVAR(&_86$$36);
- ZEPHIR_CONCAT_VS(&_86$$36, &attribute, " IS NULL");
- zephir_array_update_multi(¶ms, &_86$$36, SL("sa"), 3, SL("conditions"));
- }
- if (zephir_is_true(&except)) {
- _87$$37 = Z_TYPE_P(&except) == IS_ARRAY;
- if (_87$$37) {
- ZEPHIR_INIT_NVAR(&_88$$37);
- zephir_array_keys(&_88$$37, &except);
- ZVAL_LONG(&_89$$37, 0);
- ZVAL_LONG(&_90$$37, (zephir_fast_count_int(&except) - 1));
- ZEPHIR_CALL_FUNCTION(&_91$$37, "range", &_14, 276, &_89$$37, &_90$$37);
- zephir_check_call_status();
- _87$$37 = !ZEPHIR_IS_IDENTICAL(&_88$$37, &_91$$37);
- }
- if (_87$$37) {
- zephir_is_iterable(&except, 0, "phalcon/Validation/Validator/Uniqueness.zep", 358);
- if (Z_TYPE_P(&except) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&except), _94$$38, _95$$38, _92$$38)
- {
- ZEPHIR_INIT_NVAR(&singleField);
- if (_95$$38 != NULL) {
- ZVAL_STR_COPY(&singleField, _95$$38);
- } else {
- ZVAL_LONG(&singleField, _94$$38);
- }
- ZEPHIR_INIT_NVAR(&fieldExcept);
- ZVAL_COPY(&fieldExcept, _92$$38);
- ZEPHIR_INIT_NVAR(¬InValues);
- array_init(¬InValues);
- ZEPHIR_INIT_NVAR(&_97$$39);
- ZVAL_STRING(&_97$$39, "attribute");
- ZEPHIR_CALL_METHOD(&_96$$39, this_ptr, "getoption", NULL, 0, &_97$$39, &singleField);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_5, 0, record, &_96$$39);
- zephir_check_call_status();
- if (Z_TYPE_P(&fieldExcept) == IS_ARRAY) {
- zephir_is_iterable(&fieldExcept, 0, "phalcon/Validation/Validator/Uniqueness.zep", 351);
- if (Z_TYPE_P(&fieldExcept) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&fieldExcept), _98$$40)
- {
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZVAL_COPY(&singleExcept, _98$$40);
- ZEPHIR_INIT_NVAR(&_100$$41);
- ZVAL_LONG(&_100$$41, index);
- ZEPHIR_INIT_NVAR(&_101$$41);
- ZEPHIR_CONCAT_SV(&_101$$41, "?", &_100$$41);
- zephir_array_append(¬InValues, &_101$$41, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 346);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &fieldExcept, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_99$$40, &fieldExcept, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_99$$40)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleExcept, &fieldExcept, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_102$$42);
- ZVAL_LONG(&_102$$42, index);
- ZEPHIR_INIT_NVAR(&_103$$42);
- ZEPHIR_CONCAT_SV(&_103$$42, "?", &_102$$42);
- zephir_array_append(¬InValues, &_103$$42, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 346);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- ZEPHIR_CALL_METHOD(NULL, &fieldExcept, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZEPHIR_INIT_NVAR(&_104$$40);
- zephir_fast_join_str(&_104$$40, SL(","), ¬InValues);
- ZEPHIR_INIT_NVAR(&_105$$40);
- ZEPHIR_CONCAT_VSVS(&_105$$40, &attribute, " NOT IN (", &_104$$40, ")");
- zephir_array_append(&exceptConditions, &_105$$40, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 351);
- } else {
- ZEPHIR_INIT_NVAR(&_106$$43);
- ZVAL_LONG(&_106$$43, index);
- ZEPHIR_INIT_NVAR(&_107$$43);
- ZEPHIR_CONCAT_VSV(&_107$$43, &attribute, " <> ?", &_106$$43);
- zephir_array_append(&exceptConditions, &_107$$43, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 353);
- zephir_array_update_multi(¶ms, &fieldExcept, SL("sa"), 3, SL("bind"));
- index++;
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &except, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_93$$38, &except, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_93$$38)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleField, &except, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&fieldExcept, &except, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(¬InValues);
- array_init(¬InValues);
- ZEPHIR_INIT_NVAR(&_109$$44);
- ZVAL_STRING(&_109$$44, "attribute");
- ZEPHIR_CALL_METHOD(&_108$$44, this_ptr, "getoption", NULL, 0, &_109$$44, &singleField);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_5, 0, record, &_108$$44);
- zephir_check_call_status();
- if (Z_TYPE_P(&fieldExcept) == IS_ARRAY) {
- zephir_is_iterable(&fieldExcept, 0, "phalcon/Validation/Validator/Uniqueness.zep", 351);
- if (Z_TYPE_P(&fieldExcept) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&fieldExcept), _110$$45)
- {
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZVAL_COPY(&singleExcept, _110$$45);
- ZEPHIR_INIT_NVAR(&_112$$46);
- ZVAL_LONG(&_112$$46, index);
- ZEPHIR_INIT_NVAR(&_113$$46);
- ZEPHIR_CONCAT_SV(&_113$$46, "?", &_112$$46);
- zephir_array_append(¬InValues, &_113$$46, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 346);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &fieldExcept, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_111$$45, &fieldExcept, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_111$$45)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleExcept, &fieldExcept, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_114$$47);
- ZVAL_LONG(&_114$$47, index);
- ZEPHIR_INIT_NVAR(&_115$$47);
- ZEPHIR_CONCAT_SV(&_115$$47, "?", &_114$$47);
- zephir_array_append(¬InValues, &_115$$47, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 346);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- ZEPHIR_CALL_METHOD(NULL, &fieldExcept, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZEPHIR_INIT_NVAR(&_116$$45);
- zephir_fast_join_str(&_116$$45, SL(","), ¬InValues);
- ZEPHIR_INIT_NVAR(&_117$$45);
- ZEPHIR_CONCAT_VSVS(&_117$$45, &attribute, " NOT IN (", &_116$$45, ")");
- zephir_array_append(&exceptConditions, &_117$$45, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 351);
- } else {
- ZEPHIR_INIT_NVAR(&_118$$48);
- ZVAL_LONG(&_118$$48, index);
- ZEPHIR_INIT_NVAR(&_119$$48);
- ZEPHIR_CONCAT_VSV(&_119$$48, &attribute, " <> ?", &_118$$48);
- zephir_array_append(&exceptConditions, &_119$$48, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 353);
- zephir_array_update_multi(¶ms, &fieldExcept, SL("sa"), 3, SL("bind"));
- index++;
- }
- ZEPHIR_CALL_METHOD(NULL, &except, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&fieldExcept);
- ZEPHIR_INIT_NVAR(&singleField);
- } else if (zephir_fast_count_int(&field) == 1) {
- zephir_array_fetch_long(&_121$$49, &field, 0, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Uniqueness.zep", 361);
- ZEPHIR_INIT_NVAR(&_122$$49);
- ZVAL_STRING(&_122$$49, "attribute");
- ZEPHIR_CALL_METHOD(&_120$$49, this_ptr, "getoption", NULL, 0, &_122$$49, &_121$$49);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_5, 0, record, &_120$$49);
- zephir_check_call_status();
- if (Z_TYPE_P(&except) == IS_ARRAY) {
- zephir_is_iterable(&except, 0, "phalcon/Validation/Validator/Uniqueness.zep", 371);
- if (Z_TYPE_P(&except) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&except), _123$$50)
- {
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZVAL_COPY(&singleExcept, _123$$50);
- ZEPHIR_INIT_NVAR(&_125$$51);
- ZVAL_LONG(&_125$$51, index);
- ZEPHIR_INIT_NVAR(&_126$$51);
- ZEPHIR_CONCAT_SV(&_126$$51, "?", &_125$$51);
- zephir_array_append(¬InValues, &_126$$51, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 366);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &except, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_124$$50, &except, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_124$$50)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleExcept, &except, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_127$$52);
- ZVAL_LONG(&_127$$52, index);
- ZEPHIR_INIT_NVAR(&_128$$52);
- ZEPHIR_CONCAT_SV(&_128$$52, "?", &_127$$52);
- zephir_array_append(¬InValues, &_128$$52, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 366);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- ZEPHIR_CALL_METHOD(NULL, &except, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZEPHIR_INIT_NVAR(&_129$$50);
- zephir_fast_join_str(&_129$$50, SL(","), ¬InValues);
- ZEPHIR_INIT_NVAR(&_130$$50);
- ZEPHIR_CONCAT_VSVS(&_130$$50, &attribute, " NOT IN (", &_129$$50, ")");
- zephir_array_append(&exceptConditions, &_130$$50, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 371);
- } else {
- ZEPHIR_INIT_NVAR(&_131$$53);
- ZVAL_LONG(&_131$$53, index);
- ZEPHIR_INIT_NVAR(&_132$$53);
- ZEPHIR_CONCAT_VSV(&_132$$53, &attribute, " <> ?", &_131$$53);
- zephir_array_update_multi(¶ms, &_132$$53, SL("sa"), 3, SL("conditions"));
- zephir_array_update_multi(¶ms, &except, SL("sa"), 3, SL("bind"));
- index++;
- }
- } else if (zephir_fast_count_int(&field) > 1) {
- zephir_is_iterable(&field, 0, "phalcon/Validation/Validator/Uniqueness.zep", 398);
- if (Z_TYPE_P(&field) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&field), _133$$54)
- {
- ZEPHIR_INIT_NVAR(&singleField);
- ZVAL_COPY(&singleField, _133$$54);
- ZEPHIR_INIT_NVAR(&_136$$55);
- ZVAL_STRING(&_136$$55, "attribute");
- ZEPHIR_CALL_METHOD(&_135$$55, this_ptr, "getoption", NULL, 0, &_136$$55, &singleField);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_5, 0, record, &_135$$55);
- zephir_check_call_status();
- if (Z_TYPE_P(&except) == IS_ARRAY) {
- zephir_is_iterable(&except, 0, "phalcon/Validation/Validator/Uniqueness.zep", 391);
- if (Z_TYPE_P(&except) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&except), _137$$56)
- {
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZVAL_COPY(&singleExcept, _137$$56);
- ZEPHIR_INIT_NVAR(&_139$$57);
- ZVAL_LONG(&_139$$57, index);
- ZEPHIR_INIT_NVAR(&_140$$57);
- ZEPHIR_CONCAT_SV(&_140$$57, "?", &_139$$57);
- zephir_array_append(¬InValues, &_140$$57, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 386);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &except, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_138$$56, &except, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_138$$56)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleExcept, &except, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_141$$58);
- ZVAL_LONG(&_141$$58, index);
- ZEPHIR_INIT_NVAR(&_142$$58);
- ZEPHIR_CONCAT_SV(&_142$$58, "?", &_141$$58);
- zephir_array_append(¬InValues, &_142$$58, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 386);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- ZEPHIR_CALL_METHOD(NULL, &except, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZEPHIR_INIT_NVAR(&_143$$56);
- zephir_fast_join_str(&_143$$56, SL(","), ¬InValues);
- ZEPHIR_INIT_NVAR(&_144$$56);
- ZEPHIR_CONCAT_VSVS(&_144$$56, &attribute, " NOT IN (", &_143$$56, ")");
- zephir_array_append(&exceptConditions, &_144$$56, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 391);
- } else {
- ZEPHIR_INIT_NVAR(&_145$$59);
- ZVAL_LONG(&_145$$59, index);
- ZEPHIR_INIT_NVAR(&_146$$59);
- ZEPHIR_CONCAT_VSV(&_146$$59, &attribute, " <> ?", &_145$$59);
- zephir_array_update_multi(¶ms, &_146$$59, SL("sa"), 3, SL("conditions"));
- zephir_array_update_multi(¶ms, &except, SL("sa"), 3, SL("bind"));
- index++;
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &field, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_134$$54, &field, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_134$$54)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleField, &field, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_148$$60);
- ZVAL_STRING(&_148$$60, "attribute");
- ZEPHIR_CALL_METHOD(&_147$$60, this_ptr, "getoption", NULL, 0, &_148$$60, &singleField);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_5, 0, record, &_147$$60);
- zephir_check_call_status();
- if (Z_TYPE_P(&except) == IS_ARRAY) {
- zephir_is_iterable(&except, 0, "phalcon/Validation/Validator/Uniqueness.zep", 391);
- if (Z_TYPE_P(&except) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&except), _149$$61)
- {
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZVAL_COPY(&singleExcept, _149$$61);
- ZEPHIR_INIT_NVAR(&_151$$62);
- ZVAL_LONG(&_151$$62, index);
- ZEPHIR_INIT_NVAR(&_152$$62);
- ZEPHIR_CONCAT_SV(&_152$$62, "?", &_151$$62);
- zephir_array_append(¬InValues, &_152$$62, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 386);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &except, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_150$$61, &except, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_150$$61)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&singleExcept, &except, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_153$$63);
- ZVAL_LONG(&_153$$63, index);
- ZEPHIR_INIT_NVAR(&_154$$63);
- ZEPHIR_CONCAT_SV(&_154$$63, "?", &_153$$63);
- zephir_array_append(¬InValues, &_154$$63, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 386);
- zephir_array_update_multi(¶ms, &singleExcept, SL("sa"), 3, SL("bind"));
- index++;
- ZEPHIR_CALL_METHOD(NULL, &except, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&singleExcept);
- ZEPHIR_INIT_NVAR(&_155$$61);
- zephir_fast_join_str(&_155$$61, SL(","), ¬InValues);
- ZEPHIR_INIT_NVAR(&_156$$61);
- ZEPHIR_CONCAT_VSVS(&_156$$61, &attribute, " NOT IN (", &_155$$61, ")");
- zephir_array_append(&exceptConditions, &_156$$61, PH_SEPARATE, "phalcon/Validation/Validator/Uniqueness.zep", 391);
- } else {
- ZEPHIR_INIT_NVAR(&_157$$64);
- ZVAL_LONG(&_157$$64, index);
- ZEPHIR_INIT_NVAR(&_158$$64);
- ZEPHIR_CONCAT_VSV(&_158$$64, &attribute, " <> ?", &_157$$64);
- zephir_array_update_multi(¶ms, &_158$$64, SL("sa"), 3, SL("conditions"));
- zephir_array_update_multi(¶ms, &except, SL("sa"), 3, SL("bind"));
- index++;
- }
- ZEPHIR_CALL_METHOD(NULL, &field, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&singleField);
- }
- }
- ZEPHIR_CALL_METHOD(NULL, &field, "next", NULL, 0);
- zephir_check_call_status();
- }
+ ZEPHIR_INIT_NVAR(&delimiter);
+ ZVAL_STRING(&delimiter, ";");
+ }
+ if (zephir_array_isset_string(&options, SL("enclosure"))) {
+ ZEPHIR_OBS_VAR(&enclosure);
+ zephir_array_fetch_string(&enclosure, &options, SL("enclosure"), PH_NOISY, "phalcon/Translate/Adapter/Csv.zep", 55);
+ } else {
+ ZEPHIR_INIT_NVAR(&enclosure);
+ ZVAL_STRING(&enclosure, "\"");
+ }
+ zephir_array_fetch_string(&_1, &options, SL("content"), PH_NOISY | PH_READONLY, "phalcon/Translate/Adapter/Csv.zep", 60);
+ ZVAL_LONG(&_2, 0);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "load", NULL, 0, &_1, &_2, &delimiter, &enclosure);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Translate_Adapter_Csv, exists)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *index_param = NULL, _0;
+ zval index;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(index)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_INIT_NVAR(&singleField);
- ZEPHIR_CALL_METHOD(&_159, record, "getdirtystate", NULL, 0);
+ 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));
+}
+
+static PHP_METHOD(Phalcon_Translate_Adapter_Csv, query)
+{
+ 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 *this_ptr = getThis();
+
+ ZVAL_UNDEF(&translateKey);
+ ZVAL_UNDEF(&translation);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&placeholders);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(translateKey)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(placeholders)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_OBS_VAR(&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);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "replaceplaceholders", NULL, 0, &translation, &placeholders);
zephir_check_call_status();
- if (ZEPHIR_IS_LONG(&_159, 0)) {
- ZEPHIR_CALL_METHOD(&_160$$65, record, "getdi", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_161$$65);
- ZVAL_STRING(&_161$$65, "modelsMetadata");
- ZEPHIR_CALL_METHOD(&metaData, &_160$$65, "getshared", NULL, 0, &_161$$65);
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Translate_Adapter_Csv, load)
+{
+ 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 *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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(4, 4)
+ Z_PARAM_STR(file)
+ Z_PARAM_LONG(length)
+ Z_PARAM_STR(delimiter)
+ Z_PARAM_STR(enclosure)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 4, 0, &file_param, &length_param, &delimiter_param, &enclosure_param);
+ zephir_get_strval(&file, file_param);
+ length = zephir_get_intval(length_param);
+ zephir_get_strval(&delimiter, delimiter_param);
+ zephir_get_strval(&enclosure, enclosure_param);
+
+
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "rb");
+ ZEPHIR_CALL_FUNCTION(&fileHandler, "fopen", NULL, 89, &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, 8, &_2$$3);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_162$$65, &metaData, "getprimarykeyattributes", NULL, 0, record);
+ zephir_throw_exception_debug(&_1$$3, "phalcon/Translate/Adapter/Csv.zep", 97);
+ 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();
- zephir_is_iterable(&_162$$65, 0, "phalcon/Validation/Validator/Uniqueness.zep", 417);
- if (Z_TYPE_P(&_162$$65) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_162$$65), _163$$65)
- {
- ZEPHIR_INIT_NVAR(&primaryField);
- ZVAL_COPY(&primaryField, _163$$65);
- ZEPHIR_CALL_METHOD(&_165$$66, this_ptr, "getcolumnnamereal", &_5, 0, record, &primaryField);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_166$$66);
- ZVAL_LONG(&_166$$66, index);
- ZEPHIR_INIT_NVAR(&_167$$66);
- ZEPHIR_CONCAT_VSV(&_167$$66, &_165$$66, " <> ?", &_166$$66);
- zephir_array_update_multi(¶ms, &_167$$66, SL("sa"), 3, SL("conditions"));
- ZEPHIR_CALL_METHOD(&_169$$66, this_ptr, "getcolumnnamereal", &_5, 0, record, &primaryField);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_168$$66, record, "readattribute", NULL, 0, &_169$$66);
- zephir_check_call_status();
- zephir_array_update_multi(¶ms, &_168$$66, SL("sa"), 3, SL("bind"));
- index++;
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_162$$65, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_164$$65, &_162$$65, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_164$$65)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&primaryField, &_162$$65, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_170$$67, this_ptr, "getcolumnnamereal", &_5, 0, record, &primaryField);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_171$$67);
- ZVAL_LONG(&_171$$67, index);
- ZEPHIR_INIT_NVAR(&_172$$67);
- ZEPHIR_CONCAT_VSV(&_172$$67, &_170$$67, " <> ?", &_171$$67);
- zephir_array_update_multi(¶ms, &_172$$67, SL("sa"), 3, SL("conditions"));
- ZEPHIR_CALL_METHOD(&_174$$67, this_ptr, "getcolumnnamereal", &_5, 0, record, &primaryField);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_173$$67, record, "readattribute", NULL, 0, &_174$$67);
- zephir_check_call_status();
- zephir_array_update_multi(¶ms, &_173$$67, SL("sa"), 3, SL("bind"));
- index++;
- ZEPHIR_CALL_METHOD(NULL, &_162$$65, "next", NULL, 0);
- zephir_check_call_status();
- }
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&data)) {
+ break;
}
- ZEPHIR_INIT_NVAR(&primaryField);
+ zephir_array_fetch_long(&_5$$4, &data, 0, PH_NOISY | PH_READONLY, "phalcon/Translate/Adapter/Csv.zep", 107);
+ 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", 111);
+ ZEPHIR_OBS_NVAR(&_10$$4);
+ zephir_array_fetch_long(&_10$$4, &data, 0, PH_NOISY, "phalcon/Translate/Adapter/Csv.zep", 111);
+ zephir_update_property_array(this_ptr, SL("translate"), &_10$$4, &_9$$4);
}
- if (!(ZEPHIR_IS_EMPTY(&exceptConditions))) {
- ZEPHIR_INIT_VAR(&_175$$68);
- zephir_fast_join_str(&_175$$68, SL(" OR "), &exceptConditions);
- ZEPHIR_INIT_VAR(&_176$$68);
- ZEPHIR_CONCAT_SVS(&_176$$68, "(", &_175$$68, ")");
- zephir_array_update_multi(¶ms, &_176$$68, SL("sa"), 3, SL("conditions"));
+ zephir_fclose(&fileHandler);
+ ZEPHIR_MM_RESTORE();
+}
+
+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_MM_GROW();
+
+ {
+ 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);
}
- ZEPHIR_INIT_NVAR(&_0);
- zephir_array_fetch_string(&_177, ¶ms, SL("conditions"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/Uniqueness.zep", 426);
- zephir_fast_join_str(&_0, SL(" AND "), &_177);
- zephir_array_update_string(¶ms, SL("conditions"), &_0, PH_COPY | PH_SEPARATE);
- RETURN_CCTOR(¶ms);
}
@@ -214673,652 +214545,1082 @@ static PHP_METHOD(Phalcon_Validation_Validator_Uniqueness, isUniquenessModel)
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Url)
+ZEPHIR_INIT_CLASS(Phalcon_Translate_Adapter_Gettext)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Url, phalcon, validation_validator_url, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_url_method_entry, 0);
+ 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_string(phalcon_validation_validator_url_ce, SL("template"), "Field :field must be a url", ZEND_ACC_PROTECTED);
+ 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;
}
-static PHP_METHOD(Phalcon_Validation_Validator_Url, __construct)
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getCategory)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "category");
+}
+
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getDefaultDomain)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "defaultDomain");
+}
+
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getDirectory)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "directory");
+}
+
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getLocale)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "locale");
+}
+
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
zval options;
+ zval *interpolator, interpolator_sub, *options_param = NULL;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&interpolator_sub);
ZVAL_UNDEF(&options);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
- } else {
+ zephir_fetch_params(1, 2, 0, &interpolator, &options_param);
ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- }
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_url_ce, getThis(), "__construct", &_0, 0, &options);
+ if (UNEXPECTED(!((zephir_function_exists_ex(ZEND_STRL("gettext")) == SUCCESS)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_translate_exception_ce, "This class requires the gettext extension for PHP", "phalcon/Translate/Adapter/Gettext.zep", 72);
+ return;
+ }
+ ZEPHIR_CALL_PARENT(NULL, phalcon_translate_adapter_gettext_ce, getThis(), "__construct", &_0, 0, interpolator, &options);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "prepareoptions", NULL, 0, &options);
zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_Validator_Url, validate)
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, exists)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, options, result, value, _0, _1$$3, _2$$4, _3$$5;
+ zval *index_param = NULL, result;
+ zval index;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&index);
ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$5);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(index)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ 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(&value, validation, "getvalue", NULL, 0, field);
+ ZEPHIR_CALL_METHOD(&result, this_ptr, "query", NULL, 0, &index);
zephir_check_call_status();
- ZEPHIR_OBS_VAR(&options);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset_string_fetch(&options, &_0, SL("options"), 0)) {
- ZVAL_LONG(&_1$$3, 273);
- ZEPHIR_CALL_FUNCTION(&result, "filter_var", NULL, 237, &value, &_1$$3, &options);
- zephir_check_call_status();
+ RETURN_MM_BOOL(!ZEPHIR_IS_IDENTICAL(&result, &index));
+}
+
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, nquery)
+{
+ 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;
+ 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);
+#if PHP_VERSION_ID >= 80000
+ 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)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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 {
- ZVAL_LONG(&_2$$4, 273);
- ZEPHIR_CALL_FUNCTION(&result, "filter_var", NULL, 237, &value, &_2$$4);
- zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&msgid1);
}
- if (!(zephir_is_true(&result))) {
- ZEPHIR_CALL_METHOD(&_3$$5, this_ptr, "messagefactory", NULL, 0, validation, field);
+ 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_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_3$$5);
+ } else {
+ ZVAL_LONG(&_1$$4, count);
+ ZEPHIR_CALL_FUNCTION(&translation, "dngettext", NULL, 0, &domain, &msgid1, &msgid2, &_1$$4);
zephir_check_call_status();
- RETURN_MM_BOOL(0);
}
- RETURN_MM_BOOL(1);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "replaceplaceholders", NULL, 0, &translation, &placeholders);
+ zephir_check_call_status();
+ RETURN_MM();
}
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, query)
+{
+ 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;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&translateKey);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&placeholders);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(translateKey)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(placeholders)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_CALL_FUNCTION(&_0, "gettext", NULL, 0, &translateKey);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "replaceplaceholders", NULL, 0, &_0, &placeholders);
+ zephir_check_call_status();
+ RETURN_MM();
+}
-#ifdef HAVE_CONFIG_H
-#endif
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, resetDomain)
+{
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&_0);
+ ZEPHIR_MM_GROW();
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdefaultdomain", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_FUNCTION("textdomain", NULL, 0, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_File_AbstractFile)
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setDefaultDomain)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator\\File, AbstractFile, phalcon, validation_validator_file_abstractfile, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_file_abstractfile_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *domain_param = NULL;
+ zval domain;
+ zval *this_ptr = getThis();
- zend_declare_property_string(phalcon_validation_validator_file_abstractfile_ce, SL("messageFileEmpty"), "Field :field must not be empty", ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_validation_validator_file_abstractfile_ce, SL("messageIniSize"), "File :field exceeds the maximum file size", ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_validation_validator_file_abstractfile_ce, SL("messageValid"), "Field :field is not valid", ZEND_ACC_PROTECTED);
- return SUCCESS;
+ ZVAL_UNDEF(&domain);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(domain)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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();
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_AbstractFile, getMessageFileEmpty)
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setDirectory)
{
+ zend_string *_3$$4;
+ zend_ulong _2$$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;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&directory_sub);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_5$$7);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(directory)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &directory);
- RETURN_MEMBER(getThis(), "messageFileEmpty");
+
+ if (ZEPHIR_IS_EMPTY(directory)) {
+ RETURN_MM_NULL();
+ }
+ 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", 180);
+ 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_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);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1$$4)) {
+ break;
+ }
+ 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);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, directory, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ 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_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_AbstractFile, setMessageFileEmpty)
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setDomain)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *messageFileEmpty_param = NULL;
- zval messageFileEmpty;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *domain, domain_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&messageFileEmpty);
+ ZVAL_UNDEF(&domain_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(messageFileEmpty)
+ Z_PARAM_ZVAL(domain)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &messageFileEmpty_param);
- zephir_get_strval(&messageFileEmpty, messageFileEmpty_param);
+ zephir_fetch_params(1, 1, 0, &domain);
- zephir_update_property_zval(this_ptr, ZEND_STRL("messageFileEmpty"), &messageFileEmpty);
- RETURN_THIS();
+ ZEPHIR_RETURN_CALL_FUNCTION("textdomain", NULL, 0, domain);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_AbstractFile, getMessageIniSize)
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setLocale)
{
+ 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();
+ 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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_LONG(category)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(localeArray)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
- RETURN_MEMBER(getThis(), "messageIniSize");
+ ZEPHIR_MM_GROW();
+ 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"));
+ RETURN_MM_NULL();
+ }
+ category = Z_LVAL_P(category_param);
+ if (!localeArray_param) {
+ ZEPHIR_INIT_VAR(&localeArray);
+ array_init(&localeArray);
+ } else {
+ zephir_get_arrval(&localeArray, localeArray_param);
+ }
+
+
+ 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);
+ ZEPHIR_INIT_ZVAL_NREF(_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);
+ 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);
+ zephir_check_call_status();
+ RETURN_MM_MEMBER(getThis(), "locale");
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_AbstractFile, setMessageIniSize)
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getOptionsDefault)
+{
+ zval *this_ptr = getThis();
+
+
+
+ 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;
+}
+
+static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, prepareOptions)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *messageIniSize_param = NULL;
- zval messageIniSize;
+ 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(&messageIniSize);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(messageIniSize)
+ Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &messageIniSize_param);
- zephir_get_strval(&messageIniSize, messageIniSize_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("messageIniSize"), &messageIniSize);
- RETURN_THIS();
+ 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", 237);
+ 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", 241);
+ return;
+ }
+ 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", 250);
+ zephir_array_fetch_string(&_3, &options, SL("locale"), PH_NOISY | PH_READONLY, "phalcon/Translate/Adapter/Gettext.zep", 252);
+ 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", 256);
+ 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", 260);
+ 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", 264);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdomain", NULL, 0, &_6);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_AbstractFile, getMessageValid)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Translate_Adapter_NativeArray)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Translate\\Adapter, NativeArray, phalcon, translate_adapter_nativearray, phalcon_translate_adapter_abstractadapter_ce, phalcon_translate_adapter_nativearray_method_entry, 0);
+
+ 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;
+
+ 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;
+ zephir_fcall_cache_entry *_0 = NULL;
+ 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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
+ Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &interpolator, &options_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- RETURN_MEMBER(getThis(), "messageValid");
+
+ ZEPHIR_CALL_PARENT(NULL, phalcon_translate_adapter_nativearray_ce, getThis(), "__construct", &_0, 0, interpolator, &options);
+ zephir_check_call_status();
+ ZEPHIR_OBS_VAR(&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", 49);
+ return;
+ }
+ ZEPHIR_OBS_VAR(&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", 57);
+ return;
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("translate"), &data);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_AbstractFile, setMessageValid)
+static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, exists)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *messageValid_param = NULL;
- zval messageValid;
+ zval *index_param = NULL, _0;
+ zval index;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&messageValid);
+ ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(messageValid)
+ Z_PARAM_STR(index)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &messageValid_param);
- zephir_get_strval(&messageValid, messageValid_param);
+ 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_update_property_zval(this_ptr, ZEND_STRL("messageValid"), &messageValid);
- RETURN_THIS();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("translate"), PH_NOISY_CC | PH_READONLY);
+ RETURN_MM_BOOL(zephir_array_isset(&_0, &index));
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_AbstractFile, checkUpload)
+static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, notFound)
{
- zend_bool _1, _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, _0, _2, _4;
+ zval *index_param = NULL, _0, _1$$3;
+ zval index, _2$$3;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(index)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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, 8, &_2$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_1$$3, "phalcon/Translate/Adapter/NativeArray.zep", 77);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ RETURN_CTOR(&index);
+}
+
+static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, query)
+{
+ 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 *this_ptr = getThis();
+
+ ZVAL_UNDEF(&translateKey);
+ ZVAL_UNDEF(&translation);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&placeholders);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(translateKey)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(placeholders)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ 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_OBS_VAR(&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_check_call_status();
+ RETURN_MM();
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "replaceplaceholders", NULL, 0, &translation, &placeholders);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+zend_object *zephir_init_properties_Phalcon_Translate_Adapter_NativeArray(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_MM_GROW();
+
+ {
+ 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_Cache_AdapterFactory)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache, AdapterFactory, phalcon, cache_adapterfactory, phalcon_factory_abstractfactory_ce, phalcon_cache_adapterfactory_method_entry, 0);
+
+ zend_declare_property_string(phalcon_cache_adapterfactory_ce, SL("exception"), "Phalcon\\Cache\\Exception\\Exception", ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_cache_adapterfactory_ce, SL("serializerFactory"), ZEND_ACC_PRIVATE);
+ return SUCCESS;
+}
+
+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();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&factory_sub);
+ ZVAL_UNDEF(&services);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ 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();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ 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_CALL_METHOD(&_0, this_ptr, "checkuploadmaxsize", NULL, 0, validation, field);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("serializerFactory"), factory);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
zephir_check_call_status();
- _1 = zephir_is_true(&_0);
- if (_1) {
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkuploadisempty", NULL, 0, validation, field);
- zephir_check_call_status();
- _1 = zephir_is_true(&_2);
- }
- _3 = _1;
- if (_3) {
- ZEPHIR_CALL_METHOD(&_4, this_ptr, "checkuploadisvalid", NULL, 0, validation, field);
- zephir_check_call_status();
- _3 = zephir_is_true(&_4);
- }
- RETURN_MM_BOOL(_3);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_AbstractFile, checkUploadIsEmpty)
+static PHP_METHOD(Phalcon_Cache_AdapterFactory, newInstance)
{
- zend_bool _0, _1, _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, label, replacePairs, value, _2, _4, _5, _6$$3, _7$$3, _8$$3, _9$$3, _10$$3;
+ zval options, _0;
+ zval *name_param = NULL, *options_param = NULL, definition, _1;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&label);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_2);
- 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(&name);
+ ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
-
-
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- _0 = !(zephir_array_isset_string(&value, SL("error")));
- if (!(_0)) {
- _0 = !(zephir_array_isset_string(&value, SL("tmp_name")));
- }
- _1 = _0;
- if (!(_1)) {
- zephir_array_fetch_string(&_2, &value, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/AbstractFile.zep", 109);
- _1 = !ZEPHIR_IS_LONG_IDENTICAL(&_2, 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();
}
- _3 = _1;
- if (!(_3)) {
- zephir_array_fetch_string(&_5, &value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/AbstractFile.zep", 110);
- ZEPHIR_CALL_METHOD(&_4, this_ptr, "checkisuploadedfile", NULL, 0, &_5);
- zephir_check_call_status();
- _3 = !zephir_is_true(&_4);
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
}
- if (_3) {
- ZEPHIR_CALL_METHOD(&label, this_ptr, "preparelabel", NULL, 0, validation, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- zephir_array_update_string(&replacePairs, SL(":field"), &label, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_VAR(&_6$$3);
- object_init_ex(&_6$$3, phalcon_messages_message_ce);
- ZEPHIR_CALL_METHOD(&_7$$3, this_ptr, "getmessagefileempty", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&_8$$3, "strtr", NULL, 5, &_7$$3, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_9$$3);
- zephir_get_class(&_9$$3, this_ptr, 0);
- ZEPHIR_CALL_METHOD(&_10$$3, this_ptr, "preparecode", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_6$$3, "__construct", NULL, 6, &_8$$3, field, &_9$$3, &_10$$3);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_6$$3);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
+ if (!options_param) {
+ ZEPHIR_INIT_VAR(&options);
+ array_init(&options);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
}
- RETURN_MM_BOOL(1);
+
+
+ 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_OBS_VAR(&_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_Validation_Validator_File_AbstractFile, checkUploadIsValid)
+static PHP_METHOD(Phalcon_Cache_AdapterFactory, getAdapters)
{
- zend_bool _0, _1;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, label, replacePairs, value, _2$$3, _3$$3, _4$$3, _5$$3, _6$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&label);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_6$$3);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
- ZEND_PARSE_PARAMETERS_END();
+
+
+ zephir_create_array(return_value, 5, 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"));
+ return;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- _0 = !(zephir_array_isset_string(&value, SL("name")));
- if (!(_0)) {
- _0 = !(zephir_array_isset_string(&value, SL("type")));
- }
- _1 = _0;
- if (!(_1)) {
- _1 = !(zephir_array_isset_string(&value, SL("size")));
- }
- if (_1) {
- ZEPHIR_CALL_METHOD(&label, this_ptr, "preparelabel", NULL, 0, validation, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- zephir_array_update_string(&replacePairs, SL(":field"), &label, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_VAR(&_2$$3);
- object_init_ex(&_2$$3, phalcon_messages_message_ce);
- ZEPHIR_CALL_METHOD(&_3$$3, this_ptr, "getmessagevalid", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&_4$$3, "strtr", NULL, 5, &_3$$3, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_5$$3);
- zephir_get_class(&_5$$3, this_ptr, 0);
- ZEPHIR_CALL_METHOD(&_6$$3, this_ptr, "preparecode", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 6, &_4$$3, field, &_5$$3, &_6$$3);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_2$$3);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+
+ZEPHIR_INIT_CLASS(Phalcon_Cache_CacheFactory)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Cache, CacheFactory, phalcon, cache_cachefactory, phalcon_cache_cachefactory_method_entry, 0);
+
+ zend_declare_property_null(phalcon_cache_cachefactory_ce, SL("adapterFactory"), ZEND_ACC_PROTECTED);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_AbstractFile, checkUploadMaxSize)
+static PHP_METHOD(Phalcon_Cache_CacheFactory, __construct)
{
- zend_bool _1, _2, _3, _5, _6;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, _SERVER, _POST, _FILES, label, replacePairs, value, _0, _4, _7, _8$$3, _9$$3, _10$$3, _11$$3, _12$$3;
+ zval *factory, factory_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&_SERVER);
- ZVAL_UNDEF(&_POST);
- ZVAL_UNDEF(&_FILES);
- ZVAL_UNDEF(&label);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8$$3);
- ZVAL_UNDEF(&_9$$3);
- ZVAL_UNDEF(&_10$$3);
- ZVAL_UNDEF(&_11$$3);
- ZVAL_UNDEF(&_12$$3);
+ ZVAL_UNDEF(&factory_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_cache_adapterfactory_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- zephir_get_global(&_FILES, SL("_FILES"));
- zephir_get_global(&_POST, SL("_POST"));
- zephir_get_global(&_SERVER, SL("_SERVER"));
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ zephir_fetch_params_without_memory_grow(1, 0, &factory);
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- zephir_array_fetch_string(&_0, &_SERVER, SL("REQUEST_METHOD"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/AbstractFile.zep", 180);
- _1 = ZEPHIR_IS_STRING(&_0, "POST");
- if (_1) {
- _1 = ZEPHIR_IS_EMPTY(&_POST);
- }
- _2 = _1;
- if (_2) {
- _2 = ZEPHIR_IS_EMPTY(&_FILES);
- }
- _3 = _2;
- if (_3) {
- zephir_array_fetch_string(&_4, &_SERVER, SL("CONTENT_LENGTH"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/AbstractFile.zep", 183);
- _3 = ZEPHIR_GT_LONG(&_4, 0);
- }
- _5 = _3;
- if (!(_5)) {
- _6 = zephir_array_isset_string(&value, SL("error"));
- if (_6) {
- zephir_array_fetch_string(&_7, &value, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/AbstractFile.zep", 184);
- _6 = ZEPHIR_IS_LONG_IDENTICAL(&_7, 1);
- }
- _5 = _6;
- }
- if (_5) {
- ZEPHIR_CALL_METHOD(&label, this_ptr, "preparelabel", NULL, 0, validation, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- zephir_array_update_string(&replacePairs, SL(":field"), &label, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_VAR(&_8$$3);
- object_init_ex(&_8$$3, phalcon_messages_message_ce);
- ZEPHIR_CALL_METHOD(&_9$$3, this_ptr, "getmessageinisize", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&_10$$3, "strtr", NULL, 5, &_9$$3, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_11$$3);
- zephir_get_class(&_11$$3, this_ptr, 0);
- ZEPHIR_CALL_METHOD(&_12$$3, this_ptr, "preparecode", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_8$$3, "__construct", NULL, 6, &_10$$3, field, &_11$$3, &_12$$3);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_8$$3);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("adapterFactory"), factory);
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_AbstractFile, getFileSizeInBytes)
+static PHP_METHOD(Phalcon_Cache_CacheFactory, load)
{
+ zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_2 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *size_param = NULL, byteUnits, unit, matches, _0, _1, _2, _3, _4, _5, _6, _7, _8;
- zval size;
+ zval *config = NULL, config_sub, name, options, _3, _4, _1$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&size);
- ZVAL_UNDEF(&byteUnits);
- ZVAL_UNDEF(&unit);
- ZVAL_UNDEF(&matches);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&config_sub);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&options);
ZVAL_UNDEF(&_3);
ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_1$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(size)
+ Z_PARAM_ZVAL(config)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &size_param);
- if (UNEXPECTED(Z_TYPE_P(size_param) != IS_STRING && Z_TYPE_P(size_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'size' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(size_param) == IS_STRING)) {
- zephir_get_strval(&size, size_param);
- } else {
- ZEPHIR_INIT_VAR(&size);
- }
+ zephir_fetch_params(1, 1, 0, &config);
+ ZEPHIR_SEPARATE_PARAM(config);
- ZEPHIR_INIT_VAR(&byteUnits);
- zephir_create_array(&byteUnits, 9, 0);
- add_assoc_long_ex(&byteUnits, SL("B"), 0);
- add_assoc_long_ex(&byteUnits, SL("K"), 10);
- add_assoc_long_ex(&byteUnits, SL("M"), 20);
- add_assoc_long_ex(&byteUnits, SL("G"), 30);
- add_assoc_long_ex(&byteUnits, SL("T"), 40);
- add_assoc_long_ex(&byteUnits, SL("KB"), 10);
- add_assoc_long_ex(&byteUnits, SL("MB"), 20);
- add_assoc_long_ex(&byteUnits, SL("GB"), 30);
- add_assoc_long_ex(&byteUnits, SL("TB"), 40);
- ZEPHIR_INIT_VAR(&unit);
- ZVAL_STRING(&unit, "B");
- ZEPHIR_INIT_VAR(&matches);
- ZVAL_NULL(&matches);
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_INIT_VAR(&_1);
- zephir_array_keys(&_1, &byteUnits);
- zephir_fast_join_str(&_0, SL("|"), &_1);
- ZEPHIR_INIT_VAR(&_2);
- ZEPHIR_CONCAT_SVS(&_2, "/^([0-9]+(?:\\.[0-9]+)?)(", &_0, ")?$/Di");
- ZEPHIR_INIT_VAR(&_3);
- zephir_preg_match(&_3, &_2, &size, &matches, 0, 0 , 0 );
- if (zephir_array_isset_long(&matches, 2)) {
- ZEPHIR_OBS_NVAR(&unit);
- zephir_array_fetch_long(&unit, &matches, 2, PH_NOISY, "phalcon/Validation/Validator/File/AbstractFile.zep", 233);
+ _0 = Z_TYPE_P(config) == IS_OBJECT;
+ if (_0) {
+ _0 = zephir_instance_of_ev(config, phalcon_config_configinterface_ce);
}
- zephir_array_fetch_long(&_4, &matches, 1, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/AbstractFile.zep", 236);
- ZEPHIR_CALL_FUNCTION(&_5, "floatval", NULL, 18, &_4);
+ if (_0) {
+ ZEPHIR_CALL_METHOD(&_1$$3, config, "toarray", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(config, &_1$$3);
+ }
+ if (UNEXPECTED(Z_TYPE_P(config) != IS_ARRAY)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_exception_ce, "Config must be array or Phalcon\\Config object", "phalcon/Cache/CacheFactory.zep", 78);
+ return;
+ }
+ if (UNEXPECTED(!(zephir_array_isset_string(config, SL("adapter"))))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_exception_ce, "You must provide 'adapter' option in factory config parameter.", "phalcon/Cache/CacheFactory.zep", 84);
+ return;
+ }
+ ZEPHIR_OBS_VAR(&name);
+ zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Cache/CacheFactory.zep", 87);
+ ZEPHIR_INIT_VAR(&_3);
+ array_init(&_3);
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_STRING(&_4, "options");
+ ZEPHIR_CALL_CE_STATIC(&options, phalcon_helper_arr_ce, "get", &_2, 16, config, &_4, &_3);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &options);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_6);
- zephir_array_fetch(&_7, &byteUnits, &unit, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/AbstractFile.zep", 236);
- ZVAL_LONG(&_8, 2);
- zephir_pow_function(&_6, &_8, &_7);
- mul_function(return_value, &_5, &_6);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_AbstractFile, isAllowEmpty)
+static PHP_METHOD(Phalcon_Cache_CacheFactory, newInstance)
{
- zend_bool _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval field;
- zval *validation, validation_sub, *field_param = NULL, value, _2;
+ zval options;
+ zval *name_param = NULL, *options_param = NULL, adapter, _0;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&field);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&adapter);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&options);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_STR(field)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field_param);
- if (UNEXPECTED(Z_TYPE_P(field_param) != IS_STRING && Z_TYPE_P(field_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'field' must be of the type string"));
+ 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(field_param) == IS_STRING)) {
- zephir_get_strval(&field, field_param);
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
} else {
- ZEPHIR_INIT_VAR(&field);
+ 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(&value, validation, "getvalue", NULL, 0, &field);
+ 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();
- _0 = ZEPHIR_IS_EMPTY(&value);
- if (!(_0)) {
- _1 = zephir_array_isset_string(&value, SL("error"));
- if (_1) {
- zephir_array_fetch_string(&_2, &value, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/AbstractFile.zep", 250);
- _1 = ZEPHIR_IS_LONG_IDENTICAL(&_2, 4);
- }
- _0 = _1;
- }
- RETURN_MM_BOOL(_0);
+ object_init_ex(return_value, phalcon_cache_ce);
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 171, &adapter);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_AbstractFile, checkIsUploadedFile)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL;
- zval name;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
- ZEND_PARSE_PARAMETERS_END();
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 1, 0, &name_param);
- zephir_get_strval(&name, name_param);
- ZEPHIR_RETURN_CALL_FUNCTION("is_uploaded_file", NULL, 19, &name);
- zephir_check_call_status();
- RETURN_MM();
+
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Exception_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Exception, Exception, phalcon, cache_exception_exception, phalcon_exception_ce, NULL, 0);
+
+ zend_class_implements(phalcon_cache_exception_exception_ce, 1, zephir_get_internal_ce(SL("psr\\simplecache\\cacheexception")));
+ return SUCCESS;
}
@@ -215331,93 +215633,48 @@ static PHP_METHOD(Phalcon_Validation_Validator_File_AbstractFile, checkIsUploade
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_File_MimeType)
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Exception_InvalidArgumentException)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator\\File, MimeType, phalcon, validation_validator_file_mimetype, phalcon_validation_validator_file_abstractfile_ce, phalcon_validation_validator_file_mimetype_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Exception, InvalidArgumentException, phalcon, cache_exception_invalidargumentexception, phalcon_exception_ce, NULL, 0);
- zend_declare_property_string(phalcon_validation_validator_file_mimetype_ce, SL("template"), "File :field must be of type: :types", ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_cache_exception_invalidargumentexception_ce, 1, zephir_get_internal_ce(SL("psr\\simplecache\\invalidargumentexception")));
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_MimeType, validate)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Adapter_AdapterInterface)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, fieldTypes, mime, replacePairs, tmp, types, value, _0, _1, _2$$6, _3$$6, _4$$8, _5$$8;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Cache\\Adapter, AdapterInterface, phalcon, cache_adapter_adapterinterface, NULL);
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&fieldTypes);
- ZVAL_UNDEF(&mime);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&tmp);
- ZVAL_UNDEF(&types);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2$$6);
- ZVAL_UNDEF(&_3$$6);
- ZVAL_UNDEF(&_4$$8);
- ZVAL_UNDEF(&_5$$8);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
- ZEND_PARSE_PARAMETERS_END();
+ zend_class_implements(phalcon_cache_adapter_adapterinterface_ce, 1, phalcon_storage_adapter_adapterinterface_ce);
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkupload", NULL, 0, validation, field);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "types");
- ZEPHIR_CALL_METHOD(&types, this_ptr, "getoption", NULL, 0, &_1);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(&fieldTypes);
- if (zephir_array_isset_fetch(&fieldTypes, &types, field, 0)) {
- ZEPHIR_CPY_WRT(&types, &fieldTypes);
- }
- if (UNEXPECTED(Z_TYPE_P(&types) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Option 'allowedTypes' must be an array", "phalcon/Validation/Validator/File/MimeType.zep", 96);
- return;
- }
- if ((zephir_function_exists_ex(ZEND_STRL("finfo_open")) == SUCCESS)) {
- ZVAL_LONG(&_2$$6, 16);
- ZEPHIR_CALL_FUNCTION(&tmp, "finfo_open", NULL, 355, &_2$$6);
- zephir_check_call_status();
- zephir_array_fetch_string(&_3$$6, &value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/MimeType.zep", 101);
- ZEPHIR_CALL_FUNCTION(&mime, "finfo_file", NULL, 356, &tmp, &_3$$6);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(NULL, "finfo_close", NULL, 357, &tmp);
- zephir_check_call_status();
- } else {
- ZEPHIR_OBS_NVAR(&mime);
- zephir_array_fetch_string(&mime, &value, SL("type"), PH_NOISY, "phalcon/Validation/Validator/File/MimeType.zep", 105);
- }
- if (!(zephir_fast_in_array(&mime, &types))) {
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- ZEPHIR_INIT_VAR(&_4$$8);
- zephir_fast_join_str(&_4$$8, SL(", "), &types);
- zephir_array_update_string(&replacePairs, SL(":types"), &_4$$8, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_5$$8, this_ptr, "messagefactory", NULL, 0, validation, field, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_5$$8);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+
+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);
+
+ zend_class_implements(phalcon_cache_adapter_apcu_ce, 1, phalcon_cache_adapter_adapterinterface_ce);
+ return SUCCESS;
}
@@ -215430,133 +215687,83 @@ static PHP_METHOD(Phalcon_Validation_Validator_File_MimeType, validate)
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_File_Resolution_Equal)
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Adapter_Libmemcached)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator\\File\\Resolution, Equal, phalcon, validation_validator_file_resolution_equal, phalcon_validation_validator_file_abstractfile_ce, phalcon_validation_validator_file_resolution_equal_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Adapter, Libmemcached, phalcon, cache_adapter_libmemcached, phalcon_storage_adapter_libmemcached_ce, NULL, 0);
- zend_declare_property_string(phalcon_validation_validator_file_resolution_equal_ce, SL("template"), "The resolution of the field :field has to be equal :resolution", ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_cache_adapter_libmemcached_ce, 1, phalcon_cache_adapter_adapterinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_Resolution_Equal, __construct)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Adapter_Memory)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Adapter, Memory, phalcon, cache_adapter_memory, phalcon_storage_adapter_memory_ce, NULL, 0);
- ZVAL_UNDEF(&options);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
+ zend_class_implements(phalcon_cache_adapter_memory_ce, 1, phalcon_cache_adapter_adapterinterface_ce);
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &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_validation_validator_file_resolution_equal_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+
+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);
+
+ zend_class_implements(phalcon_cache_adapter_redis_ce, 1, phalcon_cache_adapter_adapterinterface_ce);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_Resolution_Equal, validate)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Adapter_Stream)
{
- zend_bool _5;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, height, equalHeight, equalWidth, resolution, resolutionArray, tmp, value, width, replacePairs, _0, _1, _2, _3$$4, _4$$5, _6$$6;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Adapter, Stream, phalcon, cache_adapter_stream, phalcon_storage_adapter_stream_ce, NULL, 0);
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&height);
- ZVAL_UNDEF(&equalHeight);
- ZVAL_UNDEF(&equalWidth);
- ZVAL_UNDEF(&resolution);
- ZVAL_UNDEF(&resolutionArray);
- ZVAL_UNDEF(&tmp);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&width);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_4$$5);
- ZVAL_UNDEF(&_6$$6);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
- ZEND_PARSE_PARAMETERS_END();
+ zend_class_implements(phalcon_cache_adapter_stream_ce, 1, phalcon_cache_adapter_adapterinterface_ce);
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkupload", NULL, 0, validation, field);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- zephir_array_fetch_string(&_1, &value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Resolution/Equal.zep", 88);
- ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 363, &_1);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(&width);
- zephir_array_fetch_long(&width, &tmp, 0, PH_NOISY, "phalcon/Validation/Validator/File/Resolution/Equal.zep", 89);
- ZEPHIR_OBS_VAR(&height);
- zephir_array_fetch_long(&height, &tmp, 1, PH_NOISY, "phalcon/Validation/Validator/File/Resolution/Equal.zep", 90);
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "resolution");
- ZEPHIR_CALL_METHOD(&resolution, this_ptr, "getoption", NULL, 0, &_2);
- zephir_check_call_status();
- if (Z_TYPE_P(&resolution) == IS_ARRAY) {
- zephir_array_fetch(&_3$$4, &resolution, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Resolution/Equal.zep", 95);
- ZEPHIR_CPY_WRT(&resolution, &_3$$4);
- }
- ZEPHIR_INIT_VAR(&resolutionArray);
- zephir_fast_explode_str(&resolutionArray, SL("x"), &resolution, LONG_MAX);
- ZEPHIR_OBS_VAR(&equalWidth);
- zephir_array_fetch_long(&equalWidth, &resolutionArray, 0, PH_NOISY, "phalcon/Validation/Validator/File/Resolution/Equal.zep", 99);
- ZEPHIR_OBS_VAR(&equalHeight);
- zephir_array_fetch_long(&equalHeight, &resolutionArray, 1, PH_NOISY, "phalcon/Validation/Validator/File/Resolution/Equal.zep", 100);
- if (Z_TYPE_P(&resolution) == IS_ARRAY) {
- zephir_array_fetch(&_4$$5, &resolution, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Resolution/Equal.zep", 103);
- ZEPHIR_CPY_WRT(&resolution, &_4$$5);
- }
- _5 = !ZEPHIR_IS_EQUAL(&width, &equalWidth);
- if (!(_5)) {
- _5 = !ZEPHIR_IS_EQUAL(&height, &equalHeight);
- }
- if (_5) {
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- zephir_array_update_string(&replacePairs, SL(":resolution"), &resolution, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "messagefactory", NULL, 0, validation, field, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_6$$6);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+
+ZEPHIR_INIT_CLASS(Phalcon_Messages_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Messages, Exception, phalcon, messages_exception, phalcon_exception_ce, NULL, 0);
+
+ return SUCCESS;
}
@@ -215569,459 +215776,367 @@ static PHP_METHOD(Phalcon_Validation_Validator_File_Resolution_Equal, validate)
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_File_Resolution_Max)
+ZEPHIR_INIT_CLASS(Phalcon_Messages_Message)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator\\File\\Resolution, Max, phalcon, validation_validator_file_resolution_max, phalcon_validation_validator_file_abstractfile_ce, phalcon_validation_validator_file_resolution_max_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Messages, Message, phalcon, messages_message, phalcon_messages_message_method_entry, 0);
- zend_declare_property_string(phalcon_validation_validator_file_resolution_max_ce, SL("template"), "File :field exceeds the maximum resolution of :resolution", ZEND_ACC_PROTECTED);
+ 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, zephir_get_internal_ce(SL("jsonserializable")));
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_Resolution_Max, __construct)
+static PHP_METHOD(Phalcon_Messages_Message, getCode)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
-#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
- } else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- }
+ RETURN_MEMBER(getThis(), "code");
+}
+static PHP_METHOD(Phalcon_Messages_Message, getField)
+{
+ zval *this_ptr = getThis();
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_file_resolution_max_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+
+
+ RETURN_MEMBER(getThis(), "field");
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_Resolution_Max, validate)
+static PHP_METHOD(Phalcon_Messages_Message, getMessage)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "message");
+}
+
+static PHP_METHOD(Phalcon_Messages_Message, getType)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "type");
+}
+
+static PHP_METHOD(Phalcon_Messages_Message, getMetaData)
+{
+ zval *this_ptr = getThis();
+
+
+
+ RETURN_MEMBER(getThis(), "metaData");
+}
+
+static PHP_METHOD(Phalcon_Messages_Message, __construct)
{
- double _5$$5, _6$$6;
- zend_bool result = 0, _7$$7, _8$$8;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, height, maxHeight, maxWidth, resolution, resolutionArray, tmp, value, width, replacePairs, included, _0, _1, _2, _3$$4, _4$$5, _9$$9, _10$$10;
+ 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(&validation_sub);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&type);
ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&height);
- ZVAL_UNDEF(&maxHeight);
- ZVAL_UNDEF(&maxWidth);
- ZVAL_UNDEF(&resolution);
- ZVAL_UNDEF(&resolutionArray);
- ZVAL_UNDEF(&tmp);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&width);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&included);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_4$$5);
- ZVAL_UNDEF(&_9$$9);
- ZVAL_UNDEF(&_10$$10);
+ ZVAL_UNDEF(&metaData);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
+ 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();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
-
-
- ZEPHIR_INIT_VAR(&included);
- ZVAL_BOOL(&included, 0);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkupload", NULL, 0, validation, field);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- zephir_array_fetch_string(&_1, &value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Resolution/Max.zep", 94);
- ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 363, &_1);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(&width);
- zephir_array_fetch_long(&width, &tmp, 0, PH_NOISY, "phalcon/Validation/Validator/File/Resolution/Max.zep", 95);
- ZEPHIR_OBS_VAR(&height);
- zephir_array_fetch_long(&height, &tmp, 1, PH_NOISY, "phalcon/Validation/Validator/File/Resolution/Max.zep", 96);
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "resolution");
- ZEPHIR_CALL_METHOD(&resolution, this_ptr, "getoption", NULL, 0, &_2);
- zephir_check_call_status();
- if (Z_TYPE_P(&resolution) == IS_ARRAY) {
- zephir_array_fetch(&_3$$4, &resolution, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Resolution/Max.zep", 101);
- ZEPHIR_CPY_WRT(&resolution, &_3$$4);
+ 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();
}
- ZEPHIR_INIT_VAR(&resolutionArray);
- zephir_fast_explode_str(&resolutionArray, SL("x"), &resolution, LONG_MAX);
- ZEPHIR_OBS_VAR(&maxWidth);
- zephir_array_fetch_long(&maxWidth, &resolutionArray, 0, PH_NOISY, "phalcon/Validation/Validator/File/Resolution/Max.zep", 105);
- ZEPHIR_OBS_VAR(&maxHeight);
- zephir_array_fetch_long(&maxHeight, &resolutionArray, 1, PH_NOISY, "phalcon/Validation/Validator/File/Resolution/Max.zep", 106);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "included");
- ZEPHIR_CALL_METHOD(&included, this_ptr, "getoption", NULL, 0, &_2);
- zephir_check_call_status();
- if (Z_TYPE_P(&included) == IS_ARRAY) {
- ZEPHIR_OBS_VAR(&_4$$5);
- zephir_array_fetch(&_4$$5, &included, field, PH_NOISY, "phalcon/Validation/Validator/File/Resolution/Max.zep", 111);
- _5$$5 = zephir_get_boolval(&_4$$5);
- ZEPHIR_INIT_NVAR(&included);
- ZVAL_BOOL(&included, _5$$5);
+ if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) {
+ zephir_get_strval(&message, message_param);
} else {
- _6$$6 = zephir_get_boolval(&included);
- ZEPHIR_INIT_NVAR(&included);
- ZVAL_BOOL(&included, _6$$6);
+ ZEPHIR_INIT_VAR(&message);
}
- if (zephir_is_true(&included)) {
- _7$$7 = ZEPHIR_GE(&width, &maxWidth);
- if (!(_7$$7)) {
- _7$$7 = ZEPHIR_GE(&height, &maxHeight);
- }
- result = _7$$7;
+ if (!field) {
+ field = &field_sub;
+ ZEPHIR_INIT_VAR(field);
+ ZVAL_STRING(field, "");
+ }
+ if (!type_param) {
+ ZEPHIR_INIT_VAR(&type);
+ ZVAL_STRING(&type, "");
} else {
- _8$$8 = ZEPHIR_GT(&width, &maxWidth);
- if (!(_8$$8)) {
- _8$$8 = ZEPHIR_GT(&height, &maxHeight);
- }
- result = _8$$8;
+ zephir_get_strval(&type, type_param);
}
- if (Z_TYPE_P(&resolution) == IS_ARRAY) {
- zephir_array_fetch(&_9$$9, &resolution, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Resolution/Max.zep", 123);
- ZEPHIR_CPY_WRT(&resolution, &_9$$9);
+ if (!code_param) {
+ code = 0;
+ } else {
+ code = zephir_get_intval(code_param);
}
- if (result) {
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- zephir_array_update_string(&replacePairs, SL(":resolution"), &resolution, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_10$$10, this_ptr, "messagefactory", NULL, 0, validation, field, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_10$$10);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
+ if (!metaData_param) {
+ ZEPHIR_INIT_VAR(&metaData);
+ array_init(&metaData);
+ } else {
+ zephir_get_arrval(&metaData, metaData_param);
}
- RETURN_MM_BOOL(1);
+
+
+ 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);
+ ZEPHIR_INIT_ZVAL_NREF(_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)
+{
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
+ RETURN_MEMBER(getThis(), "message");
+}
+static PHP_METHOD(Phalcon_Messages_Message, jsonSerialize)
+{
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&_0);
+ ZEPHIR_MM_GROW();
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_File_Resolution_Min)
+ zephir_create_array(return_value, 5, 0);
+ ZEPHIR_OBS_VAR(&_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_Messages_Message, setCode)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator\\File\\Resolution, Min, phalcon, validation_validator_file_resolution_min, phalcon_validation_validator_file_abstractfile_ce, phalcon_validation_validator_file_resolution_min_method_entry, 0);
+ zval *code_param = NULL, _0;
+ zend_long code;
+ zval *this_ptr = getThis();
- zend_declare_property_string(phalcon_validation_validator_file_resolution_min_ce, SL("template"), "File :field can not have the minimum resolution of :resolution", ZEND_ACC_PROTECTED);
- return SUCCESS;
+ ZVAL_UNDEF(&_0);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(code)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &code_param);
+ code = zephir_get_intval(code_param);
+
+
+ ZEPHIR_INIT_ZVAL_NREF(_0);
+ ZVAL_LONG(&_0, code);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("code"), &_0);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_Resolution_Min, __construct)
+static PHP_METHOD(Phalcon_Messages_Message, setField)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *field, field_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&field_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(field)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
- } else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- }
+ zephir_fetch_params_without_memory_grow(1, 0, &field);
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_file_resolution_min_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("field"), field);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_Resolution_Min, validate)
+static PHP_METHOD(Phalcon_Messages_Message, setMessage)
{
- double _5$$5, _6$$6;
- zend_bool result = 0, _7$$7, _8$$8;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, height, minHeight, minWidth, resolution, resolutionArray, tmp, value, width, replacePairs, included, _0, _1, _2, _3$$4, _4$$5, _9$$9, _10$$10;
+ zval *message_param = NULL;
+ zval message;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&height);
- ZVAL_UNDEF(&minHeight);
- ZVAL_UNDEF(&minWidth);
- ZVAL_UNDEF(&resolution);
- ZVAL_UNDEF(&resolutionArray);
- ZVAL_UNDEF(&tmp);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&width);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&included);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_4$$5);
- ZVAL_UNDEF(&_9$$9);
- ZVAL_UNDEF(&_10$$10);
+ ZVAL_UNDEF(&message);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(message)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
-
-
- ZEPHIR_INIT_VAR(&included);
- ZVAL_BOOL(&included, 0);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkupload", NULL, 0, validation, field);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- zephir_array_fetch_string(&_1, &value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Resolution/Min.zep", 94);
- ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 363, &_1);
- zephir_check_call_status();
- ZEPHIR_OBS_VAR(&width);
- zephir_array_fetch_long(&width, &tmp, 0, PH_NOISY, "phalcon/Validation/Validator/File/Resolution/Min.zep", 95);
- ZEPHIR_OBS_VAR(&height);
- zephir_array_fetch_long(&height, &tmp, 1, PH_NOISY, "phalcon/Validation/Validator/File/Resolution/Min.zep", 96);
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "resolution");
- ZEPHIR_CALL_METHOD(&resolution, this_ptr, "getoption", NULL, 0, &_2);
- zephir_check_call_status();
- if (Z_TYPE_P(&resolution) == IS_ARRAY) {
- zephir_array_fetch(&_3$$4, &resolution, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Resolution/Min.zep", 101);
- ZEPHIR_CPY_WRT(&resolution, &_3$$4);
- }
- ZEPHIR_INIT_VAR(&resolutionArray);
- zephir_fast_explode_str(&resolutionArray, SL("x"), &resolution, LONG_MAX);
- ZEPHIR_OBS_VAR(&minWidth);
- zephir_array_fetch_long(&minWidth, &resolutionArray, 0, PH_NOISY, "phalcon/Validation/Validator/File/Resolution/Min.zep", 105);
- ZEPHIR_OBS_VAR(&minHeight);
- zephir_array_fetch_long(&minHeight, &resolutionArray, 1, PH_NOISY, "phalcon/Validation/Validator/File/Resolution/Min.zep", 106);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "included");
- ZEPHIR_CALL_METHOD(&included, this_ptr, "getoption", NULL, 0, &_2);
- zephir_check_call_status();
- if (Z_TYPE_P(&included) == IS_ARRAY) {
- ZEPHIR_OBS_VAR(&_4$$5);
- zephir_array_fetch(&_4$$5, &included, field, PH_NOISY, "phalcon/Validation/Validator/File/Resolution/Min.zep", 111);
- _5$$5 = zephir_get_boolval(&_4$$5);
- ZEPHIR_INIT_NVAR(&included);
- ZVAL_BOOL(&included, _5$$5);
- } else {
- _6$$6 = zephir_get_boolval(&included);
- ZEPHIR_INIT_NVAR(&included);
- ZVAL_BOOL(&included, _6$$6);
+ 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 (zephir_is_true(&included)) {
- _7$$7 = ZEPHIR_LE(&width, &minWidth);
- if (!(_7$$7)) {
- _7$$7 = ZEPHIR_LE(&height, &minHeight);
- }
- result = _7$$7;
+ if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) {
+ zephir_get_strval(&message, message_param);
} else {
- _8$$8 = ZEPHIR_LT(&width, &minWidth);
- if (!(_8$$8)) {
- _8$$8 = ZEPHIR_LT(&height, &minHeight);
- }
- result = _8$$8;
- }
- if (Z_TYPE_P(&resolution) == IS_ARRAY) {
- zephir_array_fetch(&_9$$9, &resolution, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Resolution/Min.zep", 123);
- ZEPHIR_CPY_WRT(&resolution, &_9$$9);
- }
- if (result) {
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- zephir_array_update_string(&replacePairs, SL(":resolution"), &resolution, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_10$$10, this_ptr, "messagefactory", NULL, 0, validation, field, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_10$$10);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
+ ZEPHIR_INIT_VAR(&message);
}
- RETURN_MM_BOOL(1);
-}
+ zephir_update_property_zval(this_ptr, ZEND_STRL("message"), &message);
+ RETURN_THIS();
+}
+static PHP_METHOD(Phalcon_Messages_Message, setMetaData)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *metaData_param = NULL;
+ zval metaData;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&metaData);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(metaData)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 1, 0, &metaData_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&metaData, metaData_param);
-
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_File_Size_Equal)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator\\File\\Size, Equal, phalcon, validation_validator_file_size_equal, phalcon_validation_validator_file_abstractfile_ce, phalcon_validation_validator_file_size_equal_method_entry, 0);
-
- zend_declare_property_string(phalcon_validation_validator_file_size_equal_ce, SL("template"), "File :field does not have the exact :size file size", ZEND_ACC_PROTECTED);
- return SUCCESS;
+ zephir_update_property_zval(this_ptr, ZEND_STRL("metaData"), &metaData);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_Size_Equal, __construct)
+static PHP_METHOD(Phalcon_Messages_Message, setType)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *type_param = NULL;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&type);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(type)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ 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_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_INIT_VAR(&type);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_file_size_equal_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &type);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_Size_Equal, validate)
+zend_object *zephir_init_properties_Phalcon_Messages_Message(zend_class_entry *class_type)
{
+ zval _0, _1$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, bytes, fileSize, replacePairs, size, value, _0, _1, _3, _4, _5, _6, _7, _2$$4, _8$$5;
- zval *this_ptr = getThis();
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&bytes);
- ZVAL_UNDEF(&fileSize);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&size);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_8$$5);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
- ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_MM_GROW();
+
+ {
+ 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("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("metaData"), &_1$$3);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
+ }
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkupload", NULL, 0, validation, field);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "size");
- ZEPHIR_CALL_METHOD(&size, this_ptr, "getoption", NULL, 0, &_1);
- zephir_check_call_status();
- if (Z_TYPE_P(&size) == IS_ARRAY) {
- zephir_array_fetch(&_2$$4, &size, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Size/Equal.zep", 95);
- ZEPHIR_CPY_WRT(&size, &_2$$4);
- }
- ZEPHIR_CALL_METHOD(&_3, this_ptr, "getfilesizeinbytes", NULL, 0, &size);
- zephir_check_call_status();
- ZVAL_LONG(&_4, 6);
- ZEPHIR_INIT_VAR(&bytes);
- zephir_round(&bytes, &_3, &_4, NULL);
- zephir_array_fetch_string(&_5, &value, SL("size"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Size/Equal.zep", 99);
- ZEPHIR_CALL_FUNCTION(&_6, "floatval", NULL, 18, &_5);
- zephir_check_call_status();
- ZVAL_LONG(&_7, 6);
- ZEPHIR_INIT_VAR(&fileSize);
- zephir_round(&fileSize, &_6, &_7, NULL);
- if (!ZEPHIR_IS_IDENTICAL(&bytes, &fileSize)) {
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- zephir_array_update_string(&replacePairs, SL(":size"), &size, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_8$$5, this_ptr, "messagefactory", NULL, 0, validation, field, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_8$$5);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+
+ZEPHIR_INIT_CLASS(Phalcon_Messages_MessageInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Messages, MessageInterface, phalcon, messages_messageinterface, phalcon_messages_messageinterface_method_entry);
+
+ return SUCCESS;
}
+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);
@@ -216032,570 +216147,479 @@ static PHP_METHOD(Phalcon_Validation_Validator_File_Size_Equal, validate)
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_File_Size_Max)
+ZEPHIR_INIT_CLASS(Phalcon_Messages_Messages)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator\\File\\Size, Max, phalcon, validation_validator_file_size_max, phalcon_validation_validator_file_abstractfile_ce, phalcon_validation_validator_file_size_max_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Messages, Messages, phalcon, messages_messages, phalcon_messages_messages_method_entry, 0);
- zend_declare_property_string(phalcon_validation_validator_file_size_max_ce, SL("template"), "File :field exceeds the size of :size", ZEND_ACC_PROTECTED);
+ 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, zephir_get_internal_ce(SL("jsonserializable")));
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_Size_Max, __construct)
+static PHP_METHOD(Phalcon_Messages_Messages, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *messages_param = NULL;
+ zval messages;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&messages);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_ARRAY(messages)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 0, 1, &messages_param);
+ if (!messages_param) {
+ ZEPHIR_INIT_VAR(&messages);
+ array_init(&messages);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_get_arrval(&messages, messages_param);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_file_size_max_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("messages"), &messages);
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_Size_Max, validate)
+static PHP_METHOD(Phalcon_Messages_Messages, appendMessage)
{
- double _9$$5, _10$$6;
- zend_bool result = 0;
+ zval *message, message_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&message_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(message, phalcon_messages_messageinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ zephir_fetch_params_without_memory_grow(1, 0, &message);
+
+
+ zephir_update_property_array_append(this_ptr, SL("messages"), message);
+}
+
+static PHP_METHOD(Phalcon_Messages_Messages, appendMessages)
+{
+ 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 *validation, validation_sub, *field, field_sub, bytes, fileSize, included, replacePairs, size, value, _0, _1, _3, _4, _5, _6, _7, _2$$4, _8$$5, _11$$9;
+ zval *messages, messages_sub, currentMessages, finalMessages, message, _1$$7;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&bytes);
- ZVAL_UNDEF(&fileSize);
- ZVAL_UNDEF(&included);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&size);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_8$$5);
- ZVAL_UNDEF(&_11$$9);
+ ZVAL_UNDEF(&messages_sub);
+ ZVAL_UNDEF(¤tMessages);
+ ZVAL_UNDEF(&finalMessages);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_1$$7);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(messages)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ zephir_fetch_params(1, 1, 0, &messages);
- ZEPHIR_INIT_VAR(&included);
- ZVAL_BOOL(&included, 0);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkupload", NULL, 0, validation, field);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "size");
- ZEPHIR_CALL_METHOD(&size, this_ptr, "getoption", NULL, 0, &_1);
- zephir_check_call_status();
- if (Z_TYPE_P(&size) == IS_ARRAY) {
- zephir_array_fetch(&_2$$4, &size, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Size/Max.zep", 96);
- ZEPHIR_CPY_WRT(&size, &_2$$4);
+ _0 = Z_TYPE_P(messages) != IS_ARRAY;
+ if (_0) {
+ _0 = Z_TYPE_P(messages) != IS_OBJECT;
}
- ZEPHIR_CALL_METHOD(&_3, this_ptr, "getfilesizeinbytes", NULL, 0, &size);
- zephir_check_call_status();
- ZVAL_LONG(&_4, 6);
- ZEPHIR_INIT_VAR(&bytes);
- zephir_round(&bytes, &_3, &_4, NULL);
- zephir_array_fetch_string(&_5, &value, SL("size"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Size/Max.zep", 100);
- ZEPHIR_CALL_FUNCTION(&_6, "floatval", NULL, 18, &_5);
- zephir_check_call_status();
- ZVAL_LONG(&_7, 6);
- ZEPHIR_INIT_VAR(&fileSize);
- zephir_round(&fileSize, &_6, &_7, NULL);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "included");
- ZEPHIR_CALL_METHOD(&included, this_ptr, "getoption", NULL, 0, &_1);
- zephir_check_call_status();
- if (Z_TYPE_P(&included) == IS_ARRAY) {
- ZEPHIR_OBS_VAR(&_8$$5);
- zephir_array_fetch(&_8$$5, &included, field, PH_NOISY, "phalcon/Validation/Validator/File/Size/Max.zep", 105);
- _9$$5 = zephir_get_boolval(&_8$$5);
- ZEPHIR_INIT_NVAR(&included);
- ZVAL_BOOL(&included, _9$$5);
- } else {
- _10$$6 = zephir_get_boolval(&included);
- ZEPHIR_INIT_NVAR(&included);
- ZVAL_BOOL(&included, _10$$6);
+ if (_0) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_messages_exception_ce, "The messages must be array or object", "phalcon/Messages/Messages.zep", 69);
+ return;
}
- if (zephir_is_true(&included)) {
- result = ZEPHIR_GE(&fileSize, &bytes);
+ ZEPHIR_OBS_VAR(¤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 {
- result = ZEPHIR_GT(&fileSize, &bytes);
- }
- if (result) {
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- zephir_array_update_string(&replacePairs, SL(":size"), &size, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_11$$9, this_ptr, "messagefactory", NULL, 0, validation, field, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_11$$9);
+ ZEPHIR_CALL_METHOD(NULL, messages, "rewind", NULL, 0);
zephir_check_call_status();
- RETURN_MM_BOOL(0);
+ 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_BOOL(1);
+ ZEPHIR_MM_RESTORE();
}
+static PHP_METHOD(Phalcon_Messages_Messages, count)
+{
+ zval _0;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&_0);
-#ifdef HAVE_CONFIG_H
-#endif
+ 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_Messages_Messages, current)
+{
+ zval _0, _1, _2;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_File_Size_Min)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator\\File\\Size, Min, phalcon, validation_validator_file_size_min, phalcon_validation_validator_file_abstractfile_ce, phalcon_validation_validator_file_size_min_method_entry, 0);
+ ZEPHIR_MM_GROW();
- zend_declare_property_string(phalcon_validation_validator_file_size_min_ce, SL("template"), "File :field can not have the minimum size of :size", ZEND_ACC_PROTECTED);
- return SUCCESS;
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_OBS_VAR(&_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_Validation_Validator_File_Size_Min, __construct)
+static PHP_METHOD(Phalcon_Messages_Messages, filter)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *fieldName_param = NULL, filtered, messages, message, _0, *_1$$3, _2$$3, _3$$5, _4$$8;
+ zval fieldName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&fieldName);
+ ZVAL_UNDEF(&filtered);
+ ZVAL_UNDEF(&messages);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&_4$$8);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(fieldName)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ 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(fieldName_param) == IS_STRING)) {
+ zephir_get_strval(&fieldName, fieldName_param);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_INIT_VAR(&fieldName);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_file_size_min_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ 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_INIT_NVAR(&message);
+ }
+ RETURN_CCTOR(&filtered);
}
-static PHP_METHOD(Phalcon_Validation_Validator_File_Size_Min, validate)
+static PHP_METHOD(Phalcon_Messages_Messages, jsonSerialize)
{
- double _9$$5, _10$$6;
- zend_bool result = 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 *validation, validation_sub, *field, field_sub, bytes, fileSize, included, replacePairs, size, value, _0, _1, _3, _4, _5, _6, _7, _2$$4, _8$$5, _11$$9;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&bytes);
- ZVAL_UNDEF(&fileSize);
- ZVAL_UNDEF(&included);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&size);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&message);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_8$$5);
- ZVAL_UNDEF(&_11$$9);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
- ZEND_PARSE_PARAMETERS_END();
-#endif
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&records);
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
-
- ZEPHIR_INIT_VAR(&included);
- ZVAL_BOOL(&included, 0);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkupload", NULL, 0, validation, field);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "size");
- ZEPHIR_CALL_METHOD(&size, this_ptr, "getoption", NULL, 0, &_1);
- zephir_check_call_status();
- if (Z_TYPE_P(&size) == IS_ARRAY) {
- zephir_array_fetch(&_2$$4, &size, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Size/Min.zep", 96);
- ZEPHIR_CPY_WRT(&size, &_2$$4);
- }
- ZEPHIR_CALL_METHOD(&_3, this_ptr, "getfilesizeinbytes", NULL, 0, &size);
- zephir_check_call_status();
- ZVAL_LONG(&_4, 6);
- ZEPHIR_INIT_VAR(&bytes);
- zephir_round(&bytes, &_3, &_4, NULL);
- zephir_array_fetch_string(&_5, &value, SL("size"), PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/File/Size/Min.zep", 100);
- ZEPHIR_CALL_FUNCTION(&_6, "floatval", NULL, 18, &_5);
- zephir_check_call_status();
- ZVAL_LONG(&_7, 6);
- ZEPHIR_INIT_VAR(&fileSize);
- zephir_round(&fileSize, &_6, &_7, NULL);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "included");
- ZEPHIR_CALL_METHOD(&included, this_ptr, "getoption", NULL, 0, &_1);
- zephir_check_call_status();
- if (Z_TYPE_P(&included) == IS_ARRAY) {
- ZEPHIR_OBS_VAR(&_8$$5);
- zephir_array_fetch(&_8$$5, &included, field, PH_NOISY, "phalcon/Validation/Validator/File/Size/Min.zep", 105);
- _9$$5 = zephir_get_boolval(&_8$$5);
- ZEPHIR_INIT_NVAR(&included);
- ZVAL_BOOL(&included, _9$$5);
- } else {
- _10$$6 = zephir_get_boolval(&included);
- ZEPHIR_INIT_NVAR(&included);
- ZVAL_BOOL(&included, _10$$6);
- }
- if (zephir_is_true(&included)) {
- result = ZEPHIR_GE(&fileSize, &bytes);
+ 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 {
- result = ZEPHIR_GT(&fileSize, &bytes);
- }
- if (result) {
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- zephir_array_update_string(&replacePairs, SL(":size"), &size, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_11$$9, this_ptr, "messagefactory", NULL, 0, validation, field, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_11$$9);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0);
zephir_check_call_status();
- RETURN_MM_BOOL(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_MM_BOOL(1);
+ ZEPHIR_INIT_NVAR(&message);
+ RETURN_CTOR(&records);
}
+static PHP_METHOD(Phalcon_Messages_Messages, key)
+{
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
-
-
+ RETURN_MEMBER(getThis(), "position");
+}
+static PHP_METHOD(Phalcon_Messages_Messages, next)
+{
+ zval *this_ptr = getThis();
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_StringLength_Max)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator\\StringLength, Max, phalcon, validation_validator_stringlength_max, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_stringlength_max_method_entry, 0);
- zend_declare_property_string(phalcon_validation_validator_stringlength_max_ce, SL("template"), "Field :field must not exceed :max characters long", ZEND_ACC_PROTECTED);
- return SUCCESS;
+ RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("position")));
}
-static PHP_METHOD(Phalcon_Validation_Validator_StringLength_Max, __construct)
+static PHP_METHOD(Phalcon_Messages_Messages, offsetExists)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *index, index_sub, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(index)
ZEND_PARSE_PARAMETERS_END();
#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
- } else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- }
+ zephir_fetch_params_without_memory_grow(1, 0, &index);
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_stringlength_max_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ 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_Validation_Validator_StringLength_Max, validate)
+static PHP_METHOD(Phalcon_Messages_Messages, offsetGet)
{
- double _3$$6, _4$$7;
- zend_bool result = 0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, value, length, maximum, replacePairs, included, _0, _1$$5, _2$$6, _5$$10;
+ zval *index, index_sub, message, returnValue, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&length);
- ZVAL_UNDEF(&maximum);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&included);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&returnValue);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$5);
- ZVAL_UNDEF(&_2$$6);
- ZVAL_UNDEF(&_5$$10);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(index)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ zephir_fetch_params(1, 1, 0, &index);
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- if ((zephir_function_exists_ex(ZEND_STRL("mb_strlen")) == SUCCESS)) {
- ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 281, &value);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&length);
- ZVAL_LONG(&length, zephir_fast_strlen_ev(&value));
- }
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "max");
- ZEPHIR_CALL_METHOD(&maximum, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (Z_TYPE_P(&maximum) == IS_ARRAY) {
- zephir_array_fetch(&_1$$5, &maximum, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/StringLength/Max.zep", 103);
- ZEPHIR_CPY_WRT(&maximum, &_1$$5);
- }
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "included");
- ZEPHIR_CALL_METHOD(&included, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (Z_TYPE_P(&included) == IS_ARRAY) {
- ZEPHIR_OBS_VAR(&_2$$6);
- zephir_array_fetch(&_2$$6, &included, field, PH_NOISY, "phalcon/Validation/Validator/StringLength/Max.zep", 109);
- _3$$6 = zephir_get_boolval(&_2$$6);
- ZEPHIR_INIT_NVAR(&included);
- ZVAL_BOOL(&included, _3$$6);
- } else {
- _4$$7 = zephir_get_boolval(&included);
- ZEPHIR_INIT_NVAR(&included);
- ZVAL_BOOL(&included, _4$$7);
- }
- if (zephir_is_true(&included)) {
- result = ZEPHIR_GE(&length, &maximum);
- } else {
- result = ZEPHIR_GT(&length, &maximum);
- }
- if (result) {
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- zephir_array_update_string(&replacePairs, SL(":max"), &maximum, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_5$$10, this_ptr, "messagefactory", NULL, 0, validation, field, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_5$$10);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
+ ZEPHIR_INIT_VAR(&returnValue);
+ ZVAL_NULL(&returnValue);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset_fetch(&message, &_0, index, 1)) {
+ ZEPHIR_CPY_WRT(&returnValue, &message);
}
- RETURN_MM_BOOL(1);
+ RETURN_CCTOR(&returnValue);
}
+static PHP_METHOD(Phalcon_Messages_Messages, offsetSet)
+{
+ zval *index, index_sub, *message, message_sub;
+ zval *this_ptr = getThis();
-
-
-#ifdef HAVE_CONFIG_H
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&message_sub);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ZVAL(index)
+ Z_PARAM_ZVAL(message)
+ ZEND_PARSE_PARAMETERS_END();
#endif
+ zephir_fetch_params_without_memory_grow(2, 0, &index, &message);
-
-ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_StringLength_Min)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator\\StringLength, Min, phalcon, validation_validator_stringlength_min, phalcon_validation_abstractvalidator_ce, phalcon_validation_validator_stringlength_min_method_entry, 0);
-
- zend_declare_property_string(phalcon_validation_validator_stringlength_min_ce, SL("template"), "Field :field must be at least :min characters long", ZEND_ACC_PROTECTED);
- return SUCCESS;
+ if (Z_TYPE_P(message) != IS_OBJECT) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_messages_exception_ce, "The message must be an object", "phalcon/Messages/Messages.zep", 241);
+ return;
+ }
+ zephir_update_property_array(this_ptr, SL("messages"), index, message);
}
-static PHP_METHOD(Phalcon_Validation_Validator_StringLength_Min, __construct)
+static PHP_METHOD(Phalcon_Messages_Messages, offsetUnset)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_0 = NULL;
- zval *options_param = NULL;
- zval options;
+ zval *index, index_sub, _0, _1$$3, _2$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(index)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &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, &index);
- ZEPHIR_CALL_PARENT(NULL, phalcon_validation_validator_stringlength_min_ce, getThis(), "__construct", &_0, 0, &options);
- zephir_check_call_status();
+ 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, 420, &_1$$3, index, &_2$$3);
+ ZEPHIR_UNREF(&_1$$3);
+ zephir_check_call_status();
+ }
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Validation_Validator_StringLength_Min, validate)
+static PHP_METHOD(Phalcon_Messages_Messages, rewind)
{
- double _3$$6, _4$$7;
- zend_bool result = 0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *validation, validation_sub, *field, field_sub, value, length, minimum, replacePairs, included, _0, _1$$5, _2$$6, _5$$10;
+ zval _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validation_sub);
- ZVAL_UNDEF(&field_sub);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&length);
- ZVAL_UNDEF(&minimum);
- ZVAL_UNDEF(&replacePairs);
- ZVAL_UNDEF(&included);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$5);
- ZVAL_UNDEF(&_2$$6);
- ZVAL_UNDEF(&_5$$10);
-#if PHP_VERSION_ID >= 80000
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_validation_ce)
- Z_PARAM_ZVAL(field)
- ZEND_PARSE_PARAMETERS_END();
-#endif
- ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 2, 0, &validation, &field);
+ ZEPHIR_INIT_ZVAL_NREF(_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();
- ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
- zephir_check_call_status();
- if ((zephir_function_exists_ex(ZEND_STRL("mb_strlen")) == SUCCESS)) {
- ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 281, &value);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&length);
- ZVAL_LONG(&length, zephir_fast_strlen_ev(&value));
- }
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "min");
- ZEPHIR_CALL_METHOD(&minimum, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (Z_TYPE_P(&minimum) == IS_ARRAY) {
- zephir_array_fetch(&_1$$5, &minimum, field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator/StringLength/Min.zep", 103);
- ZEPHIR_CPY_WRT(&minimum, &_1$$5);
- }
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "included");
- ZEPHIR_CALL_METHOD(&included, this_ptr, "getoption", NULL, 0, &_0);
- zephir_check_call_status();
- if (Z_TYPE_P(&included) == IS_ARRAY) {
- ZEPHIR_OBS_VAR(&_2$$6);
- zephir_array_fetch(&_2$$6, &included, field, PH_NOISY, "phalcon/Validation/Validator/StringLength/Min.zep", 109);
- _3$$6 = zephir_get_boolval(&_2$$6);
- ZEPHIR_INIT_NVAR(&included);
- ZVAL_BOOL(&included, _3$$6);
- } else {
- _4$$7 = zephir_get_boolval(&included);
- ZEPHIR_INIT_NVAR(&included);
- ZVAL_BOOL(&included, _4$$7);
- }
- if (zephir_is_true(&included)) {
- result = ZEPHIR_LE(&length, &minimum);
- } else {
- result = ZEPHIR_LT(&length, &minimum);
- }
- if (result) {
- ZEPHIR_INIT_VAR(&replacePairs);
- zephir_create_array(&replacePairs, 1, 0);
- zephir_array_update_string(&replacePairs, SL(":min"), &minimum, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_5$$10, this_ptr, "messagefactory", NULL, 0, validation, field, &replacePairs);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_5$$10);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
- }
- RETURN_MM_BOOL(1);
+ 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));
}
diff --git a/build/phalcon/phalcon.zep.h b/build/phalcon/phalcon.zep.h
index 848c133cced..9926a1cfbf3 100644
--- a/build/phalcon/phalcon.zep.h
+++ b/build/phalcon/phalcon.zep.h
@@ -1996,18 +1996,19 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterf
ZEND_ARG_TYPE_INFO(0, nesting, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterface_close, 0, 0, _IS_BOOL, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterface_close, 0, 0, IS_VOID, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterface_commit, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, nesting, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterface_connect, 0, 0, _IS_BOOL, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterface_connect, 0, 0, IS_VOID, 0)
+
#if PHP_VERSION_ID >= 80000
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 1, "[]")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 0, "[]")
#else
- ZEND_ARG_ARRAY_INFO(0, descriptor, 1)
+ ZEND_ARG_ARRAY_INFO(0, descriptor, 0)
#endif
ZEND_END_ARG_INFO()
@@ -2225,7 +2226,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterf
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_adapterinterface_lastinsertid, 0, 0, 0)
- ZEND_ARG_INFO(0, sequenceName)
+ ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterface_limit, 0, 2, IS_STRING, 0)
@@ -4135,14 +4136,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractp
ZEND_ARG_TYPE_INFO(0, nesting, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_close, 0, 0, _IS_BOOL, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_close, 0, 0, IS_VOID, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_connect, 0, 0, _IS_BOOL, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_connect, 0, 0, IS_VOID, 0)
+
#if PHP_VERSION_ID >= 80000
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 1, "[]")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 0, "[]")
#else
- ZEND_ARG_ARRAY_INFO(0, descriptor, 1)
+ ZEND_ARG_ARRAY_INFO(0, descriptor, 0)
#endif
ZEND_END_ARG_INFO()
@@ -4179,7 +4181,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpd
ZEND_ARG_INFO(0, dataTypes)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_geterrorinfo, 0, 0, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_geterrorinfo, 0, 0, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_getinternalhandler, 0, 0, PDO, 0)
@@ -4192,7 +4194,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractp
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_lastinsertid, 0, 0, 0)
- ZEND_ARG_INFO(0, sequenceName)
+ ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_prepare, 0, 1, PDOStatement, 0)
@@ -4237,11 +4239,7 @@ ZEPHIR_INIT_FUNCS(phalcon_db_adapter_pdo_abstractpdo_method_entry) {
PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, escapeString, arginfo_phalcon_db_adapter_pdo_abstractpdo_escapestring, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, execute, arginfo_phalcon_db_adapter_pdo_abstractpdo_execute, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, executePrepared, arginfo_phalcon_db_adapter_pdo_abstractpdo_executeprepared, ZEND_ACC_PUBLIC)
-#if PHP_VERSION_ID >= 80000
PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, getErrorInfo, arginfo_phalcon_db_adapter_pdo_abstractpdo_geterrorinfo, ZEND_ACC_PUBLIC)
-#else
- PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, getErrorInfo, NULL, ZEND_ACC_PUBLIC)
-#endif
PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, getInternalHandler, arginfo_phalcon_db_adapter_pdo_abstractpdo_getinternalhandler, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, getTransactionLevel, arginfo_phalcon_db_adapter_pdo_abstractpdo_gettransactionlevel, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, isUnderTransaction, arginfo_phalcon_db_adapter_pdo_abstractpdo_isundertransaction, ZEND_ACC_PUBLIC)
@@ -15297,11 +15295,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql___construct, 0,
ZEND_ARG_ARRAY_INFO(0, descriptor, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_connect, 0, 0, _IS_BOOL, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_connect, 0, 0, IS_VOID, 0)
+
#if PHP_VERSION_ID >= 80000
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 1, "[]")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 0, "[]")
#else
- ZEND_ARG_ARRAY_INFO(0, descriptor, 1)
+ ZEND_ARG_ARRAY_INFO(0, descriptor, 0)
#endif
ZEND_END_ARG_INFO()
@@ -15372,11 +15371,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite___construct, 0, 0,
ZEND_ARG_ARRAY_INFO(0, descriptor, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_connect, 0, 0, _IS_BOOL, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_connect, 0, 0, IS_VOID, 0)
+
#if PHP_VERSION_ID >= 80000
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 1, "[]")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 0, "[]")
#else
- ZEND_ARG_ARRAY_INFO(0, descriptor, 1)
+ ZEND_ARG_ARRAY_INFO(0, descriptor, 0)
#endif
ZEND_END_ARG_INFO()
@@ -28040,6 +28040,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Builder);
static PHP_METHOD(Phalcon_Security_JWT_Builder, __construct);
static PHP_METHOD(Phalcon_Security_JWT_Builder, init);
+static PHP_METHOD(Phalcon_Security_JWT_Builder, addClaim);
static PHP_METHOD(Phalcon_Security_JWT_Builder, getAudience);
static PHP_METHOD(Phalcon_Security_JWT_Builder, getClaims);
static PHP_METHOD(Phalcon_Security_JWT_Builder, getContentType);
@@ -28070,6 +28071,11 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_security_jwt_builder_init, 0, 0, Phalcon\\Security\\JWT\\Builder, 0)
ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_security_jwt_builder_addclaim, 0, 2, Phalcon\\Security\\JWT\\Builder, 0)
+ ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_jwt_builder_getaudience, 0, 0, 0)
ZEND_END_ARG_INFO()
@@ -28150,6 +28156,7 @@ ZEND_END_ARG_INFO()
ZEPHIR_INIT_FUNCS(phalcon_security_jwt_builder_method_entry) {
PHP_ME(Phalcon_Security_JWT_Builder, __construct, arginfo_phalcon_security_jwt_builder___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_ME(Phalcon_Security_JWT_Builder, init, arginfo_phalcon_security_jwt_builder_init, ZEND_ACC_PUBLIC)
+ PHP_ME(Phalcon_Security_JWT_Builder, addClaim, arginfo_phalcon_security_jwt_builder_addclaim, ZEND_ACC_PUBLIC)
#if PHP_VERSION_ID >= 80000
PHP_ME(Phalcon_Security_JWT_Builder, getAudience, arginfo_phalcon_security_jwt_builder_getaudience, ZEND_ACC_PUBLIC)
#else
diff --git a/build/phalcon/php_phalcon.h b/build/phalcon/php_phalcon.h
index e9d5422c5d1..ccd3177c9a0 100644
--- a/build/phalcon/php_phalcon.h
+++ b/build/phalcon/php_phalcon.h
@@ -103,18 +103,18 @@ typedef zend_function zephir_fcall_cache_entry;
#define PHP_PHALCON_NAME "phalcon"
-#define PHP_PHALCON_VERSION "5.0.0alpha5"
+#define PHP_PHALCON_VERSION "5.0.0alpha6"
#define PHP_PHALCON_EXTNAME "phalcon"
#define PHP_PHALCON_AUTHOR "Phalcon Team and contributors"
#define PHP_PHALCON_ZEPVERSION "0.14.0-beta.3-0be9ad5"
#define PHP_PHALCON_DESCRIPTION "Phalcon is a full stack PHP framework, delivered as a PHP extension, offering lower resource consumption and high performance."
-typedef struct _zephir_struct_db {
+typedef struct _zephir_struct_db {
zend_bool escape_identifiers;
zend_bool force_casting;
} zephir_struct_db;
-typedef struct _zephir_struct_orm {
+typedef struct _zephir_struct_orm {
HashTable* ast_cache;
int cache_level;
zend_bool case_insensitive_column_map;
@@ -137,7 +137,7 @@ typedef struct _zephir_struct_orm {
zend_bool virtual_foreign_keys;
} zephir_struct_orm;
-typedef struct _zephir_struct_warning {
+typedef struct _zephir_struct_warning {
zend_bool enable;
} zephir_struct_warning;
@@ -158,7 +158,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phalcon)
/* Max recursion control */
unsigned int recursive_lock;
-
+
zephir_struct_db db;
zephir_struct_orm orm;
diff --git a/config.json b/config.json
index 9d182500000..61c43550153 100644
--- a/config.json
+++ b/config.json
@@ -3,7 +3,7 @@
"name": "phalcon",
"description": "Phalcon is a full stack PHP framework, delivered as a PHP extension, offering lower resource consumption and high performance.",
"author": "Phalcon Team and contributors",
- "version": "5.0.0alpha5",
+ "version": "5.0.0alpha6",
"verbose": false,
"stubs": {
"path": "ide\/%version%\/%namespace%\/",
diff --git a/ext/phalcon/db/adapter/adapterinterface.zep.c b/ext/phalcon/db/adapter/adapterinterface.zep.c
index 7f01d21a474..44f9da0ab5c 100644
--- a/ext/phalcon/db/adapter/adapterinterface.zep.c
+++ b/ext/phalcon/db/adapter/adapterinterface.zep.c
@@ -282,6 +282,8 @@ ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, isUnderTransaction);
/**
* Returns insert id for the auto_increment column inserted in the last SQL
* statement
+ *
+ * @param string|null $name Name of the sequence object from which the ID should be returned.
*/
ZEPHIR_DOC_METHOD(Phalcon_Db_Adapter_AdapterInterface, lastInsertId);
/**
diff --git a/ext/phalcon/db/adapter/adapterinterface.zep.h b/ext/phalcon/db/adapter/adapterinterface.zep.h
index 994f2c36a12..8be7b955895 100644
--- a/ext/phalcon/db/adapter/adapterinterface.zep.h
+++ b/ext/phalcon/db/adapter/adapterinterface.zep.h
@@ -34,18 +34,19 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterf
ZEND_ARG_TYPE_INFO(0, nesting, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterface_close, 0, 0, _IS_BOOL, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterface_close, 0, 0, IS_VOID, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterface_commit, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, nesting, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterface_connect, 0, 0, _IS_BOOL, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterface_connect, 0, 0, IS_VOID, 0)
+
#if PHP_VERSION_ID >= 80000
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 1, "[]")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 0, "[]")
#else
- ZEND_ARG_ARRAY_INFO(0, descriptor, 1)
+ ZEND_ARG_ARRAY_INFO(0, descriptor, 0)
#endif
ZEND_END_ARG_INFO()
@@ -263,7 +264,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterf
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_adapterinterface_lastinsertid, 0, 0, 0)
- ZEND_ARG_INFO(0, sequenceName)
+ ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_adapterinterface_limit, 0, 2, IS_STRING, 0)
diff --git a/ext/phalcon/db/adapter/pdo/abstractpdo.zep.c b/ext/phalcon/db/adapter/pdo/abstractpdo.zep.c
index 2c133c5cbd5..5ac3e730415 100644
--- a/ext/phalcon/db/adapter/pdo/abstractpdo.zep.c
+++ b/ext/phalcon/db/adapter/pdo/abstractpdo.zep.c
@@ -143,19 +143,18 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, begin)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS, transactionLevel = 0;
- zval *nesting_param = NULL, pdo, eventsManager, savepointName, _0, _1, _6, _2$$4, _3$$5, _7$$7;
- zend_bool nesting, _4, _5;
+ zval *nesting_param = NULL, eventsManager, savepointName, _0, _5, _6, _1$$3, _2$$4, _7$$6;
+ zend_bool nesting, _3, _4;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pdo);
ZVAL_UNDEF(&eventsManager);
ZVAL_UNDEF(&savepointName);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_5);
ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_1$$3);
ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$5);
- ZVAL_UNDEF(&_7$$7);
+ ZVAL_UNDEF(&_7$$6);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
@@ -174,49 +173,45 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, begin)
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&pdo, &_0);
- if (Z_TYPE_P(&pdo) != IS_OBJECT) {
- RETURN_MM_BOOL(0);
- }
RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("transactionLevel")));
- ZEPHIR_OBS_VAR(&_1);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("transactionLevel"), PH_NOISY_CC);
- transactionLevel = zephir_get_intval(&_1);
+ ZEPHIR_OBS_VAR(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("transactionLevel"), PH_NOISY_CC);
+ transactionLevel = zephir_get_intval(&_0);
if (transactionLevel == 1) {
- zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&eventsManager, &_2$$4);
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&eventsManager, &_1$$3);
if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
- ZEPHIR_INIT_VAR(&_3$$5);
- ZVAL_STRING(&_3$$5, "db:beginTransaction");
- ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_3$$5, this_ptr);
+ ZEPHIR_INIT_VAR(&_2$$4);
+ ZVAL_STRING(&_2$$4, "db:beginTransaction");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_2$$4, this_ptr);
zephir_check_call_status();
}
- ZEPHIR_RETURN_CALL_METHOD(&pdo, "begintransaction", NULL, 0);
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_1$$3, "begintransaction", NULL, 0);
zephir_check_call_status();
RETURN_MM();
}
- _4 = !transactionLevel;
- if (!(_4)) {
- _4 = !nesting;
+ _3 = !transactionLevel;
+ if (!(_3)) {
+ _3 = !nesting;
}
- _5 = _4;
- if (!(_5)) {
- ZEPHIR_CALL_METHOD(&_6, this_ptr, "isnestedtransactionswithsavepoints", NULL, 0);
+ _4 = _3;
+ if (!(_4)) {
+ ZEPHIR_CALL_METHOD(&_5, this_ptr, "isnestedtransactionswithsavepoints", NULL, 0);
zephir_check_call_status();
- _5 = !zephir_is_true(&_6);
+ _4 = !zephir_is_true(&_5);
}
- if (_5) {
+ if (_4) {
RETURN_MM_BOOL(0);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&eventsManager, &_0);
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&eventsManager, &_6);
ZEPHIR_CALL_METHOD(&savepointName, this_ptr, "getnestedtransactionsavepointname", NULL, 0);
zephir_check_call_status();
if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
- ZEPHIR_INIT_VAR(&_7$$7);
- ZVAL_STRING(&_7$$7, "db:createSavepoint");
- ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_7$$7, this_ptr, &savepointName);
+ ZEPHIR_INIT_VAR(&_7$$6);
+ ZVAL_STRING(&_7$$6, "db:createSavepoint");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_7$$6, this_ptr, &savepointName);
zephir_check_call_status();
}
ZEPHIR_RETURN_CALL_METHOD(this_ptr, "createsavepoint", NULL, 0, &savepointName);
@@ -231,19 +226,18 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, commit)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS, transactionLevel = 0;
- zval *nesting_param = NULL, pdo, eventsManager, savepointName, _0, _1, _6, _2$$5, _3$$6, _7$$9;
- zend_bool nesting, _4, _5;
+ zval *nesting_param = NULL, eventsManager, savepointName, _0, _5, _6, _1$$4, _2$$5, _7$$8;
+ zend_bool nesting, _3, _4;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pdo);
ZVAL_UNDEF(&eventsManager);
ZVAL_UNDEF(&savepointName);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_5);
ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_1$$4);
ZVAL_UNDEF(&_2$$5);
- ZVAL_UNDEF(&_3$$6);
- ZVAL_UNDEF(&_7$$9);
+ ZVAL_UNDEF(&_7$$8);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
@@ -262,56 +256,52 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, commit)
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&pdo, &_0);
- if (Z_TYPE_P(&pdo) != IS_OBJECT) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_OBS_VAR(&_1);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("transactionLevel"), PH_NOISY_CC);
- transactionLevel = zephir_get_intval(&_1);
+ ZEPHIR_OBS_VAR(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("transactionLevel"), PH_NOISY_CC);
+ transactionLevel = zephir_get_intval(&_0);
if (UNEXPECTED(!transactionLevel)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "There is no active transaction", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 164);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "There is no active transaction", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 154);
return;
}
if (transactionLevel == 1) {
- zephir_read_property(&_2$$5, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&eventsManager, &_2$$5);
+ zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&eventsManager, &_1$$4);
if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
- ZEPHIR_INIT_VAR(&_3$$6);
- ZVAL_STRING(&_3$$6, "db:commitTransaction");
- ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_3$$6, this_ptr);
+ ZEPHIR_INIT_VAR(&_2$$5);
+ ZVAL_STRING(&_2$$5, "db:commitTransaction");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_2$$5, this_ptr);
zephir_check_call_status();
}
RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel")));
- ZEPHIR_RETURN_CALL_METHOD(&pdo, "commit", NULL, 0);
+ zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_1$$4, "commit", NULL, 0);
zephir_check_call_status();
RETURN_MM();
}
- _4 = !transactionLevel;
- if (!(_4)) {
- _4 = !nesting;
+ _3 = !transactionLevel;
+ if (!(_3)) {
+ _3 = !nesting;
}
- _5 = _4;
- if (!(_5)) {
- ZEPHIR_CALL_METHOD(&_6, this_ptr, "isnestedtransactionswithsavepoints", NULL, 0);
+ _4 = _3;
+ if (!(_4)) {
+ ZEPHIR_CALL_METHOD(&_5, this_ptr, "isnestedtransactionswithsavepoints", NULL, 0);
zephir_check_call_status();
- _5 = !zephir_is_true(&_6);
+ _4 = !zephir_is_true(&_5);
}
- if (_5) {
+ if (_4) {
if (transactionLevel > 0) {
RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel")));
}
RETURN_MM_BOOL(0);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&eventsManager, &_0);
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&eventsManager, &_6);
ZEPHIR_CALL_METHOD(&savepointName, this_ptr, "getnestedtransactionsavepointname", NULL, 0);
zephir_check_call_status();
if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
- ZEPHIR_INIT_VAR(&_7$$9);
- ZVAL_STRING(&_7$$9, "db:releaseSavepoint");
- ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_7$$9, this_ptr, &savepointName);
+ ZEPHIR_INIT_VAR(&_7$$8);
+ ZVAL_STRING(&_7$$8, "db:releaseSavepoint");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_7$$8, this_ptr, &savepointName);
zephir_check_call_status();
}
RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel")));
@@ -334,7 +324,6 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, close)
zephir_update_property_zval(this_ptr, ZEND_STRL("pdo"), &__$null);
- RETURN_BOOL(1);
}
/**
@@ -363,19 +352,19 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, close)
*/
PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, connect)
{
- zend_string *_8;
- zend_ulong _7;
+ zend_string *_9;
+ zend_ulong _8;
+ zend_bool _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *descriptor_param = NULL, username, password, dsnParts, dsnAttributes, dsnAttributesCustomRaw, dsnAttributesMap, key, options, persistent, value, _3, _4, *_5, _6, _11, _12, _13, _0$$3, _2$$9, _9$$11, _10$$12;
- zval descriptor, _1$$3;
+ zval *descriptor_param = NULL, username, password, dsnAttributes, dsnAttributesCustomRaw, dsnAttributesMap, key, options, persistent, value, _2, _4, _5, *_6, _7, _12, _13, _14, _0$$3, _3$$9, _10$$11, _11$$12;
+ zval descriptor, dsnParts;
zval *this_ptr = getThis();
ZVAL_UNDEF(&descriptor);
- ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&dsnParts);
ZVAL_UNDEF(&username);
ZVAL_UNDEF(&password);
- ZVAL_UNDEF(&dsnParts);
ZVAL_UNDEF(&dsnAttributes);
ZVAL_UNDEF(&dsnAttributesCustomRaw);
ZVAL_UNDEF(&dsnAttributesMap);
@@ -383,21 +372,22 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, connect)
ZVAL_UNDEF(&options);
ZVAL_UNDEF(&persistent);
ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_7);
ZVAL_UNDEF(&_12);
ZVAL_UNDEF(&_13);
+ ZVAL_UNDEF(&_14);
ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_2$$9);
- ZVAL_UNDEF(&_9$$11);
- ZVAL_UNDEF(&_10$$12);
+ ZVAL_UNDEF(&_3$$9);
+ ZVAL_UNDEF(&_10$$11);
+ ZVAL_UNDEF(&_11$$12);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY_OR_NULL(descriptor)
+ Z_PARAM_ARRAY(descriptor)
ZEND_PARSE_PARAMETERS_END();
#endif
@@ -406,16 +396,17 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, connect)
zephir_fetch_params(1, 0, 1, &descriptor_param);
if (!descriptor_param) {
ZEPHIR_INIT_VAR(&descriptor);
+ array_init(&descriptor);
} else {
- zephir_get_arrval(&descriptor, descriptor_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&descriptor, descriptor_param);
}
+ ZEPHIR_INIT_VAR(&dsnParts);
+ array_init(&dsnParts);
if (ZEPHIR_IS_EMPTY(&descriptor)) {
- ZEPHIR_OBS_VAR(&_0$$3);
- zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("descriptor"), PH_NOISY_CC);
- zephir_get_arrval(&_1$$3, &_0$$3);
- ZEPHIR_CPY_WRT(&descriptor, &_1$$3);
+ zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("descriptor"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&descriptor, &_0$$3);
}
ZEPHIR_OBS_VAR(&username);
if (zephir_array_isset_string_fetch(&username, &descriptor, SL("username"), 0)) {
@@ -428,8 +419,14 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, connect)
if (zephir_array_isset_string(&descriptor, SL("dialectClass"))) {
zephir_array_unset_string(&descriptor, SL("dialectClass"), PH_SEPARATE);
}
- ZEPHIR_OBS_VAR(&options);
- if (zephir_array_isset_string_fetch(&options, &descriptor, SL("options"), 0)) {
+ _1 = zephir_array_isset_string(&descriptor, SL("options"));
+ if (_1) {
+ zephir_array_fetch_string(&_2, &descriptor, SL("options"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 268);
+ _1 = Z_TYPE_P(&_2) == IS_ARRAY;
+ }
+ if (_1) {
+ ZEPHIR_OBS_VAR(&options);
+ zephir_array_fetch_string(&options, &descriptor, SL("options"), PH_NOISY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 269);
zephir_array_unset_string(&descriptor, SL("options"), PH_SEPARATE);
} else {
ZEPHIR_INIT_NVAR(&options);
@@ -437,56 +434,54 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, connect)
}
ZEPHIR_OBS_VAR(&persistent);
if (zephir_array_isset_string_fetch(&persistent, &descriptor, SL("persistent"), 0)) {
- ZEPHIR_INIT_VAR(&_2$$9);
- ZVAL_BOOL(&_2$$9, zephir_get_boolval(&persistent));
- zephir_array_update_long(&options, 12, &_2$$9, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
+ ZEPHIR_INIT_VAR(&_3$$9);
+ ZVAL_BOOL(&_3$$9, zephir_get_boolval(&persistent));
+ zephir_array_update_long(&options, 12, &_3$$9, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
}
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_LONG(&_3, 2);
- zephir_array_update_long(&options, 3, &_3, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
- ZEPHIR_INIT_VAR(&dsnParts);
- array_init(&dsnParts);
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_LONG(&_4, 2);
+ zephir_array_update_long(&options, 3, &_4, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
ZEPHIR_OBS_VAR(&dsnAttributesCustomRaw);
if (zephir_array_isset_string_fetch(&dsnAttributesCustomRaw, &descriptor, SL("dsn"), 0)) {
- zephir_array_append(&dsnParts, &dsnAttributesCustomRaw, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 297);
+ zephir_array_append(&dsnParts, &dsnAttributesCustomRaw, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 285);
zephir_array_unset_string(&descriptor, SL("dsn"), PH_SEPARATE);
}
- ZEPHIR_CALL_METHOD(&_4, this_ptr, "getdsndefaults", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_5, this_ptr, "getdsndefaults", NULL, 0);
zephir_check_call_status();
ZEPHIR_INIT_VAR(&dsnAttributesMap);
- zephir_fast_array_merge(&dsnAttributesMap, &_4, &descriptor);
- zephir_is_iterable(&dsnAttributesMap, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 317);
+ zephir_fast_array_merge(&dsnAttributesMap, &_5, &descriptor);
+ zephir_is_iterable(&dsnAttributesMap, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 305);
if (Z_TYPE_P(&dsnAttributesMap) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&dsnAttributesMap), _7, _8, _5)
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&dsnAttributesMap), _8, _9, _6)
{
ZEPHIR_INIT_NVAR(&key);
- if (_8 != NULL) {
- ZVAL_STR_COPY(&key, _8);
+ if (_9 != NULL) {
+ ZVAL_STR_COPY(&key, _9);
} else {
- ZVAL_LONG(&key, _7);
+ ZVAL_LONG(&key, _8);
}
ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _5);
- ZEPHIR_INIT_NVAR(&_9$$11);
- ZEPHIR_CONCAT_VSV(&_9$$11, &key, "=", &value);
- zephir_array_append(&dsnParts, &_9$$11, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 313);
+ ZVAL_COPY(&value, _6);
+ ZEPHIR_INIT_NVAR(&_10$$11);
+ ZEPHIR_CONCAT_VSV(&_10$$11, &key, "=", &value);
+ zephir_array_append(&dsnParts, &_10$$11, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 301);
} ZEND_HASH_FOREACH_END();
} else {
ZEPHIR_CALL_METHOD(NULL, &dsnAttributesMap, "rewind", NULL, 0);
zephir_check_call_status();
while (1) {
- ZEPHIR_CALL_METHOD(&_6, &dsnAttributesMap, "valid", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_7, &dsnAttributesMap, "valid", NULL, 0);
zephir_check_call_status();
- if (!zend_is_true(&_6)) {
+ if (!zend_is_true(&_7)) {
break;
}
ZEPHIR_CALL_METHOD(&key, &dsnAttributesMap, "key", NULL, 0);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(&value, &dsnAttributesMap, "current", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_10$$12);
- ZEPHIR_CONCAT_VSV(&_10$$12, &key, "=", &value);
- zephir_array_append(&dsnParts, &_10$$12, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 313);
+ ZEPHIR_INIT_NVAR(&_11$$12);
+ ZEPHIR_CONCAT_VSV(&_11$$12, &key, "=", &value);
+ zephir_array_append(&dsnParts, &_11$$12, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 301);
ZEPHIR_CALL_METHOD(NULL, &dsnAttributesMap, "next", NULL, 0);
zephir_check_call_status();
}
@@ -495,15 +490,15 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, connect)
ZEPHIR_INIT_NVAR(&key);
ZEPHIR_INIT_VAR(&dsnAttributes);
zephir_fast_join_str(&dsnAttributes, SL(";"), &dsnParts);
- ZEPHIR_INIT_VAR(&_11);
- object_init_ex(&_11, php_pdo_get_dbh_ce());
- zephir_read_property(&_12, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_13);
- ZEPHIR_CONCAT_VSV(&_13, &_12, ":", &dsnAttributes);
- ZEPHIR_CALL_METHOD(NULL, &_11, "__construct", NULL, 0, &_13, &username, &password, &options);
+ ZEPHIR_INIT_VAR(&_12);
+ object_init_ex(&_12, php_pdo_get_dbh_ce());
+ zephir_read_property(&_13, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_14);
+ ZEPHIR_CONCAT_VSV(&_14, &_13, ":", &dsnAttributes);
+ ZEPHIR_CALL_METHOD(NULL, &_12, "__construct", NULL, 0, &_14, &username, &password, &options);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("pdo"), &_11);
- RETURN_MM_BOOL(1);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("pdo"), &_12);
+ ZEPHIR_MM_RESTORE();
}
/**
@@ -587,27 +582,27 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, convertBoundParams)
ZVAL_LONG(&_2, setOrder);
zephir_preg_match(&_1, &bindPattern, &sql, &matches, 1, zephir_get_intval(&_0) , 0 );
if (zephir_is_true(&_1)) {
- zephir_is_iterable(&matches, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 373);
+ zephir_is_iterable(&matches, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 359);
if (Z_TYPE_P(&matches) == IS_ARRAY) {
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&matches), _3$$3)
{
ZEPHIR_INIT_NVAR(&placeMatch);
ZVAL_COPY(&placeMatch, _3$$3);
ZEPHIR_OBS_NVAR(&value);
- zephir_array_fetch_long(&_5$$4, &placeMatch, 1, PH_READONLY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 356);
+ zephir_array_fetch_long(&_5$$4, &placeMatch, 1, PH_READONLY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 342);
if (!(zephir_array_isset_fetch(&value, ¶ms, &_5$$4, 0))) {
if (UNEXPECTED(!(zephir_array_isset_long(&placeMatch, 2)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Matched parameter wasn't found in parameters list", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 360);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Matched parameter wasn't found in parameters list", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 346);
return;
}
ZEPHIR_OBS_NVAR(&value);
- zephir_array_fetch_long(&_6$$5, &placeMatch, 2, PH_READONLY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 363);
+ zephir_array_fetch_long(&_6$$5, &placeMatch, 2, PH_READONLY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 349);
if (UNEXPECTED(!(zephir_array_isset_fetch(&value, ¶ms, &_6$$5, 0)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Matched parameter wasn't found in parameters list", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 366);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Matched parameter wasn't found in parameters list", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 352);
return;
}
}
- zephir_array_append(&placeHolders, &value, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 370);
+ zephir_array_append(&placeHolders, &value, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 356);
} ZEND_HASH_FOREACH_END();
} else {
ZEPHIR_CALL_METHOD(NULL, &matches, "rewind", NULL, 0);
@@ -621,20 +616,20 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, convertBoundParams)
ZEPHIR_CALL_METHOD(&placeMatch, &matches, "current", NULL, 0);
zephir_check_call_status();
ZEPHIR_OBS_NVAR(&value);
- zephir_array_fetch_long(&_7$$8, &placeMatch, 1, PH_READONLY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 356);
+ zephir_array_fetch_long(&_7$$8, &placeMatch, 1, PH_READONLY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 342);
if (!(zephir_array_isset_fetch(&value, ¶ms, &_7$$8, 0))) {
if (UNEXPECTED(!(zephir_array_isset_long(&placeMatch, 2)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Matched parameter wasn't found in parameters list", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 360);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Matched parameter wasn't found in parameters list", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 346);
return;
}
ZEPHIR_OBS_NVAR(&value);
- zephir_array_fetch_long(&_8$$9, &placeMatch, 2, PH_READONLY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 363);
+ zephir_array_fetch_long(&_8$$9, &placeMatch, 2, PH_READONLY, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 349);
if (UNEXPECTED(!(zephir_array_isset_fetch(&value, ¶ms, &_8$$9, 0)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Matched parameter wasn't found in parameters list", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 366);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Matched parameter wasn't found in parameters list", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 352);
return;
}
}
- zephir_array_append(&placeHolders, &value, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 370);
+ zephir_array_append(&placeHolders, &value, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 356);
ZEPHIR_CALL_METHOD(NULL, &matches, "next", NULL, 0);
zephir_check_call_status();
}
@@ -715,20 +710,21 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, execute)
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval bindParams, bindTypes;
- zval *sqlStatement_param = NULL, *bindParams_param = NULL, *bindTypes_param = NULL, eventsManager, affectedRows, pdo, newStatement, statement, _0, _1$$3, _2$$3, _3$$9;
+ zval *sqlStatement_param = NULL, *bindParams_param = NULL, *bindTypes_param = NULL, eventsManager, affectedRows, newStatement, statement, _0, _1$$3, _2$$3, _3$$5, _4$$7, _5$$9;
zval sqlStatement;
zval *this_ptr = getThis();
ZVAL_UNDEF(&sqlStatement);
ZVAL_UNDEF(&eventsManager);
ZVAL_UNDEF(&affectedRows);
- ZVAL_UNDEF(&pdo);
ZVAL_UNDEF(&newStatement);
ZVAL_UNDEF(&statement);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1$$3);
ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$9);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&_4$$7);
+ ZVAL_UNDEF(&_5$$9);
ZVAL_UNDEF(&bindParams);
ZVAL_UNDEF(&bindTypes);
#if PHP_VERSION_ID >= 80000
@@ -785,10 +781,9 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, execute)
ZVAL_LONG(&affectedRows, 0);
ZEPHIR_CALL_METHOD(NULL, this_ptr, "preparerealsql", NULL, 0, &sqlStatement, &bindParams);
zephir_check_call_status();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&pdo, &_0);
if (!(ZEPHIR_IS_EMPTY(&bindParams))) {
- ZEPHIR_CALL_METHOD(&statement, &pdo, "prepare", NULL, 0, &sqlStatement);
+ zephir_read_property(&_3$$5, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&statement, &_3$$5, "prepare", NULL, 0, &sqlStatement);
zephir_check_call_status();
if (Z_TYPE_P(&statement) == IS_OBJECT) {
ZEPHIR_CALL_METHOD(&newStatement, this_ptr, "executeprepared", NULL, 0, &statement, &bindParams, &bindTypes);
@@ -797,15 +792,16 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, execute)
zephir_check_call_status();
}
} else {
- ZEPHIR_CALL_METHOD(&affectedRows, &pdo, "exec", NULL, 0, &sqlStatement);
+ zephir_read_property(&_4$$7, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&affectedRows, &_4$$7, "exec", NULL, 0, &sqlStatement);
zephir_check_call_status();
}
if (Z_TYPE_P(&affectedRows) == IS_LONG) {
zephir_update_property_zval(this_ptr, ZEND_STRL("affectedRows"), &affectedRows);
if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
- ZEPHIR_INIT_VAR(&_3$$9);
- ZVAL_STRING(&_3$$9, "db:afterQuery");
- ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_3$$9, this_ptr);
+ ZEPHIR_INIT_VAR(&_5$$9);
+ ZVAL_STRING(&_5$$9, "db:afterQuery");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_5$$9, this_ptr);
zephir_check_call_status();
}
}
@@ -895,7 +891,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, executePrepared)
ZEPHIR_OBS_COPY_OR_DUP(&placeholders, placeholders_param);
- zephir_is_iterable(&placeholders, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 586);
+ zephir_is_iterable(&placeholders, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 570);
if (Z_TYPE_P(&placeholders) == IS_ARRAY) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&placeholders), _2, _3, _0)
{
@@ -913,7 +909,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, executePrepared)
} else if (Z_TYPE_P(&wildcard) == IS_STRING) {
ZEPHIR_CPY_WRT(¶meter, &wildcard);
} else {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid bind parameter (1)", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 506);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid bind parameter (1)", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 490);
return;
}
_4$$3 = Z_TYPE_P(dataTypes) == IS_ARRAY;
@@ -972,7 +968,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, executePrepared)
zephir_check_call_status();
}
} else {
- zephir_is_iterable(&castValue, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 574);
+ zephir_is_iterable(&castValue, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 558);
if (Z_TYPE_P(&castValue) == IS_ARRAY) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&castValue), _12$$22, _13$$22, _10$$22)
{
@@ -1032,7 +1028,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, executePrepared)
ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, ¶meter, &value);
zephir_check_call_status();
} else {
- zephir_is_iterable(&value, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 582);
+ zephir_is_iterable(&value, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 566);
if (Z_TYPE_P(&value) == IS_ARRAY) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&value), _20$$31, _21$$31, _18$$31)
{
@@ -1094,7 +1090,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, executePrepared)
} else if (Z_TYPE_P(&wildcard) == IS_STRING) {
ZEPHIR_CPY_WRT(¶meter, &wildcard);
} else {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid bind parameter (1)", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 506);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid bind parameter (1)", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 490);
return;
}
_24$$34 = Z_TYPE_P(dataTypes) == IS_ARRAY;
@@ -1153,7 +1149,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, executePrepared)
zephir_check_call_status();
}
} else {
- zephir_is_iterable(&castValue, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 574);
+ zephir_is_iterable(&castValue, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 558);
if (Z_TYPE_P(&castValue) == IS_ARRAY) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&castValue), _30$$53, _31$$53, _28$$53)
{
@@ -1213,7 +1209,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, executePrepared)
ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_9, 0, ¶meter, &value);
zephir_check_call_status();
} else {
- zephir_is_iterable(&value, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 582);
+ zephir_is_iterable(&value, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 566);
if (Z_TYPE_P(&value) == IS_ARRAY) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&value), _38$$62, _39$$62, _36$$62)
{
@@ -1326,23 +1322,18 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, getTransactionLevel)
*/
PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, isUnderTransaction)
{
- zval pdo, _0;
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pdo);
ZVAL_UNDEF(&_0);
ZEPHIR_MM_GROW();
zephir_read_property(&_0, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&pdo, &_0);
- if (Z_TYPE_P(&pdo) != IS_OBJECT) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_RETURN_CALL_METHOD(&pdo, "intransaction", NULL, 0);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "intransaction", NULL, 0);
zephir_check_call_status();
RETURN_MM();
}
@@ -1368,41 +1359,48 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, isUnderTransaction)
* // Getting the generated id
* $id = $connection->lastInsertId();
*```
+ *
+ * @param string|null $name
+ * @return string|bool
*/
PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, lastInsertId)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *sequenceName = NULL, sequenceName_sub, __$null, pdo, _0;
+ zval *name_param = NULL, _0;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&sequenceName_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&pdo);
+ ZVAL_UNDEF(&name);
ZVAL_UNDEF(&_0);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(sequenceName)
+ Z_PARAM_STR_OR_NULL(name)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
- zephir_fetch_params(1, 0, 1, &sequenceName);
- if (!sequenceName) {
- sequenceName = &sequenceName_sub;
- sequenceName = &__$null;
+ zephir_fetch_params(1, 0, 1, &name_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);
+ }
}
zephir_read_property(&_0, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&pdo, &_0);
- if (Z_TYPE_P(&pdo) != IS_OBJECT) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_RETURN_CALL_METHOD(&pdo, "lastinsertid", NULL, 0, sequenceName);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "lastinsertid", NULL, 0, &name);
zephir_check_call_status();
RETURN_MM();
}
@@ -1489,13 +1487,12 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, query)
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval bindParams, bindTypes;
- zval *sqlStatement_param = NULL, *bindParams_param = NULL, *bindTypes_param = NULL, eventsManager, pdo, statement, params, types, _0, _3, _1$$3, _2$$3, _4$$9;
+ zval *sqlStatement_param = NULL, *bindParams_param = NULL, *bindTypes_param = NULL, eventsManager, statement, params, types, _0, _3, _1$$3, _2$$3, _4$$9;
zval sqlStatement;
zval *this_ptr = getThis();
ZVAL_UNDEF(&sqlStatement);
ZVAL_UNDEF(&eventsManager);
- ZVAL_UNDEF(&pdo);
ZVAL_UNDEF(&statement);
ZVAL_UNDEF(¶ms);
ZVAL_UNDEF(&types);
@@ -1556,8 +1553,6 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, query)
RETURN_MM_BOOL(0);
}
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&pdo, &_0);
if (!(ZEPHIR_IS_EMPTY(&bindParams))) {
ZEPHIR_CPY_WRT(¶ms, &bindParams);
ZEPHIR_CPY_WRT(&types, &bindTypes);
@@ -1567,10 +1562,11 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, query)
ZEPHIR_INIT_NVAR(&types);
array_init(&types);
}
- ZEPHIR_CALL_METHOD(&statement, &pdo, "prepare", NULL, 0, &sqlStatement);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&statement, &_0, "prepare", NULL, 0, &sqlStatement);
zephir_check_call_status();
if (UNEXPECTED(Z_TYPE_P(&statement) != IS_OBJECT)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Cannot prepare statement", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 749);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Cannot prepare statement", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 720);
return;
}
ZEPHIR_CALL_METHOD(NULL, this_ptr, "preparerealsql", NULL, 0, &sqlStatement, &bindParams);
@@ -1600,19 +1596,18 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, rollback)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS, transactionLevel = 0;
- zval *nesting_param = NULL, pdo, eventsManager, savepointName, _0, _1, _6, _2$$5, _3$$6, _7$$9;
- zend_bool nesting, _4, _5;
+ zval *nesting_param = NULL, eventsManager, savepointName, _0, _5, _6, _1$$4, _2$$5, _7$$8;
+ zend_bool nesting, _3, _4;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&pdo);
ZVAL_UNDEF(&eventsManager);
ZVAL_UNDEF(&savepointName);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_5);
ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_1$$4);
ZVAL_UNDEF(&_2$$5);
- ZVAL_UNDEF(&_3$$6);
- ZVAL_UNDEF(&_7$$9);
+ ZVAL_UNDEF(&_7$$8);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
@@ -1631,43 +1626,39 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, rollback)
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&pdo, &_0);
- if (Z_TYPE_P(&pdo) != IS_OBJECT) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_OBS_VAR(&_1);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("transactionLevel"), PH_NOISY_CC);
- transactionLevel = zephir_get_intval(&_1);
+ ZEPHIR_OBS_VAR(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("transactionLevel"), PH_NOISY_CC);
+ transactionLevel = zephir_get_intval(&_0);
if (UNEXPECTED(!transactionLevel)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "There is no active transaction", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 793);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "There is no active transaction", "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 759);
return;
}
if (transactionLevel == 1) {
- zephir_read_property(&_2$$5, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&eventsManager, &_2$$5);
+ zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&eventsManager, &_1$$4);
if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
- ZEPHIR_INIT_VAR(&_3$$6);
- ZVAL_STRING(&_3$$6, "db:rollbackTransaction");
- ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_3$$6, this_ptr);
+ ZEPHIR_INIT_VAR(&_2$$5);
+ ZVAL_STRING(&_2$$5, "db:rollbackTransaction");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_2$$5, this_ptr);
zephir_check_call_status();
}
RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel")));
- ZEPHIR_RETURN_CALL_METHOD(&pdo, "rollback", NULL, 0);
+ zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("pdo"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_1$$4, "rollback", NULL, 0);
zephir_check_call_status();
RETURN_MM();
}
- _4 = !transactionLevel;
- if (!(_4)) {
- _4 = !nesting;
+ _3 = !transactionLevel;
+ if (!(_3)) {
+ _3 = !nesting;
}
- _5 = _4;
- if (!(_5)) {
- ZEPHIR_CALL_METHOD(&_6, this_ptr, "isnestedtransactionswithsavepoints", NULL, 0);
+ _4 = _3;
+ if (!(_4)) {
+ ZEPHIR_CALL_METHOD(&_5, this_ptr, "isnestedtransactionswithsavepoints", NULL, 0);
zephir_check_call_status();
- _5 = !zephir_is_true(&_6);
+ _4 = !zephir_is_true(&_5);
}
- if (_5) {
+ if (_4) {
if (transactionLevel > 0) {
RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel")));
}
@@ -1675,12 +1666,12 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, rollback)
}
ZEPHIR_CALL_METHOD(&savepointName, this_ptr, "getnestedtransactionsavepointname", NULL, 0);
zephir_check_call_status();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&eventsManager, &_0);
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&eventsManager, &_6);
if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
- ZEPHIR_INIT_VAR(&_7$$9);
- ZVAL_STRING(&_7$$9, "db:rollbackSavepoint");
- ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_7$$9, this_ptr, &savepointName);
+ ZEPHIR_INIT_VAR(&_7$$8);
+ ZVAL_STRING(&_7$$8, "db:rollbackSavepoint");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_7$$8, this_ptr, &savepointName);
zephir_check_call_status();
}
RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel")));
@@ -1753,7 +1744,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, prepareRealSql)
if (!(ZEPHIR_IS_EMPTY(¶meters))) {
ZEPHIR_INIT_VAR(&keys);
array_init(&keys);
- zephir_is_iterable(¶meters, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 881);
+ zephir_is_iterable(¶meters, 0, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 848);
if (Z_TYPE_P(¶meters) == IS_ARRAY) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(¶meters), _2$$3, _3$$3, _0$$3)
{
@@ -1768,11 +1759,11 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, prepareRealSql)
if (Z_TYPE_P(&key) == IS_STRING) {
ZEPHIR_INIT_NVAR(&_4$$5);
ZEPHIR_CONCAT_SVS(&_4$$5, "/:", &key, "/");
- zephir_array_append(&keys, &_4$$5, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 867);
+ zephir_array_append(&keys, &_4$$5, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 834);
} else {
ZEPHIR_INIT_NVAR(&_5$$6);
ZVAL_STRING(&_5$$6, "/[?]/");
- zephir_array_append(&keys, &_5$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 869);
+ zephir_array_append(&keys, &_5$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 836);
}
if (Z_TYPE_P(&value) == IS_STRING) {
ZEPHIR_INIT_NVAR(&_6$$7);
@@ -1806,11 +1797,11 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, prepareRealSql)
if (Z_TYPE_P(&key) == IS_STRING) {
ZEPHIR_INIT_NVAR(&_10$$11);
ZEPHIR_CONCAT_SVS(&_10$$11, "/:", &key, "/");
- zephir_array_append(&keys, &_10$$11, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 867);
+ zephir_array_append(&keys, &_10$$11, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 834);
} else {
ZEPHIR_INIT_NVAR(&_11$$12);
ZVAL_STRING(&_11$$12, "/[?]/");
- zephir_array_append(&keys, &_11$$12, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 869);
+ zephir_array_append(&keys, &_11$$12, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/AbstractPdo.zep", 836);
}
if (Z_TYPE_P(&value) == IS_STRING) {
ZEPHIR_INIT_NVAR(&_12$$13);
diff --git a/ext/phalcon/db/adapter/pdo/abstractpdo.zep.h b/ext/phalcon/db/adapter/pdo/abstractpdo.zep.h
index b4ee2b29946..fe812fc7016 100644
--- a/ext/phalcon/db/adapter/pdo/abstractpdo.zep.h
+++ b/ext/phalcon/db/adapter/pdo/abstractpdo.zep.h
@@ -39,14 +39,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractp
ZEND_ARG_TYPE_INFO(0, nesting, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_close, 0, 0, _IS_BOOL, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_close, 0, 0, IS_VOID, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_connect, 0, 0, _IS_BOOL, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_connect, 0, 0, IS_VOID, 0)
+
#if PHP_VERSION_ID >= 80000
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 1, "[]")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 0, "[]")
#else
- ZEND_ARG_ARRAY_INFO(0, descriptor, 1)
+ ZEND_ARG_ARRAY_INFO(0, descriptor, 0)
#endif
ZEND_END_ARG_INFO()
@@ -83,7 +84,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpd
ZEND_ARG_INFO(0, dataTypes)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_geterrorinfo, 0, 0, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_geterrorinfo, 0, 0, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_getinternalhandler, 0, 0, PDO, 0)
@@ -96,7 +97,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractp
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_lastinsertid, 0, 0, 0)
- ZEND_ARG_INFO(0, sequenceName)
+ ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_abstractpdo_prepare, 0, 1, PDOStatement, 0)
@@ -141,11 +142,7 @@ ZEPHIR_INIT_FUNCS(phalcon_db_adapter_pdo_abstractpdo_method_entry) {
PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, escapeString, arginfo_phalcon_db_adapter_pdo_abstractpdo_escapestring, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, execute, arginfo_phalcon_db_adapter_pdo_abstractpdo_execute, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, executePrepared, arginfo_phalcon_db_adapter_pdo_abstractpdo_executeprepared, ZEND_ACC_PUBLIC)
-#if PHP_VERSION_ID >= 80000
PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, getErrorInfo, arginfo_phalcon_db_adapter_pdo_abstractpdo_geterrorinfo, ZEND_ACC_PUBLIC)
-#else
- PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, getErrorInfo, NULL, ZEND_ACC_PUBLIC)
-#endif
PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, getInternalHandler, arginfo_phalcon_db_adapter_pdo_abstractpdo_getinternalhandler, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, getTransactionLevel, arginfo_phalcon_db_adapter_pdo_abstractpdo_gettransactionlevel, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Db_Adapter_Pdo_AbstractPdo, isUnderTransaction, arginfo_phalcon_db_adapter_pdo_abstractpdo_isundertransaction, ZEND_ACC_PUBLIC)
diff --git a/ext/phalcon/db/adapter/pdo/postgresql.zep.c b/ext/phalcon/db/adapter/pdo/postgresql.zep.c
index a562f3770ae..14c7fe99efa 100644
--- a/ext/phalcon/db/adapter/pdo/postgresql.zep.c
+++ b/ext/phalcon/db/adapter/pdo/postgresql.zep.c
@@ -107,28 +107,26 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, __construct)
*/
PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, connect)
{
- zend_bool _3$$6;
+ zend_bool _2$$6;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_5 = NULL;
- zval *descriptor_param = NULL, __$null, schema, sql, status, _0$$3, _2$$6, _4$$6;
- zval descriptor, _1$$3;
+ zephir_fcall_cache_entry *_4 = NULL;
+ zval *descriptor_param = NULL, __$null, schema, sql, _0$$3, _1$$6, _3$$6;
+ zval descriptor;
zval *this_ptr = getThis();
ZVAL_UNDEF(&descriptor);
- ZVAL_UNDEF(&_1$$3);
ZVAL_NULL(&__$null);
ZVAL_UNDEF(&schema);
ZVAL_UNDEF(&sql);
- ZVAL_UNDEF(&status);
ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_2$$6);
- ZVAL_UNDEF(&_4$$6);
+ ZVAL_UNDEF(&_1$$6);
+ ZVAL_UNDEF(&_3$$6);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY_OR_NULL(descriptor)
+ Z_PARAM_ARRAY(descriptor)
ZEND_PARSE_PARAMETERS_END();
#endif
@@ -137,16 +135,15 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, connect)
zephir_fetch_params(1, 0, 1, &descriptor_param);
if (!descriptor_param) {
ZEPHIR_INIT_VAR(&descriptor);
+ array_init(&descriptor);
} else {
- zephir_get_arrval(&descriptor, descriptor_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&descriptor, descriptor_param);
}
if (ZEPHIR_IS_EMPTY(&descriptor)) {
- ZEPHIR_OBS_VAR(&_0$$3);
- zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("descriptor"), PH_NOISY_CC);
- zephir_get_arrval(&_1$$3, &_0$$3);
- ZEPHIR_CPY_WRT(&descriptor, &_1$$3);
+ zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("descriptor"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&descriptor, &_0$$3);
}
ZEPHIR_OBS_VAR(&schema);
if (zephir_array_isset_string_fetch(&schema, &descriptor, SL("schema"), 0)) {
@@ -156,18 +153,18 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, connect)
ZVAL_NULL(&schema);
}
if (zephir_array_isset_string(&descriptor, SL("password"))) {
- ZEPHIR_OBS_VAR(&_2$$6);
- zephir_array_fetch_string(&_2$$6, &descriptor, SL("password"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 85);
- _3$$6 = Z_TYPE_P(&_2$$6) == IS_STRING;
- if (_3$$6) {
- zephir_array_fetch_string(&_4$$6, &descriptor, SL("password"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 85);
- _3$$6 = zephir_fast_strlen_ev(&_4$$6) == 0;
+ ZEPHIR_OBS_VAR(&_1$$6);
+ zephir_array_fetch_string(&_1$$6, &descriptor, SL("password"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 85);
+ _2$$6 = Z_TYPE_P(&_1$$6) == IS_STRING;
+ if (_2$$6) {
+ zephir_array_fetch_string(&_3$$6, &descriptor, SL("password"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 85);
+ _2$$6 = zephir_fast_strlen_ev(&_3$$6) == 0;
}
- if (_3$$6) {
+ if (_2$$6) {
zephir_array_update_string(&descriptor, SL("password"), &__$null, PH_COPY | PH_SEPARATE);
}
}
- ZEPHIR_CALL_PARENT(&status, phalcon_db_adapter_pdo_postgresql_ce, getThis(), "connect", &_5, 0, &descriptor);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_db_adapter_pdo_postgresql_ce, getThis(), "connect", &_4, 0, &descriptor);
zephir_check_call_status();
if (!(ZEPHIR_IS_EMPTY(&schema))) {
ZEPHIR_INIT_VAR(&sql);
@@ -175,7 +172,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, connect)
ZEPHIR_CALL_METHOD(NULL, this_ptr, "execute", NULL, 0, &sql);
zephir_check_call_status();
}
- RETURN_CCTOR(&status);
+ ZEPHIR_MM_RESTORE();
}
/**
@@ -241,11 +238,11 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, createTable)
ZEPHIR_OBS_VAR(&columns);
if (UNEXPECTED(!(zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The table must contain at least one column", "phalcon/Db/Adapter/Pdo/Postgresql.zep", 109);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The table must contain at least one column", "phalcon/Db/Adapter/Pdo/Postgresql.zep", 107);
return;
}
if (UNEXPECTED(!(zephir_fast_count_int(&columns)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The table must contain at least one column", "phalcon/Db/Adapter/Pdo/Postgresql.zep", 113);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The table must contain at least one column", "phalcon/Db/Adapter/Pdo/Postgresql.zep", 111);
return;
}
zephir_read_property(&_0, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY);
@@ -259,7 +256,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, createTable)
ZEPHIR_CALL_METHOD(NULL, this_ptr, "begin", NULL, 0);
zephir_check_call_status_or_jump(try_end_1);
- zephir_is_iterable(&queries, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 132);
+ zephir_is_iterable(&queries, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 130);
if (Z_TYPE_P(&queries) == IS_ARRAY) {
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&queries), _1$$6)
{
@@ -311,13 +308,13 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, createTable)
ZEPHIR_CPY_WRT(&exception, &_6$$5);
ZEPHIR_CALL_METHOD(NULL, this_ptr, "rollback", NULL, 0);
zephir_check_call_status();
- zephir_throw_exception_debug(&exception, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 136);
+ zephir_throw_exception_debug(&exception, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 134);
ZEPHIR_MM_RESTORE();
return;
}
}
} else {
- zephir_array_fetch_long(&_7$$12, &queries, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 139);
+ zephir_array_fetch_long(&_7$$12, &queries, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 137);
ZEPHIR_INIT_VAR(&_8$$12);
ZEPHIR_CONCAT_VS(&_8$$12, &_7$$12, ";");
ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_8$$12);
@@ -504,7 +501,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
ZVAL_LONG(&_2, 3);
ZEPHIR_CALL_METHOD(&fields, this_ptr, "fetchall", NULL, 0, &_1, &_2);
zephir_check_call_status();
- zephir_is_iterable(&fields, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 531);
+ zephir_is_iterable(&fields, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 529);
if (Z_TYPE_P(&fields) == IS_ARRAY) {
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&fields), _3)
{
@@ -514,16 +511,16 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_create_array(&definition, 1, 0);
add_assoc_long_ex(&definition, SL("bindType"), 2);
ZEPHIR_OBS_NVAR(&columnType);
- zephir_array_fetch_long(&columnType, &field, 1, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 184);
+ zephir_array_fetch_long(&columnType, &field, 1, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 182);
ZEPHIR_OBS_NVAR(&charSize);
- zephir_array_fetch_long(&charSize, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 185);
+ zephir_array_fetch_long(&charSize, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 183);
ZEPHIR_OBS_NVAR(&numericSize);
- zephir_array_fetch_long(&numericSize, &field, 3, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 186);
+ zephir_array_fetch_long(&numericSize, &field, 3, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 184);
ZEPHIR_OBS_NVAR(&numericScale);
- zephir_array_fetch_long(&numericScale, &field, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 187);
+ zephir_array_fetch_long(&numericScale, &field, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 185);
do {
_5$$3 = 1;
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("boolean"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 205)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("boolean"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 203)) {
ZEPHIR_INIT_NVAR(&_6$$4);
ZVAL_LONG(&_6$$4, 8);
zephir_array_update_string(&definition, SL("type"), &_6$$4, PH_COPY | PH_SEPARATE);
@@ -532,7 +529,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_7$$4, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 217)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 215)) {
ZEPHIR_INIT_NVAR(&_8$$5);
ZVAL_LONG(&_8$$5, 14);
zephir_array_update_string(&definition, SL("type"), &_8$$5, PH_COPY | PH_SEPARATE);
@@ -542,7 +539,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_9$$5, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("mediumint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 227)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("mediumint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 225)) {
ZEPHIR_INIT_NVAR(&_10$$6);
ZVAL_LONG(&_10$$6, 21);
zephir_array_update_string(&definition, SL("type"), &_10$$6, PH_COPY | PH_SEPARATE);
@@ -552,7 +549,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_11$$6, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("smallint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 237)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("smallint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 235)) {
ZEPHIR_INIT_NVAR(&_12$$7);
ZVAL_LONG(&_12$$7, 22);
zephir_array_update_string(&definition, SL("type"), &_12$$7, PH_COPY | PH_SEPARATE);
@@ -562,7 +559,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_13$$7, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("tinyint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 247)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("tinyint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 245)) {
ZEPHIR_INIT_NVAR(&_14$$8);
ZVAL_LONG(&_14$$8, 26);
zephir_array_update_string(&definition, SL("type"), &_14$$8, PH_COPY | PH_SEPARATE);
@@ -572,7 +569,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_15$$8, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 260)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 258)) {
ZEPHIR_INIT_NVAR(&_16$$9);
ZVAL_LONG(&_16$$9, 0);
zephir_array_update_string(&definition, SL("type"), &_16$$9, PH_COPY | PH_SEPARATE);
@@ -582,20 +579,20 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_17$$9, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("bit"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 270)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("bit"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 268)) {
ZEPHIR_INIT_NVAR(&_18$$10);
ZVAL_LONG(&_18$$10, 19);
zephir_array_update_string(&definition, SL("type"), &_18$$10, PH_COPY | PH_SEPARATE);
zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 279)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 277)) {
ZEPHIR_INIT_NVAR(&_19$$11);
ZVAL_LONG(&_19$$11, 18);
zephir_array_update_string(&definition, SL("type"), &_19$$11, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 287)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 285)) {
ZEPHIR_INIT_NVAR(&_20$$12);
ZVAL_LONG(&_20$$12, 4);
zephir_array_update_string(&definition, SL("type"), &_20$$12, PH_COPY | PH_SEPARATE);
@@ -604,7 +601,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("size"), &_21$$12, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 296)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 294)) {
ZEPHIR_INIT_NVAR(&_22$$13);
ZVAL_LONG(&_22$$13, 1);
zephir_array_update_string(&definition, SL("type"), &_22$$13, PH_COPY | PH_SEPARATE);
@@ -613,7 +610,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("size"), &_23$$13, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 306) || _5$$3 == zephir_memnstr_str(&columnType, SL("numeric"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 307)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 304) || _5$$3 == zephir_memnstr_str(&columnType, SL("numeric"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 305)) {
ZEPHIR_INIT_NVAR(&_24$$14);
ZVAL_LONG(&_24$$14, 3);
zephir_array_update_string(&definition, SL("type"), &_24$$14, PH_COPY | PH_SEPARATE);
@@ -624,7 +621,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_25$$14, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("double precision"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 318)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("double precision"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 316)) {
ZEPHIR_INIT_NVAR(&_26$$15);
ZVAL_LONG(&_26$$15, 9);
zephir_array_update_string(&definition, SL("type"), &_26$$15, PH_COPY | PH_SEPARATE);
@@ -635,7 +632,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_27$$15, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 329) || _5$$3 == zephir_memnstr_str(&columnType, SL("real"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 330)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 327) || _5$$3 == zephir_memnstr_str(&columnType, SL("real"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 328)) {
ZEPHIR_INIT_NVAR(&_28$$16);
ZVAL_LONG(&_28$$16, 7);
zephir_array_update_string(&definition, SL("type"), &_28$$16, PH_COPY | PH_SEPARATE);
@@ -646,93 +643,93 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_29$$16, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("mediumblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 341)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("mediumblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 339)) {
ZEPHIR_INIT_NVAR(&_30$$17);
ZVAL_LONG(&_30$$17, 6);
zephir_array_update_string(&definition, SL("type"), &_30$$17, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("longblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 349)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("longblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 347)) {
ZEPHIR_INIT_NVAR(&_31$$18);
ZVAL_LONG(&_31$$18, 13);
zephir_array_update_string(&definition, SL("type"), &_31$$18, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("tinyblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 357)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("tinyblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 355)) {
ZEPHIR_INIT_NVAR(&_32$$19);
ZVAL_LONG(&_32$$19, 10);
zephir_array_update_string(&definition, SL("type"), &_32$$19, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("blob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 365)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("blob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 363)) {
ZEPHIR_INIT_NVAR(&_33$$20);
ZVAL_LONG(&_33$$20, 11);
zephir_array_update_string(&definition, SL("type"), &_33$$20, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 373)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 371)) {
ZEPHIR_INIT_NVAR(&_34$$21);
ZVAL_LONG(&_34$$21, 17);
zephir_array_update_string(&definition, SL("type"), &_34$$21, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("time"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 381)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("time"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 379)) {
ZEPHIR_INIT_NVAR(&_35$$22);
ZVAL_LONG(&_35$$22, 20);
zephir_array_update_string(&definition, SL("type"), &_35$$22, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("jsonb"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 389)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("jsonb"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 387)) {
ZEPHIR_INIT_NVAR(&_36$$23);
ZVAL_LONG(&_36$$23, 16);
zephir_array_update_string(&definition, SL("type"), &_36$$23, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("json"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 397)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("json"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 395)) {
ZEPHIR_INIT_NVAR(&_37$$24);
ZVAL_LONG(&_37$$24, 15);
zephir_array_update_string(&definition, SL("type"), &_37$$24, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("longtext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 405)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("longtext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 403)) {
ZEPHIR_INIT_NVAR(&_38$$25);
ZVAL_LONG(&_38$$25, 24);
zephir_array_update_string(&definition, SL("type"), &_38$$25, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("mediumtext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 413)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("mediumtext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 411)) {
ZEPHIR_INIT_NVAR(&_39$$26);
ZVAL_LONG(&_39$$26, 23);
zephir_array_update_string(&definition, SL("type"), &_39$$26, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("tinytext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 421)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("tinytext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 419)) {
ZEPHIR_INIT_NVAR(&_40$$27);
ZVAL_LONG(&_40$$27, 25);
zephir_array_update_string(&definition, SL("type"), &_40$$27, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 429)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 427)) {
ZEPHIR_INIT_NVAR(&_41$$28);
ZVAL_LONG(&_41$$28, 6);
zephir_array_update_string(&definition, SL("type"), &_41$$28, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("varying"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 437) || _5$$3 == zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 438)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("varying"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 435) || _5$$3 == zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 436)) {
ZEPHIR_INIT_NVAR(&_42$$29);
ZVAL_LONG(&_42$$29, 2);
zephir_array_update_string(&definition, SL("type"), &_42$$29, PH_COPY | PH_SEPARATE);
zephir_array_update_string(&definition, SL("size"), &charSize, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 447)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 445)) {
ZEPHIR_INIT_NVAR(&_43$$30);
ZVAL_LONG(&_43$$30, 5);
zephir_array_update_string(&definition, SL("type"), &_43$$30, PH_COPY | PH_SEPARATE);
zephir_array_update_string(&definition, SL("size"), &charSize, PH_COPY | PH_SEPARATE);
break;
}
- if (_5$$3 == zephir_memnstr_str(&columnType, SL("uuid"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 456)) {
+ if (_5$$3 == zephir_memnstr_str(&columnType, SL("uuid"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 454)) {
ZEPHIR_INIT_NVAR(&_44$$31);
ZVAL_LONG(&_44$$31, 5);
zephir_array_update_string(&definition, SL("type"), &_44$$31, PH_COPY | PH_SEPARATE);
@@ -752,21 +749,21 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
} else {
zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE);
}
- zephir_array_fetch_long(&_47$$3, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 483);
+ zephir_array_fetch_long(&_47$$3, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 481);
if (ZEPHIR_IS_STRING(&_47$$3, "PRI")) {
zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE);
}
- zephir_array_fetch_long(&_48$$3, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 490);
+ zephir_array_fetch_long(&_48$$3, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 488);
if (ZEPHIR_IS_STRING(&_48$$3, "YES")) {
zephir_array_update_string(&definition, SL("notNull"), &__$false, PH_COPY | PH_SEPARATE);
}
- zephir_array_fetch_long(&_49$$3, &field, 7, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 497);
+ zephir_array_fetch_long(&_49$$3, &field, 7, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 495);
if (ZEPHIR_IS_STRING(&_49$$3, "auto_increment")) {
zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE);
}
- zephir_array_fetch_long(&_50$$3, &field, 9, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 504);
+ zephir_array_fetch_long(&_50$$3, &field, 9, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 502);
if (Z_TYPE_P(&_50$$3) != IS_NULL) {
- zephir_array_fetch_long(&_51$$38, &field, 9, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 509);
+ zephir_array_fetch_long(&_51$$38, &field, 9, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 507);
ZEPHIR_INIT_NVAR(&_52$$38);
ZVAL_STRING(&_52$$38, "/^'|'?::[[:alnum:][:space:]]+$/");
ZEPHIR_INIT_NVAR(&_53$$38);
@@ -774,7 +771,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
ZEPHIR_CALL_FUNCTION(&_54$$38, "preg_replace", &_55, 50, &_52$$38, &_53$$38, &_51$$38);
zephir_check_call_status();
zephir_array_update_string(&definition, SL("default"), &_54$$38, PH_COPY | PH_SEPARATE);
- zephir_array_fetch_string(&_56$$38, &definition, SL("default"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 511);
+ zephir_array_fetch_string(&_56$$38, &definition, SL("default"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 509);
ZEPHIR_INIT_NVAR(&_52$$38);
ZVAL_STRING(&_52$$38, "null");
ZEPHIR_CALL_FUNCTION(&_57$$38, "strcasecmp", &_58, 47, &_56$$38, &_52$$38);
@@ -783,17 +780,17 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("default"), &__$null, PH_COPY | PH_SEPARATE);
}
}
- zephir_array_fetch_long(&_59$$3, &field, 10, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 519);
+ zephir_array_fetch_long(&_59$$3, &field, 10, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 517);
if (Z_TYPE_P(&_59$$3) != IS_NULL) {
- zephir_array_fetch_long(&_60$$40, &field, 10, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 520);
+ zephir_array_fetch_long(&_60$$40, &field, 10, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 518);
zephir_array_update_string(&definition, SL("comment"), &_60$$40, PH_COPY | PH_SEPARATE);
}
- zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 526);
+ zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 524);
ZEPHIR_INIT_NVAR(&_61$$3);
object_init_ex(&_61$$3, phalcon_db_column_ce);
ZEPHIR_CALL_METHOD(NULL, &_61$$3, "__construct", &_62, 212, &columnName, &definition);
zephir_check_call_status();
- zephir_array_append(&columns, &_61$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 527);
+ zephir_array_append(&columns, &_61$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 525);
ZEPHIR_CPY_WRT(&oldColumn, &columnName);
} ZEND_HASH_FOREACH_END();
} else {
@@ -812,16 +809,16 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
add_assoc_long_ex(&_63$$41, SL("bindType"), 2);
ZEPHIR_CPY_WRT(&definition, &_63$$41);
ZEPHIR_OBS_NVAR(&columnType);
- zephir_array_fetch_long(&columnType, &field, 1, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 184);
+ zephir_array_fetch_long(&columnType, &field, 1, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 182);
ZEPHIR_OBS_NVAR(&charSize);
- zephir_array_fetch_long(&charSize, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 185);
+ zephir_array_fetch_long(&charSize, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 183);
ZEPHIR_OBS_NVAR(&numericSize);
- zephir_array_fetch_long(&numericSize, &field, 3, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 186);
+ zephir_array_fetch_long(&numericSize, &field, 3, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 184);
ZEPHIR_OBS_NVAR(&numericScale);
- zephir_array_fetch_long(&numericScale, &field, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 187);
+ zephir_array_fetch_long(&numericScale, &field, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 185);
do {
_64$$41 = 1;
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("boolean"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 205)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("boolean"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 203)) {
ZEPHIR_INIT_NVAR(&_65$$42);
ZVAL_LONG(&_65$$42, 8);
zephir_array_update_string(&definition, SL("type"), &_65$$42, PH_COPY | PH_SEPARATE);
@@ -830,7 +827,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_66$$42, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 217)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 215)) {
ZEPHIR_INIT_NVAR(&_67$$43);
ZVAL_LONG(&_67$$43, 14);
zephir_array_update_string(&definition, SL("type"), &_67$$43, PH_COPY | PH_SEPARATE);
@@ -840,7 +837,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_68$$43, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("mediumint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 227)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("mediumint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 225)) {
ZEPHIR_INIT_NVAR(&_69$$44);
ZVAL_LONG(&_69$$44, 21);
zephir_array_update_string(&definition, SL("type"), &_69$$44, PH_COPY | PH_SEPARATE);
@@ -850,7 +847,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_70$$44, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("smallint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 237)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("smallint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 235)) {
ZEPHIR_INIT_NVAR(&_71$$45);
ZVAL_LONG(&_71$$45, 22);
zephir_array_update_string(&definition, SL("type"), &_71$$45, PH_COPY | PH_SEPARATE);
@@ -860,7 +857,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_72$$45, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("tinyint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 247)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("tinyint"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 245)) {
ZEPHIR_INIT_NVAR(&_73$$46);
ZVAL_LONG(&_73$$46, 26);
zephir_array_update_string(&definition, SL("type"), &_73$$46, PH_COPY | PH_SEPARATE);
@@ -870,7 +867,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_74$$46, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 260)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 258)) {
ZEPHIR_INIT_NVAR(&_75$$47);
ZVAL_LONG(&_75$$47, 0);
zephir_array_update_string(&definition, SL("type"), &_75$$47, PH_COPY | PH_SEPARATE);
@@ -880,20 +877,20 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_76$$47, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("bit"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 270)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("bit"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 268)) {
ZEPHIR_INIT_NVAR(&_77$$48);
ZVAL_LONG(&_77$$48, 19);
zephir_array_update_string(&definition, SL("type"), &_77$$48, PH_COPY | PH_SEPARATE);
zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 279)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 277)) {
ZEPHIR_INIT_NVAR(&_78$$49);
ZVAL_LONG(&_78$$49, 18);
zephir_array_update_string(&definition, SL("type"), &_78$$49, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 287)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 285)) {
ZEPHIR_INIT_NVAR(&_79$$50);
ZVAL_LONG(&_79$$50, 4);
zephir_array_update_string(&definition, SL("type"), &_79$$50, PH_COPY | PH_SEPARATE);
@@ -902,7 +899,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("size"), &_80$$50, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 296)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 294)) {
ZEPHIR_INIT_NVAR(&_81$$51);
ZVAL_LONG(&_81$$51, 1);
zephir_array_update_string(&definition, SL("type"), &_81$$51, PH_COPY | PH_SEPARATE);
@@ -911,7 +908,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("size"), &_82$$51, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 306) || _64$$41 == zephir_memnstr_str(&columnType, SL("numeric"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 307)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 304) || _64$$41 == zephir_memnstr_str(&columnType, SL("numeric"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 305)) {
ZEPHIR_INIT_NVAR(&_83$$52);
ZVAL_LONG(&_83$$52, 3);
zephir_array_update_string(&definition, SL("type"), &_83$$52, PH_COPY | PH_SEPARATE);
@@ -922,7 +919,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_84$$52, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("double precision"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 318)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("double precision"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 316)) {
ZEPHIR_INIT_NVAR(&_85$$53);
ZVAL_LONG(&_85$$53, 9);
zephir_array_update_string(&definition, SL("type"), &_85$$53, PH_COPY | PH_SEPARATE);
@@ -933,7 +930,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_86$$53, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 329) || _64$$41 == zephir_memnstr_str(&columnType, SL("real"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 330)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 327) || _64$$41 == zephir_memnstr_str(&columnType, SL("real"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 328)) {
ZEPHIR_INIT_NVAR(&_87$$54);
ZVAL_LONG(&_87$$54, 7);
zephir_array_update_string(&definition, SL("type"), &_87$$54, PH_COPY | PH_SEPARATE);
@@ -944,93 +941,93 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("bindType"), &_88$$54, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("mediumblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 341)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("mediumblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 339)) {
ZEPHIR_INIT_NVAR(&_89$$55);
ZVAL_LONG(&_89$$55, 6);
zephir_array_update_string(&definition, SL("type"), &_89$$55, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("longblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 349)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("longblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 347)) {
ZEPHIR_INIT_NVAR(&_90$$56);
ZVAL_LONG(&_90$$56, 13);
zephir_array_update_string(&definition, SL("type"), &_90$$56, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("tinyblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 357)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("tinyblob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 355)) {
ZEPHIR_INIT_NVAR(&_91$$57);
ZVAL_LONG(&_91$$57, 10);
zephir_array_update_string(&definition, SL("type"), &_91$$57, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("blob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 365)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("blob"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 363)) {
ZEPHIR_INIT_NVAR(&_92$$58);
ZVAL_LONG(&_92$$58, 11);
zephir_array_update_string(&definition, SL("type"), &_92$$58, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 373)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 371)) {
ZEPHIR_INIT_NVAR(&_93$$59);
ZVAL_LONG(&_93$$59, 17);
zephir_array_update_string(&definition, SL("type"), &_93$$59, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("time"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 381)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("time"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 379)) {
ZEPHIR_INIT_NVAR(&_94$$60);
ZVAL_LONG(&_94$$60, 20);
zephir_array_update_string(&definition, SL("type"), &_94$$60, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("jsonb"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 389)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("jsonb"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 387)) {
ZEPHIR_INIT_NVAR(&_95$$61);
ZVAL_LONG(&_95$$61, 16);
zephir_array_update_string(&definition, SL("type"), &_95$$61, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("json"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 397)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("json"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 395)) {
ZEPHIR_INIT_NVAR(&_96$$62);
ZVAL_LONG(&_96$$62, 15);
zephir_array_update_string(&definition, SL("type"), &_96$$62, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("longtext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 405)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("longtext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 403)) {
ZEPHIR_INIT_NVAR(&_97$$63);
ZVAL_LONG(&_97$$63, 24);
zephir_array_update_string(&definition, SL("type"), &_97$$63, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("mediumtext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 413)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("mediumtext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 411)) {
ZEPHIR_INIT_NVAR(&_98$$64);
ZVAL_LONG(&_98$$64, 23);
zephir_array_update_string(&definition, SL("type"), &_98$$64, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("tinytext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 421)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("tinytext"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 419)) {
ZEPHIR_INIT_NVAR(&_99$$65);
ZVAL_LONG(&_99$$65, 25);
zephir_array_update_string(&definition, SL("type"), &_99$$65, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 429)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 427)) {
ZEPHIR_INIT_NVAR(&_100$$66);
ZVAL_LONG(&_100$$66, 6);
zephir_array_update_string(&definition, SL("type"), &_100$$66, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("varying"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 437) || _64$$41 == zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 438)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("varying"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 435) || _64$$41 == zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 436)) {
ZEPHIR_INIT_NVAR(&_101$$67);
ZVAL_LONG(&_101$$67, 2);
zephir_array_update_string(&definition, SL("type"), &_101$$67, PH_COPY | PH_SEPARATE);
zephir_array_update_string(&definition, SL("size"), &charSize, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 447)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 445)) {
ZEPHIR_INIT_NVAR(&_102$$68);
ZVAL_LONG(&_102$$68, 5);
zephir_array_update_string(&definition, SL("type"), &_102$$68, PH_COPY | PH_SEPARATE);
zephir_array_update_string(&definition, SL("size"), &charSize, PH_COPY | PH_SEPARATE);
break;
}
- if (_64$$41 == zephir_memnstr_str(&columnType, SL("uuid"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 456)) {
+ if (_64$$41 == zephir_memnstr_str(&columnType, SL("uuid"), "phalcon/Db/Adapter/Pdo/Postgresql.zep", 454)) {
ZEPHIR_INIT_NVAR(&_103$$69);
ZVAL_LONG(&_103$$69, 5);
zephir_array_update_string(&definition, SL("type"), &_103$$69, PH_COPY | PH_SEPARATE);
@@ -1050,21 +1047,21 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
} else {
zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE);
}
- zephir_array_fetch_long(&_106$$41, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 483);
+ zephir_array_fetch_long(&_106$$41, &field, 6, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 481);
if (ZEPHIR_IS_STRING(&_106$$41, "PRI")) {
zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE);
}
- zephir_array_fetch_long(&_107$$41, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 490);
+ zephir_array_fetch_long(&_107$$41, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 488);
if (ZEPHIR_IS_STRING(&_107$$41, "YES")) {
zephir_array_update_string(&definition, SL("notNull"), &__$false, PH_COPY | PH_SEPARATE);
}
- zephir_array_fetch_long(&_108$$41, &field, 7, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 497);
+ zephir_array_fetch_long(&_108$$41, &field, 7, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 495);
if (ZEPHIR_IS_STRING(&_108$$41, "auto_increment")) {
zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE);
}
- zephir_array_fetch_long(&_109$$41, &field, 9, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 504);
+ zephir_array_fetch_long(&_109$$41, &field, 9, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 502);
if (Z_TYPE_P(&_109$$41) != IS_NULL) {
- zephir_array_fetch_long(&_110$$76, &field, 9, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 509);
+ zephir_array_fetch_long(&_110$$76, &field, 9, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 507);
ZEPHIR_INIT_NVAR(&_111$$76);
ZVAL_STRING(&_111$$76, "/^'|'?::[[:alnum:][:space:]]+$/");
ZEPHIR_INIT_NVAR(&_112$$76);
@@ -1072,7 +1069,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
ZEPHIR_CALL_FUNCTION(&_113$$76, "preg_replace", &_55, 50, &_111$$76, &_112$$76, &_110$$76);
zephir_check_call_status();
zephir_array_update_string(&definition, SL("default"), &_113$$76, PH_COPY | PH_SEPARATE);
- zephir_array_fetch_string(&_114$$76, &definition, SL("default"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 511);
+ zephir_array_fetch_string(&_114$$76, &definition, SL("default"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 509);
ZEPHIR_INIT_NVAR(&_111$$76);
ZVAL_STRING(&_111$$76, "null");
ZEPHIR_CALL_FUNCTION(&_115$$76, "strcasecmp", &_58, 47, &_114$$76, &_111$$76);
@@ -1081,18 +1078,18 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns)
zephir_array_update_string(&definition, SL("default"), &__$null, PH_COPY | PH_SEPARATE);
}
}
- zephir_array_fetch_long(&_116$$41, &field, 10, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 519);
+ zephir_array_fetch_long(&_116$$41, &field, 10, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 517);
if (Z_TYPE_P(&_116$$41) != IS_NULL) {
- zephir_array_fetch_long(&_117$$78, &field, 10, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 520);
+ zephir_array_fetch_long(&_117$$78, &field, 10, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 518);
zephir_array_update_string(&definition, SL("comment"), &_117$$78, PH_COPY | PH_SEPARATE);
}
ZEPHIR_OBS_NVAR(&columnName);
- zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 526);
+ zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 524);
ZEPHIR_INIT_NVAR(&_118$$41);
object_init_ex(&_118$$41, phalcon_db_column_ce);
ZEPHIR_CALL_METHOD(NULL, &_118$$41, "__construct", &_62, 212, &columnName, &definition);
zephir_check_call_status();
- zephir_array_append(&columns, &_118$$41, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 527);
+ zephir_array_append(&columns, &_118$$41, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 525);
ZEPHIR_CPY_WRT(&oldColumn, &columnName);
ZEPHIR_CALL_METHOD(NULL, &fields, "next", NULL, 0);
zephir_check_call_status();
@@ -1211,50 +1208,50 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeReferences)
ZVAL_LONG(&_3, 3);
ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3);
zephir_check_call_status();
- zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 583);
+ zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 581);
if (Z_TYPE_P(&_0) == IS_ARRAY) {
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4)
{
ZEPHIR_INIT_NVAR(&reference);
ZVAL_COPY(&reference, _4);
- zephir_array_fetch_long(&constraintName, &reference, 2, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 552);
+ zephir_array_fetch_long(&constraintName, &reference, 2, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 550);
if (!(zephir_array_isset(&references, &constraintName))) {
ZEPHIR_OBS_NVAR(&referencedSchema);
- zephir_array_fetch_long(&referencedSchema, &reference, 3, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 555);
+ zephir_array_fetch_long(&referencedSchema, &reference, 3, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 553);
ZEPHIR_OBS_NVAR(&referencedTable);
- zephir_array_fetch_long(&referencedTable, &reference, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 556);
+ zephir_array_fetch_long(&referencedTable, &reference, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 554);
ZEPHIR_OBS_NVAR(&referenceUpdate);
- zephir_array_fetch_long(&referenceUpdate, &reference, 6, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 557);
+ zephir_array_fetch_long(&referenceUpdate, &reference, 6, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 555);
ZEPHIR_OBS_NVAR(&referenceDelete);
- zephir_array_fetch_long(&referenceDelete, &reference, 7, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 558);
+ zephir_array_fetch_long(&referenceDelete, &reference, 7, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 556);
ZEPHIR_INIT_NVAR(&columns);
array_init(&columns);
ZEPHIR_INIT_NVAR(&referencedColumns);
array_init(&referencedColumns);
} else {
- zephir_array_fetch(&_6$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 562);
+ zephir_array_fetch(&_6$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 560);
ZEPHIR_OBS_NVAR(&referencedSchema);
- zephir_array_fetch_string(&referencedSchema, &_6$$5, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 562);
- zephir_array_fetch(&_7$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 563);
+ zephir_array_fetch_string(&referencedSchema, &_6$$5, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 560);
+ zephir_array_fetch(&_7$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 561);
ZEPHIR_OBS_NVAR(&referencedTable);
- zephir_array_fetch_string(&referencedTable, &_7$$5, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 563);
- zephir_array_fetch(&_8$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 564);
+ zephir_array_fetch_string(&referencedTable, &_7$$5, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 561);
+ zephir_array_fetch(&_8$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 562);
ZEPHIR_OBS_NVAR(&columns);
- zephir_array_fetch_string(&columns, &_8$$5, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 564);
- zephir_array_fetch(&_9$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 565);
+ zephir_array_fetch_string(&columns, &_8$$5, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 562);
+ zephir_array_fetch(&_9$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 563);
ZEPHIR_OBS_NVAR(&referencedColumns);
- zephir_array_fetch_string(&referencedColumns, &_9$$5, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 565);
- zephir_array_fetch(&_10$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 566);
+ zephir_array_fetch_string(&referencedColumns, &_9$$5, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 563);
+ zephir_array_fetch(&_10$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 564);
ZEPHIR_OBS_NVAR(&referenceUpdate);
- zephir_array_fetch_string(&referenceUpdate, &_10$$5, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 566);
- zephir_array_fetch(&_11$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 567);
+ zephir_array_fetch_string(&referenceUpdate, &_10$$5, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 564);
+ zephir_array_fetch(&_11$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 565);
ZEPHIR_OBS_NVAR(&referenceDelete);
- zephir_array_fetch_string(&referenceDelete, &_11$$5, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 567);
+ zephir_array_fetch_string(&referenceDelete, &_11$$5, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 565);
}
- zephir_array_fetch_long(&_12$$3, &reference, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 570);
- zephir_array_append(&columns, &_12$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 570);
- zephir_array_fetch_long(&_13$$3, &reference, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 571);
- zephir_array_append(&referencedColumns, &_13$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 571);
+ zephir_array_fetch_long(&_12$$3, &reference, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 568);
+ zephir_array_append(&columns, &_12$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 568);
+ zephir_array_fetch_long(&_13$$3, &reference, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 569);
+ zephir_array_append(&referencedColumns, &_13$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 569);
ZEPHIR_INIT_NVAR(&_14$$3);
zephir_create_array(&_14$$3, 6, 0);
zephir_array_update_string(&_14$$3, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE);
@@ -1277,44 +1274,44 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeReferences)
ZEPHIR_CALL_METHOD(&reference, &_0, "current", NULL, 0);
zephir_check_call_status();
ZEPHIR_OBS_NVAR(&constraintName);
- zephir_array_fetch_long(&constraintName, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 552);
+ zephir_array_fetch_long(&constraintName, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 550);
if (!(zephir_array_isset(&references, &constraintName))) {
ZEPHIR_OBS_NVAR(&referencedSchema);
- zephir_array_fetch_long(&referencedSchema, &reference, 3, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 555);
+ zephir_array_fetch_long(&referencedSchema, &reference, 3, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 553);
ZEPHIR_OBS_NVAR(&referencedTable);
- zephir_array_fetch_long(&referencedTable, &reference, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 556);
+ zephir_array_fetch_long(&referencedTable, &reference, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 554);
ZEPHIR_OBS_NVAR(&referenceUpdate);
- zephir_array_fetch_long(&referenceUpdate, &reference, 6, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 557);
+ zephir_array_fetch_long(&referenceUpdate, &reference, 6, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 555);
ZEPHIR_OBS_NVAR(&referenceDelete);
- zephir_array_fetch_long(&referenceDelete, &reference, 7, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 558);
+ zephir_array_fetch_long(&referenceDelete, &reference, 7, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 556);
ZEPHIR_INIT_NVAR(&columns);
array_init(&columns);
ZEPHIR_INIT_NVAR(&referencedColumns);
array_init(&referencedColumns);
} else {
- zephir_array_fetch(&_15$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 562);
+ zephir_array_fetch(&_15$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 560);
ZEPHIR_OBS_NVAR(&referencedSchema);
- zephir_array_fetch_string(&referencedSchema, &_15$$8, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 562);
- zephir_array_fetch(&_16$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 563);
+ zephir_array_fetch_string(&referencedSchema, &_15$$8, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 560);
+ zephir_array_fetch(&_16$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 561);
ZEPHIR_OBS_NVAR(&referencedTable);
- zephir_array_fetch_string(&referencedTable, &_16$$8, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 563);
- zephir_array_fetch(&_17$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 564);
+ zephir_array_fetch_string(&referencedTable, &_16$$8, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 561);
+ zephir_array_fetch(&_17$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 562);
ZEPHIR_OBS_NVAR(&columns);
- zephir_array_fetch_string(&columns, &_17$$8, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 564);
- zephir_array_fetch(&_18$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 565);
+ zephir_array_fetch_string(&columns, &_17$$8, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 562);
+ zephir_array_fetch(&_18$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 563);
ZEPHIR_OBS_NVAR(&referencedColumns);
- zephir_array_fetch_string(&referencedColumns, &_18$$8, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 565);
- zephir_array_fetch(&_19$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 566);
+ zephir_array_fetch_string(&referencedColumns, &_18$$8, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 563);
+ zephir_array_fetch(&_19$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 564);
ZEPHIR_OBS_NVAR(&referenceUpdate);
- zephir_array_fetch_string(&referenceUpdate, &_19$$8, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 566);
- zephir_array_fetch(&_20$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 567);
+ zephir_array_fetch_string(&referenceUpdate, &_19$$8, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 564);
+ zephir_array_fetch(&_20$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 565);
ZEPHIR_OBS_NVAR(&referenceDelete);
- zephir_array_fetch_string(&referenceDelete, &_20$$8, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 567);
+ zephir_array_fetch_string(&referenceDelete, &_20$$8, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 565);
}
- zephir_array_fetch_long(&_21$$6, &reference, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 570);
- zephir_array_append(&columns, &_21$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 570);
- zephir_array_fetch_long(&_22$$6, &reference, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 571);
- zephir_array_append(&referencedColumns, &_22$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 571);
+ zephir_array_fetch_long(&_21$$6, &reference, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 568);
+ zephir_array_append(&columns, &_21$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 568);
+ zephir_array_fetch_long(&_22$$6, &reference, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 569);
+ zephir_array_append(&referencedColumns, &_22$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 569);
ZEPHIR_INIT_NVAR(&_23$$6);
zephir_create_array(&_23$$6, 6, 0);
zephir_array_update_string(&_23$$6, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE);
@@ -1331,7 +1328,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeReferences)
ZEPHIR_INIT_NVAR(&reference);
ZEPHIR_INIT_VAR(&referenceObjects);
array_init(&referenceObjects);
- zephir_is_iterable(&references, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 599);
+ zephir_is_iterable(&references, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 597);
if (Z_TYPE_P(&references) == IS_ARRAY) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&references), _26, _27, _24)
{
@@ -1348,22 +1345,22 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeReferences)
ZEPHIR_INIT_NVAR(&_29$$9);
zephir_create_array(&_29$$9, 6, 0);
ZEPHIR_OBS_NVAR(&_30$$9);
- zephir_array_fetch_string(&_30$$9, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 589);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 587);
zephir_array_update_string(&_29$$9, SL("referencedSchema"), &_30$$9, PH_COPY | PH_SEPARATE);
ZEPHIR_OBS_NVAR(&_30$$9);
- zephir_array_fetch_string(&_30$$9, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 590);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 588);
zephir_array_update_string(&_29$$9, SL("referencedTable"), &_30$$9, PH_COPY | PH_SEPARATE);
ZEPHIR_OBS_NVAR(&_30$$9);
- zephir_array_fetch_string(&_30$$9, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 591);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 589);
zephir_array_update_string(&_29$$9, SL("columns"), &_30$$9, PH_COPY | PH_SEPARATE);
ZEPHIR_OBS_NVAR(&_30$$9);
- zephir_array_fetch_string(&_30$$9, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 592);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 590);
zephir_array_update_string(&_29$$9, SL("referencedColumns"), &_30$$9, PH_COPY | PH_SEPARATE);
ZEPHIR_OBS_NVAR(&_30$$9);
- zephir_array_fetch_string(&_30$$9, &arrayReference, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 593);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 591);
zephir_array_update_string(&_29$$9, SL("onUpdate"), &_30$$9, PH_COPY | PH_SEPARATE);
ZEPHIR_OBS_NVAR(&_30$$9);
- zephir_array_fetch_string(&_30$$9, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 595);
+ zephir_array_fetch_string(&_30$$9, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 593);
zephir_array_update_string(&_29$$9, SL("onDelete"), &_30$$9, PH_COPY | PH_SEPARATE);
ZEPHIR_CALL_METHOD(NULL, &_28$$9, "__construct", &_31, 33, &name, &_29$$9);
zephir_check_call_status();
@@ -1387,22 +1384,22 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeReferences)
ZEPHIR_INIT_NVAR(&_33$$10);
zephir_create_array(&_33$$10, 6, 0);
ZEPHIR_OBS_NVAR(&_34$$10);
- zephir_array_fetch_string(&_34$$10, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 589);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 587);
zephir_array_update_string(&_33$$10, SL("referencedSchema"), &_34$$10, PH_COPY | PH_SEPARATE);
ZEPHIR_OBS_NVAR(&_34$$10);
- zephir_array_fetch_string(&_34$$10, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 590);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 588);
zephir_array_update_string(&_33$$10, SL("referencedTable"), &_34$$10, PH_COPY | PH_SEPARATE);
ZEPHIR_OBS_NVAR(&_34$$10);
- zephir_array_fetch_string(&_34$$10, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 591);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 589);
zephir_array_update_string(&_33$$10, SL("columns"), &_34$$10, PH_COPY | PH_SEPARATE);
ZEPHIR_OBS_NVAR(&_34$$10);
- zephir_array_fetch_string(&_34$$10, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 592);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 590);
zephir_array_update_string(&_33$$10, SL("referencedColumns"), &_34$$10, PH_COPY | PH_SEPARATE);
ZEPHIR_OBS_NVAR(&_34$$10);
- zephir_array_fetch_string(&_34$$10, &arrayReference, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 593);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("onUpdate"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 591);
zephir_array_update_string(&_33$$10, SL("onUpdate"), &_34$$10, PH_COPY | PH_SEPARATE);
ZEPHIR_OBS_NVAR(&_34$$10);
- zephir_array_fetch_string(&_34$$10, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 595);
+ zephir_array_fetch_string(&_34$$10, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 593);
zephir_array_update_string(&_33$$10, SL("onDelete"), &_34$$10, PH_COPY | PH_SEPARATE);
ZEPHIR_CALL_METHOD(NULL, &_32$$10, "__construct", &_31, 33, &name, &_33$$10);
zephir_check_call_status();
@@ -1534,7 +1531,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, modifyColumn)
ZEPHIR_CALL_METHOD(NULL, this_ptr, "begin", NULL, 0);
zephir_check_call_status_or_jump(try_end_1);
- zephir_is_iterable(&queries, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 655);
+ zephir_is_iterable(&queries, 0, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 653);
if (Z_TYPE_P(&queries) == IS_ARRAY) {
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&queries), _1$$4)
{
@@ -1586,7 +1583,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, modifyColumn)
ZEPHIR_CPY_WRT(&exception, &_6$$3);
ZEPHIR_CALL_METHOD(NULL, this_ptr, "rollback", NULL, 0);
zephir_check_call_status();
- zephir_throw_exception_debug(&exception, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 659);
+ zephir_throw_exception_debug(&exception, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 657);
ZEPHIR_MM_RESTORE();
return;
}
@@ -1594,7 +1591,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, modifyColumn)
} else {
ZEPHIR_INIT_VAR(&_7$$10);
if (!(ZEPHIR_IS_EMPTY(&sql))) {
- zephir_array_fetch_long(&_8$$10, &queries, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 662);
+ zephir_array_fetch_long(&_8$$10, &queries, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 660);
ZEPHIR_INIT_VAR(&_9$$10);
ZEPHIR_CONCAT_VS(&_9$$10, &_8$$10, ";");
ZEPHIR_CALL_METHOD(&_7$$10, this_ptr, "execute", NULL, 0, &_9$$10);
diff --git a/ext/phalcon/db/adapter/pdo/postgresql.zep.h b/ext/phalcon/db/adapter/pdo/postgresql.zep.h
index 984d927cd2e..577b2bee24c 100644
--- a/ext/phalcon/db/adapter/pdo/postgresql.zep.h
+++ b/ext/phalcon/db/adapter/pdo/postgresql.zep.h
@@ -18,11 +18,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql___construct, 0,
ZEND_ARG_ARRAY_INFO(0, descriptor, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_connect, 0, 0, _IS_BOOL, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_connect, 0, 0, IS_VOID, 0)
+
#if PHP_VERSION_ID >= 80000
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 1, "[]")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 0, "[]")
#else
- ZEND_ARG_ARRAY_INFO(0, descriptor, 1)
+ ZEND_ARG_ARRAY_INFO(0, descriptor, 0)
#endif
ZEND_END_ARG_INFO()
diff --git a/ext/phalcon/db/adapter/pdo/sqlite.zep.c b/ext/phalcon/db/adapter/pdo/sqlite.zep.c
index d166346d666..9cd9bd24b97 100644
--- a/ext/phalcon/db/adapter/pdo/sqlite.zep.c
+++ b/ext/phalcon/db/adapter/pdo/sqlite.zep.c
@@ -105,20 +105,19 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, connect)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zephir_fcall_cache_entry *_2 = NULL;
+ zephir_fcall_cache_entry *_1 = NULL;
zval *descriptor_param = NULL, dbname, _0$$3;
- zval descriptor, _1$$3;
+ zval descriptor;
zval *this_ptr = getThis();
ZVAL_UNDEF(&descriptor);
- ZVAL_UNDEF(&_1$$3);
ZVAL_UNDEF(&dbname);
ZVAL_UNDEF(&_0$$3);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY_OR_NULL(descriptor)
+ Z_PARAM_ARRAY(descriptor)
ZEND_PARSE_PARAMETERS_END();
#endif
@@ -127,16 +126,15 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, connect)
zephir_fetch_params(1, 0, 1, &descriptor_param);
if (!descriptor_param) {
ZEPHIR_INIT_VAR(&descriptor);
+ array_init(&descriptor);
} else {
- zephir_get_arrval(&descriptor, descriptor_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&descriptor, descriptor_param);
}
if (ZEPHIR_IS_EMPTY(&descriptor)) {
- ZEPHIR_OBS_VAR(&_0$$3);
- zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("descriptor"), PH_NOISY_CC);
- zephir_get_arrval(&_1$$3, &_0$$3);
- ZEPHIR_CPY_WRT(&descriptor, &_1$$3);
+ zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("descriptor"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&descriptor, &_0$$3);
}
ZEPHIR_OBS_VAR(&dbname);
if (zephir_array_isset_string_fetch(&dbname, &descriptor, SL("dbname"), 0)) {
@@ -146,9 +144,9 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, connect)
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The database must be specified with either 'dbname' or 'dsn'.", "phalcon/Db/Adapter/Pdo/Sqlite.zep", 82);
return;
}
- ZEPHIR_RETURN_CALL_PARENT(phalcon_db_adapter_pdo_sqlite_ce, getThis(), "connect", &_2, 0, &descriptor);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_db_adapter_pdo_sqlite_ce, getThis(), "connect", &_1, 0, &descriptor);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_MM_RESTORE();
}
/**
diff --git a/ext/phalcon/db/adapter/pdo/sqlite.zep.h b/ext/phalcon/db/adapter/pdo/sqlite.zep.h
index d08064f3b54..8994be04d14 100644
--- a/ext/phalcon/db/adapter/pdo/sqlite.zep.h
+++ b/ext/phalcon/db/adapter/pdo/sqlite.zep.h
@@ -17,11 +17,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite___construct, 0, 0,
ZEND_ARG_ARRAY_INFO(0, descriptor, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_connect, 0, 0, _IS_BOOL, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_connect, 0, 0, IS_VOID, 0)
+
#if PHP_VERSION_ID >= 80000
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 1, "[]")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, descriptor, IS_ARRAY, 0, "[]")
#else
- ZEND_ARG_ARRAY_INFO(0, descriptor, 1)
+ ZEND_ARG_ARRAY_INFO(0, descriptor, 0)
#endif
ZEND_END_ARG_INFO()
diff --git a/ext/phalcon/security/jwt/builder.zep.c b/ext/phalcon/security/jwt/builder.zep.c
index a97444a8885..a2727dabcd1 100644
--- a/ext/phalcon/security/jwt/builder.zep.c
+++ b/ext/phalcon/security/jwt/builder.zep.c
@@ -16,11 +16,11 @@
#include "kernel/object.h"
#include "kernel/memory.h"
#include "kernel/array.h"
-#include "kernel/operators.h"
+#include "ext/spl/spl_exceptions.h"
#include "kernel/exception.h"
+#include "kernel/operators.h"
#include "kernel/concat.h"
#include "kernel/time.h"
-#include "ext/spl/spl_exceptions.h"
#include "kernel/string.h"
@@ -147,6 +147,53 @@ PHP_METHOD(Phalcon_Security_JWT_Builder, init)
RETURN_THIS();
}
+/**
+ * Adds a custom claim
+ *
+ * @param string $name
+ * @param mixed $value
+ *
+ * @return Builder
+ */
+PHP_METHOD(Phalcon_Security_JWT_Builder, addClaim)
+{
+ 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);
+#if PHP_VERSION_ID >= 80000
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+
+ ZEPHIR_MM_GROW();
+ zephir_fetch_params(1, 2, 0, &name_param, &value);
+ 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("claims"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &name, value);
+ zephir_check_call_status();
+ RETURN_THIS();
+}
+
/**
* @return array|string
*/
@@ -451,7 +498,7 @@ PHP_METHOD(Phalcon_Security_JWT_Builder, getToken)
zephir_read_property(&_0, this_ptr, ZEND_STRL("passphrase"), PH_NOISY_CC | PH_READONLY);
if (ZEPHIR_IS_EMPTY(&_0)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid passphrase (empty)", "phalcon/Security/JWT/Builder.zep", 183);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid passphrase (empty)", "phalcon/Security/JWT/Builder.zep", 198);
return;
}
ZEPHIR_CALL_METHOD(&_4, this_ptr, "getclaims", NULL, 0);
@@ -554,7 +601,7 @@ PHP_METHOD(Phalcon_Security_JWT_Builder, setAudience)
_0 = Z_TYPE_P(audience) != IS_ARRAY;
}
if (_0) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid Audience", "phalcon/Security/JWT/Builder.zep", 233);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid Audience", "phalcon/Security/JWT/Builder.zep", 248);
return;
}
if (Z_TYPE_P(audience) == IS_STRING) {
@@ -650,7 +697,7 @@ PHP_METHOD(Phalcon_Security_JWT_Builder, setExpirationTime)
ZEPHIR_INIT_VAR(&_0);
zephir_time(&_0);
if (ZEPHIR_GT_LONG(&_0, timestamp)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid Expiration Time", "phalcon/Security/JWT/Builder.zep", 278);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid Expiration Time", "phalcon/Security/JWT/Builder.zep", 293);
return;
}
ZEPHIR_INIT_VAR(&_1);
@@ -849,7 +896,7 @@ PHP_METHOD(Phalcon_Security_JWT_Builder, setNotBefore)
ZEPHIR_INIT_VAR(&_0);
zephir_time(&_0);
if (ZEPHIR_LT_LONG(&_0, timestamp)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid Not Before", "phalcon/Security/JWT/Builder.zep", 352);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid Not Before", "phalcon/Security/JWT/Builder.zep", 367);
return;
}
ZEPHIR_INIT_VAR(&_1);
@@ -958,7 +1005,7 @@ PHP_METHOD(Phalcon_Security_JWT_Builder, setPassphrase)
ZVAL_STRING(&_3, "/(?=^.{16,}$)((?=.*\\d)|(?=.*\\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/");
zephir_preg_match(&_2, &_3, &passphrase, &_0, 0, 0 , 0 );
if (!(zephir_is_true(&_2))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid passphrase (too weak)", "phalcon/Security/JWT/Builder.zep", 390);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_jwt_exceptions_validatorexception_ce, "Invalid passphrase (too weak)", "phalcon/Security/JWT/Builder.zep", 405);
return;
}
zephir_update_property_zval(this_ptr, ZEND_STRL("passphrase"), &passphrase);
diff --git a/ext/phalcon/security/jwt/builder.zep.h b/ext/phalcon/security/jwt/builder.zep.h
index 5776b1b2324..f6e8b819871 100644
--- a/ext/phalcon/security/jwt/builder.zep.h
+++ b/ext/phalcon/security/jwt/builder.zep.h
@@ -5,6 +5,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Security_JWT_Builder);
PHP_METHOD(Phalcon_Security_JWT_Builder, __construct);
PHP_METHOD(Phalcon_Security_JWT_Builder, init);
+PHP_METHOD(Phalcon_Security_JWT_Builder, addClaim);
PHP_METHOD(Phalcon_Security_JWT_Builder, getAudience);
PHP_METHOD(Phalcon_Security_JWT_Builder, getClaims);
PHP_METHOD(Phalcon_Security_JWT_Builder, getContentType);
@@ -35,6 +36,11 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_security_jwt_builder_init, 0, 0, Phalcon\\Security\\JWT\\Builder, 0)
ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_security_jwt_builder_addclaim, 0, 2, Phalcon\\Security\\JWT\\Builder, 0)
+ ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_jwt_builder_getaudience, 0, 0, 0)
ZEND_END_ARG_INFO()
@@ -115,6 +121,7 @@ ZEND_END_ARG_INFO()
ZEPHIR_INIT_FUNCS(phalcon_security_jwt_builder_method_entry) {
PHP_ME(Phalcon_Security_JWT_Builder, __construct, arginfo_phalcon_security_jwt_builder___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_ME(Phalcon_Security_JWT_Builder, init, arginfo_phalcon_security_jwt_builder_init, ZEND_ACC_PUBLIC)
+ PHP_ME(Phalcon_Security_JWT_Builder, addClaim, arginfo_phalcon_security_jwt_builder_addclaim, ZEND_ACC_PUBLIC)
#if PHP_VERSION_ID >= 80000
PHP_ME(Phalcon_Security_JWT_Builder, getAudience, arginfo_phalcon_security_jwt_builder_getaudience, ZEND_ACC_PUBLIC)
#else
diff --git a/ext/phalcon/storage/adapter/abstractadapter.zep.c b/ext/phalcon/storage/adapter/abstractadapter.zep.c
index 76fcf5c14b7..6c2c5fde139 100644
--- a/ext/phalcon/storage/adapter/abstractadapter.zep.c
+++ b/ext/phalcon/storage/adapter/abstractadapter.zep.c
@@ -184,7 +184,9 @@ PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, __construct)
ZEPHIR_CALL_CE_STATIC(&_4, phalcon_helper_arr_ce, "get", &_1, 16, &options, &_2, &_5);
zephir_check_call_status();
zephir_update_property_zval(this_ptr, ZEND_STRL("lifetime"), &_4);
- if (zephir_array_isset_string(&options, SL("prefix"))) {
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "prefix");
+ if (zephir_array_key_exists(&options, &_2)) {
zephir_array_fetch_string(&_6$$3, &options, SL("prefix"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/AbstractAdapter.zep", 81);
zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_6$$3);
}
diff --git a/ext/phalcon/support/version.zep.c b/ext/phalcon/support/version.zep.c
index 8662439ebe2..14cb7095308 100644
--- a/ext/phalcon/support/version.zep.c
+++ b/ext/phalcon/support/version.zep.c
@@ -123,7 +123,7 @@ PHP_METHOD(Phalcon_Support_Version, getVersion)
ZVAL_LONG(&_0, 1);
zephir_array_fast_append(return_value, &_0);
ZEPHIR_INIT_NVAR(&_0);
- ZVAL_LONG(&_0, 4);
+ ZVAL_LONG(&_0, 6);
zephir_array_fast_append(return_value, &_0);
RETURN_MM();
}
diff --git a/ext/php_phalcon.h b/ext/php_phalcon.h
index 56093d42c3e..894615b7eda 100644
--- a/ext/php_phalcon.h
+++ b/ext/php_phalcon.h
@@ -11,18 +11,18 @@
#include "kernel/globals.h"
#define PHP_PHALCON_NAME "phalcon"
-#define PHP_PHALCON_VERSION "5.0.0alpha5"
+#define PHP_PHALCON_VERSION "5.0.0alpha6"
#define PHP_PHALCON_EXTNAME "phalcon"
#define PHP_PHALCON_AUTHOR "Phalcon Team and contributors"
#define PHP_PHALCON_ZEPVERSION "0.14.0-beta.3-0be9ad5"
#define PHP_PHALCON_DESCRIPTION "Phalcon is a full stack PHP framework, delivered as a PHP extension, offering lower resource consumption and high performance."
-typedef struct _zephir_struct_db {
+typedef struct _zephir_struct_db {
zend_bool escape_identifiers;
zend_bool force_casting;
} zephir_struct_db;
-typedef struct _zephir_struct_orm {
+typedef struct _zephir_struct_orm {
HashTable* ast_cache;
int cache_level;
zend_bool case_insensitive_column_map;
@@ -45,7 +45,7 @@ typedef struct _zephir_struct_orm {
zend_bool virtual_foreign_keys;
} zephir_struct_orm;
-typedef struct _zephir_struct_warning {
+typedef struct _zephir_struct_warning {
zend_bool enable;
} zephir_struct_warning;
@@ -66,7 +66,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phalcon)
/* Max recursion control */
unsigned int recursive_lock;
-
+
zephir_struct_db db;
zephir_struct_orm orm;
diff --git a/package.xml b/package.xml
index 4ae1f71bbe2..a2e790d1370 100644
--- a/package.xml
+++ b/package.xml
@@ -1,21 +1,32 @@
-
+
phalcon
pecl.php.net
Phalcon is a full stack PHP framework offering low resource consumption and high performance.
- Phalcon is an open source full stack framework for PHP, written as a C-extension. Phalcon is optimized for high performance. Its unique architecture allows the framework to always be memory resident, offering its functionality whenever its needed, without expensive file stats and file reads that traditional PHP frameworks employ.
+ Phalcon is an open source full stack framework for PHP, written as a C-extension. Phalcon is optimized for high
+ performance. Its unique architecture allows the framework to always be memory resident, offering its functionality
+ whenever its needed, without expensive file stats and file reads that traditional PHP frameworks employ.
+
+
+ Anton Vasiliev
+ jeckerson
+ anton@phalcon.io
+ yes
+
Ruud Boon
ruudboon
ruud@ruudboon.io
yes
- 2021-09-05
+ 2021-09-16
17:00:00
- 5.0.0alpha5
- 5.0.0alpha5
+ 5.0.0alpha6
+ 5.0.0alpha6
alpha
@@ -26,23 +37,27 @@
Full changelog can be found at: https://github.com/phalcon/cphalcon/blob/master/CHANGELOG-5.0.md
## Changed
- - Merged all architectures (`build/phalcon/32bits`, `build/phalcon/64bits` and `build/phalcon/safe`) into single universal inside `build/phalcon` [#15647](https://github.com/phalcon/cphalcon/issues/15647)
+ - Adjusted the constructor for `Phalcon\Storage\Adapter\*` and `Phalcon\Cache\Adapter\*` to allow an empty key prefix to be set if needed. [#15480](https://github.com/phalcon/cphalcon/issues/15480)
+ - Changed:
+ - `Phalcon\Db\Adapter\AdapterInterface:lastInsertId()` to be identical as `Pdo:lastInsertId()`
+ - `Phalcon\Db\Adapter\AdapterInterface:close()` now returns `void` instead of `bool`
+ - `Phalcon\Db\Adapter\AdapterInterface:connect()` now returns `void` instead of `bool` and 1st argument default value is empty `array` instead of `null` [#15659](https://github.com/phalcon/cphalcon/issues/15659)
- ## Fixed
- - Fixed C code in `build/` directory [#15647](https://github.com/phalcon/cphalcon/issues/15647)
+ ## Added
+ - Added `Phalcon\Security\JWT\Builder::addClaim` for custom JWT claims. [#15656](https://github.com/phalcon/cphalcon/issues/15656)
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/phalcon/Db/Adapter/AdapterInterface.zep b/phalcon/Db/Adapter/AdapterInterface.zep
index b8f3961cfe2..65789b3d224 100644
--- a/phalcon/Db/Adapter/AdapterInterface.zep
+++ b/phalcon/Db/Adapter/AdapterInterface.zep
@@ -57,7 +57,7 @@ interface AdapterInterface
* Closes active connection returning success. Phalcon automatically closes
* and destroys active connections within Phalcon\Db\Pool
*/
- public function close() -> bool;
+ public function close() -> void;
/**
* Commits the active transaction in the connection
@@ -68,7 +68,7 @@ interface AdapterInterface
* This method is automatically called in \Phalcon\Db\Adapter\Pdo
* constructor. Call it when you need to restore a database connection
*/
- public function connect(array descriptor = null) -> bool;
+ public function connect(array! descriptor = []) -> void;
/**
* Creates a new savepoint
@@ -322,8 +322,10 @@ interface AdapterInterface
/**
* Returns insert id for the auto_increment column inserted in the last SQL
* statement
+ *
+ * @param string|null $name Name of the sequence object from which the ID should be returned.
*/
- public function lastInsertId(sequenceName = null);
+ public function lastInsertId(string! name = null) -> string|bool;
/**
* Appends a LIMIT clause to sqlQuery argument
diff --git a/phalcon/Db/Adapter/Pdo/AbstractPdo.zep b/phalcon/Db/Adapter/Pdo/AbstractPdo.zep
index f67f93640e6..916b4ab78ba 100644
--- a/phalcon/Db/Adapter/Pdo/AbstractPdo.zep
+++ b/phalcon/Db/Adapter/Pdo/AbstractPdo.zep
@@ -95,12 +95,7 @@ abstract class AbstractPdo extends AbstractAdapter
*/
public function begin(bool nesting = true) -> bool
{
- var pdo, transactionLevel, eventsManager, savepointName;
-
- let pdo = this->pdo;
- if typeof pdo != "object" {
- return false;
- }
+ var transactionLevel, eventsManager, savepointName;
/**
* Increase the transaction nesting level
@@ -121,7 +116,7 @@ abstract class AbstractPdo extends AbstractAdapter
eventsManager->fire("db:beginTransaction", this);
}
- return pdo->beginTransaction();
+ return this->pdo->beginTransaction();
}
/**
@@ -149,12 +144,7 @@ abstract class AbstractPdo extends AbstractAdapter
*/
public function commit(bool nesting = true) -> bool
{
- var pdo, transactionLevel, eventsManager, savepointName;
-
- let pdo = this->pdo;
- if typeof pdo != "object" {
- return false;
- }
+ var transactionLevel, eventsManager, savepointName;
/**
* Check the transaction nesting level
@@ -178,7 +168,7 @@ abstract class AbstractPdo extends AbstractAdapter
*/
let this->transactionLevel--;
- return pdo->commit();
+ return this->pdo->commit();
}
/**
@@ -217,11 +207,9 @@ abstract class AbstractPdo extends AbstractAdapter
* Closes the active connection returning success. Phalcon automatically
* closes and destroys active connections when the request ends
*/
- public function close() -> bool
+ public function close() -> void
{
let this->pdo = null;
-
- return true;
}
/**
@@ -248,13 +236,14 @@ abstract class AbstractPdo extends AbstractAdapter
* $connection->connect();
* ```
*/
- public function connect(array descriptor = null) -> bool
+ public function connect(array! descriptor = []) -> void
{
- var username, password, dsnParts, dsnAttributes, dsnAttributesCustomRaw,
+ var username, password, dsnAttributes, dsnAttributesCustomRaw,
dsnAttributesMap, key, options, persistent, value;
+ array dsnParts = [];
if empty descriptor {
- let descriptor = (array) this->descriptor;
+ let descriptor = this->descriptor;
}
// Check for a username or use null as default
@@ -276,7 +265,8 @@ abstract class AbstractPdo extends AbstractAdapter
* Check if the developer has defined custom options or create one from
* scratch
*/
- if fetch options, descriptor["options"] {
+ if isset descriptor["options"] && is_array(descriptor["options"]) {
+ let options = descriptor["options"];
unset descriptor["options"];
} else {
let options = [];
@@ -289,8 +279,6 @@ abstract class AbstractPdo extends AbstractAdapter
// Set PDO to throw exceptions when an error is encountered.
let options[\PDO::ATTR_ERRMODE] = \PDO::ERRMODE_EXCEPTION;
- let dsnParts = [];
-
// Check if the user has defined a custom dsn string. It should be in
// the form of key=value with semicolons delineating sections.
if fetch dsnAttributesCustomRaw, descriptor["dsn"] {
@@ -323,8 +311,6 @@ abstract class AbstractPdo extends AbstractAdapter
password,
options
);
-
- return true;
}
/**
@@ -416,7 +402,7 @@ abstract class AbstractPdo extends AbstractAdapter
*/
public function execute(string! sqlStatement, array! bindParams = [], array! bindTypes = []) -> bool
{
- var eventsManager, affectedRows, pdo, newStatement, statement;
+ var eventsManager, affectedRows, newStatement, statement;
/**
* Execute the beforeQuery event if an EventsManager is available
@@ -439,10 +425,8 @@ abstract class AbstractPdo extends AbstractAdapter
this->prepareRealSql(sqlStatement, bindParams);
- let pdo = <\PDO> this->pdo;
-
if !empty bindParams {
- let statement = pdo->prepare(sqlStatement);
+ let statement = this->pdo->prepare(sqlStatement);
if typeof statement == "object" {
let newStatement = this->executePrepared(
@@ -454,7 +438,7 @@ abstract class AbstractPdo extends AbstractAdapter
let affectedRows = newStatement->rowCount();
}
} else {
- let affectedRows = pdo->exec(sqlStatement);
+ let affectedRows = this->pdo->exec(sqlStatement);
}
/**
@@ -584,13 +568,14 @@ abstract class AbstractPdo extends AbstractAdapter
}
statement->execute();
+
return statement;
}
/**
* Return the error info, if any
*/
- public function getErrorInfo()
+ public function getErrorInfo() -> array
{
return this->pdo->errorInfo();
}
@@ -625,15 +610,7 @@ abstract class AbstractPdo extends AbstractAdapter
*/
public function isUnderTransaction() -> bool
{
- var pdo;
-
- let pdo = this->pdo;
-
- if typeof pdo != "object" {
- return false;
- }
-
- return pdo->inTransaction();
+ return this->pdo->inTransaction();
}
/**
@@ -657,18 +634,13 @@ abstract class AbstractPdo extends AbstractAdapter
* // Getting the generated id
* $id = $connection->lastInsertId();
*```
+ *
+ * @param string|null $name
+ * @return string|bool
*/
- public function lastInsertId(sequenceName = null) -> int | bool
+ public function lastInsertId(string! name = null) -> string | bool
{
- var pdo;
-
- let pdo = this->pdo;
-
- if typeof pdo != "object" {
- return false;
- }
-
- return pdo->lastInsertId(sequenceName);
+ return this->pdo->lastInsertId(name);
}
/**
@@ -718,7 +690,7 @@ abstract class AbstractPdo extends AbstractAdapter
*/
public function query(string! sqlStatement, array! bindParams = [], array! bindTypes = []) -> | bool
{
- var eventsManager, pdo, statement, params, types;
+ var eventsManager, statement, params, types;
let eventsManager = this->eventsManager;
@@ -735,7 +707,6 @@ abstract class AbstractPdo extends AbstractAdapter
}
}
- let pdo = <\PDO> this->pdo;
if !empty bindParams {
let params = bindParams;
let types = bindTypes;
@@ -744,7 +715,7 @@ abstract class AbstractPdo extends AbstractAdapter
let types = [];
}
- let statement = pdo->prepare(sqlStatement);
+ let statement = this->pdo->prepare(sqlStatement);
if unlikely typeof statement != "object" {
throw new Exception("Cannot prepare statement");
}
@@ -778,12 +749,7 @@ abstract class AbstractPdo extends AbstractAdapter
*/
public function rollback(bool nesting = true) -> bool
{
- var pdo, transactionLevel, eventsManager, savepointName;
-
- let pdo = this->pdo;
- if typeof pdo != "object" {
- return false;
- }
+ var transactionLevel, eventsManager, savepointName;
/**
* Check the transaction nesting level
@@ -807,7 +773,7 @@ abstract class AbstractPdo extends AbstractAdapter
*/
let this->transactionLevel--;
- return pdo->rollback();
+ return this->pdo->rollback();
}
/**
@@ -859,6 +825,7 @@ abstract class AbstractPdo extends AbstractAdapter
let result = statement,
values = parameters;
+
if !empty parameters {
let keys = [];
diff --git a/phalcon/Db/Adapter/Pdo/Postgresql.zep b/phalcon/Db/Adapter/Pdo/Postgresql.zep
index 996b7a97f86..ab472ba61f6 100644
--- a/phalcon/Db/Adapter/Pdo/Postgresql.zep
+++ b/phalcon/Db/Adapter/Pdo/Postgresql.zep
@@ -67,12 +67,12 @@ class Postgresql extends PdoAdapter
* This method is automatically called in Phalcon\Db\Adapter\Pdo
* constructor. Call it when you need to restore a database connection.
*/
- public function connect(array descriptor = null) -> bool
+ public function connect(array! descriptor = []) -> void
{
- var schema, sql, status;
+ var schema, sql;
if empty descriptor {
- let descriptor = (array) this->descriptor;
+ let descriptor = this->descriptor;
}
if fetch schema, descriptor["schema"] {
@@ -87,15 +87,13 @@ class Postgresql extends PdoAdapter
}
}
- let status = parent::connect(descriptor);
+ parent::connect(descriptor);
if !empty schema {
let sql = "SET search_path TO '" . schema . "'";
this->execute(sql);
}
-
- return status;
}
/**
diff --git a/phalcon/Db/Adapter/Pdo/Sqlite.zep b/phalcon/Db/Adapter/Pdo/Sqlite.zep
index 5b85b9873a6..e19b02742ed 100644
--- a/phalcon/Db/Adapter/Pdo/Sqlite.zep
+++ b/phalcon/Db/Adapter/Pdo/Sqlite.zep
@@ -64,12 +64,12 @@ class Sqlite extends PdoAdapter
* This method is automatically called in Phalcon\Db\Adapter\Pdo
* constructor. Call it when you need to restore a database connection.
*/
- public function connect(array descriptor = null) -> bool
+ public function connect(array! descriptor = []) -> void
{
var dbname;
if empty descriptor {
- let descriptor = (array) this->descriptor;
+ let descriptor = this->descriptor;
}
if fetch dbname, descriptor["dbname"] {
@@ -82,7 +82,7 @@ class Sqlite extends PdoAdapter
);
}
- return parent::connect(descriptor);
+ parent::connect(descriptor);
}
/**
diff --git a/phalcon/Security/JWT/Builder.zep b/phalcon/Security/JWT/Builder.zep
index 66d97ab17f5..f6ffae52e38 100644
--- a/phalcon/Security/JWT/Builder.zep
+++ b/phalcon/Security/JWT/Builder.zep
@@ -88,6 +88,21 @@ class Builder
return this;
}
+ /**
+ * Adds a custom claim
+ *
+ * @param string $name
+ * @param mixed $value
+ *
+ * @return Builder
+ */
+ public function addClaim(string! name, var value) ->
+ {
+ this->claims->set(name, value);
+
+ return this;
+ }
+
/**
* @return array|string
*/
diff --git a/phalcon/Storage/Adapter/AbstractAdapter.zep b/phalcon/Storage/Adapter/AbstractAdapter.zep
index e614835d185..58f1c139af0 100644
--- a/phalcon/Storage/Adapter/AbstractAdapter.zep
+++ b/phalcon/Storage/Adapter/AbstractAdapter.zep
@@ -77,7 +77,7 @@ abstract class AbstractAdapter implements AdapterInterface
this->defaultSerializer = Arr::get(options, "defaultSerializer", "Php"),
this->lifetime = Arr::get(options, "lifetime", 3600);
- if isset options["prefix"] {
+ if array_key_exists("prefix", options) {
let this->prefix = options["prefix"];
}
}
diff --git a/phalcon/Support/Version.zep b/phalcon/Support/Version.zep
index b7f4c21dc95..c0b5247c36b 100644
--- a/phalcon/Support/Version.zep
+++ b/phalcon/Support/Version.zep
@@ -77,7 +77,7 @@ class Version
*/
protected function getVersion() -> array
{
- return [5, 0, 0, 1, 5];
+ return [5, 0, 0, 1, 6];
}
/**
diff --git a/tests/_data/fixtures/models/Invoices.php b/tests/_data/fixtures/models/Invoices.php
index 4df274bb181..3196e2e25da 100644
--- a/tests/_data/fixtures/models/Invoices.php
+++ b/tests/_data/fixtures/models/Invoices.php
@@ -18,21 +18,23 @@
/**
* Class Invoices
*
- * @property int $inv_id
- * @property int $inv_cst_id
- * @property int $inv_status_flag
- * @property string $inv_title
- * @property float $inv_total
- * @property string $inv_created_at
+ * @property int $inv_id
+ * @property int $inv_cst_id
+ * @property int $inv_status_flag
+ * @property string $inv_title
+ * @property float $inv_total
+ * @property string $inv_created_at
+ * @property mixed $secretValue
+ * @property bool|null $isActive
*
* @method static static findFirst($parameters = null)
* @method static Model\Resultset\Simple|static[] find($parameters = null)
*/
class Invoices extends Model
{
- const STATUS_UNPAID = 0;
- const STATUS_PAID = 1;
- const STATUS_INACTIVE = 2;
+ public const STATUS_UNPAID = 0;
+ public const STATUS_PAID = 1;
+ public const STATUS_INACTIVE = 2;
public $inv_id;
public $inv_cst_id;
@@ -41,8 +43,9 @@ class Invoices extends Model
public $inv_total;
public $inv_created_at;
- private $secretValue;
- private $superSecret;
+ private $secretValue; // Used with getter and setter
+ private $superSecret; // Used to check exception when accessing it
+ private ?bool $isActive = true;
public function initialize()
{
@@ -59,13 +62,35 @@ public function initialize()
);
}
- public function setSecretValue($value)
+ /**
+ * @return bool|null
+ */
+ public function getIsActive(): ?bool
{
- $this->secretValue = $value;
+ return $this->isActive;
+ }
+
+ /**
+ * @param bool|null $flag
+ */
+ public function setIsActive(?bool $flag)
+ {
+ $this->isActive = $flag;
}
+ /**
+ * @return mixed
+ */
public function getSecretValue()
{
return $this->secretValue;
}
+
+ /**
+ * @param mixed $value
+ */
+ public function setSecretValue($value)
+ {
+ $this->secretValue = $value;
+ }
}
diff --git a/tests/database/Mvc/Model/FindCest.php b/tests/database/Mvc/Model/FindCest.php
index 8b712019dea..ec67482c096 100644
--- a/tests/database/Mvc/Model/FindCest.php
+++ b/tests/database/Mvc/Model/FindCest.php
@@ -19,13 +19,18 @@
use Phalcon\Cache\AdapterFactory;
use Phalcon\Mvc\Model\Exception;
use Phalcon\Storage\SerializerFactory;
+use Phalcon\Test\Fixtures\Migrations\AbstractMigration;
use Phalcon\Test\Fixtures\Migrations\CustomersMigration;
+use Phalcon\Test\Fixtures\Migrations\InvoicesMigration;
use Phalcon\Test\Fixtures\Migrations\ObjectsMigration;
use Phalcon\Test\Fixtures\Traits\DiTrait;
use Phalcon\Test\Models\Customers;
+use Phalcon\Test\Models\Invoices;
use Phalcon\Test\Models\Objects;
+use function getOptionsRedis;
use function outputDir;
+use function uniqid;
/**
* Class FindCest
@@ -38,11 +43,6 @@ public function _before(DatabaseTester $I)
{
$this->setNewFactoryDefault();
$this->setDatabase($I);
-
- /** @var PDO $connection */
- $connection = $I->getConnection();
- $migration = new ObjectsMigration($connection);
- $migration->clear();
}
/**
@@ -253,4 +253,127 @@ function () {
}
);
}
+
+ /**
+ * Tests Phalcon\Mvc\Model :: find() - private property with Redis cache
+ *
+ * @author Phalcon Team
+ * @since 2021-05-25
+ * @issue 15439
+ *
+ * @group mysql
+ * @group pgsql
+ * @group sqlite
+ */
+ public function mvcModelFindPrivatePropertyWithRedisCache(DatabaseTester $I)
+ {
+ $I->wantToTest('Mvc\Model - find() - private property with Redis cache');
+
+ /** @var PDO $connection */
+ $connection = $I->getConnection();
+ $migration = new InvoicesMigration($connection);
+ $migration->insert(1, 1, 1, 'Test', 101);
+
+ $cacheKey = uniqid('redis-');
+
+ /**
+ * Find without models cache
+ */
+ /** @var Invoices $original */
+ $original = Invoices::find(
+ [
+ 'conditions' => 'inv_id = :inv_id:',
+ 'bind' => [
+ 'inv_id' => 1,
+ ],
+ ]
+ );
+
+ $I->assertCount(1, $original);
+
+ $record = $original[0];
+ $actual = $record->getIsActive();
+
+ $I->assertTrue($actual);
+
+ // Models Cache setup
+ $serializerFactory = new SerializerFactory();
+ $adapterFactory = new AdapterFactory($serializerFactory);
+ $adapter = $adapterFactory->newInstance('redis', getOptionsRedis());
+ $cache = new Cache($adapter);
+ $this->container->setShared('modelsCache', $cache);
+
+ /**
+ * Find it - so that we can use the models cache now
+ */
+ /** @var Invoices $cached */
+ $cached = Invoices::find(
+ [
+ 'conditions' => 'inv_id = :inv_id:',
+ 'bind' => [
+ 'inv_id' => 1,
+ ],
+ 'cache' => [
+ 'key' => $cacheKey,
+ 'lifetime' => 60,
+ ],
+ ]
+ );
+
+ $I->assertCount(1, $cached);
+
+ $record = $cached[0];
+ $actual = $record->getIsActive();
+ $I->assertTrue($actual);
+
+ /**
+ * Delete the record just in case to ensure we get it from the cache
+ */
+ $result = $original->delete();
+ $I->assertNotFalse($result);
+
+ /**
+ * Ensure we do not have anything in the db
+ */
+ /** @var Invoices $original */
+ $original = Invoices::find(
+ [
+ 'conditions' => 'inv_id = :inv_id:',
+ 'bind' => [
+ 'inv_id' => 1,
+ ],
+ ]
+ );
+
+ $I->assertCount(0, $original);
+
+ /**
+ * Finally get it back from the cache
+ */
+ /** @var Invoices $cached */
+ $cached = Invoices::find(
+ [
+ 'conditions' => 'inv_id = :inv_id:',
+ 'bind' => [
+ 'inv_id' => 1,
+ ],
+ 'cache' => [
+ 'key' => $cacheKey,
+ 'lifetime' => 60,
+ ],
+ ]
+ );
+
+ $I->assertCount(1, $cached);
+
+ $record = $cached[0];
+ $actual = $record->getIsActive();
+ $I->assertTrue($actual);
+
+ /**
+ * delete the cached entry
+ */
+ $result = $cache->delete($cacheKey);
+ $I->assertTrue($result);
+ }
}
diff --git a/tests/integration/Cache/Adapter/Apcu/ClearCest.php b/tests/integration/Cache/Adapter/Apcu/ClearCest.php
deleted file mode 100644
index 3a40fe07354..00000000000
--- a/tests/integration/Cache/Adapter/Apcu/ClearCest.php
+++ /dev/null
@@ -1,105 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Apcu;
-
-use Phalcon\Cache\Adapter\Apcu;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
-
-class ClearCest
-{
- use ApcuTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Apcu :: clear()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterApcuClear(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Apcu - clear()');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $key1 = uniqid();
- $key2 = uniqid();
-
-
- $adapter->set($key1, 'test');
-
- $I->assertTrue(
- $adapter->has($key1)
- );
-
-
- $adapter->set($key2, 'test');
-
- $I->assertTrue(
- $adapter->has($key2)
- );
-
- $I->assertTrue(
- $adapter->clear()
- );
-
- $I->assertFalse(
- $adapter->has($key1)
- );
-
- $I->assertFalse(
- $adapter->has($key2)
- );
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Apcu :: clear() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterApcuClearTwice(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Apcu - clear() - twice');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $key1 = uniqid();
- $key2 = uniqid();
-
- $adapter->set($key1, 'test');
-
- $I->assertTrue(
- $adapter->has($key1)
- );
-
-
- $adapter->set($key2, 'test');
-
- $I->assertTrue(
- $adapter->has($key2)
- );
-
- $I->assertTrue(
- $adapter->clear()
- );
-
- $I->assertTrue(
- $adapter->clear()
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Apcu/ConstructCest.php b/tests/integration/Cache/Adapter/Apcu/ConstructCest.php
deleted file mode 100644
index 5392117d561..00000000000
--- a/tests/integration/Cache/Adapter/Apcu/ConstructCest.php
+++ /dev/null
@@ -1,49 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Apcu;
-
-use Phalcon\Cache\Adapter\AdapterInterface;
-use Phalcon\Cache\Adapter\Apcu;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
-
-class ConstructCest
-{
- use ApcuTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Apcu :: __construct()
- *
- * @author Phalcon Team
- * @since 2019-04-09
- */
- public function cacheAdapterApcuConstruct(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Apcu - __construct()');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $I->assertInstanceOf(
- Apcu::class,
- $adapter
- );
-
- $I->assertInstanceOf(
- AdapterInterface::class,
- $adapter
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Apcu/DecrementCest.php b/tests/integration/Cache/Adapter/Apcu/DecrementCest.php
index a818bd1f982..14fcf137687 100644
--- a/tests/integration/Cache/Adapter/Apcu/DecrementCest.php
+++ b/tests/integration/Cache/Adapter/Apcu/DecrementCest.php
@@ -14,10 +14,10 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Apcu;
use Exception;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Apcu;
use Phalcon\Storage\SerializerFactory;
use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
class DecrementCest
{
diff --git a/tests/integration/Cache/Adapter/Apcu/DeleteCest.php b/tests/integration/Cache/Adapter/Apcu/DeleteCest.php
deleted file mode 100644
index 2cdc6009e1d..00000000000
--- a/tests/integration/Cache/Adapter/Apcu/DeleteCest.php
+++ /dev/null
@@ -1,102 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Apcu;
-
-use Phalcon\Cache\Adapter\Apcu;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
-
-class DeleteCest
-{
- use ApcuTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Apcu :: delete()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterApcuDelete(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Apcu - delete()');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
-
- $I->assertTrue(
- $adapter->delete($key)
- );
-
- $I->assertFalse(
- $adapter->has($key)
- );
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Apcu :: delete() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterApcuDeleteTwice(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Apcu - delete() - twice');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
-
- $I->assertTrue(
- $adapter->delete($key)
- );
-
- $I->assertFalse(
- $adapter->delete($key)
- );
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Apcu :: delete() - unknown
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterApcuDeleteUnknown(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Apcu - delete() - unknown');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $key = 'cache-data';
-
- $I->assertFalse(
- $adapter->delete($key)
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Apcu/GetAdapterCest.php b/tests/integration/Cache/Adapter/Apcu/GetAdapterCest.php
deleted file mode 100644
index 34d2739a84c..00000000000
--- a/tests/integration/Cache/Adapter/Apcu/GetAdapterCest.php
+++ /dev/null
@@ -1,42 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Apcu;
-
-use Phalcon\Cache\Adapter\Apcu;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
-
-class GetAdapterCest
-{
- use ApcuTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Apcu :: getAdapter()
- *
- * @author Phalcon Team
- * @since 2019-04-14
- */
- public function cacheAdapterApcuGetAdapter(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Apcu - getAdapter()');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $I->assertNull(
- $adapter->getAdapter()
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Apcu/GetKeysCest.php b/tests/integration/Cache/Adapter/Apcu/GetKeysCest.php
index 11615b2754e..56648fb187d 100644
--- a/tests/integration/Cache/Adapter/Apcu/GetKeysCest.php
+++ b/tests/integration/Cache/Adapter/Apcu/GetKeysCest.php
@@ -13,10 +13,10 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Apcu;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Apcu;
use Phalcon\Storage\SerializerFactory;
use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
class GetKeysCest
{
diff --git a/tests/integration/Cache/Adapter/Apcu/GetPrefixCest.php b/tests/integration/Cache/Adapter/Apcu/GetPrefixCest.php
deleted file mode 100644
index 0523cd8e2a1..00000000000
--- a/tests/integration/Cache/Adapter/Apcu/GetPrefixCest.php
+++ /dev/null
@@ -1,68 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Apcu;
-
-use Phalcon\Cache\Adapter\Apcu;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
-
-class GetPrefixCest
-{
- use ApcuTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Apcu :: getPrefix()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterApcuGetSetPrefix(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Apcu - getPrefix()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Apcu(
- $serializer,
- [
- 'prefix' => 'my-prefix',
- ]
- );
-
- $I->assertEquals(
- 'my-prefix',
- $adapter->getPrefix()
- );
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Apcu :: getPrefix() - default
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterApcuGetSetPrefixDefault(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Apcu - getPrefix() - default');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $I->assertEquals(
- 'ph-apcu-',
- $adapter->getPrefix()
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Apcu/GetSetCest.php b/tests/integration/Cache/Adapter/Apcu/GetSetCest.php
index 9acb82545b3..7aeede158c2 100644
--- a/tests/integration/Cache/Adapter/Apcu/GetSetCest.php
+++ b/tests/integration/Cache/Adapter/Apcu/GetSetCest.php
@@ -14,11 +14,11 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Apcu;
use Codeception\Example;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Apcu;
use Phalcon\Storage\SerializerFactory;
use Phalcon\Test\Fixtures\Cache\CacheFixtureData;
use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
class GetSetCest
{
diff --git a/tests/integration/Cache/Adapter/Apcu/GetSetDefaultSerializerCest.php b/tests/integration/Cache/Adapter/Apcu/GetSetDefaultSerializerCest.php
deleted file mode 100644
index 0363307d33c..00000000000
--- a/tests/integration/Cache/Adapter/Apcu/GetSetDefaultSerializerCest.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Apcu;
-
-use Phalcon\Cache\Adapter\Apcu;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
-
-class GetSetDefaultSerializerCest
-{
- use ApcuTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Apcu ::
- * getDefaultSerializer()/setDefaultSerializer()
- *
- * @author Phalcon Team
- * @since 2019-04-13
- */
- public function storageAdapterApcuGetKeys(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Apcu - getDefaultSerializer()/setDefaultSerializer()');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $I->assertEquals('Php', $adapter->getDefaultSerializer());
-
- $adapter->setDefaultSerializer('Base64');
- $I->assertEquals('Base64', $adapter->getDefaultSerializer());
- }
-}
diff --git a/tests/integration/Cache/Adapter/Apcu/HasCest.php b/tests/integration/Cache/Adapter/Apcu/HasCest.php
deleted file mode 100644
index a674c46f29d..00000000000
--- a/tests/integration/Cache/Adapter/Apcu/HasCest.php
+++ /dev/null
@@ -1,51 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Apcu;
-
-use Phalcon\Cache\Adapter\Apcu;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
-
-class HasCest
-{
- use ApcuTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Apcu :: get()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterApcuGetSetHas(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Apcu - has()');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $key = uniqid();
-
- $I->assertFalse(
- $adapter->has($key)
- );
-
-
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Apcu/IncrementCest.php b/tests/integration/Cache/Adapter/Apcu/IncrementCest.php
index 9fc065db562..658d4b6d825 100644
--- a/tests/integration/Cache/Adapter/Apcu/IncrementCest.php
+++ b/tests/integration/Cache/Adapter/Apcu/IncrementCest.php
@@ -13,10 +13,10 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Apcu;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Apcu;
use Phalcon\Storage\SerializerFactory;
use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
class IncrementCest
{
diff --git a/tests/integration/Cache/Adapter/ClearCest.php b/tests/integration/Cache/Adapter/ClearCest.php
new file mode 100644
index 00000000000..e734a5c5804
--- /dev/null
+++ b/tests/integration/Cache/Adapter/ClearCest.php
@@ -0,0 +1,126 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE.txt
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Phalcon\Test\Integration\Cache\Adapter;
+
+use Codeception\Example;
+use IntegrationTester;
+use Phalcon\Cache\Adapter\Apcu;
+use Phalcon\Cache\Adapter\Libmemcached;
+use Phalcon\Cache\Adapter\Memory;
+use Phalcon\Cache\Adapter\Redis;
+use Phalcon\Cache\Adapter\Stream;
+use Phalcon\Storage\SerializerFactory;
+
+use function getOptionsLibmemcached;
+use function getOptionsRedis;
+use function outputDir;
+use function uniqid;
+
+class ClearCest
+{
+ /**
+ * Tests Phalcon\Cache\Adapter\* :: clear()
+ *
+ * @dataProvider getExamples
+ *
+ * @author Phalcon Team
+ * @since 2020-09-09
+ */
+ public function cacheAdapterClear(IntegrationTester $I, Example $example)
+ {
+ $I->wantToTest(
+ 'Cache\Adapter\'' . $example['className'] . ' - getPrefix()'
+ );
+
+ $extension = $example['extension'];
+ $class = $example['class'];
+ $options = $example['options'];
+
+ if (!empty($extension)) {
+ $I->checkExtensionIsLoaded($extension);
+ }
+
+ $serializer = new SerializerFactory();
+ $adapter = new $class($serializer, $options);
+
+ $key1 = uniqid();
+ $key2 = uniqid();
+ $adapter->set($key1, 'test');
+ $actual = $adapter->has($key1);
+ $I->assertTrue($actual);
+
+ $adapter->set($key2, 'test');
+ $actual = $adapter->has($key2);
+ $I->assertTrue($actual);
+
+ $actual = $adapter->clear();
+ $I->assertTrue($actual);
+
+ $actual = $adapter->has($key1);
+ $I->assertFalse($actual);
+
+ $actual = $adapter->has($key2);
+ $I->assertFalse($actual);
+
+ /**
+ * Call clear twice to ensure it returns true
+ */
+ $actual = $adapter->clear();
+ $I->assertTrue($actual);
+ }
+
+ /**
+ * @return array[]
+ */
+ private function getExamples(): array
+ {
+ return [
+ [
+ 'className' => 'Apcu',
+ 'class' => Apcu::class,
+ 'options' => [],
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'class' => Libmemcached::class,
+ 'options' => getOptionsLibmemcached(),
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'default',
+ 'class' => Memory::class,
+ 'options' => [],
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'default',
+ 'class' => Redis::class,
+ 'options' => getOptionsRedis(),
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'default',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ ],
+ 'extension' => '',
+ ],
+ ];
+ }
+}
diff --git a/tests/integration/Cache/Adapter/ConstructCest.php b/tests/integration/Cache/Adapter/ConstructCest.php
new file mode 100644
index 00000000000..6d7a0968af5
--- /dev/null
+++ b/tests/integration/Cache/Adapter/ConstructCest.php
@@ -0,0 +1,104 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE.txt
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Phalcon\Test\Integration\Cache\Adapter;
+
+use Codeception\Example;
+use IntegrationTester;
+use Phalcon\Cache\Adapter\AdapterInterface;
+use Phalcon\Cache\Adapter\Apcu;
+use Phalcon\Cache\Adapter\Libmemcached;
+use Phalcon\Cache\Adapter\Memory;
+use Phalcon\Cache\Adapter\Redis;
+use Phalcon\Cache\Adapter\Stream;
+use Phalcon\Storage\SerializerFactory;
+
+use function getOptionsLibmemcached;
+use function getOptionsRedis;
+use function outputDir;
+
+class ConstructCest
+{
+ /**
+ * Tests Phalcon\Cache\Adapter\* :: __construct()
+ *
+ * @dataProvider getExamples
+ *
+ * @author Phalcon Team
+ * @since 2020-09-09
+ */
+ public function cacheAdapterConstruct(IntegrationTester $I, Example $example)
+ {
+ $I->wantToTest(
+ 'Cache\Adapter\'' . $example['className'] . ' - __construct()'
+ );
+
+ $extension = $example['extension'];
+ $class = $example['class'];
+ $options = $example['options'];
+
+ if (!empty($extension)) {
+ $I->checkExtensionIsLoaded($extension);
+ }
+
+ $serializer = new SerializerFactory();
+ $adapter = new $class($serializer, $options);
+
+ $I->assertInstanceOf($class, $adapter);
+ $I->assertInstanceOf(AdapterInterface::class, $adapter);
+ }
+
+ /**
+ * @return array[]
+ */
+ private function getExamples(): array
+ {
+ return [
+ [
+ 'className' => 'Apcu',
+ 'class' => Apcu::class,
+ 'options' => [],
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'class' => Libmemcached::class,
+ 'options' => getOptionsLibmemcached(),
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'default',
+ 'class' => Memory::class,
+ 'options' => [],
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'default',
+ 'class' => Redis::class,
+ 'options' => getOptionsRedis(),
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'default',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ ],
+ 'extension' => '',
+ ],
+ ];
+ }
+}
diff --git a/tests/integration/Cache/Adapter/DeleteCest.php b/tests/integration/Cache/Adapter/DeleteCest.php
new file mode 100644
index 00000000000..dcef6a806b8
--- /dev/null
+++ b/tests/integration/Cache/Adapter/DeleteCest.php
@@ -0,0 +1,118 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE.txt
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Phalcon\Test\Integration\Cache\Adapter;
+
+use Codeception\Example;
+use IntegrationTester;
+use Phalcon\Cache\Adapter\Apcu;
+use Phalcon\Cache\Adapter\Libmemcached;
+use Phalcon\Cache\Adapter\Memory;
+use Phalcon\Cache\Adapter\Redis;
+use Phalcon\Cache\Adapter\Stream;
+use Phalcon\Storage\SerializerFactory;
+
+use function getOptionsLibmemcached;
+use function getOptionsRedis;
+use function outputDir;
+use function uniqid;
+
+class DeleteCest
+{
+ /**
+ * Tests Phalcon\Cache\Adapter\* :: delete()
+ *
+ * @dataProvider getExamples
+ *
+ * @author Phalcon Team
+ * @since 2020-09-09
+ */
+ public function cacheAdapterDelete(IntegrationTester $I, Example $example)
+ {
+ $I->wantToTest(
+ 'Cache\Adapter\'' . $example['className'] . ' - delete()'
+ );
+
+ $extension = $example['extension'];
+ $class = $example['class'];
+ $options = $example['options'];
+
+ if (!empty($extension)) {
+ $I->checkExtensionIsLoaded($extension);
+ }
+
+ $serializer = new SerializerFactory();
+ $adapter = new $class($serializer, $options);
+
+ $key = uniqid();
+ $adapter->set($key, 'test');
+ $actual = $adapter->has($key);
+ $I->assertTrue($actual);
+
+ $actual = $adapter->delete($key);
+ $I->assertTrue($actual);
+
+ $actual = $adapter->has($key);
+ $I->assertFalse($actual);
+
+ /**
+ * Call clear twice to ensure it returns false
+ */
+ $actual = $adapter->delete($key);
+ $I->assertFalse($actual);
+ }
+
+ /**
+ * @return array[]
+ */
+ private function getExamples(): array
+ {
+ return [
+ [
+ 'className' => 'Apcu',
+ 'class' => Apcu::class,
+ 'options' => [],
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'class' => Libmemcached::class,
+ 'options' => getOptionsLibmemcached(),
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'default',
+ 'class' => Memory::class,
+ 'options' => [],
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'default',
+ 'class' => Redis::class,
+ 'options' => getOptionsRedis(),
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'default',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ ],
+ 'extension' => '',
+ ],
+ ];
+ }
+}
diff --git a/tests/integration/Cache/Adapter/GetAdapterCest.php b/tests/integration/Cache/Adapter/GetAdapterCest.php
new file mode 100644
index 00000000000..eb57f35f621
--- /dev/null
+++ b/tests/integration/Cache/Adapter/GetAdapterCest.php
@@ -0,0 +1,116 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE.txt
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Phalcon\Test\Integration\Cache\Adapter;
+
+use Codeception\Example;
+use IntegrationTester;
+use Memcached as NativeMemcached;
+use Phalcon\Cache\Adapter\Apcu;
+use Phalcon\Cache\Adapter\Libmemcached;
+use Phalcon\Cache\Adapter\Memory;
+use Phalcon\Cache\Adapter\Redis;
+use Phalcon\Cache\Adapter\Stream;
+use Phalcon\Storage\SerializerFactory;
+use Redis as NativeRedis;
+
+use function getOptionsLibmemcached;
+use function getOptionsRedis;
+use function outputDir;
+
+class GetAdapterCest
+{
+ /**
+ * Tests Phalcon\Cache\Adapter\* :: getAdapter()
+ *
+ * @dataProvider getExamples
+ *
+ * @author Phalcon Team
+ * @since 2020-09-09
+ */
+ public function cacheAdapterGetAdapter(IntegrationTester $I, Example $example)
+ {
+ $I->wantToTest(
+ 'Cache\Adapter\'' . $example['className'] . ' - getAdapter()'
+ );
+
+ $extension = $example['extension'];
+ $class = $example['class'];
+ $options = $example['options'];
+
+ if (!empty($extension)) {
+ $I->checkExtensionIsLoaded($extension);
+ }
+
+ $serializer = new SerializerFactory();
+ $adapter = new $class($serializer, $options);
+
+ $expected = $example['expected'];
+ $actual = $adapter->getAdapter();
+
+ if (null === $expected) {
+ $I->assertNull($actual);
+ } else {
+ $I->assertInstanceOf($expected, $actual);
+ }
+ }
+
+ /**
+ * @return array[]
+ */
+ private function getExamples(): array
+ {
+ return [
+ [
+ 'className' => 'Apcu',
+ 'class' => Apcu::class,
+ 'options' => [],
+ 'expected' => null,
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'class' => Libmemcached::class,
+ 'options' => getOptionsLibmemcached(),
+ 'expected' => NativeMemcached::class,
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'default',
+ 'class' => Memory::class,
+ 'options' => [],
+ 'expected' => null,
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'default',
+ 'class' => Redis::class,
+ 'options' => getOptionsRedis(),
+ 'expected' => NativeRedis::class,
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'default',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ ],
+ 'expected' => null,
+ 'extension' => '',
+ ],
+ ];
+ }
+}
diff --git a/tests/integration/Cache/Adapter/GetPrefixCest.php b/tests/integration/Cache/Adapter/GetPrefixCest.php
new file mode 100644
index 00000000000..81e37dc8b72
--- /dev/null
+++ b/tests/integration/Cache/Adapter/GetPrefixCest.php
@@ -0,0 +1,232 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE.txt
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Phalcon\Test\Integration\Cache\Adapter;
+
+use Codeception\Example;
+use IntegrationTester;
+use Phalcon\Cache\Adapter\Apcu;
+use Phalcon\Cache\Adapter\Libmemcached;
+use Phalcon\Cache\Adapter\Memory;
+use Phalcon\Cache\Adapter\Redis;
+use Phalcon\Cache\Adapter\Stream;
+use Phalcon\Storage\SerializerFactory;
+
+use function array_merge;
+use function getOptionsRedis;
+use function outputDir;
+
+class GetPrefixCest
+{
+ /**
+ * Tests Phalcon\Cache\Adapter\* :: getPrefix()
+ *
+ * @dataProvider getExamples
+ *
+ * @author Phalcon Team
+ * @since 2020-09-09
+ */
+ public function cacheAdapterGetSetPrefix(IntegrationTester $I, Example $example)
+ {
+ $I->wantToTest(
+ 'Cache\Adapter\'' . $example['className'] . ' - getPrefix() - ' . $example['label']
+ );
+
+ $extension = $example['extension'];
+ $class = $example['class'];
+ $options = $example['options'];
+
+ if (!empty($extension)) {
+ $I->checkExtensionIsLoaded($extension);
+ }
+
+ $serializer = new SerializerFactory();
+ $adapter = new $class($serializer, $options);
+
+ $expected = $example['expected'];
+ $actual = $adapter->getPrefix();
+ $I->assertEquals($expected, $actual);
+ }
+
+ private function getExamples(): array
+ {
+ return [
+ [
+ 'className' => 'Apcu',
+ 'label' => 'default',
+ 'class' => Apcu::class,
+ 'options' => [
+ ],
+ 'expected' => 'ph-apcu-',
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Apcu',
+ 'label' => 'empty',
+ 'class' => Apcu::class,
+ 'options' => [
+ 'prefix' => '',
+ ],
+ 'expected' => '',
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Apcu',
+ 'label' => 'prefix set',
+ 'class' => Apcu::class,
+ 'options' => [
+ 'prefix' => 'my-prefix',
+ ],
+ 'expected' => 'my-prefix',
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'label' => 'default',
+ 'class' => Libmemcached::class,
+ 'options' => array_merge(
+ getOptionsLibmemcached(),
+ [
+ ]
+ ),
+ 'expected' => 'ph-memc-',
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'label' => 'empty',
+ 'class' => Libmemcached::class,
+ 'options' => array_merge(
+ getOptionsLibmemcached(),
+ [
+ 'prefix' => '',
+ ]
+ ),
+ 'expected' => '',
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'label' => 'prefix set',
+ 'class' => Libmemcached::class,
+ 'options' => array_merge(
+ getOptionsLibmemcached(),
+ [
+ 'prefix' => 'my-prefix',
+ ]
+ ),
+ 'expected' => 'my-prefix',
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'default',
+ 'class' => Memory::class,
+ 'options' => [
+ ],
+ 'expected' => 'ph-memo-',
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'empty',
+ 'class' => Memory::class,
+ 'options' => [
+ 'prefix' => '',
+ ],
+ 'expected' => '',
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'prefix set',
+ 'class' => Memory::class,
+ 'options' => [
+ 'prefix' => 'my-prefix',
+ ],
+ 'expected' => 'my-prefix',
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'default',
+ 'class' => Redis::class,
+ 'options' => array_merge(
+ getOptionsRedis(),
+ [
+ ]
+ ),
+ 'expected' => 'ph-reds-',
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'empty',
+ 'class' => Redis::class,
+ 'options' => array_merge(
+ getOptionsRedis(),
+ [
+ 'prefix' => '',
+ ]
+ ),
+ 'expected' => '',
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'prefix set',
+ 'class' => Redis::class,
+ 'options' => array_merge(
+ getOptionsRedis(),
+ [
+ 'prefix' => 'my-prefix',
+ ]
+ ),
+ 'expected' => 'my-prefix',
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'default',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ ],
+ 'expected' => 'ph-strm',
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'empty',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ 'prefix' => '',
+ ],
+ 'expected' => '',
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'prefix set',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ 'prefix' => 'my-prefix',
+ ],
+ 'expected' => 'my-prefix',
+ 'extension' => '',
+ ],
+ ];
+ }
+}
diff --git a/tests/integration/Cache/Adapter/GetSetDefaultSerializerCest.php b/tests/integration/Cache/Adapter/GetSetDefaultSerializerCest.php
new file mode 100644
index 00000000000..d4037ee94a3
--- /dev/null
+++ b/tests/integration/Cache/Adapter/GetSetDefaultSerializerCest.php
@@ -0,0 +1,106 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE.txt
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Phalcon\Test\Integration\Cache\Adapter;
+
+use Codeception\Example;
+use IntegrationTester;
+use Phalcon\Cache\Adapter\Apcu;
+use Phalcon\Cache\Adapter\Libmemcached;
+use Phalcon\Cache\Adapter\Memory;
+use Phalcon\Cache\Adapter\Redis;
+use Phalcon\Cache\Adapter\Stream;
+use Phalcon\Storage\SerializerFactory;
+
+use function getOptionsLibmemcached;
+use function getOptionsRedis;
+use function outputDir;
+
+class GetSetDefaultSerializerCest
+{
+ /**
+ * Tests Phalcon\Cache\Adapter\* ::
+ * getDefaultSerializer()/setDefaultSerializer()
+ *
+ * @dataProvider getExamples
+ *
+ * @author Phalcon Team
+ * @since 2020-09-09
+ */
+ public function cacheAdapterGetSetDefaultSerializer(IntegrationTester $I, Example $example)
+ {
+ $I->wantToTest(
+ 'Cache\Adapter\'' . $example['className'] . ' - getDefaultSerializer()/setDefaultSerializer()'
+ );
+
+ $extension = $example['extension'];
+ $class = $example['class'];
+ $options = $example['options'];
+
+ if (!empty($extension)) {
+ $I->checkExtensionIsLoaded($extension);
+ }
+
+ $serializer = new SerializerFactory();
+ $adapter = new $class($serializer, $options);
+
+ $I->assertEquals('Php', $adapter->getDefaultSerializer());
+
+ $adapter->setDefaultSerializer('Base64');
+ $I->assertEquals('Base64', $adapter->getDefaultSerializer());
+ }
+
+ /**
+ * @return array[]
+ */
+ private function getExamples(): array
+ {
+ return [
+ [
+ 'className' => 'Apcu',
+ 'class' => Apcu::class,
+ 'options' => [],
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'class' => Libmemcached::class,
+ 'options' => getOptionsLibmemcached(),
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'default',
+ 'class' => Memory::class,
+ 'options' => [],
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'default',
+ 'class' => Redis::class,
+ 'options' => getOptionsRedis(),
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'default',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ ],
+ 'extension' => '',
+ ],
+ ];
+ }
+}
diff --git a/tests/integration/Cache/Adapter/HasCest.php b/tests/integration/Cache/Adapter/HasCest.php
new file mode 100644
index 00000000000..0d085f0526b
--- /dev/null
+++ b/tests/integration/Cache/Adapter/HasCest.php
@@ -0,0 +1,110 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE.txt
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Phalcon\Test\Integration\Cache\Adapter;
+
+use Codeception\Example;
+use IntegrationTester;
+use Phalcon\Cache\Adapter\Apcu;
+use Phalcon\Cache\Adapter\Libmemcached;
+use Phalcon\Cache\Adapter\Memory;
+use Phalcon\Cache\Adapter\Redis;
+use Phalcon\Cache\Adapter\Stream;
+use Phalcon\Storage\SerializerFactory;
+
+use function getOptionsLibmemcached;
+use function getOptionsRedis;
+use function outputDir;
+use function uniqid;
+
+class HasCest
+{
+ /**
+ * Tests Phalcon\Cache\Adapter\* :: has()
+ *
+ * @dataProvider getExamples
+ *
+ * @author Phalcon Team
+ * @since 2020-09-09
+ */
+ public function cacheAdapterHas(IntegrationTester $I, Example $example)
+ {
+ $I->wantToTest(
+ 'Cache\Adapter\'' . $example['className'] . ' - has()'
+ );
+
+ $extension = $example['extension'];
+ $class = $example['class'];
+ $options = $example['options'];
+
+ if (!empty($extension)) {
+ $I->checkExtensionIsLoaded($extension);
+ }
+
+ $serializer = new SerializerFactory();
+ $adapter = new $class($serializer, $options);
+
+ $key = uniqid();
+
+ $actual = $adapter->has($key);
+ $I->assertFalse($actual);
+
+ $adapter->set($key, 'test');
+ $actual = $adapter->has($key);
+ $I->assertTrue($actual);
+ }
+
+ /**
+ * @return array[]
+ */
+ private function getExamples(): array
+ {
+ return [
+ [
+ 'className' => 'Apcu',
+ 'class' => Apcu::class,
+ 'options' => [],
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'class' => Libmemcached::class,
+ 'options' => getOptionsLibmemcached(),
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'default',
+ 'class' => Memory::class,
+ 'options' => [],
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'default',
+ 'class' => Redis::class,
+ 'options' => getOptionsRedis(),
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'default',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ ],
+ 'extension' => '',
+ ],
+ ];
+ }
+}
diff --git a/tests/integration/Cache/Adapter/Libmemcached/ClearCest.php b/tests/integration/Cache/Adapter/Libmemcached/ClearCest.php
deleted file mode 100644
index 3db12b9e9a1..00000000000
--- a/tests/integration/Cache/Adapter/Libmemcached/ClearCest.php
+++ /dev/null
@@ -1,110 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Libmemcached;
-
-use Phalcon\Cache\Adapter\Libmemcached;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
-
-use function getOptionsLibmemcached;
-
-class ClearCest
-{
- use LibmemcachedTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Libmemcached :: clear()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterLibmemcachedClear(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Libmemcached - clear()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $key1 = uniqid();
- $key2 = uniqid();
- $adapter->set($key1, 'test');
-
- $I->assertTrue(
- $adapter->has($key1)
- );
-
- $adapter->set($key1, 'test');
-
- $I->assertTrue(
- $adapter->has($key1)
- );
-
- $I->assertTrue(
- $adapter->clear()
- );
-
- $I->assertFalse(
- $adapter->has($key1)
- );
-
- $I->assertFalse(
- $adapter->has($key2)
- );
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Libmemcached :: clear() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterLibmemcachedClearTwice(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Libmemcached - clear() - twice');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $key = 'key-1';
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
-
- $key = 'key-2';
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
-
- $I->assertTrue(
- $adapter->clear()
- );
-
- $I->assertTrue(
- $adapter->clear()
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Libmemcached/ConstructCest.php b/tests/integration/Cache/Adapter/Libmemcached/ConstructCest.php
deleted file mode 100644
index 45ff96714e4..00000000000
--- a/tests/integration/Cache/Adapter/Libmemcached/ConstructCest.php
+++ /dev/null
@@ -1,121 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Libmemcached;
-
-use DateInterval;
-use Exception;
-use Phalcon\Cache\Adapter\AdapterInterface;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Cache\Adapter\Libmemcached;
-use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
-
-use function getOptionsLibmemcached;
-
-class ConstructCest
-{
- use LibmemcachedTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Libmemcached :: __construct()
- *
- * @author Phalcon Team
- * @since 2019-04-09
- */
- public function cacheAdapterLibmemcachedConstruct(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Libmemcached - __construct()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $I->assertInstanceOf(
- Libmemcached::class,
- $adapter
- );
-
- $I->assertInstanceOf(
- AdapterInterface::class,
- $adapter
- );
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Libmemcached :: __construct() - empty
- * options
- *
- * @author Phalcon Team
- * @since 2019-04-09
- */
- public function cacheAdapterLibmemcachedConstructEmptyOptions(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Libmemcached - __construct() - empty options');
-
- $serializer = new SerializerFactory();
- $adapter = new Libmemcached($serializer);
-
- $expected = [
- 'servers' => [
- 0 => [
- 'host' => '127.0.0.1',
- 'port' => 11211,
- 'weight' => 1,
- ],
- ],
- ];
-
- $I->assertEquals(
- $expected,
- $adapter->getOptions()
- );
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Libmemcached :: __construct() - getTtl
- * options
- *
- * @throws Exception
- * @since 2019-04-09
- *
- * @author Phalcon Team
- */
- public function cacheAdapterLibmemcachedConstructGetTtl(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Libmemcached - __construct() - getTtl');
-
- $serializer = new SerializerFactory();
- $adapter = new Libmemcached($serializer);
-
- $I->assertEquals(
- 3600,
- $adapter->getTtl(null)
- );
-
- $I->assertEquals(
- 20,
- $adapter->getTtl(20)
- );
-
- $time = new DateInterval('PT5S');
-
- $I->assertEquals(
- 5,
- $adapter->getTtl($time)
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Libmemcached/DecrementCest.php b/tests/integration/Cache/Adapter/Libmemcached/DecrementCest.php
index a280ed399b6..577badb32e7 100644
--- a/tests/integration/Cache/Adapter/Libmemcached/DecrementCest.php
+++ b/tests/integration/Cache/Adapter/Libmemcached/DecrementCest.php
@@ -13,11 +13,10 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Libmemcached;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Libmemcached;
-use Phalcon\Storage\Exception;
use Phalcon\Storage\SerializerFactory;
use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
use function getOptionsLibmemcached;
diff --git a/tests/integration/Cache/Adapter/Libmemcached/DeleteCest.php b/tests/integration/Cache/Adapter/Libmemcached/DeleteCest.php
deleted file mode 100644
index 66d41e0b16e..00000000000
--- a/tests/integration/Cache/Adapter/Libmemcached/DeleteCest.php
+++ /dev/null
@@ -1,116 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Libmemcached;
-
-use Phalcon\Cache\Adapter\Libmemcached;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
-
-use function getOptionsLibmemcached;
-
-class DeleteCest
-{
- use LibmemcachedTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Libmemcached :: delete()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterLibmemcachedDelete(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Libmemcached - delete()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
-
- $I->assertTrue(
- $adapter->delete($key)
- );
-
- $I->assertFalse(
- $adapter->has($key)
- );
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Libmemcached :: delete() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterLibmemcachedDeleteTwice(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Libmemcached - delete() - twice');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
-
- $I->assertTrue(
- $adapter->delete($key)
- );
-
- $I->assertFalse(
- $adapter->delete($key)
- );
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Libmemcached :: delete() - unknown
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterLibmemcachedDeleteUnknown(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Libmemcached - delete() - unknown');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $key = 'cache-data';
-
- $I->assertFalse(
- $adapter->delete($key)
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Libmemcached/GetAdapterCest.php b/tests/integration/Cache/Adapter/Libmemcached/GetAdapterCest.php
deleted file mode 100644
index d61935370d9..00000000000
--- a/tests/integration/Cache/Adapter/Libmemcached/GetAdapterCest.php
+++ /dev/null
@@ -1,46 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Libmemcached;
-
-use Memcached;
-use Phalcon\Cache\Adapter\Libmemcached;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
-
-use function getOptionsLibmemcached;
-
-class GetAdapterCest
-{
- use LibmemcachedTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Libmemcached :: getAdapter()
- *
- * @author Phalcon Team
- * @since 2019-04-14
- */
- public function cacheAdapterLibmemcachedGetAdapter(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Libmemcached - getAdapter()');
-
- $serializer = new SerializerFactory();
- $adapter = new Libmemcached($serializer, getOptionsLibmemcached());
-
- $I->assertInstanceOf(
- Memcached::class,
- $adapter->getAdapter()
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Libmemcached/GetKeysCest.php b/tests/integration/Cache/Adapter/Libmemcached/GetKeysCest.php
index 4276af5b120..79255018158 100644
--- a/tests/integration/Cache/Adapter/Libmemcached/GetKeysCest.php
+++ b/tests/integration/Cache/Adapter/Libmemcached/GetKeysCest.php
@@ -13,10 +13,10 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Libmemcached;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Libmemcached;
use Phalcon\Storage\SerializerFactory;
use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
use function getOptionsLibmemcached;
diff --git a/tests/integration/Cache/Adapter/Libmemcached/GetPrefixCest.php b/tests/integration/Cache/Adapter/Libmemcached/GetPrefixCest.php
deleted file mode 100644
index 14551e44841..00000000000
--- a/tests/integration/Cache/Adapter/Libmemcached/GetPrefixCest.php
+++ /dev/null
@@ -1,73 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Libmemcached;
-
-use Phalcon\Cache\Adapter\Libmemcached;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
-
-use function getOptionsLibmemcached;
-
-class GetPrefixCest
-{
- use LibmemcachedTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Libmemcached :: getPrefix()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterLibmemcachedGetSetPrefix(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Libmemcached - getPrefix()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- array_merge(
- getOptionsLibmemcached(),
- [
- 'prefix' => 'my-prefix',
- ]
- )
- );
-
- $I->assertEquals(
- 'my-prefix',
- $adapter->getPrefix()
- );
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Libmemcached :: getPrefix() - default
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterLibmemcachedGetSetPrefixDefault(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Libmemcached - getPrefix() - default');
-
- $serializer = new SerializerFactory();
- $adapter = new Libmemcached($serializer, getOptionsLibmemcached());
-
- $I->assertEquals(
- 'ph-memc-',
- $adapter->getPrefix()
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Libmemcached/GetSetCest.php b/tests/integration/Cache/Adapter/Libmemcached/GetSetCest.php
index 3ee1438fb7a..7d3c98894ee 100644
--- a/tests/integration/Cache/Adapter/Libmemcached/GetSetCest.php
+++ b/tests/integration/Cache/Adapter/Libmemcached/GetSetCest.php
@@ -14,12 +14,11 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Libmemcached;
use Codeception\Example;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Libmemcached;
-use Phalcon\Storage\Exception;
use Phalcon\Storage\SerializerFactory;
use Phalcon\Test\Fixtures\Cache\CacheFixtureData;
use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
use function getOptionsLibmemcached;
@@ -81,7 +80,7 @@ public function cacheAdapterLibmemcachedGetSetCustomSerializer(IntegrationTester
)
);
- $key = 'cache-data';
+ $key = 'cache-data';
$source = 'Phalcon Framework';
$I->assertTrue(
diff --git a/tests/integration/Cache/Adapter/Libmemcached/GetSetDefaultSerializerCest.php b/tests/integration/Cache/Adapter/Libmemcached/GetSetDefaultSerializerCest.php
deleted file mode 100644
index 7c83ec31486..00000000000
--- a/tests/integration/Cache/Adapter/Libmemcached/GetSetDefaultSerializerCest.php
+++ /dev/null
@@ -1,57 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Libmemcached;
-
-use Phalcon\Cache\Adapter\Libmemcached;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
-
-use function getOptionsLibmemcached;
-
-class GetSetDefaultSerializerCest
-{
- use LibmemcachedTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Libmemcached ::
- * getDefaultSerializer()/setDefaultSerializer()
- *
- * @author Phalcon Team
- * @since 2019-04-13
- */
- public function storageAdapterLibmemcachedGetKeys(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Libmemcached - getDefaultSerializer()/setDefaultSerializer()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $I->assertEquals(
- 'Php',
- $adapter->getDefaultSerializer()
- );
-
- $adapter->setDefaultSerializer('Base64');
-
- $I->assertEquals(
- 'Base64',
- $adapter->getDefaultSerializer()
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Libmemcached/HasCest.php b/tests/integration/Cache/Adapter/Libmemcached/HasCest.php
deleted file mode 100644
index 6207ea5f3c4..00000000000
--- a/tests/integration/Cache/Adapter/Libmemcached/HasCest.php
+++ /dev/null
@@ -1,53 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Libmemcached;
-
-use Phalcon\Cache\Adapter\Libmemcached;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
-
-use function getOptionsLibmemcached;
-
-class HasCest
-{
- use LibmemcachedTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Libmemcached :: get()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterLibmemcachedGetSetHas(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Libmemcached - has()');
-
- $serializer = new SerializerFactory();
- $adapter = new Libmemcached($serializer, getOptionsLibmemcached());
-
- $key = uniqid();
-
- $I->assertFalse(
- $adapter->has($key)
- );
-
-
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Libmemcached/IncrementCest.php b/tests/integration/Cache/Adapter/Libmemcached/IncrementCest.php
index 2e3ba922c0c..c9feed981c6 100644
--- a/tests/integration/Cache/Adapter/Libmemcached/IncrementCest.php
+++ b/tests/integration/Cache/Adapter/Libmemcached/IncrementCest.php
@@ -13,10 +13,10 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Libmemcached;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Libmemcached;
use Phalcon\Storage\SerializerFactory;
use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
use function getOptionsLibmemcached;
diff --git a/tests/integration/Cache/Adapter/Memory/ClearCest.php b/tests/integration/Cache/Adapter/Memory/ClearCest.php
deleted file mode 100644
index 84af892fdf7..00000000000
--- a/tests/integration/Cache/Adapter/Memory/ClearCest.php
+++ /dev/null
@@ -1,97 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Memory;
-
-use Phalcon\Cache\Adapter\Memory;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class ClearCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Memory :: clear()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterMemoryClear(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Memory - clear()');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $key1 = uniqid();
- $key2 = uniqid();
-
- $adapter->set($key1, 'test');
-
- $I->assertTrue(
- $adapter->has($key1)
- );
-
- $adapter->set($key2, 'test');
- $I->assertTrue(
- $adapter->has($key2)
- );
-
- $I->assertTrue(
- $adapter->clear()
- );
-
- $I->assertFalse(
- $adapter->has($key1)
- );
-
- $I->assertFalse(
- $adapter->has($key2)
- );
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Memory :: clear() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterMemoryClearTwice(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Memory - clear() - twice');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $key1 = uniqid();
- $key2 = uniqid();
- $adapter->set($key1, 'test');
-
- $I->assertTrue(
- $adapter->has($key1)
- );
-
- $adapter->set($key2, 'test');
-
- $I->assertTrue(
- $adapter->has($key2)
- );
-
- $I->assertTrue(
- $adapter->clear()
- );
-
- $I->assertTrue(
- $adapter->clear()
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Memory/ConstructCest.php b/tests/integration/Cache/Adapter/Memory/ConstructCest.php
deleted file mode 100644
index 396994c7a17..00000000000
--- a/tests/integration/Cache/Adapter/Memory/ConstructCest.php
+++ /dev/null
@@ -1,46 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Memory;
-
-use Phalcon\Cache\Adapter\AdapterInterface;
-use Phalcon\Cache\Adapter\Memory;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class ConstructCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Memory :: __construct()
- *
- * @author Phalcon Team
- * @since 2019-04-09
- */
- public function cacheAdapterMemoryConstruct(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Memory - __construct()');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $I->assertInstanceOf(
- Memory::class,
- $adapter
- );
-
- $I->assertInstanceOf(
- AdapterInterface::class,
- $adapter
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Memory/DecrementCest.php b/tests/integration/Cache/Adapter/Memory/DecrementCest.php
index 9ef99e226d4..7b8b05a5c33 100644
--- a/tests/integration/Cache/Adapter/Memory/DecrementCest.php
+++ b/tests/integration/Cache/Adapter/Memory/DecrementCest.php
@@ -13,9 +13,9 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Memory;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Memory;
use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
class DecrementCest
{
diff --git a/tests/integration/Cache/Adapter/Memory/DeleteCest.php b/tests/integration/Cache/Adapter/Memory/DeleteCest.php
deleted file mode 100644
index c92d05bf580..00000000000
--- a/tests/integration/Cache/Adapter/Memory/DeleteCest.php
+++ /dev/null
@@ -1,101 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Memory;
-
-use Phalcon\Cache\Adapter\Memory;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class DeleteCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Memory :: delete()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterMemoryDelete(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Memory - delete()');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $key = 'cache-data';
-
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
-
- $I->assertTrue(
- $adapter->delete($key)
- );
-
- $I->assertFalse(
- $adapter->has($key)
- );
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Memory :: delete() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterMemoryDeleteTwice(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Memory - delete() - twice');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $key = 'cache-data';
-
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
-
- $I->assertTrue(
- $adapter->delete($key)
- );
-
- $I->assertFalse(
- $adapter->delete($key)
- );
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Memory :: delete() - unknown
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterMemoryDeleteUnknown(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Memory - delete() - unknown');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $key = 'cache-data';
-
- $I->assertFalse(
- $adapter->delete($key)
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Memory/GetAdapterCest.php b/tests/integration/Cache/Adapter/Memory/GetAdapterCest.php
deleted file mode 100644
index 966292af041..00000000000
--- a/tests/integration/Cache/Adapter/Memory/GetAdapterCest.php
+++ /dev/null
@@ -1,39 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Memory;
-
-use Phalcon\Cache\Adapter\Memory;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class GetAdapterCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Memory :: getAdapter()
- *
- * @author Phalcon Team
- * @since 2019-04-14
- */
- public function cacheAdapterMemoryGetAdapter(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Memory - getAdapter()');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $I->assertNull(
- $adapter->getAdapter()
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Memory/GetKeysCest.php b/tests/integration/Cache/Adapter/Memory/GetKeysCest.php
index 359aeeed661..19ef09dcbab 100644
--- a/tests/integration/Cache/Adapter/Memory/GetKeysCest.php
+++ b/tests/integration/Cache/Adapter/Memory/GetKeysCest.php
@@ -13,9 +13,9 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Memory;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Memory;
use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
class GetKeysCest
{
diff --git a/tests/integration/Cache/Adapter/Memory/GetPrefixCest.php b/tests/integration/Cache/Adapter/Memory/GetPrefixCest.php
deleted file mode 100644
index c56af4a15cd..00000000000
--- a/tests/integration/Cache/Adapter/Memory/GetPrefixCest.php
+++ /dev/null
@@ -1,65 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Memory;
-
-use Phalcon\Cache\Adapter\Memory;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class GetPrefixCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Memory :: getPrefix()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterMemoryGetSetPrefix(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Memory - getPrefix()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Memory(
- $serializer,
- [
- 'prefix' => 'my-prefix',
- ]
- );
-
- $I->assertEquals(
- 'my-prefix',
- $adapter->getPrefix()
- );
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Memory :: getPrefix() - default
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterMemoryGetSetPrefixDefault(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Memory - getPrefix() - default');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $I->assertEquals(
- 'ph-memo-',
- $adapter->getPrefix()
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Memory/GetSetCest.php b/tests/integration/Cache/Adapter/Memory/GetSetCest.php
index 7c1f448824b..a10c48970f6 100644
--- a/tests/integration/Cache/Adapter/Memory/GetSetCest.php
+++ b/tests/integration/Cache/Adapter/Memory/GetSetCest.php
@@ -14,10 +14,10 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Memory;
use Codeception\Example;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Memory;
use Phalcon\Storage\SerializerFactory;
use Phalcon\Test\Fixtures\Cache\CacheFixtureData;
-use IntegrationTester;
class GetSetCest
{
diff --git a/tests/integration/Cache/Adapter/Memory/GetSetDefaultSerializerCest.php b/tests/integration/Cache/Adapter/Memory/GetSetDefaultSerializerCest.php
deleted file mode 100644
index 847be7395f1..00000000000
--- a/tests/integration/Cache/Adapter/Memory/GetSetDefaultSerializerCest.php
+++ /dev/null
@@ -1,48 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Memory;
-
-use Phalcon\Cache\Adapter\Memory;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class GetSetDefaultSerializerCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Memory ::
- * getDefaultSerializer()/setDefaultSerializer()
- *
- * @author Phalcon Team
- * @since 2019-04-13
- */
- public function storageAdapterMemoryGetKeys(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Memory - getDefaultSerializer()/setDefaultSerializer()');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $I->assertEquals(
- 'Php',
- $adapter->getDefaultSerializer()
- );
-
- $adapter->setDefaultSerializer('Base64');
-
- $I->assertEquals(
- 'Base64',
- $adapter->getDefaultSerializer()
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Memory/HasCest.php b/tests/integration/Cache/Adapter/Memory/HasCest.php
deleted file mode 100644
index 3d3bb35cfb0..00000000000
--- a/tests/integration/Cache/Adapter/Memory/HasCest.php
+++ /dev/null
@@ -1,48 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Memory;
-
-use Phalcon\Cache\Adapter\Memory;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class HasCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Memory :: get()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterMemoryGetSetHas(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Memory - has()');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $key = uniqid();
-
- $I->assertFalse(
- $adapter->has($key)
- );
-
-
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Memory/IncrementCest.php b/tests/integration/Cache/Adapter/Memory/IncrementCest.php
index 972ae222527..4dfeb04bf7d 100644
--- a/tests/integration/Cache/Adapter/Memory/IncrementCest.php
+++ b/tests/integration/Cache/Adapter/Memory/IncrementCest.php
@@ -13,9 +13,9 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Memory;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Memory;
use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
class IncrementCest
{
diff --git a/tests/integration/Cache/Adapter/Redis/ClearCest.php b/tests/integration/Cache/Adapter/Redis/ClearCest.php
deleted file mode 100644
index 8b38d522a26..00000000000
--- a/tests/integration/Cache/Adapter/Redis/ClearCest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Redis;
-
-use Phalcon\Cache\Adapter\Redis;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
-
-use function getOptionsRedis;
-
-class ClearCest
-{
- use RedisTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Redis :: clear()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterRedisClear(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Redis - clear()');
-
- $serializer = new SerializerFactory();
- $adapter = new Redis($serializer, getOptionsRedis());
-
- $key1 = uniqid();
- $key2 = uniqid();
- $adapter->set($key1, 'test');
- $actual = $adapter->has($key1);
- $I->assertTrue($actual);
-
- $adapter->set($key2, 'test');
- $actual = $adapter->has($key2);
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
-
- $actual = $adapter->has($key1);
- $I->assertFalse($actual);
-
- $actual = $adapter->has($key2);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Redis :: clear() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterRedisClearTwice(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Redis - clear() - twice');
-
- $serializer = new SerializerFactory();
- $adapter = new Redis($serializer, getOptionsRedis());
-
- $key1 = uniqid();
- $key2 = uniqid();
- $adapter->set($key1, 'test');
- $actual = $adapter->has($key1);
- $I->assertTrue($actual);
-
- $adapter->set($key2, 'test');
- $actual = $adapter->has($key2);
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
- }
-}
diff --git a/tests/integration/Cache/Adapter/Redis/ConstructCest.php b/tests/integration/Cache/Adapter/Redis/ConstructCest.php
deleted file mode 100644
index 90292a5f432..00000000000
--- a/tests/integration/Cache/Adapter/Redis/ConstructCest.php
+++ /dev/null
@@ -1,47 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Redis;
-
-use Phalcon\Cache\Adapter\AdapterInterface;
-use Phalcon\Cache\Adapter\Redis;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
-
-use function getOptionsRedis;
-
-class ConstructCest
-{
- use RedisTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Redis :: __construct()
- *
- * @author Phalcon Team
- * @since 2019-04-09
- */
- public function cacheAdapterRedisConstruct(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Redis - __construct()');
-
- $serializer = new SerializerFactory();
- $adapter = new Redis($serializer, getOptionsRedis());
-
- $class = Redis::class;
- $I->assertInstanceOf($class, $adapter);
-
- $class = AdapterInterface::class;
- $I->assertInstanceOf($class, $adapter);
- }
-}
diff --git a/tests/integration/Cache/Adapter/Redis/DecrementCest.php b/tests/integration/Cache/Adapter/Redis/DecrementCest.php
index 0e8321c2ace..6855419443e 100644
--- a/tests/integration/Cache/Adapter/Redis/DecrementCest.php
+++ b/tests/integration/Cache/Adapter/Redis/DecrementCest.php
@@ -13,11 +13,11 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Redis;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Redis;
use Phalcon\Storage\Exception;
use Phalcon\Storage\SerializerFactory;
use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
use function getOptionsRedis;
use function uniqid;
@@ -66,7 +66,7 @@ public function cacheAdapterRedisDecrement(IntegrationTester $I)
* Get: new value in key - 10
*/
$expected = 10;
- $actual = $adapter->get($key);
+ $actual = $adapter->get($key);
$I->assertEquals($expected, $actual);
/**
diff --git a/tests/integration/Cache/Adapter/Redis/DeleteCest.php b/tests/integration/Cache/Adapter/Redis/DeleteCest.php
deleted file mode 100644
index 05eeb758b02..00000000000
--- a/tests/integration/Cache/Adapter/Redis/DeleteCest.php
+++ /dev/null
@@ -1,94 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Redis;
-
-use Phalcon\Cache\Adapter\Redis;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
-
-use function getOptionsRedis;
-
-class DeleteCest
-{
- use RedisTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Redis :: delete()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterRedisDelete(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Redis - delete()');
-
- $serializer = new SerializerFactory();
- $adapter = new Redis($serializer, getOptionsRedis());
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->has($key);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Redis :: delete() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterRedisDeleteTwice(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Redis - delete() - twice');
-
- $serializer = new SerializerFactory();
- $adapter = new Redis($serializer, getOptionsRedis());
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Redis :: delete() - unknown
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterRedisDeleteUnknown(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Redis - delete() - unknown');
-
- $serializer = new SerializerFactory();
- $adapter = new Redis($serializer, getOptionsRedis());
-
- $key = 'cache-data';
- $actual = $adapter->delete($key);
- $I->assertFalse($actual);
- }
-}
diff --git a/tests/integration/Cache/Adapter/Redis/GetAdapterCest.php b/tests/integration/Cache/Adapter/Redis/GetAdapterCest.php
deleted file mode 100644
index 80a015fd217..00000000000
--- a/tests/integration/Cache/Adapter/Redis/GetAdapterCest.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Redis;
-
-use Phalcon\Cache\Adapter\Redis;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
-
-use function getOptionsRedis;
-
-class GetAdapterCest
-{
- use RedisTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Redis :: getAdapter()
- *
- * @author Phalcon Team
- * @since 2019-04-14
- */
- public function cacheAdapterRedisGetAdapter(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Redis - getAdapter()');
-
- $serializer = new SerializerFactory();
- $adapter = new Redis($serializer, getOptionsRedis());
-
- $class = \Redis::class;
- $actual = $adapter->getAdapter();
- $I->assertInstanceOf($class, $actual);
- }
-}
diff --git a/tests/integration/Cache/Adapter/Redis/GetKeysCest.php b/tests/integration/Cache/Adapter/Redis/GetKeysCest.php
index b54f2e1fccd..2ccc3e2cf26 100644
--- a/tests/integration/Cache/Adapter/Redis/GetKeysCest.php
+++ b/tests/integration/Cache/Adapter/Redis/GetKeysCest.php
@@ -13,10 +13,10 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Redis;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Redis;
use Phalcon\Storage\SerializerFactory;
use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
use function getOptionsRedis;
diff --git a/tests/integration/Cache/Adapter/Redis/GetPrefixCest.php b/tests/integration/Cache/Adapter/Redis/GetPrefixCest.php
deleted file mode 100644
index 08cdd22f1d4..00000000000
--- a/tests/integration/Cache/Adapter/Redis/GetPrefixCest.php
+++ /dev/null
@@ -1,70 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Redis;
-
-use Phalcon\Cache\Adapter\Redis;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
-
-use function getOptionsRedis;
-
-class GetPrefixCest
-{
- use RedisTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Redis :: getPrefix()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterRedisGetSetPrefix(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Redis - getPrefix()');
-
- $serializer = new SerializerFactory();
- $adapter = new Redis(
- $serializer,
- array_merge(
- getOptionsRedis(),
- [
- 'prefix' => 'my-prefix',
- ]
- )
- );
-
- $expected = 'my-prefix';
- $actual = $adapter->getPrefix();
- $I->assertEquals($expected, $actual);
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Redis :: getPrefix() - default
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterRedisGetSetPrefixDefault(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Redis - getPrefix() - default');
-
- $serializer = new SerializerFactory();
- $adapter = new Redis($serializer, getOptionsRedis());
-
- $expected = 'ph-reds-';
- $actual = $adapter->getPrefix();
- $I->assertEquals($expected, $actual);
- }
-}
diff --git a/tests/integration/Cache/Adapter/Redis/GetSetCest.php b/tests/integration/Cache/Adapter/Redis/GetSetCest.php
index 9a69121c0a0..295842bb75c 100644
--- a/tests/integration/Cache/Adapter/Redis/GetSetCest.php
+++ b/tests/integration/Cache/Adapter/Redis/GetSetCest.php
@@ -14,12 +14,12 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Redis;
use Codeception\Example;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Redis;
use Phalcon\Storage\Exception;
use Phalcon\Storage\SerializerFactory;
use Phalcon\Test\Fixtures\Cache\CacheFixtureData;
use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
use function array_merge;
use function getOptionsRedis;
@@ -175,7 +175,7 @@ public function cacheAdapterRedisGetSetCustomSerializer(IntegrationTester $I)
)
);
- $key = 'cache-data';
+ $key = 'cache-data';
$source = 'Phalcon Framework';
$I->assertTrue(
diff --git a/tests/integration/Cache/Adapter/Redis/GetSetDefaultSerializerCest.php b/tests/integration/Cache/Adapter/Redis/GetSetDefaultSerializerCest.php
deleted file mode 100644
index 66098f49e53..00000000000
--- a/tests/integration/Cache/Adapter/Redis/GetSetDefaultSerializerCest.php
+++ /dev/null
@@ -1,54 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Redis;
-
-use Phalcon\Cache\Adapter\Redis;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-use function getOptionsRedis;
-
-class GetSetDefaultSerializerCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Redis ::
- * getDefaultSerializer()/setDefaultSerializer()
- *
- * @author Phalcon Team
- * @since 2019-04-13
- */
- public function storageAdapterRedisGetKeys(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Redis - getDefaultSerializer()/setDefaultSerializer()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Redis(
- $serializer,
- getOptionsRedis()
- );
-
- $I->assertEquals(
- 'Php',
- $adapter->getDefaultSerializer()
- );
-
- $adapter->setDefaultSerializer('Base64');
-
- $I->assertEquals(
- 'Base64',
- $adapter->getDefaultSerializer()
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Redis/HasCest.php b/tests/integration/Cache/Adapter/Redis/HasCest.php
deleted file mode 100644
index cd7c3492f60..00000000000
--- a/tests/integration/Cache/Adapter/Redis/HasCest.php
+++ /dev/null
@@ -1,53 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Redis;
-
-use Phalcon\Cache\Adapter\Redis;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
-
-use function getOptionsRedis;
-
-class HasCest
-{
- use RedisTrait;
-
- /**
- * Tests Phalcon\Cache\Adapter\Redis :: get()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterRedisGetSetHas(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Redis - has()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Redis(
- $serializer,
- getOptionsRedis()
- );
-
- $key = uniqid();
-
- $actual = $adapter->has($key);
- $I->assertFalse($actual);
-
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
- }
-}
diff --git a/tests/integration/Cache/Adapter/Redis/IncrementCest.php b/tests/integration/Cache/Adapter/Redis/IncrementCest.php
index 4a965d30157..4653644b894 100644
--- a/tests/integration/Cache/Adapter/Redis/IncrementCest.php
+++ b/tests/integration/Cache/Adapter/Redis/IncrementCest.php
@@ -13,10 +13,10 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Redis;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Redis;
use Phalcon\Storage\SerializerFactory;
use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
use function getOptionsRedis;
use function uniqid;
diff --git a/tests/integration/Cache/Adapter/Stream/ClearCest.php b/tests/integration/Cache/Adapter/Stream/ClearCest.php
deleted file mode 100644
index 457f1507621..00000000000
--- a/tests/integration/Cache/Adapter/Stream/ClearCest.php
+++ /dev/null
@@ -1,85 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Stream;
-
-use Phalcon\Cache\Adapter\Stream;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-use function outputDir;
-use function uniqid;
-
-class ClearCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Stream :: clear()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterStreamClear(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Stream - clear()');
- $serializer = new SerializerFactory();
- $adapter = new Stream($serializer, ['storageDir' => outputDir()]);
-
- $key1 = uniqid();
- $key2 = uniqid();
- $adapter->set($key1, 'test');
- $actual = $adapter->has($key1);
- $I->assertTrue($actual);
-
- $adapter->set($key2, 'test');
- $actual = $adapter->has($key2);
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
-
- $actual = $adapter->has($key1);
- $I->assertFalse($actual);
-
- $actual = $adapter->has($key2);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Stream :: clear() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function cacheAdapterStreamClearTwice(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Stream - clear() - twice');
- $serializer = new SerializerFactory();
- $adapter = new Stream($serializer, ['storageDir' => outputDir()]);
-
- $key1 = uniqid();
- $key2 = uniqid();
- $adapter->set($key1, 'test');
- $actual = $adapter->has($key1);
- $I->assertTrue($actual);
-
- $adapter->set($key2, 'test');
- $actual = $adapter->has($key2);
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
- }
-}
diff --git a/tests/integration/Cache/Adapter/Stream/ConstructCest.php b/tests/integration/Cache/Adapter/Stream/ConstructCest.php
deleted file mode 100644
index 3f0c4f10064..00000000000
--- a/tests/integration/Cache/Adapter/Stream/ConstructCest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Stream;
-
-use Phalcon\Cache\Adapter\AdapterInterface;
-use Phalcon\Cache\Adapter\Stream;
-use Phalcon\Storage\Exception;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-use function outputDir;
-
-class ConstructCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Stream :: __construct()
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function cacheAdapterStreamConstruct(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Stream - __construct()');
- $serializer = new SerializerFactory();
- $adapter = new Stream($serializer, ['storageDir' => outputDir()]);
-
- $class = Stream::class;
- $I->assertInstanceOf($class, $adapter);
-
- $class = AdapterInterface::class;
- $I->assertInstanceOf($class, $adapter);
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Stream :: __construct() - exception
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function cacheAdapterStreamConstructException(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Stream - __construct() - exception');
-
- $I->expectThrowable(
- new Exception("The 'storageDir' must be specified in the options"),
- function () {
- $serializer = new SerializerFactory();
- $adapter = new Stream($serializer);
- }
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Stream/DecrementCest.php b/tests/integration/Cache/Adapter/Stream/DecrementCest.php
index b5968684b73..c997e25e95e 100644
--- a/tests/integration/Cache/Adapter/Stream/DecrementCest.php
+++ b/tests/integration/Cache/Adapter/Stream/DecrementCest.php
@@ -13,10 +13,9 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Stream;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Stream;
-use Phalcon\Storage\Exception;
use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
use function outputDir;
diff --git a/tests/integration/Cache/Adapter/Stream/DeleteCest.php b/tests/integration/Cache/Adapter/Stream/DeleteCest.php
deleted file mode 100644
index 7e42734cab3..00000000000
--- a/tests/integration/Cache/Adapter/Stream/DeleteCest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Stream;
-
-use Phalcon\Cache\Adapter\Stream;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-use function outputDir;
-
-class DeleteCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Stream :: delete()
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function cacheAdapterStreamDelete(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Stream - delete()');
- $serializer = new SerializerFactory();
- $adapter = new Stream($serializer, ['storageDir' => outputDir()]);
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->has($key);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Stream :: delete() - twice
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function cacheAdapterStreamDeleteTwice(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Stream - delete() - twice');
- $serializer = new SerializerFactory();
- $adapter = new Stream($serializer, ['storageDir' => outputDir()]);
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Stream :: delete() - unknown
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function cacheAdapterStreamDeleteUnknown(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Stream - delete() - unknown');
-
- $serializer = new SerializerFactory();
- $adapter = new Stream($serializer, ['storageDir' => outputDir()]);
-
- $key = 'cache-data';
- $actual = $adapter->delete($key);
- $I->assertFalse($actual);
- }
-}
diff --git a/tests/integration/Cache/Adapter/Stream/GetAdapterCest.php b/tests/integration/Cache/Adapter/Stream/GetAdapterCest.php
deleted file mode 100644
index 85334fd9b1e..00000000000
--- a/tests/integration/Cache/Adapter/Stream/GetAdapterCest.php
+++ /dev/null
@@ -1,38 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Stream;
-
-use Phalcon\Cache\Adapter\Stream;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class GetAdapterCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Stream :: getAdapter()
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function cacheAdapterStreamGetAdapter(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Stream - getAdapter()');
-
- $serializer = new SerializerFactory();
- $adapter = new Stream($serializer, ['storageDir' => '/tmp']);
-
- $actual = $adapter->getAdapter();
- $I->assertNull($actual);
- }
-}
diff --git a/tests/integration/Cache/Adapter/Stream/GetKeysCest.php b/tests/integration/Cache/Adapter/Stream/GetKeysCest.php
index 385a2567c6a..172f4ed22e1 100644
--- a/tests/integration/Cache/Adapter/Stream/GetKeysCest.php
+++ b/tests/integration/Cache/Adapter/Stream/GetKeysCest.php
@@ -13,9 +13,9 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Stream;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Stream;
use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
use function outputDir;
use function sort;
diff --git a/tests/integration/Cache/Adapter/Stream/GetPrefixCest.php b/tests/integration/Cache/Adapter/Stream/GetPrefixCest.php
deleted file mode 100644
index 110149d5b7e..00000000000
--- a/tests/integration/Cache/Adapter/Stream/GetPrefixCest.php
+++ /dev/null
@@ -1,65 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Stream;
-
-use Phalcon\Cache\Adapter\Stream;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-use function outputDir;
-
-class GetPrefixCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Stream :: getPrefix()
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function cacheAdapterStreamGetSetPrefix(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Stream - getPrefix()');
-
- $serializer = new SerializerFactory();
- $adapter = new Stream(
- $serializer,
- [
- 'storageDir' => outputDir(),
- 'prefix' => 'my-prefix',
- ]
- );
-
- $expected = 'my-prefix';
- $actual = $adapter->getPrefix();
- $I->assertEquals($expected, $actual);
- }
-
- /**
- * Tests Phalcon\Cache\Adapter\Stream :: getPrefix() - default
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function cacheAdapterStreamGetSetPrefixDefault(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Stream - getPrefix() - default');
-
- $serializer = new SerializerFactory();
- $adapter = new Stream($serializer, ['storageDir' => outputDir()]);
-
- $expected = 'ph-strm';
- $actual = $adapter->getPrefix();
- $I->assertEquals($expected, $actual);
- }
-}
diff --git a/tests/integration/Cache/Adapter/Stream/GetSetCest.php b/tests/integration/Cache/Adapter/Stream/GetSetCest.php
index c7c08da5191..b9f9bd6b86a 100644
--- a/tests/integration/Cache/Adapter/Stream/GetSetCest.php
+++ b/tests/integration/Cache/Adapter/Stream/GetSetCest.php
@@ -14,10 +14,10 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Stream;
use Codeception\Example;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Stream;
use Phalcon\Storage\Exception;
use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
use Phalcon\Test\Fixtures\Cache\CacheFixtureData;
use function file_put_contents;
diff --git a/tests/integration/Cache/Adapter/Stream/GetSetDefaultSerializerCest.php b/tests/integration/Cache/Adapter/Stream/GetSetDefaultSerializerCest.php
deleted file mode 100644
index 62d657ead18..00000000000
--- a/tests/integration/Cache/Adapter/Stream/GetSetDefaultSerializerCest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Stream;
-
-use Phalcon\Cache\Adapter\Stream;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-use function outputDir;
-
-class GetSetDefaultSerializerCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Stream ::
- * getDefaultSerializer()/setDefaultSerializer()
- *
- * @author Phalcon Team
- * @since 2019-04-13
- */
- public function storageAdapterStreamGetKeys(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Stream - getDefaultSerializer()/setDefaultSerializer()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Stream(
- $serializer,
- [
- 'storageDir' => outputDir(),
- ]
- );
-
- $I->assertEquals(
- 'Php',
- $adapter->getDefaultSerializer()
- );
-
- $adapter->setDefaultSerializer('Base64');
-
- $I->assertEquals(
- 'Base64',
- $adapter->getDefaultSerializer()
- );
- }
-}
diff --git a/tests/integration/Cache/Adapter/Stream/HasCest.php b/tests/integration/Cache/Adapter/Stream/HasCest.php
deleted file mode 100644
index f0d67bb0ad9..00000000000
--- a/tests/integration/Cache/Adapter/Stream/HasCest.php
+++ /dev/null
@@ -1,47 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Cache\Adapter\Stream;
-
-use Phalcon\Cache\Adapter\Stream;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-use function outputDir;
-use function uniqid;
-
-class HasCest
-{
- /**
- * Tests Phalcon\Cache\Adapter\Stream :: has()
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function cacheAdapterStreamHas(IntegrationTester $I)
- {
- $I->wantToTest('Cache\Adapter\Stream - has()');
-
- $serializer = new SerializerFactory();
- $adapter = new Stream($serializer, ['storageDir' => outputDir()]);
-
- $key = uniqid();
-
- $actual = $adapter->has($key);
- $I->assertFalse($actual);
-
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
- }
-}
diff --git a/tests/integration/Cache/Adapter/Stream/IncrementCest.php b/tests/integration/Cache/Adapter/Stream/IncrementCest.php
index 9896f608b50..0e70c2cb85a 100644
--- a/tests/integration/Cache/Adapter/Stream/IncrementCest.php
+++ b/tests/integration/Cache/Adapter/Stream/IncrementCest.php
@@ -13,10 +13,9 @@
namespace Phalcon\Test\Integration\Cache\Adapter\Stream;
+use IntegrationTester;
use Phalcon\Cache\Adapter\Stream;
-use Phalcon\Storage\Exception;
use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
use function outputDir;
diff --git a/tests/integration/Storage/Adapter/Apcu/ClearCest.php b/tests/integration/Storage/Adapter/Apcu/ClearCest.php
deleted file mode 100644
index 1f02b678043..00000000000
--- a/tests/integration/Storage/Adapter/Apcu/ClearCest.php
+++ /dev/null
@@ -1,87 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Apcu;
-
-use Phalcon\Storage\Adapter\Apcu;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
-
-class ClearCest
-{
- use ApcuTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Apcu :: clear()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterApcuClear(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Apcu - clear()');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $key1 = uniqid();
- $key2 = uniqid();
- $adapter->set($key1, 'test');
- $actual = $adapter->has($key1);
- $I->assertTrue($actual);
-
- $adapter->set($key2, 'test');
- $actual = $adapter->has($key2);
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
-
- $actual = $adapter->has($key1);
- $I->assertFalse($actual);
-
- $actual = $adapter->has($key2);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Apcu :: clear() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterApcuClearTwice(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Apcu - clear() - twice');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $key1 = uniqid();
- $key2 = uniqid();
- $adapter->set($key1, 'test');
- $actual = $adapter->has($key1);
- $I->assertTrue($actual);
-
- $adapter->set($key2, 'test');
- $actual = $adapter->has($key2);
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
- }
-}
diff --git a/tests/integration/Storage/Adapter/Apcu/ConstructCest.php b/tests/integration/Storage/Adapter/Apcu/ConstructCest.php
deleted file mode 100644
index f6a368361f7..00000000000
--- a/tests/integration/Storage/Adapter/Apcu/ConstructCest.php
+++ /dev/null
@@ -1,45 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Apcu;
-
-use Phalcon\Storage\Adapter\AdapterInterface;
-use Phalcon\Storage\Adapter\Apcu;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
-
-class ConstructCest
-{
- use ApcuTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Apcu :: __construct()
- *
- * @author Phalcon Team
- * @since 2019-04-09
- */
- public function storageAdapterApcuConstruct(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Apcu - __construct()');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $class = Apcu::class;
- $I->assertInstanceOf($class, $adapter);
-
- $class = AdapterInterface::class;
- $I->assertInstanceOf($class, $adapter);
- }
-}
diff --git a/tests/integration/Storage/Adapter/Apcu/DeleteCest.php b/tests/integration/Storage/Adapter/Apcu/DeleteCest.php
deleted file mode 100644
index f8ff0f6421e..00000000000
--- a/tests/integration/Storage/Adapter/Apcu/DeleteCest.php
+++ /dev/null
@@ -1,92 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Apcu;
-
-use Phalcon\Storage\Adapter\Apcu;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
-
-class DeleteCest
-{
- use ApcuTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Apcu :: delete()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterApcuDelete(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Apcu - delete()');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->has($key);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Apcu :: delete() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterApcuDeleteTwice(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Apcu - delete() - twice');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Apcu :: delete() - unknown
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterApcuDeleteUnknown(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Apcu - delete() - unknown');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $key = 'cache-data';
- $actual = $adapter->delete($key);
- $I->assertFalse($actual);
- }
-}
diff --git a/tests/integration/Storage/Adapter/Apcu/GetAdapterCest.php b/tests/integration/Storage/Adapter/Apcu/GetAdapterCest.php
deleted file mode 100644
index 6b288011bea..00000000000
--- a/tests/integration/Storage/Adapter/Apcu/GetAdapterCest.php
+++ /dev/null
@@ -1,41 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Apcu;
-
-use Phalcon\Storage\Adapter\Apcu;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
-
-class GetAdapterCest
-{
- use ApcuTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Apcu :: getAdapter()
- *
- * @author Phalcon Team
- * @since 2019-04-14
- */
- public function storageAdapterApcuGetAdapter(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Apcu - getAdapter()');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $actual = $adapter->getAdapter();
- $I->assertNull($actual);
- }
-}
diff --git a/tests/integration/Storage/Adapter/Apcu/GetPrefixCest.php b/tests/integration/Storage/Adapter/Apcu/GetPrefixCest.php
deleted file mode 100644
index 590c9d2ec71..00000000000
--- a/tests/integration/Storage/Adapter/Apcu/GetPrefixCest.php
+++ /dev/null
@@ -1,68 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Apcu;
-
-use Phalcon\Storage\Adapter\Apcu;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
-
-class GetPrefixCest
-{
- use ApcuTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Apcu :: getPrefix()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterApcuGetSetPrefix(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Apcu - getPrefix()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Apcu(
- $serializer,
- [
- 'prefix' => 'my-prefix',
- ]
- );
-
- $I->assertEquals(
- 'my-prefix',
- $adapter->getPrefix()
- );
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Apcu :: getPrefix() - default
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterApcuGetSetPrefixDefault(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Apcu - getPrefix() - default');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $I->assertEquals(
- 'ph-apcu-',
- $adapter->getPrefix()
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Apcu/GetSetDefaultSerializerCest.php b/tests/integration/Storage/Adapter/Apcu/GetSetDefaultSerializerCest.php
deleted file mode 100644
index a50fee42523..00000000000
--- a/tests/integration/Storage/Adapter/Apcu/GetSetDefaultSerializerCest.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Apcu;
-
-use Phalcon\Storage\Adapter\Apcu;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
-
-class GetSetDefaultSerializerCest
-{
- use ApcuTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Apcu ::
- * getDefaultSerializer()/setDefaultSerializer()
- *
- * @author Phalcon Team
- * @since 2019-04-13
- */
- public function storageAdapterApcuGetKeys(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Apcu - getDefaultSerializer()/setDefaultSerializer()');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $I->assertEquals('Php', $adapter->getDefaultSerializer());
-
- $adapter->setDefaultSerializer('Base64');
- $I->assertEquals('Base64', $adapter->getDefaultSerializer());
- }
-}
diff --git a/tests/integration/Storage/Adapter/Apcu/HasCest.php b/tests/integration/Storage/Adapter/Apcu/HasCest.php
deleted file mode 100644
index c15e7e707a5..00000000000
--- a/tests/integration/Storage/Adapter/Apcu/HasCest.php
+++ /dev/null
@@ -1,47 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Apcu;
-
-use Phalcon\Storage\Adapter\Apcu;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\ApcuTrait;
-use IntegrationTester;
-
-class HasCest
-{
- use ApcuTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Apcu :: get()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterApcuGetSetHas(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Apcu - has()');
-
- $serializer = new SerializerFactory();
- $adapter = new Apcu($serializer);
-
- $key = uniqid();
-
- $actual = $adapter->has($key);
- $I->assertFalse($actual);
-
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
- }
-}
diff --git a/tests/integration/Storage/Adapter/ClearCest.php b/tests/integration/Storage/Adapter/ClearCest.php
new file mode 100644
index 00000000000..39931d0e70d
--- /dev/null
+++ b/tests/integration/Storage/Adapter/ClearCest.php
@@ -0,0 +1,127 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE.txt
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Phalcon\Test\Integration\Storage\Adapter;
+
+use Codeception\Example;
+use Phalcon\Storage\Adapter\Apcu;
+use Phalcon\Storage\Adapter\Libmemcached;
+use Phalcon\Storage\Adapter\Memory;
+use Phalcon\Storage\Adapter\Redis;
+use Phalcon\Storage\Adapter\Stream;
+use Phalcon\Storage\SerializerFactory;
+use IntegrationTester;
+
+use function array_merge;
+use function getOptionsLibmemcached;
+use function getOptionsRedis;
+use function outputDir;
+use function uniqid;
+
+class ClearCest
+{
+ /**
+ * Tests Phalcon\Storage\Adapter\* :: clear()
+ *
+ * @dataProvider getExamples
+ *
+ * @author Phalcon Team
+ * @since 2020-09-09
+ */
+ public function storageAdapterClear(IntegrationTester $I, Example $example)
+ {
+ $I->wantToTest(
+ 'Storage\Adapter\'' . $example['className'] . ' - getPrefix()'
+ );
+
+ $extension = $example['extension'];
+ $class = $example['class'];
+ $options = $example['options'];
+
+ if (!empty($extension)) {
+ $I->checkExtensionIsLoaded($extension);
+ }
+
+ $serializer = new SerializerFactory();
+ $adapter = new $class($serializer, $options);
+
+ $key1 = uniqid();
+ $key2 = uniqid();
+ $adapter->set($key1, 'test');
+ $actual = $adapter->has($key1);
+ $I->assertTrue($actual);
+
+ $adapter->set($key2, 'test');
+ $actual = $adapter->has($key2);
+ $I->assertTrue($actual);
+
+ $actual = $adapter->clear();
+ $I->assertTrue($actual);
+
+ $actual = $adapter->has($key1);
+ $I->assertFalse($actual);
+
+ $actual = $adapter->has($key2);
+ $I->assertFalse($actual);
+
+ /**
+ * Call clear twice to ensure it returns true
+ */
+ $actual = $adapter->clear();
+ $I->assertTrue($actual);
+ }
+
+ /**
+ * @return array[]
+ */
+ private function getExamples(): array
+ {
+ return [
+ [
+ 'className' => 'Apcu',
+ 'class' => Apcu::class,
+ 'options' => [],
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'class' => Libmemcached::class,
+ 'options' => getOptionsLibmemcached(),
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'default',
+ 'class' => Memory::class,
+ 'options' => [],
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'default',
+ 'class' => Redis::class,
+ 'options' => getOptionsRedis(),
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'default',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ ],
+ 'extension' => '',
+ ],
+ ];
+ }
+}
diff --git a/tests/integration/Storage/Adapter/ConstructCest.php b/tests/integration/Storage/Adapter/ConstructCest.php
new file mode 100644
index 00000000000..d4a8ff48aa6
--- /dev/null
+++ b/tests/integration/Storage/Adapter/ConstructCest.php
@@ -0,0 +1,106 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE.txt
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Phalcon\Test\Integration\Storage\Adapter;
+
+use Codeception\Example;
+use Phalcon\Storage\Adapter\AdapterInterface;
+use Phalcon\Storage\Adapter\Apcu;
+use Phalcon\Storage\Adapter\Libmemcached;
+use Phalcon\Storage\Adapter\Memory;
+use Phalcon\Storage\Adapter\Redis;
+use Phalcon\Storage\Adapter\Stream;
+use Phalcon\Storage\SerializerFactory;
+use IntegrationTester;
+
+use function array_merge;
+use function getOptionsLibmemcached;
+use function getOptionsRedis;
+use function outputDir;
+use function uniqid;
+
+class ConstructCest
+{
+ /**
+ * Tests Phalcon\Storage\Adapter\* :: __construct()
+ *
+ * @dataProvider getExamples
+ *
+ * @author Phalcon Team
+ * @since 2020-09-09
+ */
+ public function storageAdapterConstruct(IntegrationTester $I, Example $example)
+ {
+ $I->wantToTest(
+ 'Storage\Adapter\'' . $example['className'] . ' - __construct()'
+ );
+
+ $extension = $example['extension'];
+ $class = $example['class'];
+ $options = $example['options'];
+
+ if (!empty($extension)) {
+ $I->checkExtensionIsLoaded($extension);
+ }
+
+ $serializer = new SerializerFactory();
+ $adapter = new $class($serializer, $options);
+
+ $I->assertInstanceOf($class, $adapter);
+ $I->assertInstanceOf(AdapterInterface::class, $adapter);
+ }
+
+ /**
+ * @return array[]
+ */
+ private function getExamples(): array
+ {
+ return [
+ [
+ 'className' => 'Apcu',
+ 'class' => Apcu::class,
+ 'options' => [],
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'class' => Libmemcached::class,
+ 'options' => getOptionsLibmemcached(),
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'default',
+ 'class' => Memory::class,
+ 'options' => [],
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'default',
+ 'class' => Redis::class,
+ 'options' => getOptionsRedis(),
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'default',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ ],
+ 'extension' => '',
+ ],
+ ];
+ }
+}
diff --git a/tests/integration/Storage/Adapter/DeleteCest.php b/tests/integration/Storage/Adapter/DeleteCest.php
new file mode 100644
index 00000000000..17ce5050ede
--- /dev/null
+++ b/tests/integration/Storage/Adapter/DeleteCest.php
@@ -0,0 +1,119 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE.txt
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Phalcon\Test\Integration\Storage\Adapter;
+
+use Codeception\Example;
+use Phalcon\Storage\Adapter\Apcu;
+use Phalcon\Storage\Adapter\Libmemcached;
+use Phalcon\Storage\Adapter\Memory;
+use Phalcon\Storage\Adapter\Redis;
+use Phalcon\Storage\Adapter\Stream;
+use Phalcon\Storage\SerializerFactory;
+use IntegrationTester;
+
+use function array_merge;
+use function getOptionsLibmemcached;
+use function getOptionsRedis;
+use function outputDir;
+use function uniqid;
+
+class DeleteCest
+{
+ /**
+ * Tests Phalcon\Storage\Adapter\* :: delete()
+ *
+ * @dataProvider getExamples
+ *
+ * @author Phalcon Team
+ * @since 2020-09-09
+ */
+ public function storageAdapterDelete(IntegrationTester $I, Example $example)
+ {
+ $I->wantToTest(
+ 'Storage\Adapter\'' . $example['className'] . ' - delete()'
+ );
+
+ $extension = $example['extension'];
+ $class = $example['class'];
+ $options = $example['options'];
+
+ if (!empty($extension)) {
+ $I->checkExtensionIsLoaded($extension);
+ }
+
+ $serializer = new SerializerFactory();
+ $adapter = new $class($serializer, $options);
+
+ $key = uniqid();
+ $adapter->set($key, 'test');
+ $actual = $adapter->has($key);
+ $I->assertTrue($actual);
+
+ $actual = $adapter->delete($key);
+ $I->assertTrue($actual);
+
+ $actual = $adapter->has($key);
+ $I->assertFalse($actual);
+
+ /**
+ * Call clear twice to ensure it returns false
+ */
+ $actual = $adapter->delete($key);
+ $I->assertFalse($actual);
+ }
+
+ /**
+ * @return array[]
+ */
+ private function getExamples(): array
+ {
+ return [
+ [
+ 'className' => 'Apcu',
+ 'class' => Apcu::class,
+ 'options' => [],
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'class' => Libmemcached::class,
+ 'options' => getOptionsLibmemcached(),
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'default',
+ 'class' => Memory::class,
+ 'options' => [],
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'default',
+ 'class' => Redis::class,
+ 'options' => getOptionsRedis(),
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'default',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ ],
+ 'extension' => '',
+ ],
+ ];
+ }
+}
diff --git a/tests/integration/Storage/Adapter/GetAdapterCest.php b/tests/integration/Storage/Adapter/GetAdapterCest.php
new file mode 100644
index 00000000000..c4c6c897dc0
--- /dev/null
+++ b/tests/integration/Storage/Adapter/GetAdapterCest.php
@@ -0,0 +1,118 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE.txt
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Phalcon\Test\Integration\Storage\Adapter;
+
+use Codeception\Example;
+use Memcached as NativeMemcached;
+use Phalcon\Storage\Adapter\Apcu;
+use Phalcon\Storage\Adapter\Libmemcached;
+use Phalcon\Storage\Adapter\Memory;
+use Phalcon\Storage\Adapter\Redis;
+use Phalcon\Storage\Adapter\Stream;
+use Phalcon\Storage\SerializerFactory;
+use Redis as NativeRedis;
+use IntegrationTester;
+
+use function array_merge;
+use function getOptionsLibmemcached;
+use function getOptionsRedis;
+use function outputDir;
+use function uniqid;
+
+class GetAdapterCest
+{
+ /**
+ * Tests Phalcon\Storage\Adapter\* :: getAdapter()
+ *
+ * @dataProvider getExamples
+ *
+ * @author Phalcon Team
+ * @since 2020-09-09
+ */
+ public function storageAdapterGetAdapter(IntegrationTester $I, Example $example)
+ {
+ $I->wantToTest(
+ 'Storage\Adapter\'' . $example['className'] . ' - getAdapter()'
+ );
+
+ $extension = $example['extension'];
+ $class = $example['class'];
+ $options = $example['options'];
+
+ if (!empty($extension)) {
+ $I->checkExtensionIsLoaded($extension);
+ }
+
+ $serializer = new SerializerFactory();
+ $adapter = new $class($serializer, $options);
+
+ $expected = $example['expected'];
+ $actual = $adapter->getAdapter();
+
+ if (null === $expected) {
+ $I->assertNull($actual);
+ } else {
+ $I->assertInstanceOf($expected, $actual);
+ }
+ }
+
+ /**
+ * @return array[]
+ */
+ private function getExamples(): array
+ {
+ return [
+ [
+ 'className' => 'Apcu',
+ 'class' => Apcu::class,
+ 'options' => [],
+ 'expected' => null,
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'class' => Libmemcached::class,
+ 'options' => getOptionsLibmemcached(),
+ 'expected' => NativeMemcached::class,
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'default',
+ 'class' => Memory::class,
+ 'options' => [],
+ 'expected' => null,
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'default',
+ 'class' => Redis::class,
+ 'options' => getOptionsRedis(),
+ 'expected' => NativeRedis::class,
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'default',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ ],
+ 'expected' => null,
+ 'extension' => '',
+ ],
+ ];
+ }
+}
diff --git a/tests/integration/Storage/Adapter/GetPrefixCest.php b/tests/integration/Storage/Adapter/GetPrefixCest.php
new file mode 100644
index 00000000000..cf16248b352
--- /dev/null
+++ b/tests/integration/Storage/Adapter/GetPrefixCest.php
@@ -0,0 +1,232 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE.txt
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Phalcon\Test\Integration\Storage\Adapter;
+
+use Codeception\Example;
+use Phalcon\Storage\Adapter\Apcu;
+use Phalcon\Storage\Adapter\Libmemcached;
+use Phalcon\Storage\Adapter\Memory;
+use Phalcon\Storage\Adapter\Redis;
+use Phalcon\Storage\Adapter\Stream;
+use Phalcon\Storage\SerializerFactory;
+use IntegrationTester;
+
+use function array_merge;
+use function getOptionsRedis;
+use function outputDir;
+
+class GetPrefixCest
+{
+ /**
+ * Tests Phalcon\Storage\Adapter\* :: getPrefix()
+ *
+ * @dataProvider getExamples
+ *
+ * @author Phalcon Team
+ * @since 2020-09-09
+ */
+ public function storageAdapterGetSetPrefix(IntegrationTester $I, Example $example)
+ {
+ $I->wantToTest(
+ 'Storage\Adapter\'' . $example['className'] . ' - getPrefix() - ' . $example['label']
+ );
+
+ $extension = $example['extension'];
+ $class = $example['class'];
+ $options = $example['options'];
+
+ if (!empty($extension)) {
+ $I->checkExtensionIsLoaded($extension);
+ }
+
+ $serializer = new SerializerFactory();
+ $adapter = new $class($serializer, $options);
+
+ $expected = $example['expected'];
+ $actual = $adapter->getPrefix();
+ $I->assertEquals($expected, $actual);
+ }
+
+ private function getExamples(): array
+ {
+ return [
+ [
+ 'className' => 'Apcu',
+ 'label' => 'default',
+ 'class' => Apcu::class,
+ 'options' => [
+ ],
+ 'expected' => 'ph-apcu-',
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Apcu',
+ 'label' => 'empty',
+ 'class' => Apcu::class,
+ 'options' => [
+ 'prefix' => '',
+ ],
+ 'expected' => '',
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Apcu',
+ 'label' => 'prefix set',
+ 'class' => Apcu::class,
+ 'options' => [
+ 'prefix' => 'my-prefix',
+ ],
+ 'expected' => 'my-prefix',
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'label' => 'default',
+ 'class' => Libmemcached::class,
+ 'options' => array_merge(
+ getOptionsLibmemcached(),
+ [
+ ]
+ ),
+ 'expected' => 'ph-memc-',
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'label' => 'empty',
+ 'class' => Libmemcached::class,
+ 'options' => array_merge(
+ getOptionsLibmemcached(),
+ [
+ 'prefix' => '',
+ ]
+ ),
+ 'expected' => '',
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'label' => 'prefix set',
+ 'class' => Libmemcached::class,
+ 'options' => array_merge(
+ getOptionsLibmemcached(),
+ [
+ 'prefix' => 'my-prefix',
+ ]
+ ),
+ 'expected' => 'my-prefix',
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'default',
+ 'class' => Memory::class,
+ 'options' => [
+ ],
+ 'expected' => 'ph-memo-',
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'empty',
+ 'class' => Memory::class,
+ 'options' => [
+ 'prefix' => '',
+ ],
+ 'expected' => '',
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'prefix set',
+ 'class' => Memory::class,
+ 'options' => [
+ 'prefix' => 'my-prefix',
+ ],
+ 'expected' => 'my-prefix',
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'default',
+ 'class' => Redis::class,
+ 'options' => array_merge(
+ getOptionsRedis(),
+ [
+ ]
+ ),
+ 'expected' => 'ph-reds-',
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'empty',
+ 'class' => Redis::class,
+ 'options' => array_merge(
+ getOptionsRedis(),
+ [
+ 'prefix' => '',
+ ]
+ ),
+ 'expected' => '',
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'prefix set',
+ 'class' => Redis::class,
+ 'options' => array_merge(
+ getOptionsRedis(),
+ [
+ 'prefix' => 'my-prefix',
+ ]
+ ),
+ 'expected' => 'my-prefix',
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'default',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ ],
+ 'expected' => 'ph-strm',
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'empty',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ 'prefix' => '',
+ ],
+ 'expected' => '',
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'prefix set',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ 'prefix' => 'my-prefix',
+ ],
+ 'expected' => 'my-prefix',
+ 'extension' => '',
+ ],
+ ];
+ }
+}
diff --git a/tests/integration/Storage/Adapter/GetSetDefaultSerializerCest.php b/tests/integration/Storage/Adapter/GetSetDefaultSerializerCest.php
new file mode 100644
index 00000000000..cafe2b7879a
--- /dev/null
+++ b/tests/integration/Storage/Adapter/GetSetDefaultSerializerCest.php
@@ -0,0 +1,106 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE.txt
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Phalcon\Test\Integration\Storage\Adapter;
+
+use Codeception\Example;
+use Phalcon\Storage\Adapter\Apcu;
+use Phalcon\Storage\Adapter\Libmemcached;
+use Phalcon\Storage\Adapter\Memory;
+use Phalcon\Storage\Adapter\Redis;
+use Phalcon\Storage\Adapter\Stream;
+use Phalcon\Storage\SerializerFactory;
+use IntegrationTester;
+
+use function getOptionsLibmemcached;
+use function getOptionsRedis;
+use function outputDir;
+
+class GetSetDefaultSerializerCest
+{
+ /**
+ * Tests Phalcon\Storage\Adapter\* ::
+ * getDefaultSerializer()/setDefaultSerializer()
+ *
+ * @dataProvider getExamples
+ *
+ * @author Phalcon Team
+ * @since 2020-09-09
+ */
+ public function storageAdapterGetSetDefaultSerializer(IntegrationTester $I, Example $example)
+ {
+ $I->wantToTest(
+ 'Storage\Adapter\'' . $example['className'] . ' - getDefaultSerializer()/setDefaultSerializer()'
+ );
+
+ $extension = $example['extension'];
+ $class = $example['class'];
+ $options = $example['options'];
+
+ if (!empty($extension)) {
+ $I->checkExtensionIsLoaded($extension);
+ }
+
+ $serializer = new SerializerFactory();
+ $adapter = new $class($serializer, $options);
+
+ $I->assertEquals('Php', $adapter->getDefaultSerializer());
+
+ $adapter->setDefaultSerializer('Base64');
+ $I->assertEquals('Base64', $adapter->getDefaultSerializer());
+ }
+
+ /**
+ * @return array[]
+ */
+ private function getExamples(): array
+ {
+ return [
+ [
+ 'className' => 'Apcu',
+ 'class' => Apcu::class,
+ 'options' => [],
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'class' => Libmemcached::class,
+ 'options' => getOptionsLibmemcached(),
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'default',
+ 'class' => Memory::class,
+ 'options' => [],
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'default',
+ 'class' => Redis::class,
+ 'options' => getOptionsRedis(),
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'default',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ ],
+ 'extension' => '',
+ ],
+ ];
+ }
+}
diff --git a/tests/integration/Storage/Adapter/HasCest.php b/tests/integration/Storage/Adapter/HasCest.php
new file mode 100644
index 00000000000..66bae102c06
--- /dev/null
+++ b/tests/integration/Storage/Adapter/HasCest.php
@@ -0,0 +1,111 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE.txt
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Phalcon\Test\Integration\Storage\Adapter;
+
+use Codeception\Example;
+use Phalcon\Storage\Adapter\Apcu;
+use Phalcon\Storage\Adapter\Libmemcached;
+use Phalcon\Storage\Adapter\Memory;
+use Phalcon\Storage\Adapter\Redis;
+use Phalcon\Storage\Adapter\Stream;
+use Phalcon\Storage\SerializerFactory;
+use IntegrationTester;
+
+use function array_merge;
+use function getOptionsLibmemcached;
+use function getOptionsRedis;
+use function outputDir;
+use function uniqid;
+
+class HasCest
+{
+ /**
+ * Tests Phalcon\Storage\Adapter\* :: has()
+ *
+ * @dataProvider getExamples
+ *
+ * @author Phalcon Team
+ * @since 2020-09-09
+ */
+ public function storageAdapterHas(IntegrationTester $I, Example $example)
+ {
+ $I->wantToTest(
+ 'Storage\Adapter\'' . $example['className'] . ' - has()'
+ );
+
+ $extension = $example['extension'];
+ $class = $example['class'];
+ $options = $example['options'];
+
+ if (!empty($extension)) {
+ $I->checkExtensionIsLoaded($extension);
+ }
+
+ $serializer = new SerializerFactory();
+ $adapter = new $class($serializer, $options);
+
+ $key = uniqid();
+
+ $actual = $adapter->has($key);
+ $I->assertFalse($actual);
+
+ $adapter->set($key, 'test');
+ $actual = $adapter->has($key);
+ $I->assertTrue($actual);
+ }
+
+ /**
+ * @return array[]
+ */
+ private function getExamples(): array
+ {
+ return [
+ [
+ 'className' => 'Apcu',
+ 'class' => Apcu::class,
+ 'options' => [],
+ 'extension' => 'apcu',
+ ],
+ [
+ 'className' => 'Libmemcached',
+ 'class' => Libmemcached::class,
+ 'options' => getOptionsLibmemcached(),
+ 'extension' => 'memcached',
+ ],
+ [
+ 'className' => 'Memory',
+ 'label' => 'default',
+ 'class' => Memory::class,
+ 'options' => [],
+ 'extension' => '',
+ ],
+ [
+ 'className' => 'Redis',
+ 'label' => 'default',
+ 'class' => Redis::class,
+ 'options' => getOptionsRedis(),
+ 'extension' => 'redis',
+ ],
+ [
+ 'className' => 'Stream',
+ 'label' => 'default',
+ 'class' => Stream::class,
+ 'options' => [
+ 'storageDir' => outputDir(),
+ ],
+ 'extension' => '',
+ ],
+ ];
+ }
+}
diff --git a/tests/integration/Storage/Adapter/Libmemcached/ClearCest.php b/tests/integration/Storage/Adapter/Libmemcached/ClearCest.php
deleted file mode 100644
index 2fd07bf4eee..00000000000
--- a/tests/integration/Storage/Adapter/Libmemcached/ClearCest.php
+++ /dev/null
@@ -1,105 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Libmemcached;
-
-use Phalcon\Storage\Adapter\Libmemcached;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
-
-use function getOptionsLibmemcached;
-
-class ClearCest
-{
- use LibmemcachedTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Libmemcached :: clear()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterLibmemcachedClear(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Libmemcached - clear()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $key1 = uniqid();
- $key2 = uniqid();
-
- $adapter->set($key1, 'test');
-
- $I->assertTrue(
- $adapter->has($key1)
- );
-
- $adapter->set($key1, 'test');
-
- $I->assertTrue(
- $adapter->has($key1)
- );
-
- $I->assertTrue(
- $adapter->clear()
- );
-
- $I->assertFalse(
- $adapter->has($key1)
- );
-
- $I->assertFalse(
- $adapter->has($key2)
- );
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Libmemcached :: clear() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterLibmemcachedClearTwice(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Libmemcached - clear() - twice');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $key = 'key-1';
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
-
- $key = 'key-2';
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
- }
-}
diff --git a/tests/integration/Storage/Adapter/Libmemcached/ConstructCest.php b/tests/integration/Storage/Adapter/Libmemcached/ConstructCest.php
deleted file mode 100644
index 5e8d7b944d6..00000000000
--- a/tests/integration/Storage/Adapter/Libmemcached/ConstructCest.php
+++ /dev/null
@@ -1,121 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Libmemcached;
-
-use DateInterval;
-use Exception;
-use Phalcon\Storage\Adapter\AdapterInterface;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Storage\Adapter\Libmemcached;
-use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
-
-use function getOptionsLibmemcached;
-
-class ConstructCest
-{
- use LibmemcachedTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Libmemcached :: __construct()
- *
- * @author Phalcon Team
- * @since 2019-04-09
- */
- public function storageAdapterLibmemcachedConstruct(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Libmemcached - __construct()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $I->assertInstanceOf(
- Libmemcached::class,
- $adapter
- );
-
- $I->assertInstanceOf(
- AdapterInterface::class,
- $adapter
- );
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Libmemcached :: __construct() - empty
- * options
- *
- * @author Phalcon Team
- * @since 2019-04-09
- */
- public function storageAdapterLibmemcachedConstructEmptyOptions(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Libmemcached - __construct() - empty options');
-
- $serializer = new SerializerFactory();
- $adapter = new Libmemcached($serializer);
-
- $expected = [
- 'servers' => [
- 0 => [
- 'host' => '127.0.0.1',
- 'port' => 11211,
- 'weight' => 1,
- ],
- ],
- ];
-
- $I->assertEquals(
- $expected,
- $adapter->getOptions()
- );
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Libmemcached :: __construct() - getTtl
- * options
- *
- * @throws Exception
- * @since 2019-04-09
- *
- * @author Phalcon Team
- */
- public function storageAdapterLibmemcachedConstructGetTtl(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Libmemcached - __construct() - getTtl');
-
- $serializer = new SerializerFactory();
- $adapter = new Libmemcached($serializer);
-
- $I->assertEquals(
- 3600,
- $adapter->getTtl(null)
- );
-
- $I->assertEquals(
- 20,
- $adapter->getTtl(20)
- );
-
- $time = new DateInterval('PT5S');
-
- $I->assertEquals(
- 5,
- $adapter->getTtl($time)
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Libmemcached/DeleteCest.php b/tests/integration/Storage/Adapter/Libmemcached/DeleteCest.php
deleted file mode 100644
index 16330ad5c24..00000000000
--- a/tests/integration/Storage/Adapter/Libmemcached/DeleteCest.php
+++ /dev/null
@@ -1,102 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Libmemcached;
-
-use Phalcon\Storage\Adapter\Libmemcached;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
-
-use function getOptionsLibmemcached;
-
-class DeleteCest
-{
- use LibmemcachedTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Libmemcached :: delete()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterLibmemcachedDelete(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Libmemcached - delete()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->has($key);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Libmemcached :: delete() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterLibmemcachedDeleteTwice(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Libmemcached - delete() - twice');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Libmemcached :: delete() - unknown
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterLibmemcachedDeleteUnknown(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Libmemcached - delete() - unknown');
-
- $serializer = new SerializerFactory();
- $adapter = new Libmemcached($serializer, getOptionsLibmemcached());
-
- $key = 'cache-data';
- $actual = $adapter->delete($key);
- $I->assertFalse($actual);
- }
-}
diff --git a/tests/integration/Storage/Adapter/Libmemcached/GetAdapterCest.php b/tests/integration/Storage/Adapter/Libmemcached/GetAdapterCest.php
deleted file mode 100644
index 92745ee0011..00000000000
--- a/tests/integration/Storage/Adapter/Libmemcached/GetAdapterCest.php
+++ /dev/null
@@ -1,50 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Libmemcached;
-
-use Memcached;
-use Phalcon\Storage\Adapter\Libmemcached;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
-
-use function getOptionsLibmemcached;
-
-class GetAdapterCest
-{
- use LibmemcachedTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Libmemcached :: getAdapter()
- *
- * @author Phalcon Team
- * @since 2019-04-14
- */
- public function storageAdapterLibmemcachedGetAdapter(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Libmemcached - getAdapter()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $I->assertInstanceOf(
- Memcached::class,
- $adapter->getAdapter()
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Libmemcached/GetPrefixCest.php b/tests/integration/Storage/Adapter/Libmemcached/GetPrefixCest.php
deleted file mode 100644
index 3e62c83c37d..00000000000
--- a/tests/integration/Storage/Adapter/Libmemcached/GetPrefixCest.php
+++ /dev/null
@@ -1,77 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Libmemcached;
-
-use Phalcon\Storage\Adapter\Libmemcached;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
-
-use function getOptionsLibmemcached;
-
-class GetPrefixCest
-{
- use LibmemcachedTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Libmemcached :: getPrefix()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterLibmemcachedGetSetPrefix(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Libmemcached - getPrefix()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- array_merge(
- getOptionsLibmemcached(),
- [
- 'prefix' => 'my-prefix',
- ]
- )
- );
-
- $I->assertEquals(
- 'my-prefix',
- $adapter->getPrefix()
- );
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Libmemcached :: getPrefix() - default
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterLibmemcachedGetSetPrefixDefault(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Libmemcached - getPrefix() - default');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $I->assertEquals(
- 'ph-memc-',
- $adapter->getPrefix()
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Libmemcached/GetSetDefaultSerializerCest.php b/tests/integration/Storage/Adapter/Libmemcached/GetSetDefaultSerializerCest.php
deleted file mode 100644
index 883d38a2964..00000000000
--- a/tests/integration/Storage/Adapter/Libmemcached/GetSetDefaultSerializerCest.php
+++ /dev/null
@@ -1,57 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Libmemcached;
-
-use Phalcon\Storage\Adapter\Libmemcached;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
-
-use function getOptionsLibmemcached;
-
-class GetSetDefaultSerializerCest
-{
- use LibmemcachedTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Libmemcached ::
- * getDefaultSerializer()/setDefaultSerializer()
- *
- * @author Phalcon Team
- * @since 2019-04-13
- */
- public function storageAdapterLibmemcachedGetKeys(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Libmemcached - getDefaultSerializer()/setDefaultSerializer()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $I->assertEquals(
- 'Php',
- $adapter->getDefaultSerializer()
- );
-
- $adapter->setDefaultSerializer('Base64');
-
- $I->assertEquals(
- 'Base64',
- $adapter->getDefaultSerializer()
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Libmemcached/HasCest.php b/tests/integration/Storage/Adapter/Libmemcached/HasCest.php
deleted file mode 100644
index 762c3a4b3fa..00000000000
--- a/tests/integration/Storage/Adapter/Libmemcached/HasCest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Libmemcached;
-
-use Phalcon\Storage\Adapter\Libmemcached;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\LibmemcachedTrait;
-use IntegrationTester;
-
-use function getOptionsLibmemcached;
-
-class HasCest
-{
- use LibmemcachedTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Libmemcached :: get()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterLibmemcachedGetSetHas(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Libmemcached - has()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Libmemcached(
- $serializer,
- getOptionsLibmemcached()
- );
-
- $key = uniqid();
-
- $I->assertFalse(
- $adapter->has($key)
- );
-
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Memory/ClearCest.php b/tests/integration/Storage/Adapter/Memory/ClearCest.php
deleted file mode 100644
index e546308efad..00000000000
--- a/tests/integration/Storage/Adapter/Memory/ClearCest.php
+++ /dev/null
@@ -1,84 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Memory;
-
-use Phalcon\Storage\Adapter\Memory;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class ClearCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Memory :: clear()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterMemoryClear(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Memory - clear()');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $key1 = uniqid();
- $key2 = uniqid();
- $adapter->set($key1, 'test');
- $actual = $adapter->has($key1);
- $I->assertTrue($actual);
-
- $adapter->set($key2, 'test');
- $actual = $adapter->has($key2);
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
-
- $actual = $adapter->has($key1);
- $I->assertFalse($actual);
-
- $actual = $adapter->has($key2);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Memory :: clear() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterMemoryClearTwice(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Memory - clear() - twice');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $key1 = uniqid();
- $key2 = uniqid();
- $adapter->set($key1, 'test');
- $actual = $adapter->has($key1);
- $I->assertTrue($actual);
-
- $adapter->set($key2, 'test');
- $actual = $adapter->has($key2);
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
- }
-}
diff --git a/tests/integration/Storage/Adapter/Memory/ConstructCest.php b/tests/integration/Storage/Adapter/Memory/ConstructCest.php
deleted file mode 100644
index f4bb03f0785..00000000000
--- a/tests/integration/Storage/Adapter/Memory/ConstructCest.php
+++ /dev/null
@@ -1,42 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Memory;
-
-use Phalcon\Storage\Adapter\AdapterInterface;
-use Phalcon\Storage\Adapter\Memory;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class ConstructCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Memory :: __construct()
- *
- * @author Phalcon Team
- * @since 2019-04-09
- */
- public function storageAdapterMemoryConstruct(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Memory - __construct()');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $class = Memory::class;
- $I->assertInstanceOf($class, $adapter);
-
- $class = AdapterInterface::class;
- $I->assertInstanceOf($class, $adapter);
- }
-}
diff --git a/tests/integration/Storage/Adapter/Memory/DeleteCest.php b/tests/integration/Storage/Adapter/Memory/DeleteCest.php
deleted file mode 100644
index 4a6864af9db..00000000000
--- a/tests/integration/Storage/Adapter/Memory/DeleteCest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Memory;
-
-use Phalcon\Storage\Adapter\Memory;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class DeleteCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Memory :: delete()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterMemoryDelete(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Memory - delete()');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->has($key);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Memory :: delete() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterMemoryDeleteTwice(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Memory - delete() - twice');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Memory :: delete() - unknown
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterMemoryDeleteUnknown(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Memory - delete() - unknown');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $key = 'cache-data';
- $actual = $adapter->delete($key);
- $I->assertFalse($actual);
- }
-}
diff --git a/tests/integration/Storage/Adapter/Memory/GetAdapterCest.php b/tests/integration/Storage/Adapter/Memory/GetAdapterCest.php
deleted file mode 100644
index 112c8e97568..00000000000
--- a/tests/integration/Storage/Adapter/Memory/GetAdapterCest.php
+++ /dev/null
@@ -1,38 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Memory;
-
-use Phalcon\Storage\Adapter\Memory;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class GetAdapterCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Memory :: getAdapter()
- *
- * @author Phalcon Team
- * @since 2019-04-14
- */
- public function storageAdapterMemoryGetAdapter(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Memory - getAdapter()');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $actual = $adapter->getAdapter();
- $I->assertNull($actual);
- }
-}
diff --git a/tests/integration/Storage/Adapter/Memory/GetPrefixCest.php b/tests/integration/Storage/Adapter/Memory/GetPrefixCest.php
deleted file mode 100644
index 30bb92787e3..00000000000
--- a/tests/integration/Storage/Adapter/Memory/GetPrefixCest.php
+++ /dev/null
@@ -1,65 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Memory;
-
-use Phalcon\Storage\Adapter\Memory;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class GetPrefixCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Memory :: getPrefix()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterMemoryGetSetPrefix(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Memory - getPrefix()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Memory(
- $serializer,
- [
- 'prefix' => 'my-prefix',
- ]
- );
-
- $I->assertEquals(
- 'my-prefix',
- $adapter->getPrefix()
- );
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Memory :: getPrefix() - default
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterMemoryGetSetPrefixDefault(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Memory - getPrefix() - default');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $I->assertEquals(
- 'ph-memo-',
- $adapter->getPrefix()
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Memory/GetSetDefaultSerializerCest.php b/tests/integration/Storage/Adapter/Memory/GetSetDefaultSerializerCest.php
deleted file mode 100644
index 5fecfe02f11..00000000000
--- a/tests/integration/Storage/Adapter/Memory/GetSetDefaultSerializerCest.php
+++ /dev/null
@@ -1,48 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Memory;
-
-use Phalcon\Storage\Adapter\Memory;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class GetSetDefaultSerializerCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Memory ::
- * getDefaultSerializer()/setDefaultSerializer()
- *
- * @author Phalcon Team
- * @since 2019-04-13
- */
- public function storageAdapterMemoryGetKeys(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Memory - getDefaultSerializer()/setDefaultSerializer()');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $I->assertEquals(
- 'Php',
- $adapter->getDefaultSerializer()
- );
-
- $adapter->setDefaultSerializer('Base64');
-
- $I->assertEquals(
- 'Base64',
- $adapter->getDefaultSerializer()
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Memory/HasCest.php b/tests/integration/Storage/Adapter/Memory/HasCest.php
deleted file mode 100644
index bbb6a8b13fa..00000000000
--- a/tests/integration/Storage/Adapter/Memory/HasCest.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Memory;
-
-use Phalcon\Storage\Adapter\Memory;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class HasCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Memory :: get()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterMemoryGetSetHas(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Memory - has()');
-
- $serializer = new SerializerFactory();
- $adapter = new Memory($serializer);
-
- $key = uniqid();
-
- $actual = $adapter->has($key);
- $I->assertFalse($actual);
-
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
- }
-}
diff --git a/tests/integration/Storage/Adapter/Redis/ClearCest.php b/tests/integration/Storage/Adapter/Redis/ClearCest.php
deleted file mode 100644
index de381a1a400..00000000000
--- a/tests/integration/Storage/Adapter/Redis/ClearCest.php
+++ /dev/null
@@ -1,112 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Redis;
-
-use Phalcon\Storage\Adapter\Redis;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
-
-use function getOptionsRedis;
-
-class ClearCest
-{
- use RedisTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Redis :: clear()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterRedisClear(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Redis - clear()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Redis(
- $serializer,
- getOptionsRedis()
- );
-
- $key1 = uniqid();
- $key2 = uniqid();
-
- $adapter->set($key1, 'test');
-
- $I->assertTrue(
- $adapter->has($key1)
- );
-
- $adapter->set($key2, 'test');
-
- $I->assertTrue(
- $adapter->has($key2)
- );
-
- $I->assertTrue(
- $adapter->clear()
- );
-
- $I->assertFalse(
- $adapter->has($key1)
- );
-
- $I->assertFalse(
- $adapter->has($key2)
- );
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Redis :: clear() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterRedisClearTwice(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Redis - clear() - twice');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Redis(
- $serializer,
- getOptionsRedis()
- );
-
- $key1 = uniqid();
- $key2 = uniqid();
-
- $adapter->set($key1, 'test');
-
- $I->assertTrue(
- $adapter->has($key1)
- );
-
- $adapter->set($key2, 'test');
-
- $I->assertTrue(
- $adapter->has($key2)
- );
-
- $I->assertTrue(
- $adapter->clear()
- );
-
- $I->assertTrue(
- $adapter->clear()
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Redis/ConstructCest.php b/tests/integration/Storage/Adapter/Redis/ConstructCest.php
deleted file mode 100644
index 019541d03d1..00000000000
--- a/tests/integration/Storage/Adapter/Redis/ConstructCest.php
+++ /dev/null
@@ -1,55 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Redis;
-
-use Phalcon\Storage\Adapter\AdapterInterface;
-use Phalcon\Storage\Adapter\Redis;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
-
-use function getOptionsRedis;
-
-class ConstructCest
-{
- use RedisTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Redis :: __construct()
- *
- * @author Phalcon Team
- * @since 2019-04-09
- */
- public function storageAdapterRedisConstruct(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Redis - __construct()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Redis(
- $serializer,
- getOptionsRedis()
- );
-
- $I->assertInstanceOf(
- Redis::class,
- $adapter
- );
-
- $I->assertInstanceOf(
- AdapterInterface::class,
- $adapter
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Redis/DeleteCest.php b/tests/integration/Storage/Adapter/Redis/DeleteCest.php
deleted file mode 100644
index 1094956f4c3..00000000000
--- a/tests/integration/Storage/Adapter/Redis/DeleteCest.php
+++ /dev/null
@@ -1,94 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Redis;
-
-use Phalcon\Storage\Adapter\Redis;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
-
-use function getOptionsRedis;
-
-class DeleteCest
-{
- use RedisTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Redis :: delete()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterRedisDelete(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Redis - delete()');
-
- $serializer = new SerializerFactory();
- $adapter = new Redis($serializer, getOptionsRedis());
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->has($key);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Redis :: delete() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterRedisDeleteTwice(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Redis - delete() - twice');
-
- $serializer = new SerializerFactory();
- $adapter = new Redis($serializer, getOptionsRedis());
-
- $key = 'cache-data';
- $adapter->set($key, 'test');
- $actual = $adapter->has($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertTrue($actual);
-
- $actual = $adapter->delete($key);
- $I->assertFalse($actual);
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Redis :: delete() - unknown
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterRedisDeleteUnknown(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Redis - delete() - unknown');
-
- $serializer = new SerializerFactory();
- $adapter = new Redis($serializer, getOptionsRedis());
-
- $key = 'cache-data';
- $actual = $adapter->delete($key);
- $I->assertFalse($actual);
- }
-}
diff --git a/tests/integration/Storage/Adapter/Redis/GetAdapterCest.php b/tests/integration/Storage/Adapter/Redis/GetAdapterCest.php
deleted file mode 100644
index 8be3e914dfc..00000000000
--- a/tests/integration/Storage/Adapter/Redis/GetAdapterCest.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Redis;
-
-use Phalcon\Storage\Adapter\Redis;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
-
-use function getOptionsRedis;
-
-class GetAdapterCest
-{
- use RedisTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Redis :: getAdapter()
- *
- * @author Phalcon Team
- * @since 2019-04-14
- */
- public function storageAdapterRedisGetAdapter(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Redis - getAdapter()');
-
- $serializer = new SerializerFactory();
- $adapter = new Redis($serializer, getOptionsRedis());
-
- $class = \Redis::class;
- $actual = $adapter->getAdapter();
- $I->assertInstanceOf($class, $actual);
- }
-}
diff --git a/tests/integration/Storage/Adapter/Redis/GetPrefixCest.php b/tests/integration/Storage/Adapter/Redis/GetPrefixCest.php
deleted file mode 100644
index 611252df234..00000000000
--- a/tests/integration/Storage/Adapter/Redis/GetPrefixCest.php
+++ /dev/null
@@ -1,77 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Redis;
-
-use Phalcon\Storage\Adapter\Redis;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
-
-use function getOptionsRedis;
-
-class GetPrefixCest
-{
- use RedisTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Redis :: getPrefix()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterRedisGetSetPrefix(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Redis - getPrefix()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Redis(
- $serializer,
- array_merge(
- getOptionsRedis(),
- [
- 'prefix' => 'my-prefix',
- ]
- )
- );
-
- $I->assertEquals(
- 'my-prefix',
- $adapter->getPrefix()
- );
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Redis :: getPrefix() - default
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterRedisGetSetPrefixDefault(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Redis - getPrefix() - default');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Redis(
- $serializer,
- getOptionsRedis()
- );
-
- $I->assertEquals(
- 'ph-reds-',
- $adapter->getPrefix()
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Redis/GetSetDefaultSerializerCest.php b/tests/integration/Storage/Adapter/Redis/GetSetDefaultSerializerCest.php
deleted file mode 100644
index 3260c11429e..00000000000
--- a/tests/integration/Storage/Adapter/Redis/GetSetDefaultSerializerCest.php
+++ /dev/null
@@ -1,54 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Redis;
-
-use Phalcon\Storage\Adapter\Redis;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-use function getOptionsRedis;
-
-class GetSetDefaultSerializerCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Redis ::
- * getDefaultSerializer()/setDefaultSerializer()
- *
- * @author Phalcon Team
- * @since 2019-04-13
- */
- public function storageAdapterRedisGetKeys(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Redis - getDefaultSerializer()/setDefaultSerializer()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Redis(
- $serializer,
- getOptionsRedis()
- );
-
- $I->assertEquals(
- 'Php',
- $adapter->getDefaultSerializer()
- );
-
- $adapter->setDefaultSerializer('Base64');
-
- $I->assertEquals(
- 'Base64',
- $adapter->getDefaultSerializer()
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Redis/HasCest.php b/tests/integration/Storage/Adapter/Redis/HasCest.php
deleted file mode 100644
index 976456ff5b5..00000000000
--- a/tests/integration/Storage/Adapter/Redis/HasCest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Redis;
-
-use Phalcon\Storage\Adapter\Redis;
-use Phalcon\Storage\SerializerFactory;
-use Phalcon\Test\Fixtures\Traits\RedisTrait;
-use IntegrationTester;
-
-use function getOptionsRedis;
-
-class HasCest
-{
- use RedisTrait;
-
- /**
- * Tests Phalcon\Storage\Adapter\Redis :: get()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterRedisGetSetHas(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Redis - has()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Redis(
- $serializer,
- getOptionsRedis()
- );
-
- $key = uniqid();
-
- $I->assertFalse(
- $adapter->has($key)
- );
-
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Stream/ClearCest.php b/tests/integration/Storage/Adapter/Stream/ClearCest.php
deleted file mode 100644
index b128c1f5f49..00000000000
--- a/tests/integration/Storage/Adapter/Stream/ClearCest.php
+++ /dev/null
@@ -1,107 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Stream;
-
-use Phalcon\Storage\Adapter\Stream;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-use function outputDir;
-use function uniqid;
-
-class ClearCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Stream :: clear()
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterStreamClear(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Stream - clear()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Stream(
- $serializer,
- [
- 'storageDir' => outputDir(),
- ]
- );
-
- $key1 = uniqid();
- $key2 = uniqid();
- $adapter->set($key1, 'test');
- $actual = $adapter->has($key1);
- $I->assertTrue($actual);
-
- $adapter->set($key2, 'test');
- $I->assertTrue(
- $adapter->has($key2)
- );
-
- $I->assertTrue(
- $adapter->clear()
- );
-
- $I->assertFalse(
- $adapter->has($key1)
- );
-
- $I->assertFalse(
- $adapter->has($key2)
- );
-
- $I->safeDeleteDirectory(outputDir('ph-strm'));
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Stream :: clear() - twice
- *
- * @author Phalcon Team
- * @since 2019-03-31
- */
- public function storageAdapterStreamClearTwice(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Stream - clear() - twice');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Stream(
- $serializer,
- [
- 'storageDir' => outputDir(),
- ]
- );
-
- $key1 = uniqid();
- $key2 = uniqid();
- $adapter->set($key1, 'test');
- $actual = $adapter->has($key1);
- $I->assertTrue($actual);
-
- $adapter->set($key2, 'test');
- $actual = $adapter->has($key2);
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
-
- $actual = $adapter->clear();
- $I->assertTrue($actual);
-
- $I->safeDeleteDirectory(outputDir('ph-strm'));
- }
-}
diff --git a/tests/integration/Storage/Adapter/Stream/ConstructCest.php b/tests/integration/Storage/Adapter/Stream/ConstructCest.php
deleted file mode 100644
index 239534da461..00000000000
--- a/tests/integration/Storage/Adapter/Stream/ConstructCest.php
+++ /dev/null
@@ -1,74 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Stream;
-
-use Phalcon\Storage\Adapter\AdapterInterface;
-use Phalcon\Storage\Adapter\Stream;
-use Phalcon\Storage\Exception;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-use function outputDir;
-
-class ConstructCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Stream :: __construct()
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function storageAdapterStreamConstruct(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Stream - __construct()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Stream(
- $serializer,
- [
- 'storageDir' => outputDir(),
- ]
- );
-
- $I->assertInstanceOf(
- Stream::class,
- $adapter
- );
-
- $I->assertInstanceOf(
- AdapterInterface::class,
- $adapter
- );
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Stream :: __construct() - exception
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function storageAdapterStreamConstructException(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Stream - __construct() - exception');
-
- $I->expectThrowable(
- new Exception("The 'storageDir' must be specified in the options"),
- function () {
- $serializer = new SerializerFactory();
- $adapter = new Stream($serializer);
- }
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Stream/DeleteCest.php b/tests/integration/Storage/Adapter/Stream/DeleteCest.php
deleted file mode 100644
index bb23529c397..00000000000
--- a/tests/integration/Storage/Adapter/Stream/DeleteCest.php
+++ /dev/null
@@ -1,121 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Stream;
-
-use Phalcon\Storage\Adapter\Stream;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-use function outputDir;
-
-class DeleteCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Stream :: delete()
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function storageAdapterStreamDelete(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Stream - delete()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Stream(
- $serializer,
- [
- 'storageDir' => outputDir(),
- ]
- );
-
- $key = 'cache-data';
-
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
-
- $I->assertTrue(
- $adapter->delete($key)
- );
-
- $I->assertFalse(
- $adapter->has($key)
- );
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Stream :: delete() - twice
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function storageAdapterStreamDeleteTwice(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Stream - delete() - twice');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Stream(
- $serializer,
- [
- 'storageDir' => outputDir(),
- ]
- );
-
- $key = 'cache-data';
-
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
-
- $I->assertTrue(
- $adapter->delete($key)
- );
-
- $I->assertFalse(
- $adapter->delete($key)
- );
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Stream :: delete() - unknown
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function storageAdapterStreamDeleteUnknown(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Stream - delete() - unknown');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Stream(
- $serializer,
- [
- 'storageDir' => outputDir(),
- ]
- );
-
- $key = 'cache-data';
-
- $I->assertFalse(
- $adapter->delete($key)
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Stream/GetAdapterCest.php b/tests/integration/Storage/Adapter/Stream/GetAdapterCest.php
deleted file mode 100644
index 8066d21d150..00000000000
--- a/tests/integration/Storage/Adapter/Stream/GetAdapterCest.php
+++ /dev/null
@@ -1,45 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Stream;
-
-use Phalcon\Storage\Adapter\Stream;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-class GetAdapterCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Stream :: getAdapter()
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function storageAdapterStreamGetAdapter(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Stream - getAdapter()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Stream(
- $serializer,
- [
- 'storageDir' => '/tmp',
- ]
- );
-
- $I->assertNull(
- $adapter->getAdapter()
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Stream/GetPrefixCest.php b/tests/integration/Storage/Adapter/Stream/GetPrefixCest.php
deleted file mode 100644
index eecb2a85c68..00000000000
--- a/tests/integration/Storage/Adapter/Stream/GetPrefixCest.php
+++ /dev/null
@@ -1,74 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Stream;
-
-use Phalcon\Storage\Adapter\Stream;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-use function outputDir;
-
-class GetPrefixCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Stream :: getPrefix()
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function storageAdapterStreamGetSetPrefix(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Stream - getPrefix()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Stream(
- $serializer,
- [
- 'storageDir' => outputDir(),
- 'prefix' => 'my-prefix',
- ]
- );
-
- $I->assertEquals(
- 'my-prefix',
- $adapter->getPrefix()
- );
- }
-
- /**
- * Tests Phalcon\Storage\Adapter\Stream :: getPrefix() - default
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function storageAdapterStreamGetSetPrefixDefault(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Stream - getPrefix() - default');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Stream(
- $serializer,
- [
- 'storageDir' => outputDir(),
- ]
- );
-
- $I->assertEquals(
- 'ph-strm',
- $adapter->getPrefix()
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Stream/GetSetDefaultSerializerCest.php b/tests/integration/Storage/Adapter/Stream/GetSetDefaultSerializerCest.php
deleted file mode 100644
index a3b81a2a077..00000000000
--- a/tests/integration/Storage/Adapter/Stream/GetSetDefaultSerializerCest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Stream;
-
-use Phalcon\Storage\Adapter\Stream;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-use function outputDir;
-
-class GetSetDefaultSerializerCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Stream ::
- * getDefaultSerializer()/setDefaultSerializer()
- *
- * @author Phalcon Team
- * @since 2019-04-13
- */
- public function storageAdapterStreamGetKeys(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Stream - getDefaultSerializer()/setDefaultSerializer()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Stream(
- $serializer,
- [
- 'storageDir' => outputDir(),
- ]
- );
-
- $I->assertEquals(
- 'Php',
- $adapter->getDefaultSerializer()
- );
-
- $adapter->setDefaultSerializer('Base64');
-
- $I->assertEquals(
- 'Base64',
- $adapter->getDefaultSerializer()
- );
- }
-}
diff --git a/tests/integration/Storage/Adapter/Stream/HasCest.php b/tests/integration/Storage/Adapter/Stream/HasCest.php
deleted file mode 100644
index 345415b39a9..00000000000
--- a/tests/integration/Storage/Adapter/Stream/HasCest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE.txt
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace Phalcon\Test\Integration\Storage\Adapter\Stream;
-
-use Phalcon\Storage\Adapter\Stream;
-use Phalcon\Storage\SerializerFactory;
-use IntegrationTester;
-
-use function outputDir;
-use function uniqid;
-
-class HasCest
-{
- /**
- * Tests Phalcon\Storage\Adapter\Stream :: has()
- *
- * @author Phalcon Team
- * @since 2019-04-24
- */
- public function storageAdapterStreamHas(IntegrationTester $I)
- {
- $I->wantToTest('Storage\Adapter\Stream - has()');
-
- $serializer = new SerializerFactory();
-
- $adapter = new Stream(
- $serializer,
- [
- 'storageDir' => outputDir(),
- ]
- );
-
- $key = uniqid();
-
- $I->assertFalse(
- $adapter->has($key)
- );
-
- $adapter->set($key, 'test');
-
- $I->assertTrue(
- $adapter->has($key)
- );
- }
-}
diff --git a/tests/unit/Security/JWT/Builder/AddClaimCest.php b/tests/unit/Security/JWT/Builder/AddClaimCest.php
new file mode 100644
index 00000000000..a9026a1a254
--- /dev/null
+++ b/tests/unit/Security/JWT/Builder/AddClaimCest.php
@@ -0,0 +1,50 @@
+
+ * @since 2019-12-22
+ */
+ public function securityJWTBuilderAddClaim(UnitTester $I)
+ {
+ $I->wantToTest('Security\JWT\Builder - addClaim()');
+
+ $signer = new Hmac();
+ $builder = new Builder($signer);
+
+ $I->assertEmpty($builder->getClaims());
+
+ $builder
+ ->setId('this is an id')
+ ->addClaim('username', 'Phalcon')
+ ->addClaim('email', 'team@phalcon.io')
+ ;
+
+ $expected = [
+ 'email' => 'team@phalcon.io',
+ 'jti' => 'this is an id',
+ 'username' => 'Phalcon',
+ ];
+ $actual = $builder->getClaims();
+ $I->assertCount(3, $actual);
+ $I->assertEquals($expected, $actual);
+ }
+}
diff --git a/tests/unit/Security/JWT/Builder/ConstructCest.php b/tests/unit/Security/JWT/Builder/ConstructCest.php
index b868ed406eb..2e211f7f08f 100644
--- a/tests/unit/Security/JWT/Builder/ConstructCest.php
+++ b/tests/unit/Security/JWT/Builder/ConstructCest.php
@@ -20,7 +20,8 @@ class ConstructCest
/**
* Unit Tests Phalcon\Security\JWT\Builder :: __construct()
*
- * @since 2019-12-19
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTBuilderConstruct(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Builder/GetClaimsCest.php b/tests/unit/Security/JWT/Builder/GetClaimsCest.php
index 943be4dded3..9f8a37bbcce 100644
--- a/tests/unit/Security/JWT/Builder/GetClaimsCest.php
+++ b/tests/unit/Security/JWT/Builder/GetClaimsCest.php
@@ -20,6 +20,7 @@ class GetClaimsCest
/**
* Unit Tests Phalcon\Security\JWT\Builder :: getClaims()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTBuilderGetClaims(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Builder/GetHeadersCest.php b/tests/unit/Security/JWT/Builder/GetHeadersCest.php
index 46e1133ed18..40774d06322 100644
--- a/tests/unit/Security/JWT/Builder/GetHeadersCest.php
+++ b/tests/unit/Security/JWT/Builder/GetHeadersCest.php
@@ -20,7 +20,8 @@ class GetHeadersCest
/**
* Unit Tests Phalcon\Security\JWT\Builder :: getHeaders()
*
- * @since 2019-12-19
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTBuilderGetHeaders(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Builder/GetSetAudienceCest.php b/tests/unit/Security/JWT/Builder/GetSetAudienceCest.php
index 482e6c8c366..9bd1d56eb2b 100644
--- a/tests/unit/Security/JWT/Builder/GetSetAudienceCest.php
+++ b/tests/unit/Security/JWT/Builder/GetSetAudienceCest.php
@@ -21,7 +21,8 @@ class GetSetAudienceCest
/**
* Unit Tests Phalcon\Security\JWT\Builder :: getAudience()/setAudience()
*
- * @since 2019-12-15
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTBuilderGetSetAudience(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Builder/GetSetContentTypeCest.php b/tests/unit/Security/JWT/Builder/GetSetContentTypeCest.php
index cf2b6775717..65d5290df24 100644
--- a/tests/unit/Security/JWT/Builder/GetSetContentTypeCest.php
+++ b/tests/unit/Security/JWT/Builder/GetSetContentTypeCest.php
@@ -20,7 +20,8 @@ class GetSetContentTypeCest
/**
* Unit Tests Phalcon\Security\JWT\Builder :: getContentType()/setContentType()
*
- * @since 2019-12-19
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTBuilderGetSetContentType(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Builder/GetSetExpirationTimeCest.php b/tests/unit/Security/JWT/Builder/GetSetExpirationTimeCest.php
index 56480d106c1..2b4c70e1a18 100644
--- a/tests/unit/Security/JWT/Builder/GetSetExpirationTimeCest.php
+++ b/tests/unit/Security/JWT/Builder/GetSetExpirationTimeCest.php
@@ -22,7 +22,8 @@ class GetSetExpirationTimeCest
* Unit Tests Phalcon\Security\JWT\Builder ::
* getExpirationTime()/setExpirationTime()
*
- * @since 2019-12-15
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTBuilderGetSetExpirationTime(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Builder/GetSetIdCest.php b/tests/unit/Security/JWT/Builder/GetSetIdCest.php
index 1a73f364c7b..6f137418132 100644
--- a/tests/unit/Security/JWT/Builder/GetSetIdCest.php
+++ b/tests/unit/Security/JWT/Builder/GetSetIdCest.php
@@ -20,7 +20,8 @@ class GetSetIdCest
/**
* Unit Tests Phalcon\Security\JWT\Builder :: getId()/setId()
*
- * @since 2019-12-15
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTBuilderGetSetId(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Builder/GetSetIssuedAtCest.php b/tests/unit/Security/JWT/Builder/GetSetIssuedAtCest.php
index e17f068f28a..aa35ca378a1 100644
--- a/tests/unit/Security/JWT/Builder/GetSetIssuedAtCest.php
+++ b/tests/unit/Security/JWT/Builder/GetSetIssuedAtCest.php
@@ -20,7 +20,8 @@ class GetSetIssuedAtCest
/**
* Unit Tests Phalcon\Security\JWT\Builder :: getIssuedAt()/setIssuedAt()
*
- * @since 2019-12-15
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTBuilderGetSetIssuedAt(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Builder/GetSetIssuerCest.php b/tests/unit/Security/JWT/Builder/GetSetIssuerCest.php
index c9001c2ed40..e3654f06e86 100644
--- a/tests/unit/Security/JWT/Builder/GetSetIssuerCest.php
+++ b/tests/unit/Security/JWT/Builder/GetSetIssuerCest.php
@@ -20,7 +20,8 @@ class GetSetIssuerCest
/**
* Unit Tests Phalcon\Security\JWT\Builder :: getIssuer()/setIssuer()
*
- * @since 2019-12-15
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTBuilderGetSetIssuer(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Builder/GetSetNotBeforeCest.php b/tests/unit/Security/JWT/Builder/GetSetNotBeforeCest.php
index 8f8bef0c2c1..a743091f33d 100644
--- a/tests/unit/Security/JWT/Builder/GetSetNotBeforeCest.php
+++ b/tests/unit/Security/JWT/Builder/GetSetNotBeforeCest.php
@@ -21,7 +21,8 @@ class GetSetNotBeforeCest
/**
* Unit Tests Phalcon\Security\JWT\Builder :: getNotBefore()/setNotBefore()
*
- * @since 2019-12-15
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTBuilderGetSetNotBefore(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Builder/GetSetPassphraseCest.php b/tests/unit/Security/JWT/Builder/GetSetPassphraseCest.php
index c8196350ac0..deea950931d 100644
--- a/tests/unit/Security/JWT/Builder/GetSetPassphraseCest.php
+++ b/tests/unit/Security/JWT/Builder/GetSetPassphraseCest.php
@@ -24,7 +24,9 @@ class GetSetPassphraseCest
*
* @throws ValidatorException
* @throws UnsupportedAlgorithmException
- * @since 2019-12-19
+ *
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTBuilderGetSetPassphrase(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Builder/GetSetSubjectCest.php b/tests/unit/Security/JWT/Builder/GetSetSubjectCest.php
index 7bf15075a2d..9d9edf37f3f 100644
--- a/tests/unit/Security/JWT/Builder/GetSetSubjectCest.php
+++ b/tests/unit/Security/JWT/Builder/GetSetSubjectCest.php
@@ -20,7 +20,8 @@ class GetSetSubjectCest
/**
* Unit Tests Phalcon\Security\JWT\Builder :: getSubject()/setSubject()
*
- * @since 2019-12-15
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTBuilderGetSetSubject(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Builder/GetTokenCest.php b/tests/unit/Security/JWT/Builder/GetTokenCest.php
index 5eb8eff28ac..847272b18dd 100644
--- a/tests/unit/Security/JWT/Builder/GetTokenCest.php
+++ b/tests/unit/Security/JWT/Builder/GetTokenCest.php
@@ -25,7 +25,8 @@ class GetTokenCest
/**
* Unit Tests Phalcon\Security\JWT\Builder :: getToken()
*
- * @since 2019-12-19
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTBuilderGetToken(UnitTester $I)
{
@@ -71,9 +72,9 @@ public function securityJWTBuilderGetTokenException(UnitTester $I)
'Invalid passphrase (empty)'
),
function () {
- $signer = new Hmac();
+ $signer = new Hmac();
$builder = new Builder($signer);
- $token = $builder->getToken();
+ $token = $builder->getToken();
}
);
}
diff --git a/tests/unit/Security/JWT/Builder/InitCest.php b/tests/unit/Security/JWT/Builder/InitCest.php
index e76a5e1cf6b..9e883570f4f 100644
--- a/tests/unit/Security/JWT/Builder/InitCest.php
+++ b/tests/unit/Security/JWT/Builder/InitCest.php
@@ -20,7 +20,8 @@ class InitCest
/**
* Unit Tests Phalcon\Security\JWT\Builder :: init()
*
- * @since 2019-12-19
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTBuilderInit(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Signer/Hmac/ConstructCest.php b/tests/unit/Security/JWT/Signer/Hmac/ConstructCest.php
index f901defe9f0..afda6093319 100644
--- a/tests/unit/Security/JWT/Signer/Hmac/ConstructCest.php
+++ b/tests/unit/Security/JWT/Signer/Hmac/ConstructCest.php
@@ -20,7 +20,8 @@ class ConstructCest
/**
* Unit Tests Phalcon\Security\JWT\Signer\Hmac :: __construct()
*
- * @since 2019-12-15
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTSignerHmacConstruct(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Signer/Hmac/GetAlgHeaderCest.php b/tests/unit/Security/JWT/Signer/Hmac/GetAlgHeaderCest.php
index f517adbf846..c41e4c2aa5c 100644
--- a/tests/unit/Security/JWT/Signer/Hmac/GetAlgHeaderCest.php
+++ b/tests/unit/Security/JWT/Signer/Hmac/GetAlgHeaderCest.php
@@ -19,7 +19,8 @@ class GetAlgHeaderCest
/**
* Unit Tests Phalcon\Security\JWT\Signer\Hmac :: getAlgHeader()
*
- * @since 2019-12-19
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTSignerHmacGetAlgHeader(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Signer/Hmac/GetAlgorithmCest.php b/tests/unit/Security/JWT/Signer/Hmac/GetAlgorithmCest.php
index 0e21dbae4b9..4b063f744b8 100644
--- a/tests/unit/Security/JWT/Signer/Hmac/GetAlgorithmCest.php
+++ b/tests/unit/Security/JWT/Signer/Hmac/GetAlgorithmCest.php
@@ -19,7 +19,8 @@ class GetAlgorithmCest
/**
* Unit Tests Phalcon\Security\JWT\Signer\Hmac :: getAlgorithm()
*
- * @since 2019-12-15
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTSignerHmacGetAlgorithm(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Signer/Hmac/SignCest.php b/tests/unit/Security/JWT/Signer/Hmac/SignCest.php
index 26c042e4c02..6747208f2ba 100644
--- a/tests/unit/Security/JWT/Signer/Hmac/SignCest.php
+++ b/tests/unit/Security/JWT/Signer/Hmac/SignCest.php
@@ -21,7 +21,8 @@ class SignCest
/**
* Unit Tests Phalcon\Security\JWT\Signer\Hmac :: sign()
*
- * @since 2019-12-15
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTSignerHmacSign(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Signer/Hmac/VerifyCest.php b/tests/unit/Security/JWT/Signer/Hmac/VerifyCest.php
index fcaca13f7f2..d5493c0dd15 100644
--- a/tests/unit/Security/JWT/Signer/Hmac/VerifyCest.php
+++ b/tests/unit/Security/JWT/Signer/Hmac/VerifyCest.php
@@ -21,7 +21,8 @@ class VerifyCest
/**
* Unit Tests Phalcon\Security\JWT\Signer\Hmac :: verify()
*
- * @since 2019-12-15
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTSignerHmacVerify(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Signer/None/ConstructCest.php b/tests/unit/Security/JWT/Signer/None/ConstructCest.php
index d43ac004ead..fe909bfc2e7 100644
--- a/tests/unit/Security/JWT/Signer/None/ConstructCest.php
+++ b/tests/unit/Security/JWT/Signer/None/ConstructCest.php
@@ -19,7 +19,8 @@ class ConstructCest
/**
* Unit Tests Phalcon\Security\JWT\Signer\None :: __construct()
*
- * @since 2019-12-15
+ * @author Phalcon Team
+ * @since 2019-12-22
*/
public function securityJWTSignerNoneConstruct(UnitTester $I)
{
diff --git a/tests/unit/Security/JWT/Signer/None/GetAlgHeaderCest.php b/tests/unit/Security/JWT/Signer/None/GetAlgHeaderCest.php
index 4916bc28c52..f4d8a7c8b89 100644
--- a/tests/unit/Security/JWT/Signer/None/GetAlgHeaderCest.php
+++ b/tests/unit/Security/JWT/Signer/None/GetAlgHeaderCest.php
@@ -19,6 +19,7 @@ class GetAlgHeaderCest
/**
* Unit Tests Phalcon\Security\JWT\Signer\None :: getAlgHeader()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTSignerNoneGetAlgHeader(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Signer/None/GetAlgorithmCest.php b/tests/unit/Security/JWT/Signer/None/GetAlgorithmCest.php
index ac7a4388212..6b91e5f09a8 100644
--- a/tests/unit/Security/JWT/Signer/None/GetAlgorithmCest.php
+++ b/tests/unit/Security/JWT/Signer/None/GetAlgorithmCest.php
@@ -19,6 +19,7 @@ class GetAlgorithmCest
/**
* Unit Tests Phalcon\Security\JWT\Signer\None :: getAlgorithm()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTSignerNoneGetAlgorithm(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Signer/None/SignCest.php b/tests/unit/Security/JWT/Signer/None/SignCest.php
index cc7264407fe..9f62b19bcbc 100644
--- a/tests/unit/Security/JWT/Signer/None/SignCest.php
+++ b/tests/unit/Security/JWT/Signer/None/SignCest.php
@@ -19,6 +19,7 @@ class SignCest
/**
* Unit Tests Phalcon\Security\JWT\Signer\None :: sign()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTSignerNoneSign(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Signer/None/VerifyCest.php b/tests/unit/Security/JWT/Signer/None/VerifyCest.php
index 52b08b83c78..08265420cf5 100644
--- a/tests/unit/Security/JWT/Signer/None/VerifyCest.php
+++ b/tests/unit/Security/JWT/Signer/None/VerifyCest.php
@@ -19,6 +19,7 @@ class VerifyCest
/**
* Unit Tests Phalcon\Security\JWT\Signer\None :: verify()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTSignerNoneVerify(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Token/Item/ConstructCest.php b/tests/unit/Security/JWT/Token/Item/ConstructCest.php
index d6406a8dbcb..11ca1472591 100644
--- a/tests/unit/Security/JWT/Token/Item/ConstructCest.php
+++ b/tests/unit/Security/JWT/Token/Item/ConstructCest.php
@@ -19,6 +19,7 @@ class ConstructCest
/**
* Unit Tests Phalcon\Security\JWT\Token\Item :: __construct()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenItemConstruct(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Token/Item/GetCest.php b/tests/unit/Security/JWT/Token/Item/GetCest.php
index 247bc978fc3..110ea85121e 100644
--- a/tests/unit/Security/JWT/Token/Item/GetCest.php
+++ b/tests/unit/Security/JWT/Token/Item/GetCest.php
@@ -19,6 +19,7 @@ class GetCest
/**
* Unit Tests Phalcon\Security\JWT\Token\Item :: get()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenItemGet(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Token/Item/HasCest.php b/tests/unit/Security/JWT/Token/Item/HasCest.php
index 74eba9b4b28..ac740f29fb7 100644
--- a/tests/unit/Security/JWT/Token/Item/HasCest.php
+++ b/tests/unit/Security/JWT/Token/Item/HasCest.php
@@ -19,6 +19,7 @@ class HasCest
/**
* Unit Tests Phalcon\Security\JWT\Token\Item :: has()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenItemHas(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Token/Item/UnderscoreCallCest.php b/tests/unit/Security/JWT/Token/Item/UnderscoreCallCest.php
index 1a6d472e1b2..0c8a9c9b02e 100644
--- a/tests/unit/Security/JWT/Token/Item/UnderscoreCallCest.php
+++ b/tests/unit/Security/JWT/Token/Item/UnderscoreCallCest.php
@@ -19,6 +19,7 @@ class UnderscoreCallCest
/**
* Unit Tests Phalcon\Security\JWT\Token\Item :: __call()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenItemUnderscoreCall(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Token/Parser/ParseCest.php b/tests/unit/Security/JWT/Token/Parser/ParseCest.php
index ebf0dbf2ad7..8338f72eb9e 100644
--- a/tests/unit/Security/JWT/Token/Parser/ParseCest.php
+++ b/tests/unit/Security/JWT/Token/Parser/ParseCest.php
@@ -26,6 +26,7 @@ class ParseCest
/**
* Unit Tests Phalcon\Security\JWT\Token\Parser :: parse()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenParserParse(UnitTester $I)
@@ -69,6 +70,7 @@ public function securityJWTTokenParserParse(UnitTester $I)
/**
* Unit Tests Phalcon\Security\JWT\Token\Parser :: parse() - no signature
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenParserParseNoSignature(UnitTester $I)
@@ -114,6 +116,7 @@ public function securityJWTTokenParserParseNoSignature(UnitTester $I)
/**
* Unit Tests Phalcon\Security\JWT\Token\Parser :: parse() - aud not an array
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenParserParseAudNotAnArray(UnitTester $I)
@@ -165,6 +168,7 @@ public function securityJWTTokenParserParseAudNotAnArray(UnitTester $I)
* Unit Tests Phalcon\Security\JWT\Token\Parser :: parse() - exception claims
* not array
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenParserParseExceptionClaimsNotArray(UnitTester $I)
@@ -191,6 +195,7 @@ function () {
* Unit Tests Phalcon\Security\JWT\Token\Parser :: parse() - exception headers
* not array
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenParserParseExceptionHeadersNotArray(UnitTester $I)
@@ -219,6 +224,7 @@ function () {
/**
* Unit Tests Phalcon\Security\JWT\Token\Parser :: parse() - exception no typ
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenParserParseExceptionNoTyp(UnitTester $I)
@@ -248,6 +254,7 @@ function () {
/**
* Unit Tests Phalcon\Security\JWT\Token\Parser :: parse() - exception wrong JWT
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenParserParseExceptionWrongJwt(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Token/Signature/ConstructCest.php b/tests/unit/Security/JWT/Token/Signature/ConstructCest.php
index f016972f60e..4eb6ad07302 100644
--- a/tests/unit/Security/JWT/Token/Signature/ConstructCest.php
+++ b/tests/unit/Security/JWT/Token/Signature/ConstructCest.php
@@ -19,6 +19,7 @@ class ConstructCest
/**
* Unit Tests Phalcon\Security\JWT\Token\Signature :: __construct()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenSignatureConstruct(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Token/Signature/UnderscoreCallCest.php b/tests/unit/Security/JWT/Token/Signature/UnderscoreCallCest.php
index 1401a6dab72..418c64ce23f 100644
--- a/tests/unit/Security/JWT/Token/Signature/UnderscoreCallCest.php
+++ b/tests/unit/Security/JWT/Token/Signature/UnderscoreCallCest.php
@@ -19,6 +19,7 @@ class UnderscoreCallCest
/**
* Unit Tests Phalcon\Security\JWT\Token\Signature :: __call()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenSignatureUnderscoreCall(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Token/Token/ConstructCest.php b/tests/unit/Security/JWT/Token/Token/ConstructCest.php
index 884e37ba6ae..338a8e6be89 100644
--- a/tests/unit/Security/JWT/Token/Token/ConstructCest.php
+++ b/tests/unit/Security/JWT/Token/Token/ConstructCest.php
@@ -21,6 +21,7 @@ class ConstructCest
/**
* Unit Tests Phalcon\Security\JWT\Token\Token :: __construct()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenTokenConstruct(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Token/Token/GetClaimsCest.php b/tests/unit/Security/JWT/Token/Token/GetClaimsCest.php
index 7ce0a353e5d..5d126faccda 100644
--- a/tests/unit/Security/JWT/Token/Token/GetClaimsCest.php
+++ b/tests/unit/Security/JWT/Token/Token/GetClaimsCest.php
@@ -21,6 +21,7 @@ class GetClaimsCest
/**
* Unit Tests Phalcon\Security\JWT\Token\Token :: getClaims()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenTokenGetClaims(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Token/Token/GetHeadersCest.php b/tests/unit/Security/JWT/Token/Token/GetHeadersCest.php
index f6535ee6ad6..f2691584bfe 100644
--- a/tests/unit/Security/JWT/Token/Token/GetHeadersCest.php
+++ b/tests/unit/Security/JWT/Token/Token/GetHeadersCest.php
@@ -21,6 +21,7 @@ class GetHeadersCest
/**
* Unit Tests Phalcon\Security\JWT\Token\Token :: getHeaders()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenTokenGetHeaders(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Token/Token/GetPayloadCest.php b/tests/unit/Security/JWT/Token/Token/GetPayloadCest.php
index fee132fbd18..9174dc8c5ea 100644
--- a/tests/unit/Security/JWT/Token/Token/GetPayloadCest.php
+++ b/tests/unit/Security/JWT/Token/Token/GetPayloadCest.php
@@ -21,6 +21,7 @@ class GetPayloadCest
/**
* Unit Tests Phalcon\Security\JWT\Token\Token :: getPayload()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenTokenGetPayload(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Token/Token/GetSignatureCest.php b/tests/unit/Security/JWT/Token/Token/GetSignatureCest.php
index f89753db77f..1dfad177159 100644
--- a/tests/unit/Security/JWT/Token/Token/GetSignatureCest.php
+++ b/tests/unit/Security/JWT/Token/Token/GetSignatureCest.php
@@ -21,6 +21,7 @@ class GetSignatureCest
/**
* Unit Tests Phalcon\Security\JWT\Token\Token :: getSignature()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenTokenGetSignature(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Token/Token/GetTokenCest.php b/tests/unit/Security/JWT/Token/Token/GetTokenCest.php
index 40c94d479d9..6fa28aa0249 100644
--- a/tests/unit/Security/JWT/Token/Token/GetTokenCest.php
+++ b/tests/unit/Security/JWT/Token/Token/GetTokenCest.php
@@ -21,6 +21,7 @@ class GetTokenCest
/**
* Unit Tests Phalcon\Security\JWT\Token\Token :: getToken()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTTokenTokenGetToken(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Validator/ConstructCest.php b/tests/unit/Security/JWT/Validator/ConstructCest.php
index db8edd64e9f..6b196fce9d5 100644
--- a/tests/unit/Security/JWT/Validator/ConstructCest.php
+++ b/tests/unit/Security/JWT/Validator/ConstructCest.php
@@ -22,6 +22,7 @@ class ConstructCest
/**
* Unit Tests Phalcon\Security\JWT\Validator :: __construct()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTValidatorConstruct(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Validator/SetTokenCest.php b/tests/unit/Security/JWT/Validator/SetTokenCest.php
index 5e116e1c50c..146cf5a9d2c 100644
--- a/tests/unit/Security/JWT/Validator/SetTokenCest.php
+++ b/tests/unit/Security/JWT/Validator/SetTokenCest.php
@@ -24,15 +24,16 @@ class SetTokenCest
/**
* Unit Tests Phalcon\Security\JWT\Validator :: setToken()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTValidatorSetToken(UnitTester $I)
{
$I->wantToTest('Security\JWT\Validator - setToken()');
- $token1 = $this->newToken();
- $token2 = $this->newToken(Hmac::class, 5);
- $now = strtotime("+1 second");
+ $token1 = $this->newToken();
+ $token2 = $this->newToken(Hmac::class, 5);
+ $now = strtotime("+1 second");
$validator = new Validator($token1);
$I->assertInstanceOf(Validator::class, $validator);
$I->assertInstanceOf(
diff --git a/tests/unit/Security/JWT/Validator/ValidateAudienceCest.php b/tests/unit/Security/JWT/Validator/ValidateAudienceCest.php
index b2cccae7714..2be67f13cb0 100644
--- a/tests/unit/Security/JWT/Validator/ValidateAudienceCest.php
+++ b/tests/unit/Security/JWT/Validator/ValidateAudienceCest.php
@@ -23,6 +23,7 @@ class ValidateAudienceCest
/**
* Unit Tests Phalcon\Security\JWT\Validator :: validateAudience()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTValidatorValidateAudience(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Validator/ValidateExpirationCest.php b/tests/unit/Security/JWT/Validator/ValidateExpirationCest.php
index 28e852b6a84..ece2efd51ae 100644
--- a/tests/unit/Security/JWT/Validator/ValidateExpirationCest.php
+++ b/tests/unit/Security/JWT/Validator/ValidateExpirationCest.php
@@ -23,6 +23,7 @@ class ValidateExpirationCest
/**
* Unit Tests Phalcon\Security\JWT\Validator :: validateExpiration()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTValidatorValidateExpiration(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Validator/ValidateIdCest.php b/tests/unit/Security/JWT/Validator/ValidateIdCest.php
index ab54f4e8d6d..6608ab61c5a 100644
--- a/tests/unit/Security/JWT/Validator/ValidateIdCest.php
+++ b/tests/unit/Security/JWT/Validator/ValidateIdCest.php
@@ -23,6 +23,7 @@ class ValidateIdCest
/**
* Unit Tests Phalcon\Security\JWT\Validator :: validateId()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTValidatorValidateId(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Validator/ValidateIssuedAtCest.php b/tests/unit/Security/JWT/Validator/ValidateIssuedAtCest.php
index a2a4b0d0b34..634f88f91d2 100644
--- a/tests/unit/Security/JWT/Validator/ValidateIssuedAtCest.php
+++ b/tests/unit/Security/JWT/Validator/ValidateIssuedAtCest.php
@@ -23,6 +23,7 @@ class ValidateIssuedAtCest
/**
* Unit Tests Phalcon\Security\JWT\Validator :: validateIssuedAt()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTValidatorValidateIssuedAt(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Validator/ValidateIssuerCest.php b/tests/unit/Security/JWT/Validator/ValidateIssuerCest.php
index 94c6bf7ed0e..e80d56ab4e2 100644
--- a/tests/unit/Security/JWT/Validator/ValidateIssuerCest.php
+++ b/tests/unit/Security/JWT/Validator/ValidateIssuerCest.php
@@ -23,6 +23,7 @@ class ValidateIssuerCest
/**
* Unit Tests Phalcon\Security\JWT\Validator :: validateIssuer()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTValidatorValidateIssuer(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Validator/ValidateNotBeforeCest.php b/tests/unit/Security/JWT/Validator/ValidateNotBeforeCest.php
index 05fc5e6e5f8..c9c4167470a 100644
--- a/tests/unit/Security/JWT/Validator/ValidateNotBeforeCest.php
+++ b/tests/unit/Security/JWT/Validator/ValidateNotBeforeCest.php
@@ -23,6 +23,7 @@ class ValidateNotBeforeCest
/**
* Unit Tests Phalcon\Security\JWT\Validator :: validateNotBefore()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTValidatorValidateNotBefore(UnitTester $I)
diff --git a/tests/unit/Security/JWT/Validator/ValidateSignatureCest.php b/tests/unit/Security/JWT/Validator/ValidateSignatureCest.php
index b181145232c..1d68eea37ff 100644
--- a/tests/unit/Security/JWT/Validator/ValidateSignatureCest.php
+++ b/tests/unit/Security/JWT/Validator/ValidateSignatureCest.php
@@ -25,6 +25,7 @@ class ValidateSignatureCest
/**
* Unit Tests Phalcon\Security\JWT\Validator :: validateSignature()
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTValidatorValidateNotBefore(UnitTester $I)
@@ -47,8 +48,7 @@ public function securityJWTValidatorValidateNotBefore(UnitTester $I)
->setNotBefore($notBefore)
->setSubject('Mary had a little lamb')
->setPassphrase($passphrase)
- ->getToken()
- ;
+ ->getToken();
$validator = new Validator($token);
$I->assertInstanceOf(Validator::class, $validator);
@@ -62,6 +62,7 @@ public function securityJWTValidatorValidateNotBefore(UnitTester $I)
/**
* Unit Tests Phalcon\Security\JWT\Validator :: validateSignature() - exception
*
+ * @author Phalcon Team
* @since 2019-12-22
*/
public function securityJWTValidatorValidateNotBeforeException(UnitTester $I)