本文整理汇总了C++中zephir_get_intval函数的典型用法代码示例。如果您正苦于以下问题:C++ zephir_get_intval函数的具体用法?C++ zephir_get_intval怎么用?C++ zephir_get_intval使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zephir_get_intval函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Generates the SQL for LIMIT clause
*/
PHP_METHOD(Phalcon_Db_Dialect_Oracle, limit) {
int limit = 0, offset;
zval *sqlQuery_param = NULL, *number, *_0$$4, *_1$$4, _2$$4, *_3$$3, *_4$$3, _5$$3, *_6$$5, _7$$5, _9$$6, _11$$7;
zval *sqlQuery = NULL, *_8, *_10$$6, *_12$$7;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 2, 0, &sqlQuery_param, &number);
if (unlikely(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 a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(sqlQuery_param) == IS_STRING)) {
zephir_get_strval(sqlQuery, sqlQuery_param);
} else {
ZEPHIR_INIT_VAR(sqlQuery);
ZVAL_EMPTY_STRING(sqlQuery);
}
offset = 0;
if (Z_TYPE_P(number) == IS_ARRAY) {
if (zephir_array_isset_long(number, 1)) {
ZEPHIR_INIT_VAR(_0$$4);
zephir_array_fetch_long(&_1$$4, number, 1, PH_NOISY | PH_READONLY, "phalcon/db/dialect/oracle.zep", 51 TSRMLS_CC);
ZEPHIR_SINIT_VAR(_2$$4);
ZVAL_STRING(&_2$$4, "'", 0);
zephir_fast_trim(_0$$4, _1$$4, &_2$$4, ZEPHIR_TRIM_BOTH TSRMLS_CC);
offset = zephir_get_intval(_0$$4);
}
ZEPHIR_INIT_VAR(_3$$3);
zephir_array_fetch_long(&_4$$3, number, 0, PH_NOISY | PH_READONLY, "phalcon/db/dialect/oracle.zep", 54 TSRMLS_CC);
ZEPHIR_SINIT_VAR(_5$$3);
ZVAL_STRING(&_5$$3, "'", 0);
zephir_fast_trim(_3$$3, _4$$3, &_5$$3, ZEPHIR_TRIM_BOTH TSRMLS_CC);
limit = (zephir_get_intval(_3$$3) + offset);
} else {
ZEPHIR_INIT_VAR(_6$$5);
ZEPHIR_SINIT_VAR(_7$$5);
ZVAL_STRING(&_7$$5, "'", 0);
zephir_fast_trim(_6$$5, number, &_7$$5, ZEPHIR_TRIM_BOTH TSRMLS_CC);
limit = zephir_get_intval(_6$$5);
}
ZEPHIR_INIT_VAR(_8);
ZEPHIR_CONCAT_SVS(_8, "SELECT * FROM (SELECT Z1.*, ROWNUM PHALCON_RN FROM (", sqlQuery, ") Z1");
ZEPHIR_CPY_WRT(sqlQuery, _8);
if (limit != 0) {
ZEPHIR_SINIT_VAR(_9$$6);
ZVAL_LONG(&_9$$6, limit);
ZEPHIR_INIT_VAR(_10$$6);
ZEPHIR_CONCAT_SV(_10$$6, " WHERE ROWNUM <= ", &_9$$6);
zephir_concat_self(&sqlQuery, _10$$6 TSRMLS_CC);
}
zephir_concat_self_str(&sqlQuery, ")", sizeof(")")-1 TSRMLS_CC);
if (offset != 0) {
ZEPHIR_SINIT_VAR(_11$$7);
ZVAL_LONG(&_11$$7, offset);
ZEPHIR_INIT_VAR(_12$$7);
ZEPHIR_CONCAT_SV(_12$$7, " WHERE PHALCON_RN >= ", &_11$$7);
zephir_concat_self(&sqlQuery, _12$$7 TSRMLS_CC);
}
RETURN_CTOR(sqlQuery);
}
示例2: PHP_METHOD
/**
* Removes padding @a padding_type from @a text
* If the function detects that the text was not padded, it will return it unmodified
*
* @param string text Message to be unpadded
* @param string mode Encryption mode; unpadding is applied only in CBC or ECB mode
* @param int blockSize Cipher block size
* @param int paddingType Padding scheme
*/
PHP_METHOD(Phalcon_Crypt, _cryptUnpadText) {
unsigned char _23$$11, _25$$11, _27$$15, _30$$17;
zend_bool _0, _1, _2, _22$$11, _24$$11, _26$$15, _28$$15, _29$$17, _31$$17, _32$$3;
long length = 0;
zephir_fcall_cache_entry *_6 = NULL, *_9 = NULL, *_11 = NULL;
int blockSize, paddingType, ZEPHIR_LAST_CALL_STATUS, i = 0, paddingSize, ord = 0;
zval *text_param = NULL, *mode_param = NULL, *blockSize_param = NULL, *paddingType_param = NULL, *padding = NULL, *last = NULL, _3$$4, _4$$4, *_5$$4 = NULL, _7$$5 = zval_used_for_init, *_8$$5 = NULL, *_10$$5 = NULL, *_12$$5, _13$$7, _14$$7, *_15$$7 = NULL, _16$$8 = zval_used_for_init, *_17$$8 = NULL, *_18$$8, _19$$10, _20$$10, *_21$$10 = NULL, _33$$21, _34$$21;
zval *text = NULL, *mode = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 4, 0, &text_param, &mode_param, &blockSize_param, &paddingType_param);
zephir_get_strval(text, text_param);
if (unlikely(Z_TYPE_P(mode_param) != IS_STRING && Z_TYPE_P(mode_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'mode' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(mode_param) == IS_STRING)) {
zephir_get_strval(mode, mode_param);
} else {
ZEPHIR_INIT_VAR(mode);
ZVAL_EMPTY_STRING(mode);
}
if (unlikely(Z_TYPE_P(blockSize_param) != IS_LONG)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'blockSize' must be a int") TSRMLS_CC);
RETURN_MM_NULL();
}
blockSize = Z_LVAL_P(blockSize_param);
if (unlikely(Z_TYPE_P(paddingType_param) != IS_LONG)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'paddingType' must be a int") TSRMLS_CC);
RETURN_MM_NULL();
}
paddingType = Z_LVAL_P(paddingType_param);
paddingSize = 0;
length = zephir_fast_strlen_ev(text);
_0 = length > 0;
if (_0) {
_0 = (zephir_safe_mod_long_long(length, blockSize TSRMLS_CC) == 0);
}
_1 = _0;
if (_1) {
_2 = ZEPHIR_IS_STRING(mode, "cbc");
if (!(_2)) {
_2 = ZEPHIR_IS_STRING(mode, "ecb");
}
_1 = _2;
}
if (_1) {
do {
if (paddingType == 1) {
ZEPHIR_SINIT_VAR(_3$$4);
ZVAL_LONG(&_3$$4, (length - 1));
ZEPHIR_SINIT_VAR(_4$$4);
ZVAL_LONG(&_4$$4, 1);
ZEPHIR_INIT_VAR(last);
zephir_substr(last, text, zephir_get_intval(&_3$$4), 1 , 0);
ZEPHIR_CALL_FUNCTION(&_5$$4, "ord", &_6, 134, last);
zephir_check_call_status();
ord = zephir_get_intval(_5$$4);
if (ord <= blockSize) {
paddingSize = ord;
ZEPHIR_SINIT_VAR(_7$$5);
ZVAL_LONG(&_7$$5, 0);
ZEPHIR_CALL_FUNCTION(&_8$$5, "chr", &_9, 132, &_7$$5);
zephir_check_call_status();
ZEPHIR_SINIT_NVAR(_7$$5);
ZVAL_LONG(&_7$$5, (paddingSize - 1));
ZEPHIR_CALL_FUNCTION(&_10$$5, "str_repeat", &_11, 133, _8$$5, &_7$$5);
zephir_check_call_status();
ZEPHIR_INIT_VAR(padding);
ZEPHIR_CONCAT_VV(padding, _10$$5, last);
ZEPHIR_SINIT_NVAR(_7$$5);
ZVAL_LONG(&_7$$5, (length - paddingSize));
ZEPHIR_INIT_VAR(_12$$5);
zephir_substr(_12$$5, text, zephir_get_intval(&_7$$5), 0, ZEPHIR_SUBSTR_NO_LENGTH);
if (!ZEPHIR_IS_EQUAL(_12$$5, padding)) {
paddingSize = 0;
}
}
break;
}
if (paddingType == 2) {
ZEPHIR_SINIT_VAR(_13$$7);
ZVAL_LONG(&_13$$7, (length - 1));
ZEPHIR_SINIT_VAR(_14$$7);
ZVAL_LONG(&_14$$7, 1);
ZEPHIR_INIT_NVAR(last);
zephir_substr(last, text, zephir_get_intval(&_13$$7), 1 , 0);
//.........这里部分代码省略.........
示例3: PHP_METHOD
/**
* Set an specific argument
*/
PHP_METHOD(Phalcon_Cli_Console, setArgument) {
HashTable *_3;
HashPosition _2;
int ZEPHIR_LAST_CALL_STATUS;
zephir_fcall_cache_entry *_1 = NULL, *_8 = NULL, *_27 = NULL;
zend_bool str, shift, _0;
zval *arguments_param = NULL, *str_param = NULL, *shift_param = NULL, *arg = NULL, *pos = NULL, *args = NULL, *opts = NULL, *handleArgs = NULL, **_4, _5$$5 = zval_used_for_init, _6$$5 = zval_used_for_init, *_7$$5 = NULL, _9$$6 = zval_used_for_init, *_10$$7 = NULL, _11$$7 = zval_used_for_init, *_12$$7 = NULL, *_13$$7 = NULL, _14$$7 = zval_used_for_init, _15$$7 = zval_used_for_init, *_16$$7 = NULL, *_17$$8 = NULL, _18$$8 = zval_used_for_init, *_19$$8 = NULL, _20$$9 = zval_used_for_init, _21$$9 = zval_used_for_init, *_22$$9 = NULL, _23$$10 = zval_used_for_init, *_24$$10 = NULL, *_25$$13, *_26$$13 = NULL, *_28$$15 = NULL, *_29$$16 = NULL, *_30$$17;
zval *arguments = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 0, 3, &arguments_param, &str_param, &shift_param);
if (!arguments_param) {
ZEPHIR_INIT_VAR(arguments);
array_init(arguments);
} else {
arguments = arguments_param;
}
if (!str_param) {
str = 1;
} else {
if (unlikely(Z_TYPE_P(str_param) != IS_BOOL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'str' must be a bool") TSRMLS_CC);
RETURN_MM_NULL();
}
str = Z_BVAL_P(str_param);
}
if (!shift_param) {
shift = 1;
} else {
if (unlikely(Z_TYPE_P(shift_param) != IS_BOOL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'shift' must be a bool") TSRMLS_CC);
RETURN_MM_NULL();
}
shift = Z_BVAL_P(shift_param);
}
ZEPHIR_INIT_VAR(args);
array_init(args);
ZEPHIR_INIT_VAR(opts);
array_init(opts);
ZEPHIR_INIT_VAR(handleArgs);
array_init(handleArgs);
_0 = shift;
if (_0) {
_0 = ((zephir_fast_count_int(arguments TSRMLS_CC)) ? 1 : 0);
}
if (_0) {
ZEPHIR_MAKE_REF(arguments);
ZEPHIR_CALL_FUNCTION(NULL, "array_shift", &_1, 132, arguments);
ZEPHIR_UNREF(arguments);
zephir_check_call_status();
}
zephir_is_iterable(arguments, &_3, &_2, 0, 0, "phalcon/cli/console.zep", 199);
for (
; zephir_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS
; zephir_hash_move_forward_ex(_3, &_2)
) {
ZEPHIR_GET_HVALUE(arg, _4);
if (Z_TYPE_P(arg) == IS_STRING) {
ZEPHIR_SINIT_NVAR(_5$$5);
ZVAL_STRING(&_5$$5, "--", 0);
ZEPHIR_SINIT_NVAR(_6$$5);
ZVAL_LONG(&_6$$5, 2);
ZEPHIR_CALL_FUNCTION(&_7$$5, "strncmp", &_8, 133, arg, &_5$$5, &_6$$5);
zephir_check_call_status();
if (ZEPHIR_IS_LONG(_7$$5, 0)) {
ZEPHIR_SINIT_NVAR(_9$$6);
ZVAL_STRING(&_9$$6, "=", 0);
ZEPHIR_INIT_NVAR(pos);
zephir_fast_strpos(pos, arg, &_9$$6, 0 );
if (zephir_is_true(pos)) {
ZEPHIR_INIT_NVAR(_10$$7);
ZEPHIR_SINIT_NVAR(_11$$7);
ZVAL_LONG(&_11$$7, (zephir_get_numberval(pos) + 1));
ZEPHIR_INIT_NVAR(_12$$7);
zephir_substr(_12$$7, arg, zephir_get_intval(&_11$$7), 0, ZEPHIR_SUBSTR_NO_LENGTH);
zephir_fast_trim(_10$$7, _12$$7, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC);
ZEPHIR_INIT_NVAR(_13$$7);
ZEPHIR_SINIT_NVAR(_14$$7);
ZVAL_LONG(&_14$$7, 2);
ZEPHIR_SINIT_NVAR(_15$$7);
ZVAL_LONG(&_15$$7, (zephir_get_numberval(pos) - 2));
ZEPHIR_INIT_NVAR(_16$$7);
zephir_substr(_16$$7, arg, 2 , zephir_get_intval(&_15$$7), 0);
zephir_fast_trim(_13$$7, _16$$7, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC);
zephir_array_update_zval(&opts, _13$$7, &_10$$7, PH_COPY | PH_SEPARATE);
} else {
ZEPHIR_INIT_NVAR(_17$$8);
ZEPHIR_SINIT_NVAR(_18$$8);
ZVAL_LONG(&_18$$8, 2);
ZEPHIR_INIT_NVAR(_19$$8);
zephir_substr(_19$$8, arg, 2 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
zephir_fast_trim(_17$$8, _19$$8, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC);
zephir_array_update_zval(&opts, _17$$8, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE);
//.........这里部分代码省略.........
示例4: PHP_METHOD
//.........这里部分代码省略.........
ZEPHIR_SINIT_VAR(_4);
ZVAL_LONG(&_4, -1);
ZEPHIR_INIT_VAR(_5);
zephir_substr(_5, val, -1 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
_3 = ZEPHIR_IS_STRING(_5, "]");
}
if (_3) {
ZEPHIR_INIT_VAR(vals);
ZEPHIR_SINIT_VAR(_6);
ZVAL_LONG(&_6, 1);
ZEPHIR_SINIT_VAR(_7);
ZVAL_LONG(&_7, -1);
ZEPHIR_INIT_VAR(_8);
zephir_substr(_8, val, 1 , -1 , 0);
ZEPHIR_SINIT_VAR(_9);
ZVAL_LONG(&_9, ',');
zephir_fast_explode(vals, &_9, _8, LONG_MAX TSRMLS_CC);
ZEPHIR_INIT_NVAR(val);
array_init(val);
zephir_is_iterable(vals, &_11, &_10, 0, 0, "lynx/Annotation/RegexDocParser.zep", 89);
for (
; zephir_hash_get_current_data_ex(_11, (void**) &_12, &_10) == SUCCESS
; zephir_hash_move_forward_ex(_11, &_10)
) {
ZEPHIR_GET_HVALUE(v, _12);
ZEPHIR_CALL_SELF(&_13, "parsevalue", &_14, v);
zephir_check_call_status();
zephir_array_append(&val, _13, PH_SEPARATE, "lynx/Annotation/RegexDocParser.zep", 86);
}
RETURN_CCTOR(val);
} else {
ZEPHIR_SINIT_NVAR(_6);
ZVAL_LONG(&_6, 0);
ZEPHIR_SINIT_NVAR(_7);
ZVAL_LONG(&_7, 1);
ZEPHIR_INIT_NVAR(_8);
zephir_substr(_8, val, 0 , 1 , 0);
_15 = ZEPHIR_IS_STRING(_8, "{");
if (_15) {
ZEPHIR_SINIT_NVAR(_9);
ZVAL_LONG(&_9, -1);
ZEPHIR_INIT_VAR(_16);
zephir_substr(_16, val, -1 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
_15 = ZEPHIR_IS_STRING(_16, "}");
}
if (_15) {
zephir_json_decode(return_value, &(return_value), val, 0 TSRMLS_CC);
RETURN_MM();
} else {
ZEPHIR_SINIT_VAR(_17);
ZVAL_LONG(&_17, 0);
ZEPHIR_SINIT_VAR(_18);
ZVAL_LONG(&_18, 1);
ZEPHIR_INIT_VAR(_19);
zephir_substr(_19, val, 0 , 1 , 0);
_20 = ZEPHIR_IS_STRING(_19, "\"");
if (_20) {
ZEPHIR_SINIT_VAR(_21);
ZVAL_LONG(&_21, -1);
ZEPHIR_INIT_VAR(_22);
zephir_substr(_22, val, -1 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
_20 = ZEPHIR_IS_STRING(_22, "\"");
}
if (_20) {
ZEPHIR_SINIT_VAR(_23);
ZVAL_LONG(&_23, 1);
ZEPHIR_SINIT_VAR(_24);
ZVAL_LONG(&_24, -1);
ZEPHIR_INIT_VAR(_25);
zephir_substr(_25, val, 1 , -1 , 0);
ZEPHIR_CPY_WRT(val, _25);
ZEPHIR_RETURN_CALL_SELF("parsevalue", &_14, val);
zephir_check_call_status();
RETURN_MM();
} else {
ZEPHIR_INIT_NVAR(_25);
zephir_fast_strtolower(_25, val);
if (ZEPHIR_IS_STRING(_25, "true")) {
RETURN_MM_BOOL(1);
} else {
ZEPHIR_INIT_VAR(_26);
zephir_fast_strtolower(_26, val);
if (ZEPHIR_IS_STRING(_26, "false")) {
RETURN_MM_BOOL(0);
} else {
if (zephir_is_numeric(val)) {
if (zephir_get_doubleval(val) == zephir_get_intval(val)) {
RETURN_MM_LONG(zephir_get_intval(val));
} else {
RETURN_MM_DOUBLE(zephir_get_doubleval(val));
}
}
}
}
}
}
}
RETURN_CCTOR(val);
}
示例5: PHP_METHOD
/**
* Applies a format to a message before sending it to the log
*
* @param string $message
* @param int $type
* @param int $timestamp
* @param array $context
*
* @return string
*/
PHP_METHOD(Phalcon_Logger_Formatter_Firephp, format) {
zval *_21;
HashTable *_10;
HashPosition _9;
zephir_nts_static zephir_fcall_cache_entry *_5 = NULL, *_6 = NULL, *_7 = NULL;
zend_bool param, _14, _17;
int type, timestamp, ZEPHIR_LAST_CALL_STATUS;
zval *message_param = NULL, *type_param = NULL, *timestamp_param = NULL, *context = NULL, *meta, *body = NULL, *backtrace = NULL, *encoded, *len, *lastTrace = NULL, *_0 = NULL, *_1 = NULL, *_2, *backtraceItem = NULL, *key = NULL, _3, _4, *_8, **_11, *_12, *_13, *_15, *_16, *_18, *_19, *_20;
zval *message = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 3, 1, &message_param, &type_param, ×tamp_param, &context);
zephir_get_strval(message, message_param);
type = zephir_get_intval(type_param);
timestamp = zephir_get_intval(timestamp_param);
if (!context) {
context = ZEPHIR_GLOBAL(global_null);
}
if (Z_TYPE_P(context) == IS_ARRAY) {
ZEPHIR_CALL_METHOD(&_0, this_ptr, "interpolate", NULL, message, context);
zephir_check_call_status();
zephir_get_strval(message, _0);
}
ZEPHIR_INIT_VAR(meta);
zephir_create_array(meta, 1, 0 TSRMLS_CC);
ZEPHIR_INIT_VAR(_1);
ZVAL_LONG(_1, type);
ZEPHIR_CALL_METHOD(&_0, this_ptr, "gettypestring", NULL, _1);
zephir_check_call_status();
zephir_array_update_string(&meta, SL("Type"), &_0, PH_COPY | PH_SEPARATE);
_2 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC);
if (zephir_is_true(_2)) {
param = 0;
ZEPHIR_INIT_NVAR(_1);
ZEPHIR_GET_CONSTANT(_1, "PHP_VERSION");
ZEPHIR_SINIT_VAR(_3);
ZVAL_STRING(&_3, "5.3.6", 0);
ZEPHIR_SINIT_VAR(_4);
ZVAL_STRING(&_4, "<", 0);
ZEPHIR_CALL_FUNCTION(&_0, "version_compare", &_5, _1, &_3, &_4);
zephir_check_call_status();
if (!(zephir_is_true(_0))) {
param = (2) ? 1 : 0;
}
ZEPHIR_CALL_FUNCTION(&backtrace, "debug_backtrace", &_6, (param ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false)));
zephir_check_call_status();
Z_SET_ISREF_P(backtrace);
ZEPHIR_CALL_FUNCTION(&lastTrace, "end", &_7, backtrace);
Z_UNSET_ISREF_P(backtrace);
zephir_check_call_status();
if (zephir_array_isset_string(lastTrace, SS("file"))) {
zephir_array_fetch_string(&_8, lastTrace, SL("file"), PH_NOISY | PH_READONLY, "phalcon/logger/formatter/firephp.zep", 145 TSRMLS_CC);
zephir_array_update_string(&meta, SL("File"), &_8, PH_COPY | PH_SEPARATE);
}
if (zephir_array_isset_string(lastTrace, SS("line"))) {
zephir_array_fetch_string(&_8, lastTrace, SL("line"), PH_NOISY | PH_READONLY, "phalcon/logger/formatter/firephp.zep", 149 TSRMLS_CC);
zephir_array_update_string(&meta, SL("Line"), &_8, PH_COPY | PH_SEPARATE);
}
zephir_is_iterable(backtrace, &_10, &_9, 1, 0, "phalcon/logger/formatter/firephp.zep", 158);
for (
; zephir_hash_get_current_data_ex(_10, (void**) &_11, &_9) == SUCCESS
; zephir_hash_move_forward_ex(_10, &_9)
) {
ZEPHIR_GET_HMKEY(key, _10, _9);
ZEPHIR_GET_HVALUE(backtraceItem, _11);
zephir_array_unset_string(&backtraceItem, SS("object"), PH_SEPARATE);
zephir_array_unset_string(&backtraceItem, SS("args"), PH_SEPARATE);
zephir_array_update_zval(&backtrace, key, &backtraceItem, PH_COPY | PH_SEPARATE);
}
}
_12 = zephir_fetch_nproperty_this(this_ptr, SL("_enableLabels"), PH_NOISY_CC);
if (zephir_is_true(_12)) {
zephir_array_update_string(&meta, SL("Label"), &message, PH_COPY | PH_SEPARATE);
}
_13 = zephir_fetch_nproperty_this(this_ptr, SL("_enableLabels"), PH_NOISY_CC);
_14 = !zephir_is_true(_13);
if (_14) {
_15 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC);
_14 = !zephir_is_true(_15);
}
_16 = zephir_fetch_nproperty_this(this_ptr, SL("_enableLabels"), PH_NOISY_CC);
_17 = zephir_is_true(_16);
if (_17) {
_18 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC);
_17 = !zephir_is_true(_18);
}
//.........这里部分代码省略.........
示例6: PHP_METHOD
PHP_METHOD(Xs_FieldMeta, fromConfig) {
zend_bool _8, _11, _12, _13;
int ZEPHIR_LAST_CALL_STATUS;
zephir_fcall_cache_entry *_3 = NULL, *_5 = NULL;
zval *predef = NULL;
zval *config_param = NULL, *c = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, *_4 = NULL, *_6, *_7, *_9, *_10;
zval *config = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &config_param);
zephir_get_arrval(config, config_param);
ZEPHIR_OBS_VAR(c);
if (zephir_array_isset_string_fetch(&c, config, SS("type"), 0 TSRMLS_CC)) {
ZEPHIR_INIT_VAR(_0);
zephir_fast_strtoupper(_0, c);
ZEPHIR_INIT_VAR(_1);
ZEPHIR_CONCAT_SSV(_1, "Xs\\FieldMeta", "::TYPE_", _0);
zephir_get_strval(predef, _1);
ZEPHIR_CALL_FUNCTION(&_2, "defined", &_3, 11, predef);
zephir_check_call_status();
if (zephir_is_true(_2)) {
ZEPHIR_CALL_FUNCTION(&_4, "constant", &_5, 12, predef);
zephir_check_call_status();
zephir_update_property_this(this_ptr, SL("type"), _4 TSRMLS_CC);
_6 = zephir_fetch_nproperty_this(this_ptr, SL("type"), PH_NOISY_CC);
do {
if (ZEPHIR_IS_LONG(_6, 10)) {
ZEPHIR_INIT_ZVAL_NREF(_7);
ZVAL_LONG(_7, 0x01);
zephir_update_property_this(this_ptr, SL("flag"), _7 TSRMLS_CC);
ZEPHIR_INIT_ZVAL_NREF(_7);
ZVAL_STRING(_7, "full", 1);
zephir_update_property_this(this_ptr, SL("tokenizer"), _7 TSRMLS_CC);
break;
}
if (ZEPHIR_IS_LONG(_6, 11)) {
ZEPHIR_INIT_ZVAL_NREF(_7);
ZVAL_LONG(_7, (0x03 | 0x10));
zephir_update_property_this(this_ptr, SL("flag"), _7 TSRMLS_CC);
ZEPHIR_INIT_ZVAL_NREF(_7);
ZVAL_LONG(_7, 5);
zephir_update_property_this(this_ptr, SL("weight"), _7 TSRMLS_CC);
break;
}
if (ZEPHIR_IS_LONG(_6, 12)) {
ZEPHIR_INIT_ZVAL_NREF(_7);
ZVAL_LONG(_7, 255);
zephir_update_property_this(this_ptr, SL("vno"), _7 TSRMLS_CC);
ZEPHIR_INIT_ZVAL_NREF(_7);
ZVAL_LONG(_7, (0x01 | 0x10));
zephir_update_property_this(this_ptr, SL("flag"), _7 TSRMLS_CC);
ZEPHIR_INIT_ZVAL_NREF(_7);
ZVAL_LONG(_7, 300);
zephir_update_property_this(this_ptr, SL("cutlen"), _7 TSRMLS_CC);
break;
}
} while(0);
}
}
ZEPHIR_OBS_NVAR(c);
_8 = zephir_array_isset_string_fetch(&c, config, SS("index"), 0 TSRMLS_CC);
if (_8) {
_6 = zephir_fetch_nproperty_this(this_ptr, SL("type"), PH_NOISY_CC);
_8 = !ZEPHIR_IS_LONG(_6, 12);
}
if (_8) {
ZEPHIR_INIT_NVAR(_0);
zephir_fast_strtoupper(_0, c);
ZEPHIR_INIT_LNVAR(_1);
ZEPHIR_CONCAT_SSV(_1, "Xs\\FieldMeta", "::FLAG_INDEX_", _0);
zephir_get_strval(predef, _1);
ZEPHIR_CALL_FUNCTION(&_2, "defined", &_3, 11, predef);
zephir_check_call_status();
if (zephir_is_true(_2)) {
_7 = zephir_fetch_nproperty_this(this_ptr, SL("flag"), PH_NOISY_CC);
ZEPHIR_CALL_FUNCTION(&_4, "constant", &_5, 12, predef);
zephir_check_call_status();
ZEPHIR_INIT_ZVAL_NREF(_9);
ZVAL_LONG(_9, ((((int) (zephir_get_numberval(_7)) & ~(0x03))) | zephir_get_intval(_4)));
zephir_update_property_this(this_ptr, SL("flag"), _9 TSRMLS_CC);
}
_6 = zephir_fetch_nproperty_this(this_ptr, SL("type"), PH_NOISY_CC);
if (ZEPHIR_IS_LONG(_6, 10)) {
_9 = zephir_fetch_nproperty_this(this_ptr, SL("flag"), PH_NOISY_CC);
ZEPHIR_INIT_ZVAL_NREF(_10);
ZVAL_LONG(_10, ((int) (zephir_get_numberval(_9)) | 0x01));
zephir_update_property_this(this_ptr, SL("flag"), _10 TSRMLS_CC);
}
}
ZEPHIR_OBS_NVAR(c);
if (zephir_array_isset_string_fetch(&c, config, SS("cutlen"), 0 TSRMLS_CC)) {
ZEPHIR_INIT_ZVAL_NREF(_6);
ZVAL_LONG(_6, zephir_get_intval(c));
zephir_update_property_this(this_ptr, SL("cutlen"), _6 TSRMLS_CC);
}
//.........这里部分代码省略.........
示例7: PHP_METHOD
/**
* Reads a packet from the socket. Prior to reading from the socket will
* check for availability of the connection.
*/
PHP_METHOD(Phalcon_Queue_Beanstalk, read) {
zephir_fcall_cache_entry *_2 = NULL;
zval *length_param = NULL, *connection = NULL, *data = NULL, _0$$5 = zval_used_for_init, *_1$$5 = NULL, *_3$$5 = NULL, *_4$$5, _5$$8, _6$$8;
int length, ZEPHIR_LAST_CALL_STATUS;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 0, 1, &length_param);
if (!length_param) {
length = 0;
} else {
length = zephir_get_intval(length_param);
}
ZEPHIR_OBS_VAR(connection);
zephir_read_property_this(&connection, this_ptr, SL("_connection"), PH_NOISY_CC);
if (Z_TYPE_P(connection) != IS_RESOURCE) {
ZEPHIR_CALL_METHOD(&connection, this_ptr, "connect", NULL, 0);
zephir_check_call_status();
if (Z_TYPE_P(connection) != IS_RESOURCE) {
RETURN_MM_BOOL(0);
}
}
if (length) {
if (zephir_feof(connection TSRMLS_CC)) {
RETURN_MM_BOOL(0);
}
ZEPHIR_SINIT_VAR(_0$$5);
ZVAL_LONG(&_0$$5, (length + 2));
ZEPHIR_CALL_FUNCTION(&_1$$5, "stream_get_line", &_2, 413, connection, &_0$$5);
zephir_check_call_status();
ZEPHIR_SINIT_NVAR(_0$$5);
ZVAL_STRING(&_0$$5, "\r\n", 0);
ZEPHIR_INIT_VAR(data);
zephir_fast_trim(data, _1$$5, &_0$$5, ZEPHIR_TRIM_RIGHT TSRMLS_CC);
ZEPHIR_CALL_FUNCTION(&_3$$5, "stream_get_meta_data", NULL, 414, connection);
zephir_check_call_status();
zephir_array_fetch_string(&_4$$5, _3$$5, SL("timed_out"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 535 TSRMLS_CC);
if (zephir_is_true(_4$$5)) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_queue_beanstalk_exception_ce, "Connection timed out", "phalcon/queue/beanstalk.zep", 536);
return;
}
} else {
ZEPHIR_SINIT_VAR(_5$$8);
ZVAL_LONG(&_5$$8, 16384);
ZEPHIR_SINIT_VAR(_6$$8);
ZVAL_STRING(&_6$$8, "\r\n", 0);
ZEPHIR_CALL_FUNCTION(&data, "stream_get_line", &_2, 413, connection, &_5$$8, &_6$$8);
zephir_check_call_status();
}
if (ZEPHIR_IS_STRING_IDENTICAL(data, "UNKNOWN_COMMAND")) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_queue_beanstalk_exception_ce, "UNKNOWN_COMMAND", "phalcon/queue/beanstalk.zep", 544);
return;
}
if (ZEPHIR_IS_STRING_IDENTICAL(data, "JOB_TOO_BIG")) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_queue_beanstalk_exception_ce, "JOB_TOO_BIG", "phalcon/queue/beanstalk.zep", 548);
return;
}
if (ZEPHIR_IS_STRING_IDENTICAL(data, "BAD_FORMAT")) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_queue_beanstalk_exception_ce, "BAD_FORMAT", "phalcon/queue/beanstalk.zep", 552);
return;
}
if (ZEPHIR_IS_STRING_IDENTICAL(data, "OUT_OF_MEMORY")) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_queue_beanstalk_exception_ce, "OUT_OF_MEMORY", "phalcon/queue/beanstalk.zep", 556);
return;
}
RETURN_CCTOR(data);
}
示例8: PHP_METHOD
/**
* Starts a transaction in the connection
*/
PHP_METHOD(Phalcon_Db_Adapter_Pdo, begin) {
int ZEPHIR_LAST_CALL_STATUS, transactionLevel = 0;
zval *nesting_param = NULL, *pdo = NULL, *eventsManager = NULL, *savepointName = NULL, *_0, *_1$$4, *_2$$5, *_5$$6 = NULL, *_6$$7, *_7$$8;
zend_bool nesting, _3$$6, _4$$6;
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(pdo);
zephir_read_property_this(&pdo, this_ptr, SL("_pdo"), PH_NOISY_CC);
if (Z_TYPE_P(pdo) != IS_OBJECT) {
RETURN_MM_BOOL(0);
}
RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("_transactionLevel") TSRMLS_CC));
ZEPHIR_OBS_VAR(_0);
zephir_read_property_this(&_0, this_ptr, SL("_transactionLevel"), PH_NOISY_CC);
transactionLevel = zephir_get_intval(_0);
if (transactionLevel == 1) {
_1$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC);
ZEPHIR_CPY_WRT(eventsManager, _1$$4);
if (Z_TYPE_P(eventsManager) == IS_OBJECT) {
ZEPHIR_INIT_VAR(_2$$5);
ZVAL_STRING(_2$$5, "db:beginTransaction", ZEPHIR_TEMP_PARAM_COPY);
ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _2$$5, this_ptr);
zephir_check_temp_parameter(_2$$5);
zephir_check_call_status();
}
ZEPHIR_RETURN_CALL_METHOD(pdo, "begintransaction", NULL, 0);
zephir_check_call_status();
RETURN_MM();
} else {
_3$$6 = (transactionLevel) ? 1 : 0;
if (_3$$6) {
_3$$6 = nesting;
}
_4$$6 = _3$$6;
if (_4$$6) {
ZEPHIR_CALL_METHOD(&_5$$6, this_ptr, "isnestedtransactionswithsavepoints", NULL, 0);
zephir_check_call_status();
_4$$6 = zephir_is_true(_5$$6);
}
if (_4$$6) {
_6$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC);
ZEPHIR_CPY_WRT(eventsManager, _6$$7);
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:createSavepoint", ZEPHIR_TEMP_PARAM_COPY);
ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _7$$8, this_ptr, savepointName);
zephir_check_temp_parameter(_7$$8);
zephir_check_call_status();
}
ZEPHIR_RETURN_CALL_METHOD(this_ptr, "createsavepoint", NULL, 0, savepointName);
zephir_check_call_status();
RETURN_MM();
}
}
RETURN_MM_BOOL(0);
}
示例9: PHP_METHOD
PHP_METHOD(Xpl_ClassLoader, findFileWithExtension) {
HashTable *_16, *_39, *_6$$3, *_11$$5, *_32$$12, *_35$$14;
HashPosition _15, _38, _5$$3, _10$$5, _31$$12, _34$$14;
int ZEPHIR_LAST_CALL_STATUS;
zephir_fcall_cache_entry *_3 = NULL;
zval *className_param = NULL, *ext_param = NULL, *logicalPathPsr4 = NULL, *firstChar = NULL, *prefixLengthsPsr4 = NULL, *prefix = NULL, *length = NULL, *dir = NULL, *file = NULL, *prefixesPsr0 = NULL, *logicalPathPsr0 = NULL, *nsPos = NULL, *dirs = NULL, _0 = zval_used_for_init, _1 = zval_used_for_init, *_2 = NULL, *_4, *_14, **_17, _18, *_30, *_37, **_40, *_41, **_7$$3, *_8$$5, *_9$$5, **_12$$5, *_13$$6 = NULL, _19$$10, _20$$10, *_21$$10, _22$$10, *_23$$10, _24$$10, _25$$10, *_26$$10 = NULL, _27$$11, _28$$11, *_29$$11 = NULL, **_33$$12, **_36$$14;
zval *className = NULL, *ext = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 2, 0, &className_param, &ext_param);
if (unlikely(Z_TYPE_P(className_param) != IS_STRING && Z_TYPE_P(className_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'className' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(className_param) == IS_STRING)) {
zephir_get_strval(className, className_param);
} else {
ZEPHIR_INIT_VAR(className);
ZVAL_EMPTY_STRING(className);
}
zephir_get_strval(ext, ext_param);
ZEPHIR_SINIT_VAR(_0);
ZVAL_STRING(&_0, "\\", 0);
ZEPHIR_SINIT_VAR(_1);
ZVAL_STRING(&_1, "/", 0);
ZEPHIR_CALL_FUNCTION(&_2, "strtr", &_3, 56, className, &_0, &_1);
zephir_check_call_status();
ZEPHIR_INIT_VAR(logicalPathPsr4);
ZEPHIR_CONCAT_VV(logicalPathPsr4, _2, ext);
ZEPHIR_SINIT_NVAR(_0);
ZVAL_LONG(&_0, 0);
ZEPHIR_SINIT_NVAR(_1);
ZVAL_LONG(&_1, 1);
ZEPHIR_INIT_VAR(firstChar);
zephir_substr(firstChar, className, 0 , 1 , 0);
ZEPHIR_OBS_VAR(prefixLengthsPsr4);
_4 = zephir_fetch_nproperty_this(this_ptr, SL("prefixLengthsPsr4"), PH_NOISY_CC);
if (zephir_array_isset_fetch(&prefixLengthsPsr4, _4, firstChar, 0 TSRMLS_CC)) {
zephir_is_iterable(prefixLengthsPsr4, &_6$$3, &_5$$3, 0, 0, "xpl/classloader.zep", 505);
for (
; zephir_hash_get_current_data_ex(_6$$3, (void**) &_7$$3, &_5$$3) == SUCCESS
; zephir_hash_move_forward_ex(_6$$3, &_5$$3)
) {
ZEPHIR_GET_HMKEY(prefix, _6$$3, _5$$3);
ZEPHIR_GET_HVALUE(length, _7$$3);
if (zephir_start_with(className, prefix, ZEPHIR_GLOBAL(global_false))) {
_8$$5 = zephir_fetch_nproperty_this(this_ptr, SL("prefixDirsPsr4"), PH_NOISY_CC);
zephir_array_fetch(&_9$$5, _8$$5, prefix, PH_NOISY | PH_READONLY, "xpl/classloader.zep", 495 TSRMLS_CC);
zephir_is_iterable(_9$$5, &_11$$5, &_10$$5, 0, 0, "xpl/classloader.zep", 503);
for (
; zephir_hash_get_current_data_ex(_11$$5, (void**) &_12$$5, &_10$$5) == SUCCESS
; zephir_hash_move_forward_ex(_11$$5, &_10$$5)
) {
ZEPHIR_GET_HVALUE(dir, _12$$5);
ZEPHIR_INIT_NVAR(_13$$6);
zephir_substr(_13$$6, logicalPathPsr4, zephir_get_intval(length), 0, ZEPHIR_SUBSTR_NO_LENGTH);
ZEPHIR_INIT_NVAR(file);
ZEPHIR_CONCAT_VSV(file, dir, "/", _13$$6);
if ((zephir_file_exists(file TSRMLS_CC) == SUCCESS)) {
RETURN_CCTOR(file);
}
}
}
}
}
_14 = zephir_fetch_nproperty_this(this_ptr, SL("fallbackDirsPsr4"), PH_NOISY_CC);
zephir_is_iterable(_14, &_16, &_15, 0, 0, "xpl/classloader.zep", 517);
for (
; zephir_hash_get_current_data_ex(_16, (void**) &_17, &_15) == SUCCESS
; zephir_hash_move_forward_ex(_16, &_15)
) {
ZEPHIR_GET_HVALUE(dir, _17);
ZEPHIR_INIT_NVAR(file);
ZEPHIR_CONCAT_VSV(file, dir, "/", logicalPathPsr4);
if ((zephir_file_exists(file TSRMLS_CC) == SUCCESS)) {
RETURN_CCTOR(file);
}
}
ZEPHIR_SINIT_VAR(_18);
ZVAL_STRING(&_18, "\\", 0);
ZEPHIR_CALL_FUNCTION(&nsPos, "strrpos", NULL, 57, className, &_18);
zephir_check_call_status();
ZEPHIR_INIT_VAR(logicalPathPsr0);
if (zephir_is_true(nsPos)) {
ZEPHIR_SINIT_VAR(_19$$10);
ZVAL_LONG(&_19$$10, 0);
ZEPHIR_SINIT_VAR(_20$$10);
ZVAL_LONG(&_20$$10, (zephir_get_numberval(nsPos) + 1));
ZEPHIR_INIT_VAR(_21$$10);
zephir_substr(_21$$10, logicalPathPsr4, 0 , zephir_get_intval(&_20$$10), 0);
ZEPHIR_SINIT_VAR(_22$$10);
ZVAL_LONG(&_22$$10, (zephir_get_numberval(nsPos) + 1));
ZEPHIR_INIT_VAR(_23$$10);
zephir_substr(_23$$10, logicalPathPsr4, zephir_get_intval(&_22$$10), 0, ZEPHIR_SUBSTR_NO_LENGTH);
ZEPHIR_SINIT_VAR(_24$$10);
ZVAL_STRING(&_24$$10, "_", 0);
//.........这里部分代码省略.........
示例10: PHP_METHOD
/**
* Stores cached content into the file backend and stops the frontend
*
* @param int|string keyName
* @param string content
* @param long lifetime
* @param boolean stopBuffer
*/
PHP_METHOD(Phalcon_Cache_Backend_Mongo, save) {
zval *_2;
zephir_nts_static zephir_fcall_cache_entry *_0 = NULL;
int ZEPHIR_LAST_CALL_STATUS;
zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer = NULL, *lastkey = NULL, *prefix, *frontend, *cachedContent = NULL, *tmp, *ttl = NULL, *collection = NULL, *timestamp, *conditions, *document = NULL, *preparedContent = NULL, *isBuffering = NULL, *data, *_1, *_3;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer);
if (!keyName) {
keyName = ZEPHIR_GLOBAL(global_null);
}
if (!content) {
content = ZEPHIR_GLOBAL(global_null);
}
if (!lifetime) {
lifetime = ZEPHIR_GLOBAL(global_null);
}
if (!stopBuffer) {
stopBuffer = ZEPHIR_GLOBAL(global_true);
}
ZEPHIR_INIT_VAR(conditions);
array_init(conditions);
ZEPHIR_INIT_VAR(data);
array_init(data);
if (!(zephir_is_true(keyName))) {
ZEPHIR_OBS_VAR(lastkey);
zephir_read_property_this(&lastkey, this_ptr, SL("_lastKey"), PH_NOISY_CC);
} else {
ZEPHIR_OBS_VAR(prefix);
zephir_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC);
ZEPHIR_INIT_NVAR(lastkey);
ZEPHIR_CONCAT_VV(lastkey, prefix, keyName);
}
if (!(zephir_is_true(lastkey))) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/mongo.zep", 206);
return;
}
ZEPHIR_OBS_VAR(frontend);
zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC);
if (!(zephir_is_true(content))) {
ZEPHIR_CALL_METHOD(&cachedContent, frontend, "getcontent", NULL);
zephir_check_call_status();
} else {
ZEPHIR_CPY_WRT(cachedContent, content);
}
if (!(zephir_is_numeric(cachedContent))) {
ZEPHIR_CALL_METHOD(&preparedContent, frontend, "beforestore", NULL, cachedContent);
zephir_check_call_status();
}
if (!(zephir_is_true(lifetime))) {
ZEPHIR_OBS_VAR(tmp);
zephir_read_property_this(&tmp, this_ptr, SL("_lastLifetime"), PH_NOISY_CC);
if (!(zephir_is_true(tmp))) {
ZEPHIR_CALL_METHOD(&ttl, frontend, "getlifetime", NULL);
zephir_check_call_status();
} else {
ZEPHIR_CPY_WRT(ttl, tmp);
}
} else {
ZEPHIR_CPY_WRT(ttl, lifetime);
}
ZEPHIR_CALL_METHOD(&collection, this_ptr, "_getcollection", &_0);
zephir_check_call_status();
ZEPHIR_INIT_VAR(_1);
zephir_time(_1);
ZEPHIR_INIT_VAR(timestamp);
ZVAL_LONG(timestamp, (zephir_get_numberval(_1) + zephir_get_intval(ttl)));
zephir_array_update_string(&conditions, SL("key"), &lastkey, PH_COPY | PH_SEPARATE);
ZEPHIR_CALL_METHOD(&document, collection, "findone", NULL, conditions);
zephir_check_call_status();
if (Z_TYPE_P(document) == IS_ARRAY) {
zephir_array_update_string(&document, SL("time"), ×tamp, PH_COPY | PH_SEPARATE);
if (!(zephir_is_numeric(cachedContent))) {
zephir_array_update_string(&document, SL("data"), &preparedContent, PH_COPY | PH_SEPARATE);
} else {
zephir_array_update_string(&document, SL("data"), &cachedContent, PH_COPY | PH_SEPARATE);
}
ZEPHIR_INIT_VAR(_2);
zephir_create_array(_2, 1, 0 TSRMLS_CC);
ZEPHIR_OBS_VAR(_3);
zephir_array_fetch_string(&_3, document, SL("_id"), PH_NOISY, "phalcon/cache/backend/mongo.zep", 246 TSRMLS_CC);
zephir_array_update_string(&_2, SL("_id"), &_3, PH_COPY | PH_SEPARATE);
ZEPHIR_CALL_METHOD(NULL, collection, "update", NULL, _2, document);
zephir_check_call_status();
} else {
zephir_array_update_string(&data, SL("key"), &lastkey, PH_COPY | PH_SEPARATE);
zephir_array_update_string(&data, SL("time"), ×tamp, PH_COPY | PH_SEPARATE);
if (!(zephir_is_numeric(cachedContent))) {
//.........这里部分代码省略.........
示例11: PHP_METHOD
/**
* Removes padding @a padding_type from @a text
* If the function detects that the text was not padded, it will return it unmodified
*
* @param return_value Result, possibly unpadded
* @param text Message to be unpadded
* @param mode Encryption mode; unpadding is applied only in CBC or ECB mode
* @param block_size Cipher block size
* @param padding_type Padding scheme
*/
PHP_METHOD(Phalcon_Crypt, _cryptUnpadText) {
unsigned char _14, _16;
zephir_fcall_cache_entry *_6 = NULL, *_9 = NULL, *_11 = NULL;
zend_bool _0, _1, _2, _13, _15;
long length;
int blockSize, paddingType, i, paddingSize = 0, ord, ZEPHIR_LAST_CALL_STATUS;
zval *text_param = NULL, *mode_param = NULL, *blockSize_param = NULL, *paddingType_param = NULL, *padding = NULL, *last = NULL, _3 = zval_used_for_init, _4 = zval_used_for_init, *_5 = NULL, _7 = zval_used_for_init, *_8 = NULL, *_10 = NULL, *_12 = NULL;
zval *text = NULL, *mode = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 4, 0, &text_param, &mode_param, &blockSize_param, &paddingType_param);
zephir_get_strval(text, text_param);
if (unlikely(Z_TYPE_P(mode_param) != IS_STRING && Z_TYPE_P(mode_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'mode' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(mode_param) == IS_STRING)) {
zephir_get_strval(mode, mode_param);
} else {
ZEPHIR_INIT_VAR(mode);
ZVAL_EMPTY_STRING(mode);
}
if (unlikely(Z_TYPE_P(blockSize_param) != IS_LONG)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'blockSize' must be a long/integer") TSRMLS_CC);
RETURN_MM_NULL();
}
blockSize = Z_LVAL_P(blockSize_param);
if (unlikely(Z_TYPE_P(paddingType_param) != IS_LONG)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'paddingType' must be a long/integer") TSRMLS_CC);
RETURN_MM_NULL();
}
paddingType = Z_LVAL_P(paddingType_param);
length = zephir_fast_strlen_ev(text);
_0 = length > 0;
if (_0) {
_0 = (zephir_safe_mod_long_long(length, blockSize TSRMLS_CC) == 0);
}
_1 = _0;
if (_1) {
_2 = ZEPHIR_IS_STRING(mode, "cbc");
if (!(_2)) {
_2 = ZEPHIR_IS_STRING(mode, "ecb");
}
_1 = _2;
}
if (_1) {
do {
if (paddingType == 1) {
ZEPHIR_SINIT_VAR(_3);
ZVAL_LONG(&_3, (length - 1));
ZEPHIR_SINIT_VAR(_4);
ZVAL_LONG(&_4, 1);
ZEPHIR_INIT_VAR(last);
zephir_substr(last, text, zephir_get_intval(&_3), 1 , 0);
ZEPHIR_CALL_FUNCTION(&_5, "ord", &_6, 130, last);
zephir_check_call_status();
ord = zephir_get_intval(_5);
if (ord <= blockSize) {
paddingSize = ord;
ZEPHIR_SINIT_VAR(_7);
ZVAL_LONG(&_7, 0);
ZEPHIR_CALL_FUNCTION(&_8, "chr", &_9, 128, &_7);
zephir_check_call_status();
ZEPHIR_SINIT_NVAR(_7);
ZVAL_LONG(&_7, (paddingSize - 1));
ZEPHIR_CALL_FUNCTION(&_10, "str_repeat", &_11, 129, _8, &_7);
zephir_check_call_status();
ZEPHIR_INIT_VAR(padding);
ZEPHIR_CONCAT_VV(padding, _10, last);
ZEPHIR_SINIT_NVAR(_7);
ZVAL_LONG(&_7, (length - paddingSize));
ZEPHIR_INIT_VAR(_12);
zephir_substr(_12, text, zephir_get_intval(&_7), 0, ZEPHIR_SUBSTR_NO_LENGTH);
if (!ZEPHIR_IS_EQUAL(_12, padding)) {
paddingSize = 0;
}
}
break;
}
if (paddingType == 2) {
ZEPHIR_SINIT_NVAR(_3);
ZVAL_LONG(&_3, (length - 1));
ZEPHIR_SINIT_NVAR(_4);
//.........这里部分代码省略.........
示例12: PHP_METHOD
/**
* We have to cast values manually because parse_ini_file() has a poor implementation.
*
* @param mixed ini The array casted by `parse_ini_file`
*/
PHP_METHOD(Phalcon_Config_Adapter_Ini, _cast) {
zend_bool _5$$5, _6$$5, _8$$5, _9$$5;
HashTable *_1$$3;
HashPosition _0$$3;
zephir_fcall_cache_entry *_4 = NULL;
int ZEPHIR_LAST_CALL_STATUS;
zval *ini, *key = NULL, *val = NULL, **_2$$3, *_3$$4 = NULL, *_7$$5, *_10$$5, *_11$$9, *_12$$9, _13$$9;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &ini);
ZEPHIR_SEPARATE_PARAM(ini);
if (Z_TYPE_P(ini) == IS_ARRAY) {
zephir_is_iterable(ini, &_1$$3, &_0$$3, 1, 0, "phalcon/config/adapter/ini.zep", 152);
for (
; zephir_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS
; zephir_hash_move_forward_ex(_1$$3, &_0$$3)
) {
ZEPHIR_GET_HMKEY(key, _1$$3, _0$$3);
ZEPHIR_GET_HVALUE(val, _2$$3);
ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "_cast", &_4, 138, val);
zephir_check_call_status();
zephir_array_update_zval(&ini, key, &_3$$4, PH_COPY | PH_SEPARATE);
}
zend_hash_destroy(_1$$3);
FREE_HASHTABLE(_1$$3);
}
if (Z_TYPE_P(ini) == IS_STRING) {
_5$$5 = ZEPHIR_IS_STRING_IDENTICAL(ini, "true");
if (!(_5$$5)) {
_5$$5 = ZEPHIR_IS_STRING_IDENTICAL(ini, "yes");
}
_6$$5 = _5$$5;
if (!(_6$$5)) {
ZEPHIR_INIT_VAR(_7$$5);
zephir_fast_strtolower(_7$$5, ini);
_6$$5 = ZEPHIR_IS_STRING_IDENTICAL(_7$$5, "on");
}
if (_6$$5) {
RETURN_MM_BOOL(1);
}
_8$$5 = ZEPHIR_IS_STRING_IDENTICAL(ini, "false");
if (!(_8$$5)) {
_8$$5 = ZEPHIR_IS_STRING_IDENTICAL(ini, "no");
}
_9$$5 = _8$$5;
if (!(_9$$5)) {
ZEPHIR_INIT_VAR(_10$$5);
zephir_fast_strtolower(_10$$5, ini);
_9$$5 = ZEPHIR_IS_STRING_IDENTICAL(_10$$5, "off");
}
if (_9$$5) {
RETURN_MM_BOOL(0);
}
if (ZEPHIR_IS_STRING_IDENTICAL(ini, "null")) {
RETURN_MM_NULL();
}
if (zephir_is_numeric(ini)) {
ZEPHIR_INIT_VAR(_11$$9);
ZEPHIR_INIT_VAR(_12$$9);
ZEPHIR_SINIT_VAR(_13$$9);
ZVAL_STRING(&_13$$9, "/[.]+/", 0);
zephir_preg_match(_12$$9, &_13$$9, ini, _11$$9, 0, 0 , 0 TSRMLS_CC);
if (zephir_is_true(_12$$9)) {
RETURN_MM_DOUBLE(zephir_get_doubleval(ini));
} else {
RETURN_MM_LONG(zephir_get_intval(ini));
}
}
}
RETVAL_ZVAL(ini, 1, 0);
RETURN_MM();
}
示例13: PHP_METHOD
/**
* Decrypts an encrypted text
*
*<code>
* echo $crypt->decrypt($encrypted, "decrypt password");
*</code>
*/
PHP_METHOD(Phalcon_Crypt, decrypt) {
zend_bool _12;
zephir_fcall_cache_entry *_4 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *text_param = NULL, *key = NULL, *decryptKey = NULL, *ivSize = NULL, *cipher = NULL, *mode = NULL, *blockSize = NULL, *paddingType = NULL, *decrypted = NULL, _0 = zval_used_for_init, *_1 = NULL, *_2, *_3 = NULL, *_8, _9, *_10, _11, *_5$$9, *_6$$9, *_7$$9 = NULL;
zval *text = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 1, &text_param, &key);
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 a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (EXPECTED(Z_TYPE_P(text_param) == IS_STRING)) {
zephir_get_strval(text, text_param);
} else {
ZEPHIR_INIT_VAR(text);
ZVAL_EMPTY_STRING(text);
}
if (!key) {
key = ZEPHIR_GLOBAL(global_null);
}
if (!((zephir_function_exists_ex(SS("openssl_cipher_iv_length") TSRMLS_CC) == SUCCESS))) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_crypt_exception_ce, "openssl extension is required", "phalcon/crypt.zep", 331);
return;
}
if (Z_TYPE_P(key) == IS_NULL) {
ZEPHIR_OBS_VAR(decryptKey);
zephir_read_property_this(&decryptKey, this_ptr, SL("_key"), PH_NOISY_CC);
} else {
ZEPHIR_CPY_WRT(decryptKey, key);
}
if (ZEPHIR_IS_EMPTY(decryptKey)) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_crypt_exception_ce, "Decryption key cannot be empty", "phalcon/crypt.zep", 341);
return;
}
ZEPHIR_OBS_VAR(cipher);
zephir_read_property_this(&cipher, this_ptr, SL("_cipher"), PH_NOISY_CC);
ZEPHIR_SINIT_VAR(_0);
ZVAL_STRING(&_0, "-", 0);
ZEPHIR_CALL_FUNCTION(&_1, "strrpos", NULL, 152, cipher, &_0);
zephir_check_call_status();
ZEPHIR_SINIT_NVAR(_0);
ZVAL_LONG(&_0, (zephir_get_numberval(_1) - zephir_fast_strlen_ev(cipher)));
ZEPHIR_INIT_VAR(_2);
zephir_substr(_2, cipher, zephir_get_intval(&_0), 0, ZEPHIR_SUBSTR_NO_LENGTH);
ZEPHIR_INIT_VAR(mode);
zephir_fast_strtolower(mode, _2);
ZEPHIR_CALL_FUNCTION(&_3, "openssl_get_cipher_methods", NULL, 153, ZEPHIR_GLOBAL(global_true));
zephir_check_call_status();
if (!(zephir_fast_in_array(cipher, _3 TSRMLS_CC))) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_crypt_exception_ce, "Cipher algorithm is unknown", "phalcon/crypt.zep", 348);
return;
}
ZEPHIR_CALL_FUNCTION(&ivSize, "openssl_cipher_iv_length", &_4, 154, cipher);
zephir_check_call_status();
if (ZEPHIR_GT_LONG(ivSize, 0)) {
ZEPHIR_CPY_WRT(blockSize, ivSize);
} else {
ZEPHIR_INIT_VAR(_5$$9);
ZEPHIR_CONCAT_SV(_5$$9, "-", mode);
ZEPHIR_INIT_VAR(_6$$9);
ZVAL_STRING(_6$$9, "", ZEPHIR_TEMP_PARAM_COPY);
ZEPHIR_CALL_FUNCTION(&_7$$9, "str_ireplace", NULL, 155, _5$$9, _6$$9, cipher);
zephir_check_temp_parameter(_6$$9);
zephir_check_call_status();
ZEPHIR_CALL_FUNCTION(&blockSize, "openssl_cipher_iv_length", &_4, 154, _7$$9);
zephir_check_call_status();
}
ZEPHIR_INIT_VAR(_8);
zephir_substr(_8, text, zephir_get_intval(ivSize), 0, ZEPHIR_SUBSTR_NO_LENGTH);
ZEPHIR_SINIT_VAR(_9);
ZVAL_LONG(&_9, 0);
ZEPHIR_INIT_VAR(_10);
zephir_substr(_10, text, 0 , zephir_get_intval(ivSize), 0);
ZEPHIR_SINIT_VAR(_11);
ZVAL_LONG(&_11, 1);
ZEPHIR_CALL_FUNCTION(&decrypted, "openssl_decrypt", NULL, 158, _8, cipher, decryptKey, &_11, _10);
zephir_check_call_status();
ZEPHIR_OBS_VAR(paddingType);
zephir_read_property_this(&paddingType, this_ptr, SL("_padding"), PH_NOISY_CC);
_12 = ZEPHIR_IS_STRING(mode, "cbc");
if (!(_12)) {
_12 = ZEPHIR_IS_STRING(mode, "ecb");
}
if (_12) {
ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_cryptunpadtext", NULL, 0, decrypted, mode, blockSize, paddingType);
zephir_check_call_status();
RETURN_MM();
//.........这里部分代码省略.........
示例14: PHP_METHOD
/**
* Autoloads the registered classes
*/
PHP_METHOD(Phalcon_Loader, autoLoad) {
zephir_fcall_cache_entry *_10 = NULL, *_12 = NULL, *_13 = NULL, *_23 = NULL, *_24 = NULL, *_31 = NULL, *_32 = NULL;
HashTable *_2, *_7, *_15, *_21, *_26, *_29;
HashPosition _1, _6, _14, _20, _25, _28;
int ZEPHIR_LAST_CALL_STATUS;
zval *className_param = NULL, *eventsManager, *classes, *extensions, *filePath = NULL, *ds, *fixedDirectory = NULL, *prefixes, *directories, *namespaceSeparator, *namespaces, *nsPrefix = NULL, *directory = NULL, *fileName = NULL, *extension = NULL, *prefix = NULL, *dsClassName, *nsClassName, *_0 = NULL, **_3, *_4 = NULL, _5 = zval_used_for_init, **_8, *_9 = NULL, *_11 = NULL, **_16, *_17 = NULL, _18 = zval_used_for_init, _19 = zval_used_for_init, **_22, **_27, **_30;
zval *className = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &className_param);
if (unlikely(Z_TYPE_P(className_param) != IS_STRING && Z_TYPE_P(className_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'className' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(className_param) == IS_STRING)) {
zephir_get_strval(className, className_param);
} else {
ZEPHIR_INIT_VAR(className);
ZVAL_EMPTY_STRING(className);
}
ZEPHIR_OBS_VAR(eventsManager);
zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC);
if (Z_TYPE_P(eventsManager) == IS_OBJECT) {
ZEPHIR_INIT_VAR(_0);
ZVAL_STRING(_0, "loader:beforeCheckClass", ZEPHIR_TEMP_PARAM_COPY);
ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _0, this_ptr, className);
zephir_check_temp_parameter(_0);
zephir_check_call_status();
}
ZEPHIR_OBS_VAR(classes);
zephir_read_property_this(&classes, this_ptr, SL("_classes"), PH_NOISY_CC);
if (Z_TYPE_P(classes) == IS_ARRAY) {
ZEPHIR_OBS_VAR(filePath);
if (zephir_array_isset_fetch(&filePath, classes, className, 0 TSRMLS_CC)) {
if (Z_TYPE_P(eventsManager) == IS_OBJECT) {
zephir_update_property_this(this_ptr, SL("_foundPath"), filePath TSRMLS_CC);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "loader:pathFound", ZEPHIR_TEMP_PARAM_COPY);
ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _0, this_ptr, filePath);
zephir_check_temp_parameter(_0);
zephir_check_call_status();
}
if (zephir_require_zval(filePath TSRMLS_CC) == FAILURE) {
RETURN_MM_NULL();
}
RETURN_MM_BOOL(1);
}
}
ZEPHIR_OBS_VAR(extensions);
zephir_read_property_this(&extensions, this_ptr, SL("_extensions"), PH_NOISY_CC);
ZEPHIR_INIT_VAR(ds);
ZVAL_STRING(ds, "/", 1);
ZEPHIR_INIT_VAR(namespaceSeparator);
ZVAL_STRING(namespaceSeparator, "\\", 1);
ZEPHIR_OBS_VAR(namespaces);
zephir_read_property_this(&namespaces, this_ptr, SL("_namespaces"), PH_NOISY_CC);
if (Z_TYPE_P(namespaces) == IS_ARRAY) {
zephir_is_iterable(namespaces, &_2, &_1, 0, 0, "phalcon/loader.zep", 347);
for (
; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS
; zephir_hash_move_forward_ex(_2, &_1)
) {
ZEPHIR_GET_HMKEY(nsPrefix, _2, _1);
ZEPHIR_GET_HVALUE(directory, _3);
if (zephir_start_with(className, nsPrefix, NULL)) {
ZEPHIR_INIT_LNVAR(_4);
ZEPHIR_CONCAT_VV(_4, nsPrefix, namespaceSeparator);
ZEPHIR_SINIT_NVAR(_5);
ZVAL_LONG(&_5, zephir_fast_strlen_ev(_4));
ZEPHIR_INIT_NVAR(fileName);
zephir_substr(fileName, className, zephir_get_intval(&_5), 0, ZEPHIR_SUBSTR_NO_LENGTH);
ZEPHIR_INIT_NVAR(_0);
zephir_fast_str_replace(&_0, namespaceSeparator, ds, fileName TSRMLS_CC);
ZEPHIR_CPY_WRT(fileName, _0);
if (zephir_is_true(fileName)) {
ZEPHIR_INIT_NVAR(_0);
zephir_fast_trim(_0, directory, ds, ZEPHIR_TRIM_RIGHT TSRMLS_CC);
ZEPHIR_INIT_NVAR(fixedDirectory);
ZEPHIR_CONCAT_VV(fixedDirectory, _0, ds);
zephir_is_iterable(extensions, &_7, &_6, 0, 0, "phalcon/loader.zep", 344);
for (
; zephir_hash_get_current_data_ex(_7, (void**) &_8, &_6) == SUCCESS
; zephir_hash_move_forward_ex(_7, &_6)
) {
ZEPHIR_GET_HVALUE(extension, _8);
ZEPHIR_INIT_NVAR(filePath);
ZEPHIR_CONCAT_VVSV(filePath, fixedDirectory, fileName, ".", extension);
if (Z_TYPE_P(eventsManager) == IS_OBJECT) {
zephir_update_property_this(this_ptr, SL("_checkedPath"), filePath TSRMLS_CC);
ZEPHIR_INIT_NVAR(_9);
ZVAL_STRING(_9, "loader:beforeCheckPath", ZEPHIR_TEMP_PARAM_COPY);
ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", &_10, 0, _9, this_ptr);
//.........这里部分代码省略.........
示例15: PHP_METHOD
/**
* Sets a cookie to be sent at the end of the request
* This method overrides any cookie set before with the same name
*
* @param string name
* @param mixed value
* @param int expire
* @param string path
* @param boolean secure
* @param string domain
* @param boolean httpOnly
* @return Phalcon\Http\Response\Cookies
*/
PHP_METHOD(Phalcon_Http_Response_Cookies, set) {
int expire, ZEPHIR_LAST_CALL_STATUS;
zval *name_param = NULL, *value = NULL, *expire_param = NULL, *path_param = NULL, *secure = NULL, *domain_param = NULL, *httpOnly = NULL, *cookie = NULL, *encryption, *dependencyInjector, *response = NULL, *_0, *_1 = NULL, *_2;
zval *name = NULL, *path = NULL, *domain = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 6, &name_param, &value, &expire_param, &path_param, &secure, &domain_param, &httpOnly);
if (unlikely(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 a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(name_param) == IS_STRING)) {
zephir_get_strval(name, name_param);
} else {
ZEPHIR_INIT_VAR(name);
ZVAL_EMPTY_STRING(name);
}
if (!value) {
value = ZEPHIR_GLOBAL(global_null);
}
if (!expire_param) {
expire = 0;
} else {
expire = zephir_get_intval(expire_param);
}
if (!path_param) {
ZEPHIR_INIT_VAR(path);
ZVAL_STRING(path, "/", 1);
} else {
zephir_get_strval(path, path_param);
}
if (!secure) {
secure = ZEPHIR_GLOBAL(global_null);
}
if (!domain_param) {
ZEPHIR_INIT_VAR(domain);
ZVAL_EMPTY_STRING(domain);
} else {
if (unlikely(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 a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(domain_param) == IS_STRING)) {
zephir_get_strval(domain, domain_param);
} else {
ZEPHIR_INIT_VAR(domain);
ZVAL_EMPTY_STRING(domain);
}
}
if (!httpOnly) {
httpOnly = ZEPHIR_GLOBAL(global_null);
}
ZEPHIR_OBS_VAR(encryption);
zephir_read_property_this(&encryption, this_ptr, SL("_useEncryption"), PH_NOISY_CC);
ZEPHIR_OBS_VAR(cookie);
_0 = zephir_fetch_nproperty_this(this_ptr, SL("_cookies"), PH_NOISY_CC);
if (!(zephir_array_isset_fetch(&cookie, _0, name, 0 TSRMLS_CC))) {
ZEPHIR_INIT_NVAR(cookie);
object_init_ex(cookie, phalcon_http_cookie_ce);
ZEPHIR_INIT_VAR(_1);
ZVAL_LONG(_1, expire);
ZEPHIR_CALL_METHOD(NULL, cookie, "__construct", NULL, 215, name, value, _1, path, secure, domain, httpOnly);
zephir_check_call_status();
_2 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC);
ZEPHIR_CALL_METHOD(NULL, cookie, "setdi", NULL, 216, _2);
zephir_check_call_status();
if (zephir_is_true(encryption)) {
ZEPHIR_CALL_METHOD(NULL, cookie, "useencryption", NULL, 217, encryption);
zephir_check_call_status();
}
zephir_update_property_array(this_ptr, SL("_cookies"), name, cookie TSRMLS_CC);
} else {
ZEPHIR_CALL_METHOD(NULL, cookie, "setvalue", NULL, 218, value);
zephir_check_call_status();
ZEPHIR_INIT_NVAR(_1);
ZVAL_LONG(_1, expire);
ZEPHIR_CALL_METHOD(NULL, cookie, "setexpiration", NULL, 219, _1);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(NULL, cookie, "setpath", NULL, 220, path);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(NULL, cookie, "setsecure", NULL, 221, secure);
//.........这里部分代码省略.........