From a50687c0db0e99347de3067cf7c4895694bd5303 Mon Sep 17 00:00:00 2001 From: phalcon Date: Sat, 23 Aug 2014 17:41:23 -0500 Subject: [PATCH] Using latest Zephir, fixing view caching, enabling tests --- .travis.yml | 1 - ext/kernel/main.h | 31 ++++ ext/phalcon/cache/backend.zep.c | 2 +- ext/phalcon/cache/backend/apc.zep.c | 1 + ext/phalcon/cache/backend/file.zep.c | 6 +- ext/phalcon/cache/frontend/none.zep.c | 6 +- ext/phalcon/cache/frontend/output.zep.c | 13 +- ext/phalcon/db/adapter/pdo.zep.c | 3 +- ext/phalcon/db/adapter/pdo/mysql.zep.c | 3 +- ext/phalcon/db/dialect.zep.c | 3 +- ext/phalcon/debug.zep.c | 6 +- ext/phalcon/di.zep.c | 18 +- ext/phalcon/di/factorydefault.zep.c | 125 +++++++------- ext/phalcon/di/factorydefault/cli.zep.c | 41 +++-- ext/phalcon/di/service.zep.c | 19 ++- ext/phalcon/di/service.zep.h | 2 +- ext/phalcon/dispatcher.zep.c | 3 +- ext/phalcon/filter.zep.c | 3 +- ext/phalcon/flash/session.zep.c | 3 +- ext/phalcon/forms/element.zep.c | 6 +- ext/phalcon/forms/form.zep.c | 3 +- ext/phalcon/http/cookie.zep.c | 3 +- ext/phalcon/http/request.zep.c | 27 ++- ext/phalcon/http/response.zep.c | 16 +- ext/phalcon/mvc/micro.zep.c | 3 +- ext/phalcon/mvc/model.zep.c | 9 +- ext/phalcon/mvc/model/resultset.zep.c | 2 + ext/phalcon/mvc/url.zep.c | 3 +- ext/phalcon/mvc/view.zep.c | 154 +++++++++--------- ext/phalcon/mvc/view.zep.h | 2 +- ext/phalcon/mvc/view/engine/volt.zep.c | 3 +- .../mvc/view/engine/volt/compiler.zep.c | 6 +- ext/phalcon/session/adapter.zep.c | 3 +- ext/phalcon/session/bag.zep.c | 3 +- ext/php_phalcon.h | 2 +- phalcon/cache/backend.zep | 14 +- phalcon/cache/frontend/igbinary.zep | 16 +- phalcon/cache/frontend/json.zep | 13 +- phalcon/cache/frontend/output.zep | 17 +- phalcon/debug.zep | 12 +- phalcon/di/service.zep | 11 +- phalcon/http/response.zep | 71 ++++---- phalcon/mvc/view.zep | 70 ++++---- unit-tests/CacheTest.php | 16 +- unit-tests/ViewCacheTest.php | 5 +- unit-tests/phpunit.xml | 2 +- 46 files changed, 433 insertions(+), 348 deletions(-) diff --git a/.travis.yml b/.travis.yml index 540aa175f01..82cdeb97eec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,6 @@ before_script: script: - ZEND_DONT_UNLOAD_MODULES=1 $(phpenv which php) ./unit-tests/ci/phpunit.php --debug -c unit-tests/phpunit.xml --testsuite=stable - - ZEND_DONT_UNLOAD_MODULES=1 $(phpenv which php) ./unit-tests/ci/phpunit.php --debug -c php-tests/tests/phpunit.xml --testsuite=stable after_failure: - sudo apt-get -qq install gdb diff --git a/ext/kernel/main.h b/ext/kernel/main.h index f0c9cb6ac08..541b4320647 100644 --- a/ext/kernel/main.h +++ b/ext/kernel/main.h @@ -335,6 +335,37 @@ int zephir_fetch_parameters(int num_args TSRMLS_DC, int required_args, int optio }\ } +/** Get current hash key copying the iterator if needed */ + +#if PHP_VERSION_ID < 50500 + +#define ZEPHIR_GET_IMKEY(var, it) \ + {\ + int key_type, str_key_len; \ + long int_key; \ + char *str_key; \ + \ + ZEPHIR_INIT_NVAR(var); \ + key_type = it->funcs->get_current_key(it, &str_key, &str_key_len, &int_key TSRMLS_CC); \ + if (key_type == HASH_KEY_IS_STRING) { \ + ZVAL_STRINGL(var, str_key, str_key_len, 1); \ + } else { \ + if (key_type == HASH_KEY_IS_LONG) { \ + ZVAL_LONG(var, int_key); \ + } else { \ + ZVAL_NULL(var); \ + } \ + } \ + } + +#else + +#define ZEPHIR_GET_IMKEY(var, it) \ + {\ + ZEPHIR_INIT_NVAR(var); \ + it->funcs->get_current_key(it, var TSRMLS_CC); \ + } + /** Foreach */ #define ZEPHIR_GET_FOREACH_KEY(var, hash, hash_pointer) ZEPHIR_GET_HMKEY(var, hash, hash_pointer) diff --git a/ext/phalcon/cache/backend.zep.c b/ext/phalcon/cache/backend.zep.c index 1eca93f2d29..2f6185d1aa8 100644 --- a/ext/phalcon/cache/backend.zep.c +++ b/ext/phalcon/cache/backend.zep.c @@ -153,7 +153,7 @@ PHP_METHOD(Phalcon_Cache_Backend, __construct) { /** * Starts a cache. The keyname allows to identify the created fragment * - * @param int|string keyName + * @param int|string keyName * @param long lifetime * @return mixed */ diff --git a/ext/phalcon/cache/backend/apc.zep.c b/ext/phalcon/cache/backend/apc.zep.c index acb9199c804..246da088be0 100644 --- a/ext/phalcon/cache/backend/apc.zep.c +++ b/ext/phalcon/cache/backend/apc.zep.c @@ -395,6 +395,7 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, queryKeys) { _3 = zephir_get_iterator(apc TSRMLS_CC); _3->funcs->rewind(_3 TSRMLS_CC); for (;_3->funcs->valid(_3 TSRMLS_CC) == SUCCESS && !EG(exception); _3->funcs->move_forward(_3 TSRMLS_CC)) { + ZEPHIR_GET_IMKEY(key, _3); { zval **tmp; _3->funcs->get_current_data(_3, &tmp TSRMLS_CC); item = *tmp; diff --git a/ext/phalcon/cache/backend/file.zep.c b/ext/phalcon/cache/backend/file.zep.c index 715d745d440..facbd2171f2 100644 --- a/ext/phalcon/cache/backend/file.zep.c +++ b/ext/phalcon/cache/backend/file.zep.c @@ -235,7 +235,7 @@ PHP_METHOD(Phalcon_Cache_Backend_File, save) { ZEPHIR_CONCAT_VV(lastKey, _0, keyName); } if (!(zephir_is_true(lastKey))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The cache must be started first", "phalcon/cache/backend/file.zep", 160); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/file.zep", 160); return; } ZEPHIR_OBS_VAR(frontend); @@ -263,7 +263,7 @@ PHP_METHOD(Phalcon_Cache_Backend_File, save) { ZEPHIR_INIT_NVAR(status); zephir_file_put_contents(status, cacheFile, cachedContent TSRMLS_CC); } - if (ZEPHIR_IS_FALSE(status)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(status)) { ZEPHIR_INIT_VAR(_1); object_init_ex(_1, phalcon_cache_exception_ce); ZEPHIR_INIT_VAR(_2); @@ -512,7 +512,7 @@ PHP_METHOD(Phalcon_Cache_Backend_File, increment) { ZEPHIR_INIT_VAR(_7); zephir_file_put_contents(_7, cacheFile, result TSRMLS_CC); if (ZEPHIR_IS_FALSE_IDENTICAL(_7)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache directory can't be written", "phalcon/cache/backend/file.zep", 358); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache directory could not be written", "phalcon/cache/backend/file.zep", 358); return; } RETURN_CCTOR(result); diff --git a/ext/phalcon/cache/frontend/none.zep.c b/ext/phalcon/cache/frontend/none.zep.c index ec2f4bb2d35..8703acb65ed 100644 --- a/ext/phalcon/cache/frontend/none.zep.c +++ b/ext/phalcon/cache/frontend/none.zep.c @@ -143,7 +143,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_None, beforeStore) { - RETURN_CCTORW(data); + RETVAL_ZVAL(data, 1, 0); + return; } @@ -160,7 +161,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_None, afterRetrieve) { - RETURN_CCTORW(data); + RETVAL_ZVAL(data, 1, 0); + return; } diff --git a/ext/phalcon/cache/frontend/output.zep.c b/ext/phalcon/cache/frontend/output.zep.c index 6bb93792e7d..2f195b10f0c 100644 --- a/ext/phalcon/cache/frontend/output.zep.c +++ b/ext/phalcon/cache/frontend/output.zep.c @@ -150,7 +150,7 @@ PHP_METHOD(Phalcon_Cache_Frontend_Output, isBuffering) { } /** - * Starts output frontend. Actually, does nothing + * Starts output frontend. Currently, does nothing */ PHP_METHOD(Phalcon_Cache_Frontend_Output, start) { @@ -202,12 +202,11 @@ PHP_METHOD(Phalcon_Cache_Frontend_Output, stop) { _0 = zephir_fetch_nproperty_this(this_ptr, SL("_buffering"), PH_NOISY_CC); if (zephir_is_true(_0)) { - ZEPHIR_RETURN_CALL_FUNCTION("ob_end_clean", &_1); + ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", &_1); zephir_check_call_status(); - RETURN_MM(); } zephir_update_property_this(this_ptr, SL("_buffering"), (0) ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC); - RETURN_MM_NULL(); + ZEPHIR_MM_RESTORE(); } @@ -225,7 +224,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Output, beforeStore) { - RETURN_CCTORW(data); + RETVAL_ZVAL(data, 1, 0); + return; } @@ -243,7 +243,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Output, afterRetrieve) { - RETURN_CCTORW(data); + RETVAL_ZVAL(data, 1, 0); + return; } diff --git a/ext/phalcon/db/adapter/pdo.zep.c b/ext/phalcon/db/adapter/pdo.zep.c index a88617bf126..3613ec21daa 100644 --- a/ext/phalcon/db/adapter/pdo.zep.c +++ b/ext/phalcon/db/adapter/pdo.zep.c @@ -328,7 +328,8 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, executePrepared) { } ZEPHIR_CALL_METHOD(NULL, statement, "execute", NULL); zephir_check_call_status(); - RETURN_CCTOR(statement); + RETVAL_ZVAL(statement, 1, 0); + RETURN_MM(); } diff --git a/ext/phalcon/db/adapter/pdo/mysql.zep.c b/ext/phalcon/db/adapter/pdo/mysql.zep.c index 809b0a6c76c..8ade2be7dbc 100644 --- a/ext/phalcon/db/adapter/pdo/mysql.zep.c +++ b/ext/phalcon/db/adapter/pdo/mysql.zep.c @@ -102,7 +102,8 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, escapeIdentifier) { ZEPHIR_CONCAT_SVS(return_value, "`", identifier, "`"); RETURN_MM(); } - RETURN_CCTOR(identifier); + RETVAL_ZVAL(identifier, 1, 0); + RETURN_MM(); } diff --git a/ext/phalcon/db/dialect.zep.c b/ext/phalcon/db/dialect.zep.c index 78a0a9b8bd0..47e668df8e3 100644 --- a/ext/phalcon/db/dialect.zep.c +++ b/ext/phalcon/db/dialect.zep.c @@ -491,7 +491,8 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlTable) { ZEPHIR_CONCAT_VVV(return_value, escapeChar, table, escapeChar); RETURN_MM(); } - RETURN_CCTOR(table); + RETVAL_ZVAL(table, 1, 0); + RETURN_MM(); } diff --git a/ext/phalcon/debug.zep.c b/ext/phalcon/debug.zep.c index b0cb94782cd..c2b7705dd01 100644 --- a/ext/phalcon/debug.zep.c +++ b/ext/phalcon/debug.zep.c @@ -317,7 +317,8 @@ PHP_METHOD(Phalcon_Debug, _escapeString) { zephir_check_call_status(); RETURN_MM(); } - RETURN_CCTOR(value); + RETVAL_ZVAL(value, 1, 0); + RETURN_MM(); } @@ -443,7 +444,8 @@ PHP_METHOD(Phalcon_Debug, _getVarDump) { zephir_check_call_status(); RETURN_MM(); } - RETURN_CCTOR(variable); + RETVAL_ZVAL(variable, 1, 0); + RETURN_MM(); } if (Z_TYPE_P(variable) == IS_OBJECT) { ZEPHIR_INIT_VAR(className); diff --git a/ext/phalcon/di.zep.c b/ext/phalcon/di.zep.c index bd47fd28cef..2f1781f4aed 100644 --- a/ext/phalcon/di.zep.c +++ b/ext/phalcon/di.zep.c @@ -119,6 +119,7 @@ PHP_METHOD(Phalcon_Di, __construct) { */ PHP_METHOD(Phalcon_Di, set) { + zephir_nts_static zephir_fcall_cache_entry *_0 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *name_param = NULL, *definition, *shared = NULL, *service; zval *name = NULL; @@ -144,7 +145,7 @@ PHP_METHOD(Phalcon_Di, set) { ZEPHIR_INIT_VAR(service); object_init_ex(service, phalcon_di_service_ce); - ZEPHIR_CALL_METHOD(NULL, service, "__construct", NULL, name, definition, shared); + ZEPHIR_CALL_METHOD(NULL, service, "__construct", &_0, name, definition, shared); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("_services"), name, service TSRMLS_CC); RETURN_CCTOR(service); @@ -160,8 +161,9 @@ PHP_METHOD(Phalcon_Di, set) { */ PHP_METHOD(Phalcon_Di, setShared) { + zephir_nts_static zephir_fcall_cache_entry *_1 = NULL; int ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *definition, *service, *_0; + zval *name_param = NULL, *definition, *service, _0; zval *name = NULL; ZEPHIR_MM_GROW(); @@ -182,9 +184,9 @@ PHP_METHOD(Phalcon_Di, setShared) { ZEPHIR_INIT_VAR(service); object_init_ex(service, phalcon_di_service_ce); - ZEPHIR_INIT_VAR(_0); - ZVAL_BOOL(_0, 1); - ZEPHIR_CALL_METHOD(NULL, service, "__construct", NULL, name, definition, _0); + ZEPHIR_SINIT_VAR(_0); + ZVAL_BOOL(&_0, 1); + ZEPHIR_CALL_METHOD(NULL, service, "__construct", &_1, name, definition, &_0); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("_services"), name, service TSRMLS_CC); RETURN_CCTOR(service); @@ -235,6 +237,7 @@ PHP_METHOD(Phalcon_Di, remove) { */ PHP_METHOD(Phalcon_Di, attempt) { + zephir_nts_static zephir_fcall_cache_entry *_1 = NULL; int ZEPHIR_LAST_CALL_STATUS; zend_bool shared; zval *name_param = NULL, *definition, *shared_param = NULL, *service, *_0; @@ -265,7 +268,7 @@ PHP_METHOD(Phalcon_Di, attempt) { if (!(zephir_array_isset(_0, name))) { ZEPHIR_INIT_VAR(service); object_init_ex(service, phalcon_di_service_ce); - ZEPHIR_CALL_METHOD(NULL, service, "__construct", NULL, name, definition, (shared ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false))); + ZEPHIR_CALL_METHOD(NULL, service, "__construct", &_1, name, definition, (shared ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false))); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("_services"), name, service TSRMLS_CC); RETURN_CCTOR(service); @@ -307,7 +310,8 @@ PHP_METHOD(Phalcon_Di, setRaw) { return; } zephir_update_property_array(this_ptr, SL("_services"), name, rawDefinition TSRMLS_CC); - RETURN_CCTOR(rawDefinition); + RETVAL_ZVAL(rawDefinition, 1, 0); + RETURN_MM(); } diff --git a/ext/phalcon/di/factorydefault.zep.c b/ext/phalcon/di/factorydefault.zep.c index cb1f96738bd..17fc34f9d17 100644 --- a/ext/phalcon/di/factorydefault.zep.c +++ b/ext/phalcon/di/factorydefault.zep.c @@ -55,11 +55,10 @@ ZEPHIR_INIT_CLASS(Phalcon_Di_FactoryDefault) { */ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { - zephir_fcall_cache_entry *_6 = NULL; - zval *_2 = NULL, *_3, *_4, *_5, *_7, *_8, *_9, *_10, *_11, *_12, *_13, *_14, *_15, *_16, *_17, *_18, *_19, *_20, *_21, *_22, *_23, *_24, *_25; + zval *_2 = NULL, *_3, *_4, _5, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25; zval *_1; int ZEPHIR_LAST_CALL_STATUS; - zephir_nts_static zephir_fcall_cache_entry *_0 = NULL; + zephir_nts_static zephir_fcall_cache_entry *_0 = NULL, *_6 = NULL; ZEPHIR_MM_GROW(); @@ -73,9 +72,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "router", 0); ZEPHIR_INIT_VAR(_4); ZVAL_STRING(_4, "Phalcon\\Mvc\\Router", 0); - ZEPHIR_INIT_VAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _5); + ZEPHIR_SINIT_VAR(_5); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_5); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -86,9 +85,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "dispatcher", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Mvc\\Dispatcher", 0); - ZEPHIR_INIT_VAR(_7); - ZVAL_BOOL(_7, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _7); + ZEPHIR_SINIT_VAR(_7); + ZVAL_BOOL(&_7, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_7); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -99,9 +98,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "url", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Mvc\\Url", 0); - ZEPHIR_INIT_VAR(_8); - ZVAL_BOOL(_8, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _8); + ZEPHIR_SINIT_VAR(_8); + ZVAL_BOOL(&_8, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_8); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -112,9 +111,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "modelsManager", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Mvc\\Model\\Manager", 0); - ZEPHIR_INIT_VAR(_9); - ZVAL_BOOL(_9, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _9); + ZEPHIR_SINIT_VAR(_9); + ZVAL_BOOL(&_9, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_9); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -125,9 +124,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "modelsMetadata", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Mvc\\Model\\MetaData\\Memory", 0); - ZEPHIR_INIT_VAR(_10); - ZVAL_BOOL(_10, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _10); + ZEPHIR_SINIT_VAR(_10); + ZVAL_BOOL(&_10, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_10); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -138,9 +137,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "response", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Http\\Response", 0); - ZEPHIR_INIT_VAR(_11); - ZVAL_BOOL(_11, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _11); + ZEPHIR_SINIT_VAR(_11); + ZVAL_BOOL(&_11, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_11); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -151,9 +150,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "cookies", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Http\\Response\\Cookies", 0); - ZEPHIR_INIT_VAR(_12); - ZVAL_BOOL(_12, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _12); + ZEPHIR_SINIT_VAR(_12); + ZVAL_BOOL(&_12, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_12); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -164,9 +163,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "request", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Http\\Request", 0); - ZEPHIR_INIT_VAR(_13); - ZVAL_BOOL(_13, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _13); + ZEPHIR_SINIT_VAR(_13); + ZVAL_BOOL(&_13, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_13); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -177,9 +176,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "filter", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Filter", 0); - ZEPHIR_INIT_VAR(_14); - ZVAL_BOOL(_14, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _14); + ZEPHIR_SINIT_VAR(_14); + ZVAL_BOOL(&_14, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_14); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -190,9 +189,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "escaper", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Escaper", 0); - ZEPHIR_INIT_VAR(_15); - ZVAL_BOOL(_15, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _15); + ZEPHIR_SINIT_VAR(_15); + ZVAL_BOOL(&_15, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_15); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -203,9 +202,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "security", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Security", 0); - ZEPHIR_INIT_VAR(_16); - ZVAL_BOOL(_16, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _16); + ZEPHIR_SINIT_VAR(_16); + ZVAL_BOOL(&_16, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_16); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -216,9 +215,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "crypt", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Crypt", 0); - ZEPHIR_INIT_VAR(_17); - ZVAL_BOOL(_17, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _17); + ZEPHIR_SINIT_VAR(_17); + ZVAL_BOOL(&_17, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_17); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -229,9 +228,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "annotations", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Annotations\\Adapter\\Memory", 0); - ZEPHIR_INIT_VAR(_18); - ZVAL_BOOL(_18, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _18); + ZEPHIR_SINIT_VAR(_18); + ZVAL_BOOL(&_18, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_18); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -242,9 +241,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "flash", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Flash\\Direct", 0); - ZEPHIR_INIT_VAR(_19); - ZVAL_BOOL(_19, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _19); + ZEPHIR_SINIT_VAR(_19); + ZVAL_BOOL(&_19, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_19); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -255,9 +254,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "flashSession", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Flash\\Session", 0); - ZEPHIR_INIT_VAR(_20); - ZVAL_BOOL(_20, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _20); + ZEPHIR_SINIT_VAR(_20); + ZVAL_BOOL(&_20, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_20); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -268,9 +267,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "tag", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Tag", 0); - ZEPHIR_INIT_VAR(_21); - ZVAL_BOOL(_21, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _21); + ZEPHIR_SINIT_VAR(_21); + ZVAL_BOOL(&_21, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_21); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -281,9 +280,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "session", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Session\\Adapter\\Files", 0); - ZEPHIR_INIT_VAR(_22); - ZVAL_BOOL(_22, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _22); + ZEPHIR_SINIT_VAR(_22); + ZVAL_BOOL(&_22, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_22); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -305,9 +304,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "eventsManager", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Events\\Manager", 0); - ZEPHIR_INIT_VAR(_23); - ZVAL_BOOL(_23, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _23); + ZEPHIR_SINIT_VAR(_23); + ZVAL_BOOL(&_23, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_23); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -318,9 +317,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "transactions", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Mvc\\Model\\Transaction\\Manager", 0); - ZEPHIR_INIT_VAR(_24); - ZVAL_BOOL(_24, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _24); + ZEPHIR_SINIT_VAR(_24); + ZVAL_BOOL(&_24, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_24); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -331,9 +330,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { ZVAL_STRING(_3, "assets", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Assets\\Manager", 0); - ZEPHIR_INIT_VAR(_25); - ZVAL_BOOL(_25, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, _25); + ZEPHIR_SINIT_VAR(_25); + ZVAL_BOOL(&_25, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, _3, _4, &_25); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); diff --git a/ext/phalcon/di/factorydefault/cli.zep.c b/ext/phalcon/di/factorydefault/cli.zep.c index 0d89900f909..6debc327030 100644 --- a/ext/phalcon/di/factorydefault/cli.zep.c +++ b/ext/phalcon/di/factorydefault/cli.zep.c @@ -56,11 +56,10 @@ ZEPHIR_INIT_CLASS(Phalcon_Di_FactoryDefault_Cli) { */ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) { - zephir_fcall_cache_entry *_5 = NULL; - zval *_2 = NULL, *_3, *_4, *_6, *_7, *_8, *_9, *_10, *_11; + zval *_2 = NULL, *_3, *_4, _6, _7, _8, _9, _10, _11; zval *_1; int ZEPHIR_LAST_CALL_STATUS; - zephir_nts_static zephir_fcall_cache_entry *_0 = NULL; + zephir_nts_static zephir_fcall_cache_entry *_0 = NULL, *_5 = NULL; ZEPHIR_MM_GROW(); @@ -118,9 +117,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) { ZVAL_STRING(_3, "filter", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Filter", 0); - ZEPHIR_INIT_VAR(_6); - ZVAL_BOOL(_6, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_5, _3, _4, _6); + ZEPHIR_SINIT_VAR(_6); + ZVAL_BOOL(&_6, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_5, _3, _4, &_6); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -131,9 +130,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) { ZVAL_STRING(_3, "escaper", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Escaper", 0); - ZEPHIR_INIT_VAR(_7); - ZVAL_BOOL(_7, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_5, _3, _4, _7); + ZEPHIR_SINIT_VAR(_7); + ZVAL_BOOL(&_7, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_5, _3, _4, &_7); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -144,9 +143,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) { ZVAL_STRING(_3, "annotations", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Annotations\\Adapter\\Memory", 0); - ZEPHIR_INIT_VAR(_8); - ZVAL_BOOL(_8, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_5, _3, _4, _8); + ZEPHIR_SINIT_VAR(_8); + ZVAL_BOOL(&_8, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_5, _3, _4, &_8); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -157,9 +156,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) { ZVAL_STRING(_3, "security", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Security", 0); - ZEPHIR_INIT_VAR(_9); - ZVAL_BOOL(_9, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_5, _3, _4, _9); + ZEPHIR_SINIT_VAR(_9); + ZVAL_BOOL(&_9, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_5, _3, _4, &_9); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -170,9 +169,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) { ZVAL_STRING(_3, "eventsManager", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Events\\Manage", 0); - ZEPHIR_INIT_VAR(_10); - ZVAL_BOOL(_10, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_5, _3, _4, _10); + ZEPHIR_SINIT_VAR(_10); + ZVAL_BOOL(&_10, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_5, _3, _4, &_10); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); @@ -183,9 +182,9 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) { ZVAL_STRING(_3, "transactionManager", 0); ZEPHIR_INIT_BNVAR(_4); ZVAL_STRING(_4, "Phalcon\\Mvc\\Model\\Transaction\\Manager", 0); - ZEPHIR_INIT_VAR(_11); - ZVAL_BOOL(_11, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_5, _3, _4, _11); + ZEPHIR_SINIT_VAR(_11); + ZVAL_BOOL(&_11, 1); + ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_5, _3, _4, &_11); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); diff --git a/ext/phalcon/di/service.zep.c b/ext/phalcon/di/service.zep.c index b32e1e0bf15..28f5c36a789 100644 --- a/ext/phalcon/di/service.zep.c +++ b/ext/phalcon/di/service.zep.c @@ -304,7 +304,7 @@ PHP_METHOD(Phalcon_Di_Service, resolve) { ZEPHIR_CONCAT_SVS(_4, "Service '", _3, "' cannot be resolved"); ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, _4); zephir_check_call_status(); - zephir_throw_exception_debug(_2, "phalcon/di/service.zep", 201 TSRMLS_CC); + zephir_throw_exception_debug(_2, "phalcon/di/service.zep", 202 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -345,16 +345,16 @@ PHP_METHOD(Phalcon_Di_Service, setParameter) { ZEPHIR_OBS_VAR(definition); zephir_read_property_this(&definition, this_ptr, SL("_definition"), PH_NOISY_CC); if (Z_TYPE_P(definition) != IS_ARRAY) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "Definition must be an array to update its parameters", "phalcon/di/service.zep", 229); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "Definition must be an array to update its parameters", "phalcon/di/service.zep", 230); return; } ZEPHIR_OBS_VAR(arguments); if (zephir_array_isset_string_fetch(&arguments, definition, SS("arguments"), 0 TSRMLS_CC)) { - zephir_array_update_long(&arguments, position, ¶meter, PH_COPY | PH_SEPARATE, "phalcon/di/service.zep", 236); + zephir_array_update_long(&arguments, position, ¶meter, PH_COPY | PH_SEPARATE, "phalcon/di/service.zep", 237); } else { ZEPHIR_INIT_BNVAR(arguments); array_init_size(arguments, 2); - zephir_array_update_long(&arguments, position, ¶meter, PH_COPY, "phalcon/di/service.zep", 238); + zephir_array_update_long(&arguments, position, ¶meter, PH_COPY, "phalcon/di/service.zep", 239); } zephir_array_update_string(&definition, SL("arguments"), &arguments, PH_COPY | PH_SEPARATE); zephir_update_property_this(this_ptr, SL("_definition"), definition TSRMLS_CC); @@ -382,7 +382,7 @@ PHP_METHOD(Phalcon_Di_Service, getParameter) { ZEPHIR_OBS_VAR(definition); zephir_read_property_this(&definition, this_ptr, SL("_definition"), PH_NOISY_CC); if (Z_TYPE_P(definition) != IS_ARRAY) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "Definition must be an array to obtain its parameters", "phalcon/di/service.zep", 266); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "Definition must be an array to obtain its parameters", "phalcon/di/service.zep", 267); return; } if (zephir_array_isset_string_fetch(&arguments, definition, SS("arguments"), 1 TSRMLS_CC)) { @@ -414,6 +414,7 @@ PHP_METHOD(Phalcon_Di_Service, isResolved) { */ PHP_METHOD(Phalcon_Di_Service, __set_state) { + zephir_nts_static zephir_fcall_cache_entry *_0 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *attributes_param = NULL, *name, *definition, *shared; zval *attributes = NULL; @@ -432,21 +433,21 @@ PHP_METHOD(Phalcon_Di_Service, __set_state) { ZEPHIR_OBS_VAR(name); if (!(zephir_array_isset_string_fetch(&name, attributes, SS("_name"), 0 TSRMLS_CC))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The attribute '_name' is required", "phalcon/di/service.zep", 302); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The attribute '_name' is required", "phalcon/di/service.zep", 303); return; } ZEPHIR_OBS_VAR(definition); if (!(zephir_array_isset_string_fetch(&definition, attributes, SS("_definition"), 0 TSRMLS_CC))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The attribute '_name' is required", "phalcon/di/service.zep", 306); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The attribute '_name' is required", "phalcon/di/service.zep", 307); return; } ZEPHIR_OBS_VAR(shared); if (!(zephir_array_isset_string_fetch(&shared, attributes, SS("_shared"), 0 TSRMLS_CC))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The attribute '_shared' is required", "phalcon/di/service.zep", 310); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The attribute '_shared' is required", "phalcon/di/service.zep", 311); return; } object_init_ex(return_value, phalcon_di_service_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, name, definition, shared); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", &_0, name, definition, shared); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/di/service.zep.h b/ext/phalcon/di/service.zep.h index 4397306b332..77e104e942b 100644 --- a/ext/phalcon/di/service.zep.h +++ b/ext/phalcon/di/service.zep.h @@ -53,7 +53,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_service___set_state, 0, 0, 1) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_di_service_method_entry) { - PHP_ME(Phalcon_Di_Service, __construct, arginfo_phalcon_di_service___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(Phalcon_Di_Service, __construct, arginfo_phalcon_di_service___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL|ZEND_ACC_CTOR) PHP_ME(Phalcon_Di_Service, getName, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di_Service, setShared, arginfo_phalcon_di_service_setshared, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di_Service, isShared, NULL, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/dispatcher.zep.c b/ext/phalcon/dispatcher.zep.c index 87f82d190a1..6f114b59baf 100644 --- a/ext/phalcon/dispatcher.zep.c +++ b/ext/phalcon/dispatcher.zep.c @@ -476,7 +476,8 @@ PHP_METHOD(Phalcon_Dispatcher, getParam) { RETURN_CCTOR(paramValue); } } - RETURN_CCTOR(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } diff --git a/ext/phalcon/filter.zep.c b/ext/phalcon/filter.zep.c index c09c3da3e0f..73aaed335a4 100644 --- a/ext/phalcon/filter.zep.c +++ b/ext/phalcon/filter.zep.c @@ -168,7 +168,8 @@ PHP_METHOD(Phalcon_Filter, sanitize) { } } } - RETURN_CCTOR(value); + RETVAL_ZVAL(value, 1, 0); + RETURN_MM(); } _3 = Z_TYPE_P(value) == IS_ARRAY; if (_3) { diff --git a/ext/phalcon/flash/session.zep.c b/ext/phalcon/flash/session.zep.c index 6dd8647e671..74930a91f97 100644 --- a/ext/phalcon/flash/session.zep.c +++ b/ext/phalcon/flash/session.zep.c @@ -166,7 +166,8 @@ PHP_METHOD(Phalcon_Flash_Session, _setSessionMessages) { ZEPHIR_CALL_METHOD(NULL, session, "set", NULL, _1, messages); zephir_check_temp_parameter(_1); zephir_check_call_status(); - RETURN_CCTOR(messages); + RETVAL_ZVAL(messages, 1, 0); + RETURN_MM(); } diff --git a/ext/phalcon/forms/element.zep.c b/ext/phalcon/forms/element.zep.c index 3fdbf8fd413..e74c4d34bf2 100644 --- a/ext/phalcon/forms/element.zep.c +++ b/ext/phalcon/forms/element.zep.c @@ -437,7 +437,8 @@ PHP_METHOD(Phalcon_Forms_Element, getAttribute) { if (zephir_array_isset_fetch(&value, attributes, attribute, 1 TSRMLS_CC)) { RETURN_CTOR(value); } - RETURN_CCTOR(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } @@ -532,7 +533,8 @@ PHP_METHOD(Phalcon_Forms_Element, getUserOption) { if (zephir_array_isset_fetch(&value, _0, option, 1 TSRMLS_CC)) { RETURN_CTORW(value); } - RETURN_CCTORW(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + return; } diff --git a/ext/phalcon/forms/form.zep.c b/ext/phalcon/forms/form.zep.c index 91a15e88865..6148a3d49ff 100644 --- a/ext/phalcon/forms/form.zep.c +++ b/ext/phalcon/forms/form.zep.c @@ -205,7 +205,8 @@ PHP_METHOD(Phalcon_Forms_Form, getUserOption) { if (zephir_array_isset_fetch(&value, _0, option, 1 TSRMLS_CC)) { RETURN_CTORW(value); } - RETURN_CCTORW(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + return; } diff --git a/ext/phalcon/http/cookie.zep.c b/ext/phalcon/http/cookie.zep.c index 2c2a7a3d0e9..0750567599e 100644 --- a/ext/phalcon/http/cookie.zep.c +++ b/ext/phalcon/http/cookie.zep.c @@ -283,7 +283,8 @@ PHP_METHOD(Phalcon_Http_Cookie, getValue) { } RETURN_CCTOR(decryptedValue); } - RETURN_CCTOR(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } RETURN_MM_MEMBER(this_ptr, "_value"); diff --git a/ext/phalcon/http/request.zep.c b/ext/phalcon/http/request.zep.c index 3c6805941dc..71edfcf16ba 100644 --- a/ext/phalcon/http/request.zep.c +++ b/ext/phalcon/http/request.zep.c @@ -203,7 +203,8 @@ PHP_METHOD(Phalcon_Http_Request, get) { _4 = ZEPHIR_IS_FALSE_IDENTICAL(value); } if (_4) { - RETURN_CCTOR(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } RETURN_CCTOR(value); } else { @@ -212,12 +213,14 @@ PHP_METHOD(Phalcon_Http_Request, get) { _3 = ZEPHIR_IS_TRUE_IDENTICAL(notAllowEmpty); } if (_3) { - RETURN_CCTOR(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } RETURN_CCTOR(value); } } - RETURN_CCTOR(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } RETURN_CCTOR(request); @@ -313,7 +316,8 @@ PHP_METHOD(Phalcon_Http_Request, getPost) { _3 = ZEPHIR_IS_TRUE_IDENTICAL(notAllowEmpty); } if (_3) { - RETURN_CCTOR(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } RETURN_CCTOR(value); } else { @@ -322,12 +326,14 @@ PHP_METHOD(Phalcon_Http_Request, getPost) { _3 = ZEPHIR_IS_TRUE_IDENTICAL(notAllowEmpty); } if (_3) { - RETURN_CCTOR(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } RETURN_CCTOR(value); } } - RETURN_CCTOR(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } RETURN_CCTOR(post); @@ -426,7 +432,8 @@ PHP_METHOD(Phalcon_Http_Request, getQuery) { _3 = ZEPHIR_IS_TRUE_IDENTICAL(notAllowEmpty); } if (_3) { - RETURN_CCTOR(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } RETURN_CCTOR(value); } else { @@ -435,12 +442,14 @@ PHP_METHOD(Phalcon_Http_Request, getQuery) { _3 = ZEPHIR_IS_TRUE_IDENTICAL(notAllowEmpty); } if (_3) { - RETURN_CCTOR(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } RETURN_CCTOR(value); } } - RETURN_CCTOR(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } RETURN_CCTOR(get); diff --git a/ext/phalcon/http/response.zep.c b/ext/phalcon/http/response.zep.c index 5a3aad1b13a..8997b1eca41 100644 --- a/ext/phalcon/http/response.zep.c +++ b/ext/phalcon/http/response.zep.c @@ -154,7 +154,7 @@ PHP_METHOD(Phalcon_Http_Response, getDI) { ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_1); zephir_check_call_status(); if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_request_exception_ce, "A dependency injection object is required to access the 'url' service", "phalcon/http/response.zep", 90); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "A dependency injection object is required to access the 'url' service", "phalcon/http/response.zep", 97); return; } zephir_update_property_this(this_ptr, SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); @@ -196,7 +196,7 @@ PHP_METHOD(Phalcon_Http_Response, setStatusCode) { ZEPHIR_CALL_METHOD(¤tHeadersRaw, headers, "toarray", NULL); zephir_check_call_status(); if (Z_TYPE_P(currentHeadersRaw) == IS_ARRAY) { - zephir_is_iterable(currentHeadersRaw, &_1, &_0, 0, 0, "phalcon/http/response.zep", 126); + zephir_is_iterable(currentHeadersRaw, &_1, &_0, 0, 0, "phalcon/http/response.zep", 133); for ( ; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS ; zephir_hash_move_forward_ex(_1, &_0) @@ -251,6 +251,10 @@ PHP_METHOD(Phalcon_Http_Response, setHeaders) { + if (!(zephir_instance_of_ev(headers, phalcon_http_response_headersinterface_ce TSRMLS_CC))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(spl_ce_InvalidArgumentException, "Parameter 'headers' must be an instance of 'Phalcon\\Http\\Response\\HeadersInterface'", "", 0); + return; + } zephir_update_property_this(this_ptr, SL("_headers"), headers TSRMLS_CC); RETURN_THISW(); @@ -301,10 +305,6 @@ PHP_METHOD(Phalcon_Http_Response, setCookies) { ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(spl_ce_InvalidArgumentException, "Parameter 'cookies' must be an instance of 'Phalcon\\Http\\Response\\CookiesInterface'", "", 0); return; } - if (Z_TYPE_P(cookies) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_http_response_exception_ce, "The cookies bag is not valid", "phalcon/http/response.zep", 179); - return; - } zephir_update_property_this(this_ptr, SL("_cookies"), cookies TSRMLS_CC); RETURN_THISW(); @@ -672,7 +672,7 @@ PHP_METHOD(Phalcon_Http_Response, redirect) { ZVAL_STRING(message, "Redirect", 1); } else { ZEPHIR_OBS_NVAR(message); - zephir_array_fetch_long(&message, messages, statusCode, PH_NOISY, "phalcon/http/response.zep", 399 TSRMLS_CC); + zephir_array_isset_long_fetch(&message, messages, statusCode, 0 TSRMLS_CC); } ZEPHIR_INIT_NVAR(_4); ZVAL_LONG(_4, statusCode); @@ -853,7 +853,7 @@ PHP_METHOD(Phalcon_Http_Response, send) { _0 = zephir_fetch_nproperty_this(this_ptr, SL("_sent"), PH_NOISY_CC); if (zephir_is_true(_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "Response was already sent", "phalcon/http/response.zep", 517); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "Response was already sent", "phalcon/http/response.zep", 520); return; } ZEPHIR_OBS_VAR(headers); diff --git a/ext/phalcon/mvc/micro.zep.c b/ext/phalcon/mvc/micro.zep.c index 3f1af9c2763..cb0a9238884 100644 --- a/ext/phalcon/mvc/micro.zep.c +++ b/ext/phalcon/mvc/micro.zep.c @@ -1066,7 +1066,8 @@ PHP_METHOD(Phalcon_Mvc_Micro, offsetUnset) { - RETURN_CCTORW(alias); + RETVAL_ZVAL(alias, 1, 0); + return; } diff --git a/ext/phalcon/mvc/model.zep.c b/ext/phalcon/mvc/model.zep.c index 7a4d72ebd76..8d90037236e 100644 --- a/ext/phalcon/mvc/model.zep.c +++ b/ext/phalcon/mvc/model.zep.c @@ -5357,7 +5357,8 @@ PHP_METHOD(Phalcon_Mvc_Model, __set) { ZEPHIR_INIT_ZVAL_NREF(_0); ZVAL_LONG(_0, 1); zephir_update_property_this(this_ptr, SL("_dirtyState"), _0 TSRMLS_CC); - RETURN_CCTOR(value); + RETVAL_ZVAL(value, 1, 0); + RETURN_MM(); } } if (Z_TYPE_P(value) == IS_ARRAY) { @@ -5403,10 +5404,12 @@ PHP_METHOD(Phalcon_Mvc_Model, __set) { ZVAL_LONG(_0, 1); zephir_update_property_this(this_ptr, SL("_dirtyState"), _0 TSRMLS_CC); } - RETURN_CCTOR(value); + RETVAL_ZVAL(value, 1, 0); + RETURN_MM(); } zephir_update_property_zval_zval(this_ptr, property, value TSRMLS_CC); - RETURN_CCTOR(value); + RETVAL_ZVAL(value, 1, 0); + RETURN_MM(); } diff --git a/ext/phalcon/mvc/model/resultset.zep.c b/ext/phalcon/mvc/model/resultset.zep.c index 17cd08ab11a..056a882b17e 100644 --- a/ext/phalcon/mvc/model/resultset.zep.c +++ b/ext/phalcon/mvc/model/resultset.zep.c @@ -615,6 +615,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, delete) { if (!conditionCallback) { conditionCallback = ZEPHIR_GLOBAL(global_null); } + ZEPHIR_INIT_VAR(connection); + ZVAL_NULL(connection); _0 = Z_TYPE_P(conditionCallback) != IS_NULL; diff --git a/ext/phalcon/mvc/url.zep.c b/ext/phalcon/mvc/url.zep.c index f9dca0d5738..38547ec5acf 100644 --- a/ext/phalcon/mvc/url.zep.c +++ b/ext/phalcon/mvc/url.zep.c @@ -434,7 +434,8 @@ PHP_METHOD(Phalcon_Mvc_Url, get) { } } } - RETURN_CCTOR(uri); + RETVAL_ZVAL(uri, 1, 0); + RETURN_MM(); } diff --git a/ext/phalcon/mvc/view.zep.c b/ext/phalcon/mvc/view.zep.c index e2be6b8edb1..630cb7a2d2f 100644 --- a/ext/phalcon/mvc/view.zep.c +++ b/ext/phalcon/mvc/view.zep.c @@ -609,10 +609,18 @@ PHP_METHOD(Phalcon_Mvc_View, setParamToView) { PHP_METHOD(Phalcon_Mvc_View, setVars) { zend_bool merge; - zval *params, *merge_param = NULL, *viewParams, *_0; + zval *params_param = NULL, *merge_param = NULL, *viewParams, *_0; + zval *params = NULL; ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, ¶ms, &merge_param); + zephir_fetch_params(1, 1, 1, ¶ms_param, &merge_param); + + if (unlikely(Z_TYPE_P(params_param) != IS_ARRAY)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'params' must be an array") TSRMLS_CC); + RETURN_MM_NULL(); + } + + params = params_param; if (!merge_param) { merge = 1; @@ -621,10 +629,6 @@ PHP_METHOD(Phalcon_Mvc_View, setVars) { } - if (Z_TYPE_P(params) != IS_ARRAY) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "The render parameters must be an array", "phalcon/mvc/view.zep", 420); - return; - } if (merge) { ZEPHIR_OBS_VAR(viewParams); zephir_read_property_this(&viewParams, this_ptr, SL("_viewParams"), PH_NOISY_CC); @@ -813,14 +817,14 @@ PHP_METHOD(Phalcon_Mvc_View, _loadTemplateEngines) { zephir_array_update_string(&engines, SL(".phtml"), &_1, PH_COPY | PH_SEPARATE); } else { if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "A dependency injector container is required to obtain the application services", "phalcon/mvc/view.zep", 552); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "A dependency injector container is required to obtain the application services", "phalcon/mvc/view.zep", 551); return; } ZEPHIR_INIT_VAR(arguments); array_init_size(arguments, 3); zephir_array_fast_append(arguments, this_ptr); zephir_array_fast_append(arguments, dependencyInjector); - zephir_is_iterable(registeredEngines, &_3, &_2, 0, 0, "phalcon/mvc/view.zep", 581); + zephir_is_iterable(registeredEngines, &_3, &_2, 0, 0, "phalcon/mvc/view.zep", 580); for ( ; zephir_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS ; zephir_hash_move_forward_ex(_3, &_2) @@ -844,7 +848,7 @@ PHP_METHOD(Phalcon_Mvc_View, _loadTemplateEngines) { ZEPHIR_CONCAT_SV(_6, "Invalid template engine registration for extension: ", extension); ZEPHIR_CALL_METHOD(NULL, _1, "__construct", &_7, _6); zephir_check_call_status(); - zephir_throw_exception_debug(_1, "phalcon/mvc/view.zep", 575 TSRMLS_CC); + zephir_throw_exception_debug(_1, "phalcon/mvc/view.zep", 574 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -871,14 +875,13 @@ PHP_METHOD(Phalcon_Mvc_View, _loadTemplateEngines) { */ PHP_METHOD(Phalcon_Mvc_View, _engineRender) { - zephir_fcall_cache_entry *_11 = NULL; HashTable *_8; HashPosition _7; zephir_nts_static zephir_fcall_cache_entry *_4 = NULL; int renderLevel, cacheLevel, ZEPHIR_LAST_CALL_STATUS; zend_bool silence, mustClean, _0, notExists; zval *viewPath = NULL; - zval *engines, *viewPath_param = NULL, *silence_param = NULL, *mustClean_param = NULL, *cache = NULL, *key = NULL, *lifetime = NULL, *viewsDir, *basePath, *viewsDirPath, *viewOptions, *cacheOptions, *cachedView = NULL, *viewParams, *eventsManager = NULL, *extension = NULL, *engine = NULL, *viewEnginePath = NULL, *_1, *_2, *_3 = NULL, *_5 = NULL, *_6, **_9, *_10 = NULL, *_12, *_13; + zval *engines, *viewPath_param = NULL, *silence_param = NULL, *mustClean_param = NULL, *cache = NULL, *key = NULL, *lifetime = NULL, *viewsDir, *basePath, *viewsDirPath, *viewOptions, *cacheOptions, *cachedView = NULL, *viewParams, *eventsManager = NULL, *extension = NULL, *engine = NULL, *viewEnginePath = NULL, *_1, *_2, *_3 = NULL, *_5 = NULL, *_6, **_9, *_10 = NULL, *_11, *_12; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 1, &engines, &viewPath_param, &silence_param, &mustClean_param, &cache); @@ -970,7 +973,7 @@ PHP_METHOD(Phalcon_Mvc_View, _engineRender) { zephir_update_property_this(this_ptr, SL("_activeRenderPath"), viewEnginePath TSRMLS_CC); ZEPHIR_INIT_NVAR(_10); ZVAL_STRING(_10, "view:beforeRenderView", 0); - ZEPHIR_CALL_METHOD(&_3, eventsManager, "fire", &_11, _10, this_ptr, viewEnginePath); + ZEPHIR_CALL_METHOD(&_3, eventsManager, "fire", NULL, _10, this_ptr, viewEnginePath); zephir_check_temp_parameter(_10); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(_3)) { @@ -983,7 +986,7 @@ PHP_METHOD(Phalcon_Mvc_View, _engineRender) { if (Z_TYPE_P(eventsManager) == IS_OBJECT) { ZEPHIR_INIT_NVAR(_10); ZVAL_STRING(_10, "view:afterRenderView", 0); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", &_11, _10, this_ptr); + ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, _10, this_ptr); zephir_check_temp_parameter(_10); zephir_check_call_status(); } @@ -995,18 +998,18 @@ PHP_METHOD(Phalcon_Mvc_View, _engineRender) { zephir_update_property_this(this_ptr, SL("_activeRenderPath"), viewEnginePath TSRMLS_CC); ZEPHIR_INIT_NVAR(_10); ZVAL_STRING(_10, "view:notFoundView", 0); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", &_11, _10, this_ptr, viewEnginePath); + ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, _10, this_ptr, viewEnginePath); zephir_check_temp_parameter(_10); zephir_check_call_status(); } if (!(silence)) { + ZEPHIR_INIT_VAR(_11); + object_init_ex(_11, phalcon_mvc_view_exception_ce); ZEPHIR_INIT_VAR(_12); - object_init_ex(_12, phalcon_mvc_view_exception_ce); - ZEPHIR_INIT_VAR(_13); - ZEPHIR_CONCAT_SVS(_13, "View '", viewsDirPath, "' was not found in the views directory"); - ZEPHIR_CALL_METHOD(NULL, _12, "__construct", NULL, _13); + ZEPHIR_CONCAT_SVS(_12, "View '", viewsDirPath, "' was not found in the views directory"); + ZEPHIR_CALL_METHOD(NULL, _11, "__construct", NULL, _12); zephir_check_call_status(); - zephir_throw_exception_debug(_12, "phalcon/mvc/view.zep", 709 TSRMLS_CC); + zephir_throw_exception_debug(_11, "phalcon/mvc/view.zep", 709 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -1060,7 +1063,8 @@ PHP_METHOD(Phalcon_Mvc_View, exists) { HashTable *_2; HashPosition _1; - zval *view_param = NULL, *basePath, *viewsDir, *engines, *engine = NULL, *extension = NULL, *path = NULL, *exists = NULL, *_0, **_3; + zend_bool exists; + zval *view_param = NULL, *basePath, *viewsDir, *engines, *engine = NULL, *extension = NULL, *_0, **_3, *_4 = NULL; zval *view = NULL; ZEPHIR_MM_GROW(); @@ -1093,22 +1097,22 @@ PHP_METHOD(Phalcon_Mvc_View, exists) { zephir_array_update_string(&engines, SL(".phtml"), &_0, PH_COPY | PH_SEPARATE); zephir_update_property_this(this_ptr, SL("_registeredEngines"), engines TSRMLS_CC); } - zephir_is_iterable(engines, &_2, &_1, 0, 0, "phalcon/mvc/view.zep", 763); + exists = 0; + zephir_is_iterable(engines, &_2, &_1, 0, 0, "phalcon/mvc/view.zep", 765); for ( ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS ; zephir_hash_move_forward_ex(_2, &_1) ) { ZEPHIR_GET_HMKEY(extension, _2, _1); ZEPHIR_GET_HVALUE(engine, _3); - ZEPHIR_INIT_NVAR(path); - ZEPHIR_CONCAT_VVVV(path, basePath, viewsDir, view, extension); - ZEPHIR_INIT_NVAR(exists); - ZVAL_BOOL(exists, (zephir_file_exists(path TSRMLS_CC) == SUCCESS)); - if (zephir_is_true(exists)) { + ZEPHIR_INIT_LNVAR(_4); + ZEPHIR_CONCAT_VVVV(_4, basePath, viewsDir, view, extension); + exists = (zephir_file_exists(_4 TSRMLS_CC) == SUCCESS); + if (exists) { break; } } - RETURN_CCTOR(exists); + RETURN_MM_BOOL(exists); } @@ -1133,7 +1137,7 @@ PHP_METHOD(Phalcon_Mvc_View, render) { zephir_nts_static zephir_fcall_cache_entry *_2 = NULL; int renderLevel, ZEPHIR_LAST_CALL_STATUS; zend_bool silence, mustClean; - zval *controllerName_param = NULL, *actionName_param = NULL, *params = NULL, *layoutsDir, *layout, *pickView, *layoutName = NULL, *engines = NULL, *renderView = NULL, *pickViewAction, *eventsManager, *disabledLevels, *templatesBefore, *templatesAfter, *templateBefore = NULL, *templateAfter = NULL, *cache = NULL, *_0, *_1 = NULL, *_4, *_5 = NULL, *_6, *_7, **_10, *_11 = NULL, **_15, *_16 = NULL, *_17 = NULL, *_18 = NULL; + zval *controllerName_param = NULL, *actionName_param = NULL, *params = NULL, *layoutsDir, *layout, *pickView, *layoutName = NULL, *engines = NULL, *renderView = NULL, *pickViewAction, *eventsManager = NULL, *disabledLevels, *templatesBefore, *templatesAfter, *templateBefore = NULL, *templateAfter = NULL, *cache = NULL, *_0, *_1 = NULL, *_4, *_5, *_6 = NULL, *_7, **_10, *_11 = NULL, **_15, *_16 = NULL, *_17, *_18 = NULL, *_19 = NULL; zval *controllerName = NULL, *actionName = NULL, *_3; ZEPHIR_MM_GROW(); @@ -1202,7 +1206,7 @@ PHP_METHOD(Phalcon_Mvc_View, render) { ZEPHIR_CPY_WRT(renderView, _3); } else { ZEPHIR_OBS_VAR(renderView); - zephir_array_fetch_long(&renderView, pickView, 0, PH_NOISY, "phalcon/mvc/view.zep", 837 TSRMLS_CC); + zephir_array_fetch_long(&renderView, pickView, 0, PH_NOISY, "phalcon/mvc/view.zep", 839 TSRMLS_CC); ZEPHIR_OBS_VAR(pickViewAction); if (zephir_array_isset_long_fetch(&pickViewAction, pickView, 1, 0 TSRMLS_CC)) { ZEPHIR_CPY_WRT(layoutName, pickViewAction); @@ -1216,15 +1220,15 @@ PHP_METHOD(Phalcon_Mvc_View, render) { ZEPHIR_INIT_NVAR(cache); ZVAL_NULL(cache); } - ZEPHIR_OBS_VAR(eventsManager); - zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + _5 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); + ZEPHIR_CPY_WRT(eventsManager, _5); zephir_create_symbol_table(TSRMLS_C); if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_5); - ZVAL_STRING(_5, "view:beforeRender", 0); - ZEPHIR_CALL_METHOD(&_1, eventsManager, "fire", NULL, _5, this_ptr); - zephir_check_temp_parameter(_5); + ZEPHIR_INIT_VAR(_6); + ZVAL_STRING(_6, "view:beforeRender", 0); + ZEPHIR_CALL_METHOD(&_1, eventsManager, "fire", NULL, _6, this_ptr); + zephir_check_temp_parameter(_6); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(_1)) { RETURN_MM_BOOL(0); @@ -1237,29 +1241,29 @@ PHP_METHOD(Phalcon_Mvc_View, render) { silence = 1; ZEPHIR_OBS_VAR(disabledLevels); zephir_read_property_this(&disabledLevels, this_ptr, SL("_disabledLevels"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(_6); - zephir_read_property_this(&_6, this_ptr, SL("_renderLevel"), PH_NOISY_CC); - renderLevel = zephir_get_intval(_6); + ZEPHIR_OBS_VAR(_7); + zephir_read_property_this(&_7, this_ptr, SL("_renderLevel"), PH_NOISY_CC); + renderLevel = zephir_get_intval(_7); if (renderLevel) { if (renderLevel >= 1) { if (!(zephir_array_isset_long(disabledLevels, 1))) { - ZEPHIR_INIT_ZVAL_NREF(_7); - ZVAL_LONG(_7, 1); - zephir_update_property_this(this_ptr, SL("_currentRenderLevel"), _7 TSRMLS_CC); + ZEPHIR_INIT_ZVAL_NREF(_5); + ZVAL_LONG(_5, 1); + zephir_update_property_this(this_ptr, SL("_currentRenderLevel"), _5 TSRMLS_CC); ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", NULL, engines, renderView, (silence ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false)), (mustClean ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false)), cache); zephir_check_call_status(); } } if (renderLevel >= 2) { if (!(zephir_array_isset_long(disabledLevels, 2))) { - ZEPHIR_INIT_ZVAL_NREF(_7); - ZVAL_LONG(_7, 2); - zephir_update_property_this(this_ptr, SL("_currentRenderLevel"), _7 TSRMLS_CC); + ZEPHIR_INIT_ZVAL_NREF(_5); + ZVAL_LONG(_5, 2); + zephir_update_property_this(this_ptr, SL("_currentRenderLevel"), _5 TSRMLS_CC); ZEPHIR_OBS_VAR(templatesBefore); zephir_read_property_this(&templatesBefore, this_ptr, SL("_templatesBefore"), PH_NOISY_CC); if (Z_TYPE_P(templatesBefore) == IS_ARRAY) { silence = 0; - zephir_is_iterable(templatesBefore, &_9, &_8, 0, 0, "phalcon/mvc/view.zep", 913); + zephir_is_iterable(templatesBefore, &_9, &_8, 0, 0, "phalcon/mvc/view.zep", 915); for ( ; zephir_hash_get_current_data_ex(_9, (void**) &_10, &_8) == SUCCESS ; zephir_hash_move_forward_ex(_9, &_8) @@ -1276,9 +1280,9 @@ PHP_METHOD(Phalcon_Mvc_View, render) { } if (renderLevel >= 3) { if (!(zephir_array_isset_long(disabledLevels, 3))) { - ZEPHIR_INIT_ZVAL_NREF(_7); - ZVAL_LONG(_7, 3); - zephir_update_property_this(this_ptr, SL("_currentRenderLevel"), _7 TSRMLS_CC); + ZEPHIR_INIT_ZVAL_NREF(_5); + ZVAL_LONG(_5, 3); + zephir_update_property_this(this_ptr, SL("_currentRenderLevel"), _5 TSRMLS_CC); ZEPHIR_INIT_LNVAR(_11); ZEPHIR_CONCAT_VV(_11, layoutsDir, layoutName); ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", &_12, engines, _11, (silence ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false)), (mustClean ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false)), cache); @@ -1287,14 +1291,14 @@ PHP_METHOD(Phalcon_Mvc_View, render) { } if (renderLevel >= 4) { if (!(zephir_array_isset_long(disabledLevels, 4))) { - ZEPHIR_INIT_ZVAL_NREF(_7); - ZVAL_LONG(_7, 4); - zephir_update_property_this(this_ptr, SL("_currentRenderLevel"), _7 TSRMLS_CC); + ZEPHIR_INIT_ZVAL_NREF(_5); + ZVAL_LONG(_5, 4); + zephir_update_property_this(this_ptr, SL("_currentRenderLevel"), _5 TSRMLS_CC); ZEPHIR_OBS_VAR(templatesAfter); zephir_read_property_this(&templatesAfter, this_ptr, SL("_templatesAfter"), PH_NOISY_CC); if (Z_TYPE_P(templatesAfter) == IS_ARRAY) { silence = 0; - zephir_is_iterable(templatesAfter, &_14, &_13, 0, 0, "phalcon/mvc/view.zep", 944); + zephir_is_iterable(templatesAfter, &_14, &_13, 0, 0, "phalcon/mvc/view.zep", 946); for ( ; zephir_hash_get_current_data_ex(_14, (void**) &_15, &_13) == SUCCESS ; zephir_hash_move_forward_ex(_14, &_13) @@ -1311,24 +1315,24 @@ PHP_METHOD(Phalcon_Mvc_View, render) { } if (renderLevel >= 5) { if (!(zephir_array_isset_long(disabledLevels, 5))) { - ZEPHIR_INIT_ZVAL_NREF(_7); - ZVAL_LONG(_7, 5); - zephir_update_property_this(this_ptr, SL("_currentRenderLevel"), _7 TSRMLS_CC); - _7 = zephir_fetch_nproperty_this(this_ptr, SL("_mainView"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", &_12, engines, _7, (silence ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false)), (mustClean ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false)), cache); + ZEPHIR_INIT_ZVAL_NREF(_5); + ZVAL_LONG(_5, 5); + zephir_update_property_this(this_ptr, SL("_currentRenderLevel"), _5 TSRMLS_CC); + _5 = zephir_fetch_nproperty_this(this_ptr, SL("_mainView"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", &_12, engines, _5, (silence ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false)), (mustClean ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false)), cache); zephir_check_call_status(); } } - ZEPHIR_INIT_ZVAL_NREF(_7); - ZVAL_LONG(_7, 0); - zephir_update_property_this(this_ptr, SL("_currentRenderLevel"), _7 TSRMLS_CC); + ZEPHIR_INIT_ZVAL_NREF(_17); + ZVAL_LONG(_17, 0); + zephir_update_property_this(this_ptr, SL("_currentRenderLevel"), _17 TSRMLS_CC); if (Z_TYPE_P(cache) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&_17, cache, "isstarted", NULL); + ZEPHIR_CALL_METHOD(&_18, cache, "isstarted", NULL); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE(_17)) { - ZEPHIR_CALL_METHOD(&_18, cache, "isfresh", NULL); + if (ZEPHIR_IS_TRUE(_18)) { + ZEPHIR_CALL_METHOD(&_19, cache, "isfresh", NULL); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE(_18)) { + if (ZEPHIR_IS_TRUE(_19)) { ZEPHIR_CALL_METHOD(NULL, cache, "save", NULL); zephir_check_call_status(); } else { @@ -1342,10 +1346,10 @@ PHP_METHOD(Phalcon_Mvc_View, render) { } } if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(_5); - ZVAL_STRING(_5, "view:afterRender", 0); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, _5, this_ptr); - zephir_check_temp_parameter(_5); + ZEPHIR_INIT_NVAR(_6); + ZVAL_STRING(_6, "view:afterRender", 0); + ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, _6, this_ptr); + zephir_check_temp_parameter(_6); zephir_check_call_status(); } RETURN_THIS(); @@ -1387,17 +1391,17 @@ PHP_METHOD(Phalcon_Mvc_View, pick) { } else { ZEPHIR_INIT_VAR(layout); ZVAL_NULL(layout); - if (zephir_memnstr_str(renderView, SL("/"), "phalcon/mvc/view.zep", 1017)) { + if (zephir_memnstr_str(renderView, SL("/"), "phalcon/mvc/view.zep", 1019)) { ZEPHIR_INIT_VAR(parts); zephir_fast_explode_str(parts, SL("/"), renderView, LONG_MAX TSRMLS_CC); ZEPHIR_OBS_NVAR(layout); - zephir_array_fetch_long(&layout, parts, 0, PH_NOISY, "phalcon/mvc/view.zep", 1018 TSRMLS_CC); + zephir_array_fetch_long(&layout, parts, 0, PH_NOISY, "phalcon/mvc/view.zep", 1020 TSRMLS_CC); } ZEPHIR_INIT_VAR(pickView); array_init_size(pickView, 2); zephir_array_fast_append(pickView, renderView); if (Z_TYPE_P(layout) != IS_NULL) { - zephir_array_append(&pickView, layout, PH_SEPARATE, "phalcon/mvc/view.zep", 1023); + zephir_array_append(&pickView, layout, PH_SEPARATE, "phalcon/mvc/view.zep", 1025); } } zephir_update_property_this(this_ptr, SL("_pickView"), pickView TSRMLS_CC); @@ -1594,7 +1598,7 @@ PHP_METHOD(Phalcon_Mvc_View, _createCache) { _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); ZEPHIR_CPY_WRT(dependencyInjector, _0); if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "A dependency injector container is required to obtain the view cache services", "phalcon/mvc/view.zep", 1175); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "A dependency injector container is required to obtain the view cache services", "phalcon/mvc/view.zep", 1177); return; } ZEPHIR_INIT_VAR(cacheService); @@ -1606,7 +1610,7 @@ PHP_METHOD(Phalcon_Mvc_View, _createCache) { if (zephir_array_isset_string_fetch(&cacheOptions, viewOptions, SS("cache"), 0 TSRMLS_CC)) { if (zephir_array_isset_string(cacheOptions, SS("service"))) { ZEPHIR_OBS_NVAR(cacheService); - zephir_array_fetch_string(&cacheService, cacheOptions, SL("service"), PH_NOISY, "phalcon/mvc/view.zep", 1184 TSRMLS_CC); + zephir_array_fetch_string(&cacheService, cacheOptions, SL("service"), PH_NOISY, "phalcon/mvc/view.zep", 1186 TSRMLS_CC); } } } @@ -1614,7 +1618,7 @@ PHP_METHOD(Phalcon_Mvc_View, _createCache) { zephir_check_call_status(); ZEPHIR_CPY_WRT(viewCache, _1); if (Z_TYPE_P(viewCache) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "The injected caching service is invalid", "phalcon/mvc/view.zep", 1194); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "The injected caching service is invalid", "phalcon/mvc/view.zep", 1196); return; } RETURN_CCTOR(viewCache); @@ -1701,7 +1705,7 @@ PHP_METHOD(Phalcon_Mvc_View, cache) { ZEPHIR_INIT_NVAR(cacheOptions); array_init(cacheOptions); } - zephir_is_iterable(options, &_1, &_0, 0, 0, "phalcon/mvc/view.zep", 1266); + zephir_is_iterable(options, &_1, &_0, 0, 0, "phalcon/mvc/view.zep", 1268); for ( ; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS ; zephir_hash_move_forward_ex(_1, &_0) diff --git a/ext/phalcon/mvc/view.zep.h b/ext/phalcon/mvc/view.zep.h index 146aff51a6c..80434bdbcd6 100644 --- a/ext/phalcon/mvc/view.zep.h +++ b/ext/phalcon/mvc/view.zep.h @@ -105,7 +105,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_setparamtoview, 0, 0, 2) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_setvars, 0, 0, 1) - ZEND_ARG_INFO(0, params) + ZEND_ARG_ARRAY_INFO(0, params, 0) ZEND_ARG_INFO(0, merge) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/view/engine/volt.zep.c b/ext/phalcon/mvc/view/engine/volt.zep.c index 23ff05ec2f3..41a93672c3e 100644 --- a/ext/phalcon/mvc/view/engine/volt.zep.c +++ b/ext/phalcon/mvc/view/engine/volt.zep.c @@ -469,7 +469,8 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, sort) { ZEPHIR_CALL_FUNCTION(NULL, "asort", &_0, value); Z_UNSET_ISREF_P(value); zephir_check_call_status(); - RETURN_CCTOR(value); + RETVAL_ZVAL(value, 1, 0); + RETURN_MM(); } diff --git a/ext/phalcon/mvc/view/engine/volt/compiler.zep.c b/ext/phalcon/mvc/view/engine/volt/compiler.zep.c index 7df318ffc7a..0f9326e5c48 100644 --- a/ext/phalcon/mvc/view/engine/volt/compiler.zep.c +++ b/ext/phalcon/mvc/view/engine/volt/compiler.zep.c @@ -1611,7 +1611,8 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, _statementListOrExtends) { if (Z_TYPE_P(statements) != IS_ARRAY) { - RETURN_CCTOR(statements); + RETVAL_ZVAL(statements, 1, 0); + RETURN_MM(); } isStatementList = 1; if (!(zephir_array_isset_string(statements, SS("type")))) { @@ -1632,7 +1633,8 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, _statementListOrExtends) { zephir_check_call_status(); RETURN_MM(); } - RETURN_CCTOR(statements); + RETVAL_ZVAL(statements, 1, 0); + RETURN_MM(); } diff --git a/ext/phalcon/session/adapter.zep.c b/ext/phalcon/session/adapter.zep.c index e95ff6e5a5e..744677077e8 100644 --- a/ext/phalcon/session/adapter.zep.c +++ b/ext/phalcon/session/adapter.zep.c @@ -188,7 +188,8 @@ PHP_METHOD(Phalcon_Session_Adapter, get) { RETURN_CCTOR(value); } } - RETURN_CCTOR(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } diff --git a/ext/phalcon/session/bag.zep.c b/ext/phalcon/session/bag.zep.c index f8f889ee4f7..5abd817e9e1 100644 --- a/ext/phalcon/session/bag.zep.c +++ b/ext/phalcon/session/bag.zep.c @@ -299,7 +299,8 @@ PHP_METHOD(Phalcon_Session_Bag, get) { if (zephir_array_isset_fetch(&value, _1, property, 1 TSRMLS_CC)) { RETURN_CTOR(value); } - RETURN_CCTOR(defaultValue); + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } diff --git a/ext/php_phalcon.h b/ext/php_phalcon.h index bf259f327a4..b37c06a66d9 100644 --- a/ext/php_phalcon.h +++ b/ext/php_phalcon.h @@ -12,7 +12,7 @@ #define PHP_PHALCON_VERSION "2.0.0a" #define PHP_PHALCON_EXTNAME "phalcon" #define PHP_PHALCON_AUTHOR "Phalcon Team" -#define PHP_PHALCON_ZEPVERSION "0.4.5a" +#define PHP_PHALCON_ZEPVERSION "0.4.6a" #define PHP_PHALCON_DESCRIPTION "" typedef struct _zephir_struct_db { diff --git a/phalcon/cache/backend.zep b/phalcon/cache/backend.zep index d8b503a1866..fb3b7975e1e 100644 --- a/phalcon/cache/backend.zep +++ b/phalcon/cache/backend.zep @@ -19,6 +19,8 @@ namespace Phalcon\Cache; +use Phalcon\Cache\FrontendInterface; + /** * Phalcon\Cache\Backend * @@ -27,13 +29,13 @@ namespace Phalcon\Cache; abstract class Backend { - protected _frontend {get, set}; + protected _frontend { get, set }; - protected _options {get, set}; + protected _options { get, set }; protected _prefix = ""; - protected _lastKey = "" {get, set}; + protected _lastKey = "" { get, set }; protected _lastLifetime = null; @@ -47,7 +49,7 @@ abstract class Backend * @param Phalcon\Cache\FrontendInterface frontend * @param array options */ - public function __construct(<\Phalcon\Cache\FrontendInterface> frontend, options=null) + public function __construct( frontend, options = null) { var prefix; @@ -65,7 +67,7 @@ abstract class Backend /** * Starts a cache. The keyname allows to identify the created fragment * - * @param int|string keyName + * @param int|string keyName * @param long lifetime * @return mixed */ @@ -102,7 +104,7 @@ abstract class Backend * * @param boolean stopBuffer */ - public function stop(boolean stopBuffer = true) + public function stop(boolean stopBuffer = true) -> void { if stopBuffer === true { this->_frontend->stop(); diff --git a/phalcon/cache/frontend/igbinary.zep b/phalcon/cache/frontend/igbinary.zep index 441e38fbfe8..14e56db754c 100644 --- a/phalcon/cache/frontend/igbinary.zep +++ b/phalcon/cache/frontend/igbinary.zep @@ -20,6 +20,9 @@ namespace Phalcon\Cache\Frontend; +use Phalcon\Cache\Frontend\Data; +use Phalcon\Cache\FrontendInterface; + /** * Phalcon\Cache\Frontend\Igbinary * @@ -58,7 +61,7 @@ namespace Phalcon\Cache\Frontend; * } * */ -class Igbinary extends \Phalcon\Cache\Frontend\Data implements \Phalcon\Cache\FrontendInterface +class Igbinary extends Data implements FrontendInterface { /** @@ -66,7 +69,7 @@ class Igbinary extends \Phalcon\Cache\Frontend\Data implements \Phalcon\Cache\Fr * * @param array frontendOptions */ - public function __construct(frontendOptions=null) + public function __construct(frontendOptions = null) { let this->_frontendOptions = frontendOptions; } @@ -93,7 +96,7 @@ class Igbinary extends \Phalcon\Cache\Frontend\Data implements \Phalcon\Cache\Fr * * @return boolean */ - public function isBuffering() + public function isBuffering() -> boolean { return false; } @@ -111,7 +114,8 @@ class Igbinary extends \Phalcon\Cache\Frontend\Data implements \Phalcon\Cache\Fr * * @return string */ - public function getContent(){ + public function getContent() + { return null; } @@ -129,7 +133,7 @@ class Igbinary extends \Phalcon\Cache\Frontend\Data implements \Phalcon\Cache\Fr * @param mixed data * @return string */ - public function beforeStore(data) + public function beforeStore(data) -> string { return igbinary_serialize(data); } @@ -140,7 +144,7 @@ class Igbinary extends \Phalcon\Cache\Frontend\Data implements \Phalcon\Cache\Fr * @param mixed data * @return mixed */ - public function afterRetrieve(data) + public function afterRetrieve(data) -> string { return igbinary_unserialize(data); } diff --git a/phalcon/cache/frontend/json.zep b/phalcon/cache/frontend/json.zep index e15ee8117f3..8a0621e8825 100644 --- a/phalcon/cache/frontend/json.zep +++ b/phalcon/cache/frontend/json.zep @@ -19,6 +19,8 @@ namespace Phalcon\Cache\Frontend; +use Phalcon\Cache\FrontendInterface; + /** * Phalcon\Cache\Frontend\Json * @@ -51,7 +53,7 @@ namespace Phalcon\Cache\Frontend; * $data = $cache->get('my-data'); * */ -class Json implements \Phalcon\Cache\FrontendInterface +class Json implements FrontendInterface { protected _frontendOptions; @@ -61,7 +63,7 @@ class Json implements \Phalcon\Cache\FrontendInterface * * @param array frontendOptions */ - public function __construct(frontendOptions=null) + public function __construct(frontendOptions = null) { let this->_frontendOptions = frontendOptions; } @@ -88,7 +90,7 @@ class Json implements \Phalcon\Cache\FrontendInterface * * @return boolean */ - public function isBuffering() + public function isBuffering() -> boolean { return false; } @@ -106,7 +108,8 @@ class Json implements \Phalcon\Cache\FrontendInterface * * @return string */ - public function getContent(){ + public function getContent() + { return null; } @@ -124,7 +127,7 @@ class Json implements \Phalcon\Cache\FrontendInterface * @param mixed data * @return string */ - public function beforeStore(data) + public function beforeStore(data) -> string { return json_encode(data); } diff --git a/phalcon/cache/frontend/output.zep b/phalcon/cache/frontend/output.zep index e75516a1ee3..a923d3b66e9 100644 --- a/phalcon/cache/frontend/output.zep +++ b/phalcon/cache/frontend/output.zep @@ -19,6 +19,8 @@ namespace Phalcon\Cache\Frontend; +use Phalcon\Cache\FrontendInterface; + /** * Phalcon\Cache\Frontend\Output * @@ -67,7 +69,7 @@ namespace Phalcon\Cache\Frontend; * } * */ -class Output implements \Phalcon\Cache\FrontendInterface +class Output implements FrontendInterface { protected _buffering = false; @@ -79,7 +81,7 @@ class Output implements \Phalcon\Cache\FrontendInterface * * @param array frontendOptions */ - public function __construct(frontendOptions=null) + public function __construct(frontendOptions = null) { let this->_frontendOptions = frontendOptions; } @@ -106,15 +108,15 @@ class Output implements \Phalcon\Cache\FrontendInterface * * @return boolean */ - public function isBuffering() + public function isBuffering() -> boolean { return this->_buffering; } /** - * Starts output frontend. Actually, does nothing + * Starts output frontend. Currently, does nothing */ - public function start() + public function start() -> void { let this->_buffering = true; ob_start(); @@ -138,14 +140,13 @@ class Output implements \Phalcon\Cache\FrontendInterface /** * Stops output frontend */ - public function stop() + public function stop() -> void { if this->_buffering { - return ob_end_clean(); + ob_end_clean(); } let this->_buffering = false; - return null; } /** diff --git a/phalcon/debug.zep b/phalcon/debug.zep index 9d77af4a8d5..66e0675c502 100644 --- a/phalcon/debug.zep +++ b/phalcon/debug.zep @@ -98,7 +98,7 @@ class Debug * @param boolean lowSeverity * @return Phalcon\Debug */ - public function listen(exceptions=true, lowSeverity=false) -> + public function listen(exceptions = true, lowSeverity = false) -> { if exceptions { this->listenExceptions(); @@ -372,11 +372,11 @@ class Debug { var space, twoSpaces, underscore, minus, className, namespaceSeparator, - prepareInternalClass, preparedFunctionName, html, classReflection, prepareUriClass, - functionName, functionReflection, traceArgs, arguments, argument, - filez, line, showFiles, lines, numberLines, showFileFragment, - beforeLine, firstLine, afterLine, lastLine, commentPattern, utf8, entCompat, tab, - comment, i, linePosition, currentLine; + prepareInternalClass, preparedFunctionName, html, classReflection, prepareUriClass, + functionName, functionReflection, traceArgs, arguments, argument, + filez, line, showFiles, lines, numberLines, showFileFragment, + beforeLine, firstLine, afterLine, lastLine, commentPattern, utf8, entCompat, tab, + comment, i, linePosition, currentLine; let space = " "; let twoSpaces = " "; diff --git a/phalcon/di/service.zep b/phalcon/di/service.zep index 3141fe7e266..9637ac3b9a6 100644 --- a/phalcon/di/service.zep +++ b/phalcon/di/service.zep @@ -20,6 +20,7 @@ namespace Phalcon\Di; use Phalcon\Di\Exception; +use Phalcon\Di\ServiceInterface; /** * Phalcon\Di\Service @@ -32,7 +33,7 @@ use Phalcon\Di\Exception; * * */ -class Service implements \Phalcon\Di\ServiceInterface +class Service implements ServiceInterface { protected _name; @@ -52,7 +53,7 @@ class Service implements \Phalcon\Di\ServiceInterface * @param mixed definition * @param boolean shared */ - public function __construct(string! name, definition, boolean shared=false) + public final function __construct(string! name, definition, boolean shared = false) { let this->_name = name, this->_definition = definition, @@ -126,7 +127,7 @@ class Service implements \Phalcon\Di\ServiceInterface * @param Phalcon\DiInterface dependencyInjector * @return mixed */ - public function resolve(parameters=null, <\Phalcon\DiInterface> dependencyInjector=null) + public function resolve(parameters = null, <\Phalcon\DiInterface> dependencyInjector = null) { boolean found; @@ -283,7 +284,7 @@ class Service implements \Phalcon\Di\ServiceInterface * * @return bool */ - public function isResolved() + public function isResolved() -> boolean { return this->_resolved; } @@ -294,7 +295,7 @@ class Service implements \Phalcon\Di\ServiceInterface * @param array attributes * @return Phalcon\Di\Service */ - public static function __set_state(array! attributes) -> <\Phalcon\Di\Service> + public static function __set_state(array! attributes) -> { var name, definition, shared; diff --git a/phalcon/http/response.zep b/phalcon/http/response.zep index 19cd831540b..ff5d2894bc9 100644 --- a/phalcon/http/response.zep +++ b/phalcon/http/response.zep @@ -19,6 +19,13 @@ namespace Phalcon\Http; +use Phalcon\Http\ResponseInterface; +use Phalcon\Http\Response\Exception; +use Phalcon\Http\Response\HeadersInterface; +use Phalcon\Http\Response\CookiesInterface; +use Phalcon\Mvc\UrlInterface; +use Phalcon\Http\Response\Headers; + /** * Phalcon\Http\Response * @@ -33,7 +40,7 @@ namespace Phalcon\Http; * $response->send(); * */ -class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\InjectionAwareInterface +class Response implements ResponseInterface, \Phalcon\Di\InjectionAwareInterface { protected _sent = false; @@ -55,7 +62,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * @param int code * @param string status */ - public function __construct(content=null, code=null, status=null) + public function __construct(content = null, code = null, status = null) { if content !== null { let this->_content = content; @@ -87,7 +94,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection if typeof dependencyInjector != "object" { let dependencyInjector = \Phalcon\Di::getDefault(); if typeof dependencyInjector != "object" { - throw new \Phalcon\Http\Request\Exception("A dependency injection object is required to access the 'url' service"); + throw new Exception("A dependency injection object is required to access the 'url' service"); } let this->_dependencyInjector = dependencyInjector; } @@ -105,7 +112,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * @param string message * @return Phalcon\Http\ResponseInterface */ - public function setStatusCode(int code, string message) -> <\Phalcon\Http\ResponseInterface> + public function setStatusCode(int code, string message) -> { var headers, currentHeadersRaw, key, value; @@ -142,7 +149,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * @param Phalcon\Http\Response\HeadersInterface headers * @return Phalcon\Http\ResponseInterface */ - public function setHeaders(headers) + public function setHeaders( headers) -> { let this->_headers = headers; return this; @@ -153,7 +160,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * * @return Phalcon\Http\Response\HeadersInterface */ - public function getHeaders() -> <\Phalcon\Http\Response\HeadersInterface> + public function getHeaders() -> { var headers; let headers = this->_headers; @@ -161,7 +168,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection /** * A Phalcon\Http\Response\Headers bag is temporary used to manage the headers before sent them to the client */ - let headers = new \Phalcon\Http\Response\Headers(), + let headers = new Headers(), this->_headers = headers; } return headers; @@ -173,11 +180,8 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * @param Phalcon\Http\Response\CookiesInterface cookies * @return Phalcon\Http\ResponseInterface */ - public function setCookies(<\Phalcon\Http\Response\CookiesInterface> cookies) -> <\Phalcon\Http\ResponseInterface> + public function setCookies( cookies) -> { - if typeof cookies != "object" { - throw new \Phalcon\Http\Response\Exception("The cookies bag is not valid"); - } let this->_cookies = cookies; return this; } @@ -187,7 +191,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * * @return Phalcon\Http\Response\CookiesInterface */ - public function getCookies() -> <\Phalcon\Http\Response\CookiesInterface> + public function getCookies() -> { return this->_cookies; } @@ -203,7 +207,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * @param string value * @return Phalcon\Http\ResponseInterface */ - public function setHeader(string name, value) -> <\Phalcon\Http\ResponseInterface> + public function setHeader(string name, value) -> { var headers; let headers = this->getHeaders(); @@ -221,7 +225,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * @param string header * @return Phalcon\Http\ResponseInterface */ - public function setRawHeader(string header) -> <\Phalcon\Http\ResponseInterface> + public function setRawHeader(string header) -> { var headers; let headers = this->getHeaders(); @@ -234,7 +238,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * * @return Phalcon\Http\ResponseInterface */ - public function resetHeaders() -> <\Phalcon\Http\ResponseInterface> + public function resetHeaders() -> { var headers; let headers = this->getHeaders(); @@ -252,7 +256,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * @param DateTime datetime * @return Phalcon\Http\ResponseInterface */ - public function setExpires(<\DateTime> datetime) -> <\Phalcon\Http\ResponseInterface> + public function setExpires(<\DateTime> datetime) -> { var headers, date; @@ -277,7 +281,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * * @return Phalcon\Http\ResponseInterface */ - public function setNotModified() -> <\Phalcon\Http\ResponseInterface> + public function setNotModified() -> { this->setStatusCode(304, "Not modified"); return this; @@ -295,7 +299,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * @param string charset * @return Phalcon\Http\ResponseInterface */ - public function setContentType(string contentType, charset=null) -> <\Phalcon\Http\ResponseInterface> + public function setContentType(string contentType, charset=null) -> { var headers, name; let headers = this->getHeaders(); @@ -318,7 +322,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * @param string etag * @return Phalcon\Http\ResponseInterface */ - public function setEtag(string etag) -> <\Phalcon\Http\ResponseInterface> + public function setEtag(string etag) -> { var headers; let headers = this->getHeaders(); @@ -348,7 +352,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * @param int statusCode * @return Phalcon\Http\ResponseInterface */ - public function redirect(location=null, externalRedirect=false, int statusCode=302) -> <\Phalcon\Http\ResponseInterface> + public function redirect(location = null, externalRedirect = false, int statusCode = 302) -> { var header, url, dependencyInjector, messages, matched, message; @@ -385,18 +389,17 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection if !header { let dependencyInjector = this->getDI(), - url = <\Phalcon\Mvc\UrlInterface> dependencyInjector->getShared("url"), - header = url->get(location); + url = dependencyInjector->getShared("url"), + header = url->get(location); } /** * The HTTP status is 302 by default, a temporary redirection */ if statusCode < 300 || statusCode > 308 { - let statusCode = 302, - message = "Redirect"; + let statusCode = 302, message = "Redirect"; } else { - let message = messages[statusCode]; + fetch message, messages[statusCode]; } this->setStatusCode(statusCode, message); @@ -419,7 +422,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * @param string content * @return Phalcon\Http\ResponseInterface */ - public function setContent(string content) -> <\Phalcon\Http\ResponseInterface> + public function setContent(string content) -> { let this->_content = content; return this; @@ -436,7 +439,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * @param int jsonOptions * @return Phalcon\Http\ResponseInterface */ - public function setJsonContent(var content, jsonOptions=0) -> <\Phalcon\Http\ResponseInterface> + public function setJsonContent(var content, jsonOptions = 0) -> { let this->_content = json_encode(content, jsonOptions); return this; @@ -448,7 +451,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * @param string content * @return Phalcon\Http\ResponseInterface */ - public function appendContent(content) -> <\Phalcon\Http\ResponseInterface> + public function appendContent(content) -> { let this->_content = this->getContent() . content; return this; @@ -479,7 +482,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * * @return Phalcon\Http\ResponseInterface */ - public function sendHeaders() -> <\Phalcon\Http\ResponseInterface> + public function sendHeaders() -> { var headers; let headers = this->_headers; @@ -494,7 +497,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * * @return Phalcon\Http\ResponseInterface */ - public function sendCookies() -> <\Phalcon\Http\ResponseInterface> + public function sendCookies() -> { var cookies; let cookies = this->_cookies; @@ -509,12 +512,12 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * * @return Phalcon\Http\ResponseInterface */ - public function send() -> <\Phalcon\Http\ResponseInterface> + public function send() -> { var headers, cookies, content, file; if this->_sent { - throw new \Phalcon\Http\Response\Exception("Response was already sent"); + throw new Exception("Response was already sent"); } /** @@ -558,7 +561,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection * @param string attachmentName * @return Phalcon\Http\ResponseInterface */ - public function setFileToSend(string filePath, attachmentName=null, attachment=true) -> <\Phalcon\Http\ResponseInterface> + public function setFileToSend(string filePath, attachmentName = null, attachment = true) -> { var basePath, headers; @@ -574,7 +577,7 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection headers->setRaw("Content-Description: File Transfer"); headers->setRaw("Content-Type: application/octet-stream"); headers->setRaw("Content-Disposition: attachment; filename=" . basePath); - headers->setRaw("Content-Transfer-Encoding: binary"); + headers->setRaw("Content-Transfer-Encoding: binary"); } let this->_file = filePath; diff --git a/phalcon/mvc/view.zep b/phalcon/mvc/view.zep index f4f50389572..ee8e577f967 100644 --- a/phalcon/mvc/view.zep +++ b/phalcon/mvc/view.zep @@ -19,9 +19,12 @@ namespace Phalcon\Mvc; +use Phalcon\Di\Injectable; use Phalcon\Mvc\View\Exception; - +use Phalcon\Mvc\ViewInterface; use Phalcon\Cache\BackendInterface; +use Phalcon\Events\ManagerInterface; +use Phalcon\Mvc\View\Engine\Php as PhpEngine; /** * Phalcon\Mvc\View @@ -44,7 +47,7 @@ use Phalcon\Cache\BackendInterface; * echo $view->getContent(); * */ -class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface +class View extends Injectable implements ViewInterface { /** @@ -142,7 +145,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * * @param array options */ - public function __construct(options=null) + public function __construct(options = null) { if typeof options == "array" { let this->_options = options; @@ -155,7 +158,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param string viewsDir * @return Phalcon\Mvc\View */ - public function setViewsDir(string viewsDir) + public function setViewsDir(string viewsDir) -> { let this->_viewsDir = viewsDir; return this; @@ -181,7 +184,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param string layoutsDir * @return Phalcon\Mvc\View */ - public function setLayoutsDir(string layoutsDir) -> <\Phalcon\Mvc\View> + public function setLayoutsDir(string layoutsDir) -> { let this->_layoutsDir = layoutsDir; return this; @@ -207,7 +210,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param string partialsDir * @return Phalcon\Mvc\View */ - public function setPartialsDir(string partialsDir) -> <\Phalcon\Mvc\View> + public function setPartialsDir(string partialsDir) -> { let this->_partialsDir = partialsDir; return this; @@ -233,7 +236,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param string basePath * @return Phalcon\Mvc\View */ - public function setBasePath(string basePath) -> <\Phalcon\Mvc\View> + public function setBasePath(string basePath) -> { let this->_basePath = basePath; return this; @@ -250,7 +253,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param int level * @return Phalcon\Mvc\View */ - public function setRenderLevel(int level) -> <\Phalcon\Mvc\View> + public function setRenderLevel(int level) -> { let this->_renderLevel = level; return this; @@ -267,7 +270,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param int|array level * @return Phalcon\Mvc\View */ - public function disableLevel(level) -> <\Phalcon\Mvc\View> + public function disableLevel(var level) -> { if typeof level == "array" { let this->_disabledLevels = level; @@ -288,7 +291,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param string viewPath * @return Phalcon\Mvc\View */ - public function setMainView(string viewPath) -> <\Phalcon\Mvc\View> + public function setMainView(string viewPath) -> { let this->_mainView = viewPath; return this; @@ -314,7 +317,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param string layout * @return Phalcon\Mvc\View */ - public function setLayout(string layout) -> <\Phalcon\Mvc\View> + public function setLayout(string layout) -> { let this->_layout = layout; return this; @@ -336,7 +339,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param string|array templateBefore * @return Phalcon\Mvc\View */ - public function setTemplateBefore(templateBefore) -> <\Phalcon\Mvc\View> + public function setTemplateBefore(var templateBefore) -> { if typeof templateBefore != "array" { let this->_templatesBefore = [templateBefore]; @@ -351,7 +354,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * * @return Phalcon\Mvc\View */ - public function cleanTemplateBefore() -> <\Phalcon\Mvc\View> + public function cleanTemplateBefore() -> { let this->_templatesBefore = null; return this; @@ -363,7 +366,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param string|array templateAfter * @return Phalcon\Mvc\View */ - public function setTemplateAfter(templateAfter) -> <\Phalcon\Mvc\View> + public function setTemplateAfter(var templateAfter) -> { if typeof templateAfter != "array" { let this->_templatesAfter = [templateAfter]; @@ -378,7 +381,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * * @return Phalcon\Mvc\View */ - public function cleanTemplateAfter() -> <\Phalcon\Mvc\View> + public function cleanTemplateAfter() -> { let this->_templatesAfter = null; return this; @@ -395,7 +398,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param mixed value * @return Phalcon\Mvc\View */ - public function setParamToView(string! key, value) -> <\Phalcon\Mvc\View> + public function setParamToView(string! key, value) -> { let this->_viewParams[key] = value; return this; @@ -412,14 +415,10 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param boolean merge * @return Phalcon\Mvc\View */ - public function setVars(params, boolean merge=true) -> <\Phalcon\Mvc\View> + public function setVars(array! params, boolean merge = true) -> { var viewParams; - if typeof params != "array" { - throw new Exception("The render parameters must be an array"); - } - if merge { let viewParams = this->_viewParams; if typeof viewParams == "array" { @@ -445,7 +444,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param mixed value * @return Phalcon\Mvc\View */ - public function setVar(string! key, value) -> <\Phalcon\Mvc\View> + public function setVar(string! key, value) -> { let this->_viewParams[key] = value; return this; @@ -545,7 +544,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface /** * We use Phalcon\Mvc\View\Engine\Php as default */ - let engines[".phtml"] = new \Phalcon\Mvc\View\Engine\Php(this, dependencyInjector); + let engines[".phtml"] = new PhpEngine(this, dependencyInjector); } else { if typeof dependencyInjector != "object" { @@ -613,6 +612,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface cacheLevel = (int) this->_cacheLevel; if renderLevel >= cacheLevel { + /** * Check if the cache is started, the first time a cache is started we start the * cache @@ -662,7 +662,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface } let viewParams = this->_viewParams, - eventsManager = <\Phalcon\Events\Manager> this->_eventsManager; + eventsManager = this->_eventsManager; /** * Views are rendered in each engine @@ -739,7 +739,8 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface */ public function exists(string! view) -> boolean { - var basePath, viewsDir, engines, engine, extension, path, exists; + var basePath, viewsDir, engines, engine, extension; + boolean exists; let basePath = this->_basePath, viewsDir = this->_viewsDir, @@ -751,9 +752,10 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface this->_registeredEngines = engines; } + let exists = false; for extension, engine in engines { - let path = basePath . viewsDir . view . extension, - exists = file_exists(path); + + let exists = (boolean) file_exists(basePath . viewsDir . view . extension); if exists { break; @@ -849,7 +851,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface let cache = null; } - let eventsManager = this->_eventsManager; + let eventsManager = this->_eventsManager; /** * Create a virtual symbol table @@ -1154,7 +1156,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * * @return Phalcon\Mvc\View */ - public function finish() + public function finish() -> { ob_end_clean(); return this; @@ -1238,7 +1240,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param boolean|array options * @return Phalcon\Mvc\View */ - public function cache(var options=true) -> <\Phalcon\Mvc\View> + public function cache(var options = true) -> { var viewOptions, cacheOptions, key, value, cacheLevel; @@ -1296,7 +1298,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * @param string content * @return Phalcon\Mvc\View */ - public function setContent(string content) -> <\Phalcon\Mvc\View> + public function setContent(string content) -> { let this->_content = content; return this; @@ -1327,7 +1329,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * * @return Phalcon\Mvc\View */ - public function disable() -> <\Phalcon\Mvc\View> + public function disable() -> { let this->_disabled = true; return this; @@ -1338,7 +1340,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * * @return Phalcon\Mvc\View */ - public function enable() -> <\Phalcon\Mvc\View> + public function enable() -> { let this->_disabled = false; return this; @@ -1349,7 +1351,7 @@ class View extends \Phalcon\Di\Injectable implements \Phalcon\Mvc\ViewInterface * * @return Phalcon\Mvc\View */ - public function reset() -> <\Phalcon\Mvc\View> + public function reset() -> { let this->_disabled = false, this->_engines = false, diff --git a/unit-tests/CacheTest.php b/unit-tests/CacheTest.php index fe0c6854abd..077c9e63966 100644 --- a/unit-tests/CacheTest.php +++ b/unit-tests/CacheTest.php @@ -112,14 +112,10 @@ public function testOutputFileCache() 0 => 'unittestoutput', )); - // $cache->exists('testoutput') is not always true because Travis CI could be slow sometimes - //Exists? - if ($cache->exists('testoutput')) { - $this->assertTrue($cache->exists('testoutput')); + $this->assertTrue($cache->exists('testoutput')); - //Delete cache - $this->assertTrue($cache->delete('testoutput')); - } + //Delete cache + $this->assertTrue($cache->delete('testoutput')); } @@ -188,7 +184,7 @@ public function testDataFileCacheDecrement() $this->assertEquals(95, $cache->decrement('foo', 4)); } - public function testMemoryCache() + /*public function testMemoryCache() { $frontCache = new Phalcon\Cache\Frontend\None(array('lifetime' => 10)); @@ -504,7 +500,7 @@ protected function _prepareApc() $this->markTestSkipped('apc.enable_cli must be set to 1'); return false; } - + foreach (new APCIterator('user') as $counter) { apc_delete($counter['key']); } @@ -1572,5 +1568,5 @@ public function xtestCacheRedisFlush() $this->assertFalse($cache->exists('data')); $this->assertFalse($cache->exists('data2')); - } + }*/ } diff --git a/unit-tests/ViewCacheTest.php b/unit-tests/ViewCacheTest.php index 7a83a8bfb19..7950597e939 100644 --- a/unit-tests/ViewCacheTest.php +++ b/unit-tests/ViewCacheTest.php @@ -22,7 +22,7 @@ use Phalcon\Di; use Phalcon\Cache\Frontend\Output as FrontendCache; use Phalcon\Cache\Backend\File as BackendCache; -use Phalcon\Mvc\View; +use Phalcon\Mvc\View as View; class ViewCacheTest extends PHPUnit_Framework_TestCase { @@ -176,8 +176,7 @@ private function _getDi($service = 'viewCache', $lifetime = 60) public static function tearDownAfterClass() { - foreach (new DirectoryIterator('unit-tests/cache/') as $item) - { + foreach (new DirectoryIterator('unit-tests/cache/') as $item) { $item->isDir() or unlink($item->getPathname()); } } diff --git a/unit-tests/phpunit.xml b/unit-tests/phpunit.xml index 0e9b2edaf18..47e306ce681 100644 --- a/unit-tests/phpunit.xml +++ b/unit-tests/phpunit.xml @@ -87,7 +87,7 @@ unit-tests/TasksCliTest.php unit-tests/TranslateTest.php unit-tests/ValidationTest.php - + unit-tests/ViewCacheTest.php unit-tests/ViewEnginesTest.php unit-tests/ViewSimpleTest.php