From 9db70990ec46b51e1ab713dbfde266279b2e09b1 Mon Sep 17 00:00:00 2001 From: xboston Date: Wed, 8 May 2013 00:42:24 +0600 Subject: [PATCH 01/27] Update Phalcon_Http_RequestInterface --- ext/http/requestinterface.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ext/http/requestinterface.h b/ext/http/requestinterface.h index 572b8797359..9eb3cda89a5 100644 --- a/ext/http/requestinterface.h +++ b/ext/http/requestinterface.h @@ -71,6 +71,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_ismethod, 0, 0, 1) ZEND_ARG_INFO(0, methods) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_hasfiles, 0, 0, 0) + ZEND_ARG_INFO(0, notErrored) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_getuploadedfiles, 0, 0, 0) + ZEND_ARG_INFO(0, notErrored) +ZEND_END_ARG_INFO() + PHALCON_INIT_FUNCS(phalcon_http_requestinterface_method_entry){ PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, get, arginfo_phalcon_http_requestinterface_get) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getPost, arginfo_phalcon_http_requestinterface_getpost) @@ -99,8 +107,8 @@ PHALCON_INIT_FUNCS(phalcon_http_requestinterface_method_entry){ PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isHead, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isDelete, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isOptions, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, hasFiles, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getUploadedFiles, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, hasFiles, arginfo_phalcon_http_requestinterface_hasfiles) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getUploadedFiles, arginfo_phalcon_http_requestinterface_getuploadedfiles) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getHTTPReferer, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getAcceptableContent, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getBestAccept, NULL) From ff9fa79f20f2c2d5d8ffbd57d29554bcc4c9a73d Mon Sep 17 00:00:00 2001 From: phalcon Date: Wed, 8 May 2013 01:28:11 -0500 Subject: [PATCH 02/27] Fixing memory leak in PHQL cache --- build/32bits/phalcon.c | 2 ++ build/safe/phalcon.c | 2 ++ ext/mvc/model/query/base.c | 3 ++- ext/mvc/model/query/parser.c | 3 ++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build/32bits/phalcon.c b/build/32bits/phalcon.c index 0a6d3e3e585..1dc22ebb5ff 100644 --- a/build/32bits/phalcon.c +++ b/build/32bits/phalcon.c @@ -63333,6 +63333,7 @@ static int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql if (PHALCON_GLOBAL(orm.parser_cache)) { if (zend_hash_find(PHALCON_GLOBAL(orm.parser_cache), phql, phql_length, (void**) &temp_ast) == SUCCESS) { ZVAL_ZVAL(*result, *temp_ast, 1, 0); + Z_SET_REFCOUNT_P(*result, 1); return SUCCESS; } } @@ -63640,6 +63641,7 @@ static int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql + #ifdef HAVE_CONFIG_H #endif diff --git a/build/safe/phalcon.c b/build/safe/phalcon.c index 897f728a065..c84021f95fa 100644 --- a/build/safe/phalcon.c +++ b/build/safe/phalcon.c @@ -63333,6 +63333,7 @@ static int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql if (PHALCON_GLOBAL(orm.parser_cache)) { if (zend_hash_find(PHALCON_GLOBAL(orm.parser_cache), phql, phql_length, (void**) &temp_ast) == SUCCESS) { ZVAL_ZVAL(*result, *temp_ast, 1, 0); + Z_SET_REFCOUNT_P(*result, 1); return SUCCESS; } } @@ -63640,6 +63641,7 @@ static int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql + #ifdef HAVE_CONFIG_H #endif diff --git a/ext/mvc/model/query/base.c b/ext/mvc/model/query/base.c index 01dffcc2d98..9962b38e9d9 100644 --- a/ext/mvc/model/query/base.c +++ b/ext/mvc/model/query/base.c @@ -176,6 +176,7 @@ int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql_length if (PHALCON_GLOBAL(orm.parser_cache)) { if (zend_hash_find(PHALCON_GLOBAL(orm.parser_cache), phql, phql_length, (void**) &temp_ast) == SUCCESS) { ZVAL_ZVAL(*result, *temp_ast, 1, 0); + Z_SET_REFCOUNT_P(*result, 1); return SUCCESS; } } @@ -479,4 +480,4 @@ int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql_length efree(state); return status; -} \ No newline at end of file +} diff --git a/ext/mvc/model/query/parser.c b/ext/mvc/model/query/parser.c index 45dadd44315..45a45e4c7f4 100644 --- a/ext/mvc/model/query/parser.c +++ b/ext/mvc/model/query/parser.c @@ -2910,6 +2910,7 @@ int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql_length if (PHALCON_GLOBAL(orm.parser_cache)) { if (zend_hash_find(PHALCON_GLOBAL(orm.parser_cache), phql, phql_length, (void**) &temp_ast) == SUCCESS) { ZVAL_ZVAL(*result, *temp_ast, 1, 0); + Z_SET_REFCOUNT_P(*result, 1); return SUCCESS; } } @@ -3213,4 +3214,4 @@ int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql_length efree(state); return status; -} \ No newline at end of file +} From 00b3853078a289e960757d58baecaabd654db57e Mon Sep 17 00:00:00 2001 From: phalcon Date: Wed, 8 May 2013 01:30:06 -0500 Subject: [PATCH 03/27] Regenerating build 64bits [ci skip] --- build/64bits/phalcon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/64bits/phalcon.c b/build/64bits/phalcon.c index ef8e19f87d7..8c3a4afdd5e 100644 --- a/build/64bits/phalcon.c +++ b/build/64bits/phalcon.c @@ -52911,6 +52911,7 @@ static int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql if (PHALCON_GLOBAL(orm.parser_cache)) { if (zend_hash_find(PHALCON_GLOBAL(orm.parser_cache), phql, phql_length, (void**) &temp_ast) == SUCCESS) { ZVAL_ZVAL(*result, *temp_ast, 1, 0); + Z_SET_REFCOUNT_P(*result, 1); return SUCCESS; } } @@ -53216,6 +53217,7 @@ static int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql return status; } + /* Generated by re2c 0.13.5 on Fri May 3 00:16:18 2013 */ // 1 "scanner.re" From ebd3d666c82f48acb35384de49fc39b2acde2359 Mon Sep 17 00:00:00 2001 From: xboston Date: Wed, 8 May 2013 22:37:57 +0600 Subject: [PATCH 04/27] fix Validator\Uniqueness combination fields --- ext/mvc/model/validator/uniqueness.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/ext/mvc/model/validator/uniqueness.c b/ext/mvc/model/validator/uniqueness.c index 14f0faa0469..73512eed394 100644 --- a/ext/mvc/model/validator/uniqueness.c +++ b/ext/mvc/model/validator/uniqueness.c @@ -57,6 +57,9 @@ * $this->validate(new UniquenessValidator(array( * 'field' => 'email' * ))); + * $this->validate(new UniquenessValidator(array( + * 'field' => array('username','phone') + * ))); * if ($this->validationHasFailed() == true) { * return false; * } @@ -97,6 +100,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ zval *primary_field = NULL, *attribute_field = NULL, *params; zval *class_name, *message = NULL, *type; zval *r0 = NULL, *r1 = NULL; + zval *message_field = NULL, *mmesage = NULL; HashTable *ah0, *ah1; HashPosition hp0, hp1; zval **hd; @@ -156,6 +160,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ return; } + PHALCON_INIT_VAR(message_field); + array_init(message_field); + while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) { PHALCON_GET_FOREACH_VALUE(compose_field); @@ -203,6 +210,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ phalcon_array_append(&bind_types, bind_type, PH_SEPARATE TSRMLS_CC); PHALCON_SEPARATE(number); increment_function(number); + + phalcon_array_append(&message_field, compose_field, PH_SEPARATE TSRMLS_CC); zend_hash_move_forward_ex(ah0, &hp0); } @@ -360,9 +369,18 @@ PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ PHALCON_CALL_METHOD_PARAMS_1(message, this_ptr, "getoption", option); if (!zend_is_true(message)) { PHALCON_INIT_NVAR(message); - PHALCON_CONCAT_SVS(message, "Value of field '", field, "' is already present in another record"); - } + + if( Z_TYPE_P(field) == IS_ARRAY ){ + PHALCON_INIT_VAR(mmesage); + phalcon_fast_join_str(mmesage, SL("', '"), message_field TSRMLS_CC); + PHALCON_CPY_WRT(message_field, mmesage); + + PHALCON_CONCAT_SVS(message, "Value of fields '", mmesage,"' is already present in another record"); + }else{ + PHALCON_CONCAT_SVS(message, "Value of field '", field,"' is already present in another record"); + } + } /** * Append the message to the validator */ From bb06463e83e3ace5715cc2d50cf3d882de78deb1 Mon Sep 17 00:00:00 2001 From: xboston Date: Thu, 9 May 2013 17:59:02 +0600 Subject: [PATCH 05/27] fix Phalcon_Mvc_Model_QueryInterface --- ext/mvc/model/queryinterface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/mvc/model/queryinterface.h b/ext/mvc/model/queryinterface.h index bd3c56bedb3..013b61d3ad6 100644 --- a/ext/mvc/model/queryinterface.h +++ b/ext/mvc/model/queryinterface.h @@ -21,7 +21,7 @@ extern zend_class_entry *phalcon_mvc_model_queryinterface_ce; PHALCON_INIT_CLASS(Phalcon_Mvc_Model_QueryInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_queryinterface___construct, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_queryinterface___construct, 0, 0, 0) ZEND_ARG_INFO(0, phql) ZEND_END_ARG_INFO() From b8b1e9336b63061bbc443910f4649816370fc72a Mon Sep 17 00:00:00 2001 From: xboston Date: Thu, 9 May 2013 18:00:44 +0600 Subject: [PATCH 06/27] fix Phalcon_EscaperInterface --- ext/escaperinterface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/escaperinterface.h b/ext/escaperinterface.h index d058288618e..249545c5bc0 100644 --- a/ext/escaperinterface.h +++ b/ext/escaperinterface.h @@ -34,7 +34,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapehtml, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapehtmlattr, 0, 0, 1) - ZEND_ARG_INFO(0, text) + ZEND_ARG_INFO(0, attribute) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapecss, 0, 0, 1) From da4bf1ce42a1f49360f0c93edcdfeaf881e946cd Mon Sep 17 00:00:00 2001 From: xboston Date: Thu, 9 May 2013 18:02:35 +0600 Subject: [PATCH 07/27] fix Phalcon_Mvc_CollectionInterface --- ext/mvc/collectioninterface.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/mvc/collectioninterface.h b/ext/mvc/collectioninterface.h index 485ea5088cb..711c6d92f1c 100644 --- a/ext/mvc/collectioninterface.h +++ b/ext/mvc/collectioninterface.h @@ -23,6 +23,7 @@ PHALCON_INIT_CLASS(Phalcon_Mvc_CollectionInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface___construct, 0, 0, 0) ZEND_ARG_INFO(0, dependencyInjector) + ZEND_ARG_INFO(0, modelsManager) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface_setid, 0, 0, 1) From 0ad216ef83fcf675bbe9c7eb45147412c8dc8940 Mon Sep 17 00:00:00 2001 From: xboston Date: Thu, 9 May 2013 18:14:27 +0600 Subject: [PATCH 08/27] fix Phalcon_DispatcherInterface --- ext/dispatcherinterface.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/dispatcherinterface.h b/ext/dispatcherinterface.h index ef2f4185daa..dd144be9df2 100644 --- a/ext/dispatcherinterface.h +++ b/ext/dispatcherinterface.h @@ -49,6 +49,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_getparam, 0, 0, 1) ZEND_ARG_INFO(0, param) ZEND_ARG_INFO(0, filters) + ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_forward, 0, 0, 1) From 406860d2772a049519a3ac6545d41400e6da914f Mon Sep 17 00:00:00 2001 From: xboston Date: Thu, 9 May 2013 18:15:45 +0600 Subject: [PATCH 09/27] fix Phalcon_Mvc_Model_MessageInterface --- ext/mvc/model/messageinterface.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/mvc/model/messageinterface.h b/ext/mvc/model/messageinterface.h index 142a8983191..f36f8a2fb01 100644 --- a/ext/mvc/model/messageinterface.h +++ b/ext/mvc/model/messageinterface.h @@ -25,6 +25,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_messageinterface___construct, 0 ZEND_ARG_INFO(0, message) ZEND_ARG_INFO(0, field) ZEND_ARG_INFO(0, type) + ZEND_ARG_INFO(0, model) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_messageinterface_settype, 0, 0, 1) From 0a55ef5ad53a8cadcdf60a77287615b8498d7c23 Mon Sep 17 00:00:00 2001 From: xboston Date: Thu, 9 May 2013 18:16:57 +0600 Subject: [PATCH 10/27] fix Phalcon_Events_ManagerInterface --- ext/events/managerinterface.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/events/managerinterface.h b/ext/events/managerinterface.h index fdb71f3e10a..99b066b2420 100644 --- a/ext/events/managerinterface.h +++ b/ext/events/managerinterface.h @@ -24,6 +24,7 @@ PHALCON_INIT_CLASS(Phalcon_Events_ManagerInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_attach, 0, 0, 2) ZEND_ARG_INFO(0, eventType) ZEND_ARG_INFO(0, handler) + ZEND_ARG_INFO(0, priority) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_dettachall, 0, 0, 0) From 9e2f86b4eecff18d0f9b4b22ed24b59e8649425d Mon Sep 17 00:00:00 2001 From: xboston Date: Thu, 9 May 2013 18:17:35 +0600 Subject: [PATCH 11/27] fix Phalcon_Events_ManagerInterface2 --- ext/events/managerinterface.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/events/managerinterface.h b/ext/events/managerinterface.h index 99b066b2420..0013bcda975 100644 --- a/ext/events/managerinterface.h +++ b/ext/events/managerinterface.h @@ -35,6 +35,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_fire, 0, 0, 2) ZEND_ARG_INFO(0, eventType) ZEND_ARG_INFO(0, source) ZEND_ARG_INFO(0, data) + ZEND_ARG_INFO(0, cancelable) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_getlisteners, 0, 0, 1) From c3aaf69f191038879d4e7ecb7e9d2de8a097e62b Mon Sep 17 00:00:00 2001 From: xboston Date: Thu, 9 May 2013 18:57:58 +0600 Subject: [PATCH 12/27] fix Phalcon_Db_AdapterInterface --- ext/db/adapterinterface.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ext/db/adapterinterface.h b/ext/db/adapterinterface.h index 6270f7e9a7d..eb540133615 100644 --- a/ext/db/adapterinterface.h +++ b/ext/db/adapterinterface.h @@ -21,20 +21,18 @@ extern zend_class_entry *phalcon_db_adapterinterface_ce; PHALCON_INIT_CLASS(Phalcon_Db_AdapterInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface___construct, 0, 0, 1) - ZEND_ARG_INFO(0, descriptor) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_fetchone, 0, 0, 1) ZEND_ARG_INFO(0, sqlQuery) ZEND_ARG_INFO(0, fetchMode) - ZEND_ARG_INFO(0, placeholders) + ZEND_ARG_INFO(0, bindParams) + ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_fetchall, 0, 0, 1) ZEND_ARG_INFO(0, sqlQuery) ZEND_ARG_INFO(0, fetchMode) - ZEND_ARG_INFO(0, placeholders) + ZEND_ARG_INFO(0, bindParams) + ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_insert, 0, 0, 2) @@ -213,7 +211,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_describecolumns, 0, 0 ZEND_END_ARG_INFO() PHALCON_INIT_FUNCS(phalcon_db_adapterinterface_method_entry){ - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, __construct, arginfo_phalcon_db_adapterinterface___construct) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, __construct, NULL) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, fetchOne, arginfo_phalcon_db_adapterinterface_fetchone) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, fetchAll, arginfo_phalcon_db_adapterinterface_fetchall) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, insert, arginfo_phalcon_db_adapterinterface_insert) From 42f9c6d1a88d8568a78ddbc7396f5c93b75ef8c4 Mon Sep 17 00:00:00 2001 From: dalu Date: Mon, 13 May 2013 12:29:46 +0200 Subject: [PATCH 13/27] Update install so it compiles with any libtool version --- build/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/install b/build/install index ea315681c65..bbc09baa094 100755 --- a/build/install +++ b/build/install @@ -54,4 +54,4 @@ if [ -f Makefile ]; then fi #Perform the compilation -phpize && ./configure --enable-phalcon && make && make install && echo -e "\nThanks for compiling Phalcon!\nBuild succeed: Please restart your web server to complete the installation" +phpize && aclocal && libtoolize --force && autoheader && autoconf && ./configure --enable-phalcon && make && make install && echo -e "\nThanks for compiling Phalcon!\nBuild succeed: Please restart your web server to complete the installation" From 4007bf5cf3a681510369fc75e5b00bfa1029fa8f Mon Sep 17 00:00:00 2001 From: Claudio Beatrice Date: Tue, 14 May 2013 16:40:51 +0300 Subject: [PATCH 14/27] Added conditional to allow compilation on mac os x since libtoolize on mac is called glibtoolize, it needs to be checked and set for compiling the framework in Mac OS X --- build/install | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build/install b/build/install index bbc09baa094..01d4bd877d1 100755 --- a/build/install +++ b/build/install @@ -53,5 +53,13 @@ if [ -f Makefile ]; then phpize --clean fi +LIBTOOLIZE_BIN="libtoolize" + +#GNU 'libtoolize' on MAC OS X is called 'glibtoolize' +if [ `(uname -s) 2>/dev/null` == 'Darwin' ] +then + LIBTOOLIZE_BIN="glibtoolize" +fi + #Perform the compilation -phpize && aclocal && libtoolize --force && autoheader && autoconf && ./configure --enable-phalcon && make && make install && echo -e "\nThanks for compiling Phalcon!\nBuild succeed: Please restart your web server to complete the installation" +phpize && aclocal && $LIBTOOLIZE_BIN --force && autoheader && autoconf && ./configure --enable-phalcon && make && make install && echo -e "\nThanks for compiling Phalcon!\nBuild succeed: Please restart your web server to complete the installation" From c2778adaca61036b476b261263494622bca4234d Mon Sep 17 00:00:00 2001 From: phalcon Date: Thu, 16 May 2013 00:16:52 -0500 Subject: [PATCH 15/27] Fixing double tracking of variables in memory frame --- build/32bits/phalcon.c | 24 ++++++++++++++++++++---- build/32bits/phalcon.h | 33 ++++++++++++++++++++++----------- build/safe/phalcon.c | 24 ++++++++++++++++++++---- build/safe/phalcon.h | 33 ++++++++++++++++++++++----------- ext/kernel/memory.h | 3 ++- 5 files changed, 86 insertions(+), 31 deletions(-) diff --git a/build/32bits/phalcon.c b/build/32bits/phalcon.c index 1dc22ebb5ff..74881b58247 100644 --- a/build/32bits/phalcon.c +++ b/build/32bits/phalcon.c @@ -1112,13 +1112,14 @@ static void PHALCON_FASTCALL phalcon_copy_ctor(zval *destiny, zval *origin); } \ } +//phalcon_memory_observe(&z TSRMLS_CC); \ + #define PHALCON_SEPARATE(z) \ { \ zval *orig_ptr = z; \ if (Z_REFCOUNT_P(orig_ptr) > 1) { \ Z_DELREF_P(orig_ptr); \ ALLOC_ZVAL(z); \ - phalcon_memory_observe(&z TSRMLS_CC); \ *z = *orig_ptr; \ zval_copy_ctor(z); \ Z_SET_REFCOUNT_P(z, 1); \ @@ -26969,7 +26970,7 @@ static PHP_METHOD(Phalcon_Db_Result_Pdo, numRows){ PHALCON_INIT_VAR(type); PHALCON_CALL_METHOD(type, connection, "gettype"); - if (PHALCON_IS_STRING(type, "sqlite")) { + if (PHALCON_IS_STRING(type, "sqlite") || PHALCON_IS_STRING(type, "oci")) { PHALCON_OBS_VAR(sql_statement); phalcon_read_property_this_quick(&sql_statement, this_ptr, SL("_sqlStatement"), 18972457UL, PH_NOISY_CC); @@ -67778,6 +67779,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ zval *primary_field = NULL, *attribute_field = NULL, *params; zval *class_name, *message = NULL, *type; zval *r0 = NULL, *r1 = NULL; + zval *message_field = NULL, *mmesage = NULL; HashTable *ah0, *ah1; HashPosition hp0, hp1; zval **hd; @@ -67830,6 +67832,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ return; } + PHALCON_INIT_VAR(message_field); + array_init(message_field); + while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) { PHALCON_GET_FOREACH_VALUE(compose_field); @@ -67868,6 +67873,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ phalcon_array_append(&bind_types, bind_type, PH_SEPARATE TSRMLS_CC); PHALCON_SEPARATE(number); increment_function(number); + + phalcon_array_append(&message_field, compose_field, PH_SEPARATE TSRMLS_CC); zend_hash_move_forward_ex(ah0, &hp0); } @@ -67995,9 +68002,18 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ PHALCON_CALL_METHOD_PARAMS_1_KEY(message, this_ptr, "getoption", option, 1191969182UL); if (!zend_is_true(message)) { PHALCON_INIT_NVAR(message); - PHALCON_CONCAT_SVS(message, "Value of field '", field, "' is already present in another record"); - } + + if( Z_TYPE_P(field) == IS_ARRAY ){ + PHALCON_INIT_VAR(mmesage); + phalcon_fast_join_str(mmesage, SL("', '"), message_field TSRMLS_CC); + PHALCON_CPY_WRT(message_field, mmesage); + + PHALCON_CONCAT_SVS(message, "Value of fields '", mmesage,"' is already present in another record"); + }else{ + PHALCON_CONCAT_SVS(message, "Value of field '", field,"' is already present in another record"); + } + } PHALCON_INIT_VAR(type); ZVAL_STRING(type, "Unique", 1); PHALCON_CALL_METHOD_PARAMS_3_NORETURN_KEY(this_ptr, "appendmessage", message, field, type, 2313005058UL); diff --git a/build/32bits/phalcon.h b/build/32bits/phalcon.h index 31ae1a71477..a3b97fb6a01 100644 --- a/build/32bits/phalcon.h +++ b/build/32bits/phalcon.h @@ -470,20 +470,18 @@ zend_class_entry *phalcon_db_adapterinterface_ce; PHALCON_INIT_CLASS(Phalcon_Db_AdapterInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface___construct, 0, 0, 1) - ZEND_ARG_INFO(0, descriptor) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_fetchone, 0, 0, 1) ZEND_ARG_INFO(0, sqlQuery) ZEND_ARG_INFO(0, fetchMode) - ZEND_ARG_INFO(0, placeholders) + ZEND_ARG_INFO(0, bindParams) + ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_fetchall, 0, 0, 1) ZEND_ARG_INFO(0, sqlQuery) ZEND_ARG_INFO(0, fetchMode) - ZEND_ARG_INFO(0, placeholders) + ZEND_ARG_INFO(0, bindParams) + ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_insert, 0, 0, 2) @@ -662,7 +660,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_describecolumns, 0, 0 ZEND_END_ARG_INFO() PHALCON_INIT_FUNCS(phalcon_db_adapterinterface_method_entry){ - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, __construct, arginfo_phalcon_db_adapterinterface___construct) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, __construct, NULL) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, fetchOne, arginfo_phalcon_db_adapterinterface_fetchone) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, fetchAll, arginfo_phalcon_db_adapterinterface_fetchall) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, insert, arginfo_phalcon_db_adapterinterface_insert) @@ -1281,6 +1279,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_getparam, 0, 0, 1) ZEND_ARG_INFO(0, param) ZEND_ARG_INFO(0, filters) + ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_forward, 0, 0, 1) @@ -1395,6 +1394,7 @@ PHALCON_INIT_CLASS(Phalcon_Mvc_CollectionInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface___construct, 0, 0, 0) ZEND_ARG_INFO(0, dependencyInjector) + ZEND_ARG_INFO(0, modelsManager) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface_setid, 0, 0, 1) @@ -1555,7 +1555,7 @@ zend_class_entry *phalcon_mvc_model_queryinterface_ce; PHALCON_INIT_CLASS(Phalcon_Mvc_Model_QueryInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_queryinterface___construct, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_queryinterface___construct, 0, 0, 0) ZEND_ARG_INFO(0, phql) ZEND_END_ARG_INFO() @@ -1944,6 +1944,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_ismethod, 0, 0, 1) ZEND_ARG_INFO(0, methods) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_hasfiles, 0, 0, 0) + ZEND_ARG_INFO(0, notErrored) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_getuploadedfiles, 0, 0, 0) + ZEND_ARG_INFO(0, notErrored) +ZEND_END_ARG_INFO() + PHALCON_INIT_FUNCS(phalcon_http_requestinterface_method_entry){ PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, get, arginfo_phalcon_http_requestinterface_get) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getPost, arginfo_phalcon_http_requestinterface_getpost) @@ -1972,8 +1980,8 @@ PHALCON_INIT_FUNCS(phalcon_http_requestinterface_method_entry){ PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isHead, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isDelete, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isOptions, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, hasFiles, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getUploadedFiles, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, hasFiles, arginfo_phalcon_http_requestinterface_hasfiles) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getUploadedFiles, arginfo_phalcon_http_requestinterface_getuploadedfiles) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getHTTPReferer, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getAcceptableContent, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getBestAccept, NULL) @@ -2820,7 +2828,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapehtml, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapehtmlattr, 0, 0, 1) - ZEND_ARG_INFO(0, text) + ZEND_ARG_INFO(0, attribute) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapecss, 0, 0, 1) @@ -3075,6 +3083,7 @@ PHALCON_INIT_CLASS(Phalcon_Events_ManagerInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_attach, 0, 0, 2) ZEND_ARG_INFO(0, eventType) ZEND_ARG_INFO(0, handler) + ZEND_ARG_INFO(0, priority) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_dettachall, 0, 0, 0) @@ -3085,6 +3094,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_fire, 0, 0, 2) ZEND_ARG_INFO(0, eventType) ZEND_ARG_INFO(0, source) ZEND_ARG_INFO(0, data) + ZEND_ARG_INFO(0, cancelable) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_getlisteners, 0, 0, 1) @@ -3109,6 +3119,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_messageinterface___construct, 0 ZEND_ARG_INFO(0, message) ZEND_ARG_INFO(0, field) ZEND_ARG_INFO(0, type) + ZEND_ARG_INFO(0, model) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_messageinterface_settype, 0, 0, 1) diff --git a/build/safe/phalcon.c b/build/safe/phalcon.c index c84021f95fa..f87ddcc2270 100644 --- a/build/safe/phalcon.c +++ b/build/safe/phalcon.c @@ -1112,13 +1112,14 @@ static void PHALCON_FASTCALL phalcon_copy_ctor(zval *destiny, zval *origin); } \ } +//phalcon_memory_observe(&z TSRMLS_CC); \ + #define PHALCON_SEPARATE(z) \ { \ zval *orig_ptr = z; \ if (Z_REFCOUNT_P(orig_ptr) > 1) { \ Z_DELREF_P(orig_ptr); \ ALLOC_ZVAL(z); \ - phalcon_memory_observe(&z TSRMLS_CC); \ *z = *orig_ptr; \ zval_copy_ctor(z); \ Z_SET_REFCOUNT_P(z, 1); \ @@ -26969,7 +26970,7 @@ static PHP_METHOD(Phalcon_Db_Result_Pdo, numRows){ PHALCON_INIT_VAR(type); PHALCON_CALL_METHOD(type, connection, "gettype"); - if (PHALCON_IS_STRING(type, "sqlite")) { + if (PHALCON_IS_STRING(type, "sqlite") || PHALCON_IS_STRING(type, "oci")) { PHALCON_OBS_VAR(sql_statement); phalcon_read_property_this(&sql_statement, this_ptr, SL("_sqlStatement"), PH_NOISY_CC); @@ -67778,6 +67779,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ zval *primary_field = NULL, *attribute_field = NULL, *params; zval *class_name, *message = NULL, *type; zval *r0 = NULL, *r1 = NULL; + zval *message_field = NULL, *mmesage = NULL; HashTable *ah0, *ah1; HashPosition hp0, hp1; zval **hd; @@ -67830,6 +67832,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ return; } + PHALCON_INIT_VAR(message_field); + array_init(message_field); + while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) { PHALCON_GET_FOREACH_VALUE(compose_field); @@ -67868,6 +67873,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ phalcon_array_append(&bind_types, bind_type, PH_SEPARATE TSRMLS_CC); PHALCON_SEPARATE(number); increment_function(number); + + phalcon_array_append(&message_field, compose_field, PH_SEPARATE TSRMLS_CC); zend_hash_move_forward_ex(ah0, &hp0); } @@ -67995,9 +68002,18 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ PHALCON_CALL_METHOD_PARAMS_1(message, this_ptr, "getoption", option); if (!zend_is_true(message)) { PHALCON_INIT_NVAR(message); - PHALCON_CONCAT_SVS(message, "Value of field '", field, "' is already present in another record"); - } + + if( Z_TYPE_P(field) == IS_ARRAY ){ + PHALCON_INIT_VAR(mmesage); + phalcon_fast_join_str(mmesage, SL("', '"), message_field TSRMLS_CC); + PHALCON_CPY_WRT(message_field, mmesage); + + PHALCON_CONCAT_SVS(message, "Value of fields '", mmesage,"' is already present in another record"); + }else{ + PHALCON_CONCAT_SVS(message, "Value of field '", field,"' is already present in another record"); + } + } PHALCON_INIT_VAR(type); ZVAL_STRING(type, "Unique", 1); PHALCON_CALL_METHOD_PARAMS_3_NORETURN(this_ptr, "appendmessage", message, field, type); diff --git a/build/safe/phalcon.h b/build/safe/phalcon.h index 31ae1a71477..a3b97fb6a01 100644 --- a/build/safe/phalcon.h +++ b/build/safe/phalcon.h @@ -470,20 +470,18 @@ zend_class_entry *phalcon_db_adapterinterface_ce; PHALCON_INIT_CLASS(Phalcon_Db_AdapterInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface___construct, 0, 0, 1) - ZEND_ARG_INFO(0, descriptor) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_fetchone, 0, 0, 1) ZEND_ARG_INFO(0, sqlQuery) ZEND_ARG_INFO(0, fetchMode) - ZEND_ARG_INFO(0, placeholders) + ZEND_ARG_INFO(0, bindParams) + ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_fetchall, 0, 0, 1) ZEND_ARG_INFO(0, sqlQuery) ZEND_ARG_INFO(0, fetchMode) - ZEND_ARG_INFO(0, placeholders) + ZEND_ARG_INFO(0, bindParams) + ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_insert, 0, 0, 2) @@ -662,7 +660,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_describecolumns, 0, 0 ZEND_END_ARG_INFO() PHALCON_INIT_FUNCS(phalcon_db_adapterinterface_method_entry){ - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, __construct, arginfo_phalcon_db_adapterinterface___construct) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, __construct, NULL) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, fetchOne, arginfo_phalcon_db_adapterinterface_fetchone) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, fetchAll, arginfo_phalcon_db_adapterinterface_fetchall) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, insert, arginfo_phalcon_db_adapterinterface_insert) @@ -1281,6 +1279,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_getparam, 0, 0, 1) ZEND_ARG_INFO(0, param) ZEND_ARG_INFO(0, filters) + ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_forward, 0, 0, 1) @@ -1395,6 +1394,7 @@ PHALCON_INIT_CLASS(Phalcon_Mvc_CollectionInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface___construct, 0, 0, 0) ZEND_ARG_INFO(0, dependencyInjector) + ZEND_ARG_INFO(0, modelsManager) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface_setid, 0, 0, 1) @@ -1555,7 +1555,7 @@ zend_class_entry *phalcon_mvc_model_queryinterface_ce; PHALCON_INIT_CLASS(Phalcon_Mvc_Model_QueryInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_queryinterface___construct, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_queryinterface___construct, 0, 0, 0) ZEND_ARG_INFO(0, phql) ZEND_END_ARG_INFO() @@ -1944,6 +1944,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_ismethod, 0, 0, 1) ZEND_ARG_INFO(0, methods) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_hasfiles, 0, 0, 0) + ZEND_ARG_INFO(0, notErrored) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_getuploadedfiles, 0, 0, 0) + ZEND_ARG_INFO(0, notErrored) +ZEND_END_ARG_INFO() + PHALCON_INIT_FUNCS(phalcon_http_requestinterface_method_entry){ PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, get, arginfo_phalcon_http_requestinterface_get) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getPost, arginfo_phalcon_http_requestinterface_getpost) @@ -1972,8 +1980,8 @@ PHALCON_INIT_FUNCS(phalcon_http_requestinterface_method_entry){ PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isHead, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isDelete, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isOptions, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, hasFiles, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getUploadedFiles, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, hasFiles, arginfo_phalcon_http_requestinterface_hasfiles) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getUploadedFiles, arginfo_phalcon_http_requestinterface_getuploadedfiles) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getHTTPReferer, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getAcceptableContent, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getBestAccept, NULL) @@ -2820,7 +2828,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapehtml, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapehtmlattr, 0, 0, 1) - ZEND_ARG_INFO(0, text) + ZEND_ARG_INFO(0, attribute) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapecss, 0, 0, 1) @@ -3075,6 +3083,7 @@ PHALCON_INIT_CLASS(Phalcon_Events_ManagerInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_attach, 0, 0, 2) ZEND_ARG_INFO(0, eventType) ZEND_ARG_INFO(0, handler) + ZEND_ARG_INFO(0, priority) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_dettachall, 0, 0, 0) @@ -3085,6 +3094,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_fire, 0, 0, 2) ZEND_ARG_INFO(0, eventType) ZEND_ARG_INFO(0, source) ZEND_ARG_INFO(0, data) + ZEND_ARG_INFO(0, cancelable) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_getlisteners, 0, 0, 1) @@ -3109,6 +3119,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_messageinterface___construct, 0 ZEND_ARG_INFO(0, message) ZEND_ARG_INFO(0, field) ZEND_ARG_INFO(0, type) + ZEND_ARG_INFO(0, model) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_messageinterface_settype, 0, 0, 1) diff --git a/ext/kernel/memory.h b/ext/kernel/memory.h index 95a9cbe1053..1d49f730e65 100755 --- a/ext/kernel/memory.h +++ b/ext/kernel/memory.h @@ -132,13 +132,14 @@ extern void PHALCON_FASTCALL phalcon_copy_ctor(zval *destiny, zval *origin); } \ } +//phalcon_memory_observe(&z TSRMLS_CC); \ + #define PHALCON_SEPARATE(z) \ { \ zval *orig_ptr = z; \ if (Z_REFCOUNT_P(orig_ptr) > 1) { \ Z_DELREF_P(orig_ptr); \ ALLOC_ZVAL(z); \ - phalcon_memory_observe(&z TSRMLS_CC); \ *z = *orig_ptr; \ zval_copy_ctor(z); \ Z_SET_REFCOUNT_P(z, 1); \ From 0c0a9274c356874217f82aee75ed477ce8a495a3 Mon Sep 17 00:00:00 2001 From: andresgutierrez Date: Thu, 16 May 2013 00:20:48 -0500 Subject: [PATCH 16/27] Regenerating build 64bits [ci skip] --- build/64bits/phalcon.c | 24 ++++++++++++++++++++---- build/64bits/phalcon.h | 33 ++++++++++++++++++++++----------- 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/build/64bits/phalcon.c b/build/64bits/phalcon.c index 8c3a4afdd5e..0c34556688d 100644 --- a/build/64bits/phalcon.c +++ b/build/64bits/phalcon.c @@ -1112,13 +1112,14 @@ static void PHALCON_FASTCALL phalcon_copy_ctor(zval *destiny, zval *origin); } \ } +//phalcon_memory_observe(&z TSRMLS_CC); \ + #define PHALCON_SEPARATE(z) \ { \ zval *orig_ptr = z; \ if (Z_REFCOUNT_P(orig_ptr) > 1) { \ Z_DELREF_P(orig_ptr); \ ALLOC_ZVAL(z); \ - phalcon_memory_observe(&z TSRMLS_CC); \ *z = *orig_ptr; \ zval_copy_ctor(z); \ Z_SET_REFCOUNT_P(z, 1); \ @@ -28461,7 +28462,7 @@ static PHP_METHOD(Phalcon_Db_Result_Pdo, numRows){ PHALCON_INIT_VAR(type); PHALCON_CALL_METHOD(type, connection, "gettype"); - if (PHALCON_IS_STRING(type, "sqlite")) { + if (PHALCON_IS_STRING(type, "sqlite") || PHALCON_IS_STRING(type, "oci")) { PHALCON_OBS_VAR(sql_statement); phalcon_read_property_this_quick(&sql_statement, this_ptr, SL("_sqlStatement"), 8652471029540683561UL, PH_NOISY_CC); @@ -64795,6 +64796,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ zval *primary_field = NULL, *attribute_field = NULL, *params; zval *class_name, *message = NULL, *type; zval *r0 = NULL, *r1 = NULL; + zval *message_field = NULL, *mmesage = NULL; HashTable *ah0, *ah1; HashPosition hp0, hp1; zval **hd; @@ -64847,6 +64849,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ return; } + PHALCON_INIT_VAR(message_field); + array_init(message_field); + while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) { PHALCON_GET_FOREACH_VALUE(compose_field); @@ -64885,6 +64890,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ phalcon_array_append(&bind_types, bind_type, PH_SEPARATE TSRMLS_CC); PHALCON_SEPARATE(number); increment_function(number); + + phalcon_array_append(&message_field, compose_field, PH_SEPARATE TSRMLS_CC); zend_hash_move_forward_ex(ah0, &hp0); } @@ -65012,9 +65019,18 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ PHALCON_CALL_METHOD_PARAMS_1_KEY(message, this_ptr, "getoption", option, 8246354041488802206UL); if (!zend_is_true(message)) { PHALCON_INIT_NVAR(message); - PHALCON_CONCAT_SVS(message, "Value of field '", field, "' is already present in another record"); - } + + if( Z_TYPE_P(field) == IS_ARRAY ){ + PHALCON_INIT_VAR(mmesage); + phalcon_fast_join_str(mmesage, SL("', '"), message_field TSRMLS_CC); + PHALCON_CPY_WRT(message_field, mmesage); + + PHALCON_CONCAT_SVS(message, "Value of fields '", mmesage,"' is already present in another record"); + }else{ + PHALCON_CONCAT_SVS(message, "Value of field '", field,"' is already present in another record"); + } + } PHALCON_INIT_VAR(type); ZVAL_STRING(type, "Unique", 1); PHALCON_CALL_METHOD_PARAMS_3_NORETURN_KEY(this_ptr, "appendmessage", message, field, type, 2989013970055964674UL); diff --git a/build/64bits/phalcon.h b/build/64bits/phalcon.h index 31ae1a71477..a3b97fb6a01 100644 --- a/build/64bits/phalcon.h +++ b/build/64bits/phalcon.h @@ -470,20 +470,18 @@ zend_class_entry *phalcon_db_adapterinterface_ce; PHALCON_INIT_CLASS(Phalcon_Db_AdapterInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface___construct, 0, 0, 1) - ZEND_ARG_INFO(0, descriptor) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_fetchone, 0, 0, 1) ZEND_ARG_INFO(0, sqlQuery) ZEND_ARG_INFO(0, fetchMode) - ZEND_ARG_INFO(0, placeholders) + ZEND_ARG_INFO(0, bindParams) + ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_fetchall, 0, 0, 1) ZEND_ARG_INFO(0, sqlQuery) ZEND_ARG_INFO(0, fetchMode) - ZEND_ARG_INFO(0, placeholders) + ZEND_ARG_INFO(0, bindParams) + ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_insert, 0, 0, 2) @@ -662,7 +660,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_describecolumns, 0, 0 ZEND_END_ARG_INFO() PHALCON_INIT_FUNCS(phalcon_db_adapterinterface_method_entry){ - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, __construct, arginfo_phalcon_db_adapterinterface___construct) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, __construct, NULL) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, fetchOne, arginfo_phalcon_db_adapterinterface_fetchone) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, fetchAll, arginfo_phalcon_db_adapterinterface_fetchall) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, insert, arginfo_phalcon_db_adapterinterface_insert) @@ -1281,6 +1279,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_getparam, 0, 0, 1) ZEND_ARG_INFO(0, param) ZEND_ARG_INFO(0, filters) + ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_forward, 0, 0, 1) @@ -1395,6 +1394,7 @@ PHALCON_INIT_CLASS(Phalcon_Mvc_CollectionInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface___construct, 0, 0, 0) ZEND_ARG_INFO(0, dependencyInjector) + ZEND_ARG_INFO(0, modelsManager) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface_setid, 0, 0, 1) @@ -1555,7 +1555,7 @@ zend_class_entry *phalcon_mvc_model_queryinterface_ce; PHALCON_INIT_CLASS(Phalcon_Mvc_Model_QueryInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_queryinterface___construct, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_queryinterface___construct, 0, 0, 0) ZEND_ARG_INFO(0, phql) ZEND_END_ARG_INFO() @@ -1944,6 +1944,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_ismethod, 0, 0, 1) ZEND_ARG_INFO(0, methods) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_hasfiles, 0, 0, 0) + ZEND_ARG_INFO(0, notErrored) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_getuploadedfiles, 0, 0, 0) + ZEND_ARG_INFO(0, notErrored) +ZEND_END_ARG_INFO() + PHALCON_INIT_FUNCS(phalcon_http_requestinterface_method_entry){ PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, get, arginfo_phalcon_http_requestinterface_get) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getPost, arginfo_phalcon_http_requestinterface_getpost) @@ -1972,8 +1980,8 @@ PHALCON_INIT_FUNCS(phalcon_http_requestinterface_method_entry){ PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isHead, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isDelete, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isOptions, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, hasFiles, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getUploadedFiles, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, hasFiles, arginfo_phalcon_http_requestinterface_hasfiles) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getUploadedFiles, arginfo_phalcon_http_requestinterface_getuploadedfiles) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getHTTPReferer, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getAcceptableContent, NULL) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getBestAccept, NULL) @@ -2820,7 +2828,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapehtml, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapehtmlattr, 0, 0, 1) - ZEND_ARG_INFO(0, text) + ZEND_ARG_INFO(0, attribute) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapecss, 0, 0, 1) @@ -3075,6 +3083,7 @@ PHALCON_INIT_CLASS(Phalcon_Events_ManagerInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_attach, 0, 0, 2) ZEND_ARG_INFO(0, eventType) ZEND_ARG_INFO(0, handler) + ZEND_ARG_INFO(0, priority) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_dettachall, 0, 0, 0) @@ -3085,6 +3094,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_fire, 0, 0, 2) ZEND_ARG_INFO(0, eventType) ZEND_ARG_INFO(0, source) ZEND_ARG_INFO(0, data) + ZEND_ARG_INFO(0, cancelable) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_getlisteners, 0, 0, 1) @@ -3109,6 +3119,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_messageinterface___construct, 0 ZEND_ARG_INFO(0, message) ZEND_ARG_INFO(0, field) ZEND_ARG_INFO(0, type) + ZEND_ARG_INFO(0, model) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_messageinterface_settype, 0, 0, 1) From 290d2cc8b21026d2f623bbed98c9a72d903cc53c Mon Sep 17 00:00:00 2001 From: xboston Date: Fri, 17 May 2013 01:09:12 +0600 Subject: [PATCH 17/27] fix Phalcon_DiInterface --- ext/diinterface.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/diinterface.h b/ext/diinterface.h index 99b1bddd833..34e6e7d8d3d 100644 --- a/ext/diinterface.h +++ b/ext/diinterface.h @@ -22,7 +22,7 @@ extern zend_class_entry *phalcon_diinterface_ce; PHALCON_INIT_CLASS(Phalcon_DiInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_set, 0, 0, 2) - ZEND_ARG_INFO(0, alias) + ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, definition) ZEND_ARG_INFO(0, shared) ZEND_END_ARG_INFO() @@ -33,22 +33,22 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_setshared, 0, 0, 2) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_remove, 0, 0, 1) - ZEND_ARG_INFO(0, alias) + ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_attempt, 0, 0, 2) - ZEND_ARG_INFO(0, alias) + ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, definition) ZEND_ARG_INFO(0, shared) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_get, 0, 0, 1) - ZEND_ARG_INFO(0, alias) + ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_getshared, 0, 0, 1) - ZEND_ARG_INFO(0, alias) + ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() @@ -66,7 +66,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_getservice, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_has, 0, 0, 1) - ZEND_ARG_INFO(0, alias) + ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_setdefault, 0, 0, 1) From d64e2fd8ea56ef4893f29d43079f6871f161ffe6 Mon Sep 17 00:00:00 2001 From: xboston Date: Fri, 17 May 2013 01:17:49 +0600 Subject: [PATCH 18/27] Update Phalcon_Mvc_ModelInterface --- ext/mvc/modelinterface.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/mvc/modelinterface.h b/ext/mvc/modelinterface.h index af984bb8170..0604662165b 100644 --- a/ext/mvc/modelinterface.h +++ b/ext/mvc/modelinterface.h @@ -52,11 +52,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_cloneresultmap, 0, 0, ZEND_ARG_INFO(0, data) ZEND_ARG_INFO(0, columnMap) ZEND_ARG_INFO(0, dirtyState) + ZEND_ARG_INFO(0, keepSnapshots) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_cloneresult, 0, 0, 2) ZEND_ARG_INFO(0, base) - ZEND_ARG_INFO(0, result) + ZEND_ARG_INFO(0, data) + ZEND_ARG_INFO(0, dirtyState) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_cloneresultmaphydrate, 0, 0, 3) @@ -111,14 +113,17 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_save, 0, 0, 0) ZEND_ARG_INFO(0, data) + ZEND_ARG_INFO(0, whiteList) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_create, 0, 0, 0) ZEND_ARG_INFO(0, data) + ZEND_ARG_INFO(0, whiteList) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_update, 0, 0, 0) ZEND_ARG_INFO(0, data) + ZEND_ARG_INFO(0, whiteList) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_readattribute, 0, 0, 1) @@ -131,7 +136,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_writeattribute, 0, 0, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_getrelated, 0, 0, 1) - ZEND_ARG_INFO(0, modelName) + ZEND_ARG_INFO(0, alias) ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() From 4c1e635a9d6abadaefb0e4675c9b63e03521d127 Mon Sep 17 00:00:00 2001 From: xboston Date: Fri, 17 May 2013 01:29:36 +0600 Subject: [PATCH 19/27] update Phalcon_Mvc_Model_Query_BuilderInterface & Phalcon_Mvc_Model_ManagerInterface --- ext/mvc/model/managerinterface.h | 11 ++++++----- ext/mvc/model/query/builderinterface.h | 7 +++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ext/mvc/model/managerinterface.h b/ext/mvc/model/managerinterface.h index 2608872928b..e021545be19 100644 --- a/ext/mvc/model/managerinterface.h +++ b/ext/mvc/model/managerinterface.h @@ -31,12 +31,13 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_load, 0, 0, 1) ZEND_ARG_INFO(0, modelName) + ZEND_ARG_INFO(0, newInstance) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addhasone, 0, 0, 4) ZEND_ARG_INFO(0, model) ZEND_ARG_INFO(0, fields) - ZEND_ARG_INFO(0, referenceModel) + ZEND_ARG_INFO(0, referencedModel) ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() @@ -44,7 +45,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addbelongsto, 0, 0, 4) ZEND_ARG_INFO(0, model) ZEND_ARG_INFO(0, fields) - ZEND_ARG_INFO(0, referenceModel) + ZEND_ARG_INFO(0, referencedModel) ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() @@ -52,7 +53,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addhasmany, 0, 0, 4) ZEND_ARG_INFO(0, model) ZEND_ARG_INFO(0, fields) - ZEND_ARG_INFO(0, referenceModel) + ZEND_ARG_INFO(0, referencedModel) ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() @@ -117,8 +118,8 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getrelations, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getrelationsbetween, 0, 0, 2) - ZEND_ARG_INFO(0, firstModel) - ZEND_ARG_INFO(0, secondModel) + ZEND_ARG_INFO(0, first) + ZEND_ARG_INFO(0, second) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_createquery, 0, 0, 1) diff --git a/ext/mvc/model/query/builderinterface.h b/ext/mvc/model/query/builderinterface.h index 990a0bdeefc..13eeafee7bb 100644 --- a/ext/mvc/model/query/builderinterface.h +++ b/ext/mvc/model/query/builderinterface.h @@ -42,18 +42,25 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_join, 0, ZEND_ARG_INFO(0, model) ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, alias) + ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_where, 0, 0, 1) ZEND_ARG_INFO(0, conditions) + ZEND_ARG_INFO(0, bindParams) + ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_andwhere, 0, 0, 1) ZEND_ARG_INFO(0, conditions) + ZEND_ARG_INFO(0, bindParams) + ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_orwhere, 0, 0, 1) ZEND_ARG_INFO(0, conditions) + ZEND_ARG_INFO(0, bindParams) + ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_orderby, 0, 0, 1) From c490429e52ddb5af8f76eb73eff13745482ba9f4 Mon Sep 17 00:00:00 2001 From: xboston Date: Fri, 17 May 2013 01:52:14 +0600 Subject: [PATCH 20/27] update Phalcon_DI from ArrayAccess interface --- ext/di.c | 34 +++++++++++++++++----------------- ext/di.h | 10 +++++----- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/ext/di.c b/ext/di.c index 92b8e5fef01..4dd009e96da 100644 --- a/ext/di.c +++ b/ext/di.c @@ -524,19 +524,19 @@ PHP_METHOD(Phalcon_DI, getServices){ /** * Check if a service is registered using the array syntax * - * @param string $alias + * @param string $offset * @return boolean */ PHP_METHOD(Phalcon_DI, offsetExists){ - zval *alias, *exists; + zval *offset, *exists; PHALCON_MM_GROW(); - phalcon_fetch_params(1, 1, 0, &alias); + phalcon_fetch_params(1, 1, 0, &offset); PHALCON_INIT_VAR(exists); - PHALCON_CALL_METHOD_PARAMS_1(exists, this_ptr, "has", alias); + PHALCON_CALL_METHOD_PARAMS_1(exists, this_ptr, "has", offset); RETURN_CCTOR(exists); } @@ -547,18 +547,18 @@ PHP_METHOD(Phalcon_DI, offsetExists){ * $di['request'] = new Phalcon\Http\Request(); * * - * @param string $alias - * @param mixed $definition + * @param string $offset + * @param mixed $value */ PHP_METHOD(Phalcon_DI, offsetSet){ - zval *alias, *definition; + zval *offset, *value; PHALCON_MM_GROW(); - phalcon_fetch_params(1, 2, 0, &alias, &definition); + phalcon_fetch_params(1, 2, 0, &offset, &value); - PHALCON_CALL_METHOD_PARAMS_2_NORETURN(this_ptr, "setshared", alias, definition); + PHALCON_CALL_METHOD_PARAMS_2_NORETURN(this_ptr, "setshared", offset, value); PHALCON_MM_RESTORE(); } @@ -570,34 +570,34 @@ PHP_METHOD(Phalcon_DI, offsetSet){ * var_dump($di['request']); * * - * @param string $alias + * @param string $offset * @return mixed */ PHP_METHOD(Phalcon_DI, offsetGet){ - zval *alias, *service; + zval *offset, *service; PHALCON_MM_GROW(); - phalcon_fetch_params(1, 1, 0, &alias); + phalcon_fetch_params(1, 1, 0, &offset); PHALCON_INIT_VAR(service); - PHALCON_CALL_METHOD_PARAMS_1(service, this_ptr, "getshared", alias); + PHALCON_CALL_METHOD_PARAMS_1(service, this_ptr, "getshared", offset); RETURN_CCTOR(service); } /** * Removes a service from the services container using the array syntax * - * @param string $alias + * @param string $offset */ PHP_METHOD(Phalcon_DI, offsetUnset){ - zval *alias; + zval *offset; - phalcon_fetch_params(0, 1, 0, &alias); + phalcon_fetch_params(0, 1, 0, &offset); - RETURN_CCTORW(alias); + RETURN_CCTORW(offset); } /** diff --git a/ext/di.h b/ext/di.h index 9e446b4c14c..c1b38d808a9 100644 --- a/ext/di.h +++ b/ext/di.h @@ -93,20 +93,20 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_has, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_offsetexists, 0, 0, 1) - ZEND_ARG_INFO(0, alias) + ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_offsetset, 0, 0, 2) - ZEND_ARG_INFO(0, alias) - ZEND_ARG_INFO(0, definition) + ZEND_ARG_INFO(0, offset) + ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_offsetget, 0, 0, 1) - ZEND_ARG_INFO(0, alias) + ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_offsetunset, 0, 0, 1) - ZEND_ARG_INFO(0, alias) + ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di___call, 0, 0, 1) From 89c5a24a930e545d6d2c9e66256f79c5e1e1a3ff Mon Sep 17 00:00:00 2001 From: boston Date: Fri, 17 May 2013 15:57:41 +0600 Subject: [PATCH 21/27] Add redirection based on a named route --- ext/http/response.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/http/response.c b/ext/http/response.c index bf0c2d3caec..5134f477323 100755 --- a/ext/http/response.c +++ b/ext/http/response.c @@ -1,4 +1,3 @@ - /* +------------------------------------------------------------------------+ | Phalcon Framework | @@ -505,9 +504,15 @@ PHP_METHOD(Phalcon_Http_Response, setEtag){ * $response->redirect("posts/index"); * $response->redirect("http://en.wikipedia.org", true); * $response->redirect("http://www.example.com/new-location", true, 301); + * //Making a redirection based on a named route + * $response->redirect(array( + * "for" => "index-lang", + * "lang" => "jp", + * "controller" => "index" + * )); * * - * @param string $location + * @param mixed $location * @param boolean $externalRedirect * @param int $statusCode * @return Phalcon\Http\ResponseInterface From 12e18d74536e92f86c771c6a8b294c0b8ee4821e Mon Sep 17 00:00:00 2001 From: lantian Date: Mon, 20 May 2013 14:27:43 +0300 Subject: [PATCH 22/27] Fix for assets css remote path --- ext/assets/manager.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/ext/assets/manager.c b/ext/assets/manager.c index c14052dd751..4f77856af47 100644 --- a/ext/assets/manager.c +++ b/ext/assets/manager.c @@ -389,8 +389,8 @@ PHP_METHOD(Phalcon_Assets_Manager, collection){ PHP_METHOD(Phalcon_Assets_Manager, outputCss){ zval *collection_name = NULL, *collection = NULL, *output; - zval *use_implicit_output, *resources, *resource = NULL; - zval *path = NULL, *local = NULL, *html = NULL; + zval *use_implicit_output, *resources, *resource = NULL, *prefix; + zval *path = NULL, *local = NULL, *prefixed_path = NULL, *html = NULL; HashTable *ah0; HashPosition hp0; zval **hd; @@ -423,7 +423,13 @@ PHP_METHOD(Phalcon_Assets_Manager, outputCss){ */ PHALCON_INIT_VAR(resources); PHALCON_CALL_METHOD(resources, collection, "getresources"); - + + /** + * Get the collection's prefix + */ + PHALCON_INIT_VAR(prefix); + PHALCON_CALL_METHOD(prefix, collection, "getprefix"); + if (!phalcon_is_iterable(resources, &ah0, &hp0, 0, 0 TSRMLS_CC)) { return; } @@ -437,12 +443,18 @@ PHP_METHOD(Phalcon_Assets_Manager, outputCss){ PHALCON_INIT_NVAR(local); PHALCON_CALL_METHOD(local, resource, "getlocal"); + if (Z_TYPE_P(prefix) != IS_NULL) { + PHALCON_INIT_NVAR(prefixed_path); + PHALCON_CONCAT_VV(prefixed_path, prefix, path); + } else { + PHALCON_CPY_WRT(prefixed_path, path); + } /** * Generate the html using Phalcon\Tag */ PHALCON_INIT_NVAR(html); - PHALCON_CALL_STATIC_PARAMS_2(html, "phalcon\\tag", "stylesheetlink", path, local); + PHALCON_CALL_STATIC_PARAMS_2(html, "phalcon\\tag", "stylesheetlink", prefixed_path, local); if (zend_is_true(use_implicit_output)) { zend_print_zval(html, 0); } else { From 0a146160689e6d6d49976ee8a57427446a8d4513 Mon Sep 17 00:00:00 2001 From: andresgutierrez Date: Tue, 9 Jul 2013 01:07:47 -0500 Subject: [PATCH 23/27] Regenerating build 64bits [ci skip] --- build/64bits/phalcon.c | 200 +++++++++++++++++++++-------------------- build/64bits/phalcon.h | 48 +++------- 2 files changed, 112 insertions(+), 136 deletions(-) diff --git a/build/64bits/phalcon.c b/build/64bits/phalcon.c index 92fe19f6150..2948d624b5a 100644 --- a/build/64bits/phalcon.c +++ b/build/64bits/phalcon.c @@ -181,6 +181,7 @@ PHP includes the Zend Engine, freely available at #include "ext/standard/base64.h" #include "ext/standard/md5.h" #include "ext/standard/head.h" +#include "ext/standard/url.h" #include "ext/spl/spl_heap.h" #if HAVE_BUNDLED_PCRE @@ -1265,8 +1266,6 @@ static void PHALCON_FASTCALL phalcon_copy_ctor(zval *destiny, zval *origin); } \ } -//phalcon_memory_observe(&z TSRMLS_CC); \ - #define PHALCON_SEPARATE(z) \ { \ zval *orig_ptr = z; \ @@ -10438,8 +10437,9 @@ static void phalcon_file_get_contents(zval *return_value, zval *filename TSRMLS_ static void phalcon_file_put_contents(zval *return_value, zval *filename, zval *data TSRMLS_DC) { php_stream *stream; - int numbytes = 0; + int numbytes = 0, use_copy = 0; zval *zcontext = NULL; + zval copy; php_stream_context *context = NULL; if (Z_TYPE_P(filename) != IS_STRING) { @@ -10467,7 +10467,10 @@ static void phalcon_file_put_contents(zval *return_value, zval *filename, zval * case IS_DOUBLE: case IS_BOOL: case IS_CONSTANT: - convert_to_string_ex(&data); + zend_make_printable_zval(data, ©, &use_copy); + if (use_copy) { + data = © + } case IS_STRING: if (Z_STRLEN_P(data)) { @@ -10485,6 +10488,10 @@ static void phalcon_file_put_contents(zval *return_value, zval *filename, zval * php_stream_close(stream); + if (use_copy) { + zval_dtor(data); + } + if (numbytes < 0) { if (return_value) { RETURN_FALSE; @@ -12415,8 +12422,6 @@ static void phalcon_raw_url_encode(zval *return_value, zval *url) { - - #ifdef HAVE_CONFIG_H #endif @@ -18881,15 +18886,26 @@ static PHP_METHOD(Phalcon_Assets_Manager, output){ if (Z_TYPE_P(filters) == IS_ARRAY) { if (!zend_is_true(join)) { + if (zend_is_true(local)) { - PHALCON_INIT_NVAR(source_path); - phalcon_call_method_p1_key(source_path, resource, "getrealsourcepath", complete_source_path, 13776328471776670855UL); + PHALCON_INIT_NVAR(source_path); + phalcon_call_method_p1_key(source_path, resource, "getrealsourcepath", complete_source_path, 13776328471776670855UL); - if (!zend_is_true(source_path)) { - PHALCON_INIT_NVAR(exception_message); - PHALCON_CONCAT_SVS(exception_message, "Resource '", source_path, "' does not have a valid source path"); - PHALCON_THROW_EXCEPTION_ZVAL(phalcon_assets_exception_ce, exception_message); - return; + if (!zend_is_true(source_path)) { + PHALCON_INIT_NVAR(source_path); + phalcon_call_method_key(source_path, resource, "getpath", 7572409588790706UL); + + PHALCON_INIT_NVAR(exception_message); + PHALCON_CONCAT_SVS(exception_message, "Resource '", source_path, "' does not have a valid source path"); + PHALCON_THROW_EXCEPTION_ZVAL(phalcon_assets_exception_ce, exception_message); + return; + } + } else { + PHALCON_INIT_NVAR(source_path); + phalcon_call_method_key(source_path, resource, "getpath", 7572409588790706UL); + + PHALCON_INIT_NVAR(filter_needed); + ZVAL_BOOL(filter_needed, 1); } PHALCON_INIT_NVAR(target_path); @@ -18902,21 +18918,23 @@ static PHP_METHOD(Phalcon_Assets_Manager, output){ return; } - if (PHALCON_IS_EQUAL(target_path, source_path)) { - PHALCON_INIT_NVAR(exception_message); - PHALCON_CONCAT_SVS(exception_message, "Resource '", target_path, "' have the same source and target paths"); - PHALCON_THROW_EXCEPTION_ZVAL(phalcon_assets_exception_ce, exception_message); - return; - } + if (zend_is_true(local)) { - if (phalcon_file_exists(target_path TSRMLS_CC) == SUCCESS) { - if (phalcon_compare_mtime(target_path, source_path TSRMLS_CC)) { + if (PHALCON_IS_EQUAL(target_path, source_path)) { + PHALCON_INIT_NVAR(exception_message); + PHALCON_CONCAT_SVS(exception_message, "Resource '", target_path, "' have the same source and target paths"); + PHALCON_THROW_EXCEPTION_ZVAL(phalcon_assets_exception_ce, exception_message); + return; + } + if (phalcon_file_exists(target_path TSRMLS_CC) == SUCCESS) { + if (phalcon_compare_mtime(target_path, source_path TSRMLS_CC)) { + PHALCON_INIT_NVAR(filter_needed); + ZVAL_BOOL(filter_needed, 1); + } + } else { PHALCON_INIT_NVAR(filter_needed); ZVAL_BOOL(filter_needed, 1); } - } else { - PHALCON_INIT_NVAR(filter_needed); - ZVAL_BOOL(filter_needed, 1); } } } @@ -18924,7 +18942,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, output){ if (Z_TYPE_P(filters) != IS_ARRAY) { PHALCON_INIT_NVAR(path); - phalcon_call_method_key(path, resource, "getpath", 7572409588790706UL); + phalcon_call_method_key(path, resource, "getrealtargeturi", 6566405770179792128UL); if (Z_TYPE_P(prefix) != IS_NULL) { PHALCON_INIT_NVAR(prefixed_path); PHALCON_CONCAT_VV(prefixed_path, prefix, path); @@ -19018,7 +19036,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, output){ if (!zend_is_true(join)) { PHALCON_INIT_NVAR(path); - phalcon_call_method_key(path, resource, "getpath", 7572409588790706UL); + phalcon_call_method_key(path, resource, "getrealtargeturi", 6566405770179792128UL); if (Z_TYPE_P(prefix) != IS_NULL) { PHALCON_INIT_NVAR(prefixed_path); PHALCON_CONCAT_VV(prefixed_path, prefix, path); @@ -19476,7 +19494,7 @@ static PHP_METHOD(Phalcon_Assets_Resource, getTargetPath){ static PHP_METHOD(Phalcon_Assets_Resource, getContent){ zval *base_path = NULL, *source_path = NULL, *complete_path; - zval *local, *exception_message, *content; + zval *local, *exception_message = NULL, *content; PHALCON_MM_GROW(); @@ -19511,13 +19529,35 @@ static PHP_METHOD(Phalcon_Assets_Resource, getContent){ PHALCON_INIT_VAR(content); phalcon_file_get_contents(content, complete_path TSRMLS_CC); + if (PHALCON_IS_FALSE(content)) { + PHALCON_INIT_NVAR(exception_message); + PHALCON_CONCAT_SVS(exception_message, "Resource's content for \"", complete_path, "\" cannot be read"); + PHALCON_THROW_EXCEPTION_ZVAL(phalcon_assets_exception_ce, exception_message); + return; + } RETURN_CCTOR(content); } +static PHP_METHOD(Phalcon_Assets_Resource, getRealTargetUri){ + + zval *target_uri = NULL; + + PHALCON_MM_GROW(); + + PHALCON_OBS_VAR(target_uri); + phalcon_read_property_this_quick(&target_uri, this_ptr, SL("_targetUri"), 13863683271474122203UL, PH_NOISY_CC); + if (PHALCON_IS_EMPTY(target_uri)) { + PHALCON_OBS_NVAR(target_uri); + phalcon_read_property_this_quick(&target_uri, this_ptr, SL("_path"), 6953243442321UL, PH_NOISY_CC); + } + + RETURN_CCTOR(target_uri); +} + static PHP_METHOD(Phalcon_Assets_Resource, getRealSourcePath){ - zval *base_path = NULL, *source_path = NULL, *complete_path; + zval *base_path = NULL, *source_path = NULL, *local, *complete_path; zval *real_complete_path; PHALCON_MM_GROW(); @@ -19535,18 +19575,23 @@ static PHP_METHOD(Phalcon_Assets_Resource, getRealSourcePath){ phalcon_read_property_this_quick(&source_path, this_ptr, SL("_path"), 6953243442321UL, PH_NOISY_CC); } - PHALCON_INIT_VAR(complete_path); - PHALCON_CONCAT_VV(complete_path, base_path, source_path); + PHALCON_OBS_VAR(local); + phalcon_read_property_this_quick(&local, this_ptr, SL("_local"), 229456893042927UL, PH_NOISY_CC); + if (zend_is_true(local)) { + PHALCON_INIT_VAR(complete_path); + PHALCON_CONCAT_VV(complete_path, base_path, source_path); - PHALCON_INIT_VAR(real_complete_path); - phalcon_call_func_p1(real_complete_path, "realpath", complete_path); + PHALCON_INIT_VAR(real_complete_path); + phalcon_call_func_p1(real_complete_path, "realpath", complete_path); + RETURN_CCTOR(real_complete_path); + } - RETURN_CCTOR(real_complete_path); + RETURN_CCTOR(source_path); } static PHP_METHOD(Phalcon_Assets_Resource, getRealTargetPath){ - zval *base_path = NULL, *target_path = NULL, *complete_path; + zval *base_path = NULL, *target_path = NULL, *local, *complete_path; zval *real_complete_path; PHALCON_MM_GROW(); @@ -19564,16 +19609,23 @@ static PHP_METHOD(Phalcon_Assets_Resource, getRealTargetPath){ phalcon_read_property_this_quick(&target_path, this_ptr, SL("_path"), 6953243442321UL, PH_NOISY_CC); } - PHALCON_INIT_VAR(complete_path); - PHALCON_CONCAT_VV(complete_path, base_path, target_path); + PHALCON_OBS_VAR(local); + phalcon_read_property_this_quick(&local, this_ptr, SL("_local"), 229456893042927UL, PH_NOISY_CC); + if (zend_is_true(local)) { - if (phalcon_file_exists(complete_path TSRMLS_CC) == SUCCESS) { - PHALCON_INIT_VAR(real_complete_path); - phalcon_call_func_p1(real_complete_path, "realpath", complete_path); - RETURN_CCTOR(real_complete_path); + PHALCON_INIT_VAR(complete_path); + PHALCON_CONCAT_VV(complete_path, base_path, target_path); + + if (phalcon_file_exists(complete_path TSRMLS_CC) == SUCCESS) { + PHALCON_INIT_VAR(real_complete_path); + phalcon_call_func_p1(real_complete_path, "realpath", complete_path); + RETURN_CCTOR(real_complete_path); + } + + RETURN_CTOR(complete_path); } - RETURN_CTOR(complete_path); + RETURN_CCTOR(target_path); } @@ -19747,8 +19799,7 @@ static PHP_METHOD(Phalcon_Cache_Backend_Apc, delete){ static PHP_METHOD(Phalcon_Cache_Backend_Apc, queryKeys){ zval *prefix = NULL, *keys, *type, *prefix_pattern, *iterator; - zval *key = NULL, *real_key = NULL; - zval *r0 = NULL; + zval *key = NULL; zend_class_entry *ce0; #if PHP_VERSION_ID < 50500 char *str_key; @@ -23681,7 +23732,7 @@ static void array_merge_recursive_n(zval **a1, zval *a2 TSRMLS_DC) static PHP_METHOD(Phalcon_Config, merge){ zval *config, *array_config, *value = NULL, *key = NULL, *active_value = NULL; - zval *other_array = NULL, *tmp = NULL; + zval *other_array = NULL; HashTable *ah0; HashPosition hp0; zval **hd; @@ -33532,15 +33583,9 @@ static PHP_METHOD(Phalcon_Debug, onUncaughtException){ PHALCON_INIT_VAR(ob_level); phalcon_call_func(ob_level, "ob_get_level"); -<<<<<<< HEAD - PHALCON_INIT_VAR(type); - PHALCON_CALL_METHOD(type, connection, "gettype"); - if (PHALCON_IS_STRING(type, "sqlite") || PHALCON_IS_STRING(type, "oci")) { -======= if (PHALCON_GT_LONG(ob_level, 0)) { phalcon_ob_end_clean(TSRMLS_C); } ->>>>>>> 1.2.0 PHALCON_OBS_VAR(is_active); phalcon_read_static_property(&is_active, SL("phalcon\\debug"), SL("_isActive") TSRMLS_CC); @@ -38841,6 +38886,9 @@ static PHP_METHOD(Phalcon_Forms_Element, prepareAttributes){ phalcon_array_update_string_string(&merged_attributes, SL("checked"), SL("checked"), PH_SEPARATE TSRMLS_CC); } } else { + if (zend_is_true(value)) { + phalcon_array_update_string_string(&merged_attributes, SL("checked"), SL("checked"), PH_SEPARATE TSRMLS_CC); + } phalcon_array_update_quick_string(&merged_attributes, SS("value"), 6954126163842UL, &value, PH_COPY | PH_SEPARATE TSRMLS_CC); } } else { @@ -46672,7 +46720,7 @@ static PHP_METHOD(Phalcon_Mvc_Collection, _getResultset){ if (phalcon_array_isset_quick_string(params, SS("fields"), 229465804380252UL)) { PHALCON_INIT_VAR(base); - object_init(base); + object_init_ex(base, phalcon_mvc_collection_document_ce); } else { PHALCON_CPY_WRT(base, collection); } @@ -59214,13 +59262,6 @@ static int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql return FAILURE; } -<<<<<<< HEAD - if (PHALCON_GLOBAL(orm.parser_cache)) { - if (zend_hash_find(PHALCON_GLOBAL(orm.parser_cache), phql, phql_length, (void**) &temp_ast) == SUCCESS) { - ZVAL_ZVAL(*result, *temp_ast, 1, 0); - Z_SET_REFCOUNT_P(*result, 1); - return SUCCESS; -======= if (phalcon_globals_ptr->orm.cache_level >= 0) { phql_key = zend_inline_hash_func(phql, phql_length + 1); @@ -59231,7 +59272,6 @@ static int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql Z_SET_REFCOUNT_P(*result, 1); return SUCCESS; } ->>>>>>> 1.2.0 } } @@ -59604,12 +59644,7 @@ static int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql return status; } -<<<<<<< HEAD - -/* Generated by re2c 0.13.5 on Fri May 3 00:16:18 2013 */ -======= /* Generated by re2c 0.13.5 on Sun Jun 23 22:30:45 2013 */ ->>>>>>> 1.2.0 // 1 "scanner.re" @@ -72122,20 +72157,11 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ zval *service, *meta_data, *bind_types, *bind_data_types; zval *column_map = NULL, *conditions, *bind_params; zval *number = NULL, *compose_field = NULL, *column_field = NULL; -<<<<<<< HEAD - zval *exception_message = NULL, *value = NULL, *bind_type = NULL; - zval *condition = NULL, *operation_made, *primary_fields; - zval *primary_field = NULL, *attribute_field = NULL, *params; - zval *class_name, *message = NULL, *type; - zval *r0 = NULL, *r1 = NULL; - zval *message_field = NULL, *mmesage = NULL; -======= zval *exception_message = NULL, *value = NULL, *compose_condition = NULL; zval *bind_type = NULL, *condition = NULL, *operation_made; zval *primary_fields, *primary_field = NULL, *attribute_field = NULL; zval *join_conditions, *params, *class_name; zval *message = NULL, *join_fields, *type; ->>>>>>> 1.2.0 HashTable *ah0, *ah1; HashPosition hp0, hp1; zval **hd; @@ -72183,9 +72209,6 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ phalcon_is_iterable(field, &ah0, &hp0, 0, 0); - PHALCON_INIT_VAR(message_field); - array_init(message_field); - while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) { PHALCON_GET_HVALUE(compose_field); @@ -72223,13 +72246,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ phalcon_array_fetch(&bind_type, bind_data_types, column_field, PH_NOISY_CC); phalcon_array_append(&bind_types, bind_type, PH_SEPARATE TSRMLS_CC); PHALCON_SEPARATE(number); -<<<<<<< HEAD - increment_function(number); - - phalcon_array_append(&message_field, compose_field, PH_SEPARATE TSRMLS_CC); -======= phalcon_increment(number); ->>>>>>> 1.2.0 zend_hash_move_forward_ex(ah0, &hp0); } @@ -72353,11 +72370,6 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ PHALCON_INIT_VAR(message); phalcon_call_method_p1_key(message, this_ptr, "getoption", option, 8246354041488802206UL); if (!zend_is_true(message)) { -<<<<<<< HEAD - PHALCON_INIT_NVAR(message); - - if( Z_TYPE_P(field) == IS_ARRAY ){ -======= if (Z_TYPE_P(field) == IS_ARRAY) { PHALCON_INIT_VAR(join_fields); phalcon_fast_join_str(join_fields, SL(", "), field TSRMLS_CC); @@ -72369,17 +72381,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate){ PHALCON_CONCAT_SVS(message, "Value of field: '", field, "' is already present in another record"); } } ->>>>>>> 1.2.0 - PHALCON_INIT_VAR(mmesage); - phalcon_fast_join_str(mmesage, SL("', '"), message_field TSRMLS_CC); - PHALCON_CPY_WRT(message_field, mmesage); - - PHALCON_CONCAT_SVS(message, "Value of fields '", mmesage,"' is already present in another record"); - }else{ - PHALCON_CONCAT_SVS(message, "Value of field '", field,"' is already present in another record"); - } - } PHALCON_INIT_VAR(type); ZVAL_STRING(type, "Unique", 1); phalcon_call_method_p3_noret_key(this_ptr, "appendmessage", message, field, type, 2989013970055964674UL); @@ -100041,8 +100043,8 @@ static PHP_METHOD(Phalcon_Version, _getVersion){ add_next_index_long(version, 1); add_next_index_long(version, 2); add_next_index_long(version, 0); - add_next_index_long(version, 2); - add_next_index_long(version, 3); + add_next_index_long(version, 4); + add_next_index_long(version, 0); RETURN_CTOR(version); } diff --git a/build/64bits/phalcon.h b/build/64bits/phalcon.h index 3c06764af65..926d5f8f021 100644 --- a/build/64bits/phalcon.h +++ b/build/64bits/phalcon.h @@ -319,18 +319,20 @@ zend_class_entry *phalcon_db_adapterinterface_ce; PHALCON_INIT_CLASS(Phalcon_Db_AdapterInterface); +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface___construct, 0, 0, 1) + ZEND_ARG_INFO(0, descriptor) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_fetchone, 0, 0, 1) ZEND_ARG_INFO(0, sqlQuery) ZEND_ARG_INFO(0, fetchMode) - ZEND_ARG_INFO(0, bindParams) - ZEND_ARG_INFO(0, bindTypes) + ZEND_ARG_INFO(0, placeholders) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_fetchall, 0, 0, 1) ZEND_ARG_INFO(0, sqlQuery) ZEND_ARG_INFO(0, fetchMode) - ZEND_ARG_INFO(0, bindParams) - ZEND_ARG_INFO(0, bindTypes) + ZEND_ARG_INFO(0, placeholders) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_insert, 0, 0, 2) @@ -541,7 +543,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_describecolumns, 0, 0 ZEND_END_ARG_INFO() PHALCON_INIT_FUNCS(phalcon_db_adapterinterface_method_entry){ - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, __construct, NULL) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, __construct, arginfo_phalcon_db_adapterinterface___construct) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, fetchOne, arginfo_phalcon_db_adapterinterface_fetchone) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, fetchAll, arginfo_phalcon_db_adapterinterface_fetchall) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, insert, arginfo_phalcon_db_adapterinterface_insert) @@ -1393,7 +1395,6 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_getparam, 0, 0, 1) ZEND_ARG_INFO(0, param) ZEND_ARG_INFO(0, filters) - ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_forward, 0, 0, 1) @@ -1505,14 +1506,8 @@ zend_class_entry *phalcon_mvc_model_managerinterface_ce; PHALCON_INIT_CLASS(Phalcon_Mvc_Model_ManagerInterface); -<<<<<<< HEAD -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface___construct, 0, 0, 0) - ZEND_ARG_INFO(0, dependencyInjector) - ZEND_ARG_INFO(0, modelsManager) -======= ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_initialize, 0, 0, 1) ZEND_ARG_INFO(0, model) ->>>>>>> 1.2.0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_isinitialized, 0, 0, 1) @@ -1762,7 +1757,7 @@ zend_class_entry *phalcon_mvc_model_queryinterface_ce; PHALCON_INIT_CLASS(Phalcon_Mvc_Model_QueryInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_queryinterface___construct, 0, 0, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_queryinterface___construct, 0, 0, 1) ZEND_ARG_INFO(0, phql) ZEND_END_ARG_INFO() @@ -3095,7 +3090,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapehtml, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapehtmlattr, 0, 0, 1) - ZEND_ARG_INFO(0, attribute) + ZEND_ARG_INFO(0, text) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapecss, 0, 0, 1) @@ -3321,31 +3316,16 @@ zend_class_entry *phalcon_mvc_model_criteriainterface_ce; PHALCON_INIT_CLASS(Phalcon_Mvc_Model_CriteriaInterface); -<<<<<<< HEAD -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_attach, 0, 0, 2) - ZEND_ARG_INFO(0, eventType) - ZEND_ARG_INFO(0, handler) - ZEND_ARG_INFO(0, priority) -======= ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_setmodelname, 0, 0, 1) ZEND_ARG_INFO(0, modelName) ->>>>>>> 1.2.0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_bind, 0, 0, 1) ZEND_ARG_INFO(0, bindParams) ZEND_END_ARG_INFO() -<<<<<<< HEAD -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_fire, 0, 0, 2) - ZEND_ARG_INFO(0, eventType) - ZEND_ARG_INFO(0, source) - ZEND_ARG_INFO(0, data) - ZEND_ARG_INFO(0, cancelable) -======= ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_bindtypes, 0, 0, 1) ZEND_ARG_INFO(0, bindTypes) ->>>>>>> 1.2.0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_where, 0, 0, 1) @@ -3385,18 +3365,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_orwhere, 0, 0 ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -<<<<<<< HEAD -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_messageinterface___construct, 0, 0, 1) - ZEND_ARG_INFO(0, message) - ZEND_ARG_INFO(0, field) - ZEND_ARG_INFO(0, type) - ZEND_ARG_INFO(0, model) -======= ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_betweenwhere, 0, 0, 3) ZEND_ARG_INFO(0, expr) ZEND_ARG_INFO(0, minimum) ZEND_ARG_INFO(0, maximum) ->>>>>>> 1.2.0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_notbetweenwhere, 0, 0, 3) @@ -4879,6 +4851,7 @@ static PHP_METHOD(Phalcon_Assets_Resource, getSourcePath); static PHP_METHOD(Phalcon_Assets_Resource, setTargetPath); static PHP_METHOD(Phalcon_Assets_Resource, getTargetPath); static PHP_METHOD(Phalcon_Assets_Resource, getContent); +static PHP_METHOD(Phalcon_Assets_Resource, getRealTargetUri); static PHP_METHOD(Phalcon_Assets_Resource, getRealSourcePath); static PHP_METHOD(Phalcon_Assets_Resource, getRealTargetPath); @@ -4953,6 +4926,7 @@ PHALCON_INIT_FUNCS(phalcon_assets_resource_method_entry){ PHP_ME(Phalcon_Assets_Resource, setTargetPath, arginfo_phalcon_assets_resource_settargetpath, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Resource, getTargetPath, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Resource, getContent, arginfo_phalcon_assets_resource_getcontent, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Resource, getRealTargetUri, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Resource, getRealSourcePath, arginfo_phalcon_assets_resource_getrealsourcepath, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Resource, getRealTargetPath, arginfo_phalcon_assets_resource_getrealtargetpath, ZEND_ACC_PUBLIC) PHP_FE_END From 02b3dfe22dc050d64be8d8a562ff9e6d819ae635 Mon Sep 17 00:00:00 2001 From: phalcon Date: Tue, 9 Jul 2013 01:18:05 -0500 Subject: [PATCH 24/27] Creating missing unit-tests/cache/dummy --- unit-tests/cache/dummy | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 unit-tests/cache/dummy diff --git a/unit-tests/cache/dummy b/unit-tests/cache/dummy new file mode 100644 index 00000000000..e69de29bb2d From a0817f059b78676b8ff40347071eb8f81e84746c Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Tue, 9 Jul 2013 20:26:26 +0300 Subject: [PATCH 25/27] Fix for #812 --- ext/mvc/application.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/ext/mvc/application.c b/ext/mvc/application.c index 5ae342bca4a..e601f5d1a25 100755 --- a/ext/mvc/application.c +++ b/ext/mvc/application.c @@ -356,23 +356,7 @@ PHP_METHOD(Phalcon_Mvc_Application, handle){ * An array module definition contains a path to a module definition class */ if (Z_TYPE_P(module) == IS_ARRAY) { - if (phalcon_array_isset_string(module, SS("path"))) { - - PHALCON_OBS_VAR(path); - phalcon_array_fetch_string(&path, module, SL("path"), PH_NOISY_CC); - if (phalcon_file_exists(path TSRMLS_CC) == SUCCESS) { - if (phalcon_require(path TSRMLS_CC) == FAILURE) { - return; - } - } else { - PHALCON_INIT_NVAR(exception_msg); - PHALCON_CONCAT_SVS(exception_msg, "Module definition path '", path, "' doesn't exist"); - PHALCON_THROW_EXCEPTION_ZVAL(phalcon_mvc_application_exception_ce, exception_msg); - return; - } - } - - /** + /** * Class name used to load the module definition */ if (phalcon_array_isset_string(module, SS("className"))) { @@ -382,6 +366,24 @@ PHP_METHOD(Phalcon_Mvc_Application, handle){ PHALCON_INIT_NVAR(class_name); ZVAL_STRING(class_name, "Module", 1); } + + if (!phalcon_class_exists(class_name TSRMLS_CC)) { + if (phalcon_array_isset_string(module, SS("path"))) { + + PHALCON_OBS_VAR(path); + phalcon_array_fetch_string(&path, module, SL("path"), PH_NOISY_CC); + if (phalcon_file_exists(path TSRMLS_CC) == SUCCESS) { + if (phalcon_require(path TSRMLS_CC) == FAILURE) { + return; + } + } else { + PHALCON_INIT_NVAR(exception_msg); + PHALCON_CONCAT_SVS(exception_msg, "Module definition path '", path, "' doesn't exist"); + PHALCON_THROW_EXCEPTION_ZVAL(phalcon_mvc_application_exception_ce, exception_msg); + return; + } + } + } phalcon_call_method_p1(module_object, dependency_injector, "get", class_name); From 1dbc01e1bff9e26cba9f8e0be589e71b318d5a0f Mon Sep 17 00:00:00 2001 From: lantian Date: Tue, 9 Jul 2013 23:47:42 +0300 Subject: [PATCH 26/27] Added boolean type to database dialects. --- ext/db/dialect/mysql.c | 7 ++++++- ext/db/dialect/oracle.c | 7 ++++++- ext/db/dialect/postgresql.c | 5 +++++ ext/db/dialect/sqlite.c | 5 +++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ext/db/dialect/mysql.c b/ext/db/dialect/mysql.c index 1855228af42..75b13bb48da 100755 --- a/ext/db/dialect/mysql.c +++ b/ext/db/dialect/mysql.c @@ -163,7 +163,12 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition){ } break; - + + case 8: + PHALCON_INIT_VAR(column_sql); + ZVAL_STRING(column_sql, "TINYINT(1)", 1); + break; + default: PHALCON_THROW_EXCEPTION_STR(phalcon_db_exception_ce, "Unrecognized MySQL data type"); return; diff --git a/ext/db/dialect/oracle.c b/ext/db/dialect/oracle.c index 3a10891881b..66f0bb5b598 100644 --- a/ext/db/dialect/oracle.c +++ b/ext/db/dialect/oracle.c @@ -135,7 +135,12 @@ PHP_METHOD(Phalcon_Db_Dialect_Oracle, getColumnDefinition){ PHALCON_INIT_NVAR(column_sql); PHALCON_CONCAT_SVSVS(column_sql, "FLOAT(", size, ",", scale, ")"); break; - + + case 8: + PHALCON_INIT_VAR(column_sql); + ZVAL_STRING(column_sql, "TINYINT(1)", 1); + break; + default: PHALCON_THROW_EXCEPTION_STR(phalcon_db_exception_ce, "Unrecognized Oracle data type"); return; diff --git a/ext/db/dialect/postgresql.c b/ext/db/dialect/postgresql.c index d89bc2d07b3..779c291dd5a 100644 --- a/ext/db/dialect/postgresql.c +++ b/ext/db/dialect/postgresql.c @@ -130,6 +130,11 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition){ PHALCON_INIT_NVAR(column_sql); ZVAL_STRING(column_sql, "FLOAT", 1); break; + + case 8: + PHALCON_INIT_VAR(column_sql); + ZVAL_STRING(column_sql, "SMALLINT(1)", 1); + break; default: PHALCON_THROW_EXCEPTION_STR(phalcon_db_exception_ce, "Unrecognized PostgreSQL data type"); diff --git a/ext/db/dialect/sqlite.c b/ext/db/dialect/sqlite.c index 62afc219f5e..7de011cf178 100644 --- a/ext/db/dialect/sqlite.c +++ b/ext/db/dialect/sqlite.c @@ -131,6 +131,11 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, getColumnDefinition){ PHALCON_INIT_NVAR(column_sql); ZVAL_STRING(column_sql, "FLOAT", 1); break; + + case 8: + PHALCON_INIT_VAR(column_sql); + ZVAL_STRING(column_sql, "TINYINT(1)", 1); + break; default: PHALCON_THROW_EXCEPTION_STR(phalcon_db_exception_ce, "Unrecognized SQLite data type"); From 45ff525872d991a079f3dfe154e20d74a4957808 Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Tue, 9 Jul 2013 20:26:26 +0300 Subject: [PATCH 27/27] Fix for #812 --- ext/mvc/application.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/ext/mvc/application.c b/ext/mvc/application.c index 5ae342bca4a..e601f5d1a25 100755 --- a/ext/mvc/application.c +++ b/ext/mvc/application.c @@ -356,23 +356,7 @@ PHP_METHOD(Phalcon_Mvc_Application, handle){ * An array module definition contains a path to a module definition class */ if (Z_TYPE_P(module) == IS_ARRAY) { - if (phalcon_array_isset_string(module, SS("path"))) { - - PHALCON_OBS_VAR(path); - phalcon_array_fetch_string(&path, module, SL("path"), PH_NOISY_CC); - if (phalcon_file_exists(path TSRMLS_CC) == SUCCESS) { - if (phalcon_require(path TSRMLS_CC) == FAILURE) { - return; - } - } else { - PHALCON_INIT_NVAR(exception_msg); - PHALCON_CONCAT_SVS(exception_msg, "Module definition path '", path, "' doesn't exist"); - PHALCON_THROW_EXCEPTION_ZVAL(phalcon_mvc_application_exception_ce, exception_msg); - return; - } - } - - /** + /** * Class name used to load the module definition */ if (phalcon_array_isset_string(module, SS("className"))) { @@ -382,6 +366,24 @@ PHP_METHOD(Phalcon_Mvc_Application, handle){ PHALCON_INIT_NVAR(class_name); ZVAL_STRING(class_name, "Module", 1); } + + if (!phalcon_class_exists(class_name TSRMLS_CC)) { + if (phalcon_array_isset_string(module, SS("path"))) { + + PHALCON_OBS_VAR(path); + phalcon_array_fetch_string(&path, module, SL("path"), PH_NOISY_CC); + if (phalcon_file_exists(path TSRMLS_CC) == SUCCESS) { + if (phalcon_require(path TSRMLS_CC) == FAILURE) { + return; + } + } else { + PHALCON_INIT_NVAR(exception_msg); + PHALCON_CONCAT_SVS(exception_msg, "Module definition path '", path, "' doesn't exist"); + PHALCON_THROW_EXCEPTION_ZVAL(phalcon_mvc_application_exception_ce, exception_msg); + return; + } + } + } phalcon_call_method_p1(module_object, dependency_injector, "get", class_name);