Skip to content

Commit a16bcab

Browse files
committed
merge 1.2.1
1 parent df3cad1 commit a16bcab

File tree

3 files changed

+330
-261
lines changed

3 files changed

+330
-261
lines changed

build/32bits/phalcon.c

+110-87
Original file line numberDiff line numberDiff line change
@@ -43830,8 +43830,6 @@ PHALCON_INIT_CLASS(Phalcon_Mvc_Model_Criteria){
4383043830

4383143831
zend_declare_property_null(phalcon_mvc_model_criteria_ce, SL("_model"), ZEND_ACC_PROTECTED TSRMLS_CC);
4383243832
zend_declare_property_null(phalcon_mvc_model_criteria_ce, SL("_params"), ZEND_ACC_PROTECTED TSRMLS_CC);
43833-
zend_declare_property_null(phalcon_mvc_model_criteria_ce, SL("_bindParams"), ZEND_ACC_PROTECTED TSRMLS_CC);
43834-
zend_declare_property_null(phalcon_mvc_model_criteria_ce, SL("_bindTypes"), ZEND_ACC_PROTECTED TSRMLS_CC);
4383543833
zend_declare_property_long(phalcon_mvc_model_criteria_ce, SL("_hiddenParamNumber"), 0, ZEND_ACC_PROTECTED TSRMLS_CC);
4383643834

4383743835
zend_class_implements(phalcon_mvc_model_criteria_ce TSRMLS_CC, 2, phalcon_mvc_model_criteriainterface_ce, phalcon_di_injectionawareinterface_ce);
@@ -44768,7 +44766,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Criteria, fromInput){
4476844766
zval *dependency_injector, *model_name, *data;
4476944767
zval *conditions, *service, *meta_data, *model;
4477044768
zval *data_types, *bind, *value = NULL, *field = NULL, *type = NULL, *condition = NULL;
44771-
zval *value_pattern = NULL, *criteria, *join_conditions;
44769+
zval *value_pattern = NULL, *join_conditions;
4477244770
HashTable *ah0;
4477344771
HashPosition hp0;
4477444772
zval **hd;
@@ -44846,16 +44844,16 @@ static PHP_METHOD(Phalcon_Mvc_Model_Criteria, fromInput){
4484644844

4484744845
}
4484844846

44849-
PHALCON_INIT_VAR(criteria);
44850-
object_init_ex(criteria, phalcon_mvc_model_criteria_ce);
44847+
object_init_ex(return_value, phalcon_mvc_model_criteria_ce);
4485144848
if (phalcon_fast_count_ev(conditions TSRMLS_CC)) {
4485244849
PHALCON_INIT_VAR(join_conditions);
4485344850
phalcon_fast_join_str(join_conditions, SL(" AND "), conditions TSRMLS_CC);
44854-
phalcon_call_method_p1_key(NULL, criteria, "where", join_conditions, 621293632UL);
44855-
phalcon_call_method_p1_key(NULL, criteria, "bind", bind, 254268962UL);
44851+
phalcon_call_method_p1_key(NULL, return_value, "where", join_conditions, 621293632UL);
44852+
phalcon_call_method_p1_key(NULL, return_value, "bind", bind, 254268962UL);
4485644853
}
4485744854

44858-
RETURN_CTOR(criteria);
44855+
phalcon_call_method_p1_key(NULL, return_value, "setmodelname", model_name, 3112384035UL);
44856+
RETURN_MM();
4485944857
}
4486044858

4486144859
static PHP_METHOD(Phalcon_Mvc_Model_Criteria, execute){
@@ -48010,7 +48008,6 @@ static PHP_METHOD(Phalcon_Mvc_Model_Relation, getIntermediateReferencedFields){
4801048008

4801148009

4801248010

48013-
4801448011
#ifdef HAVE_CONFIG_H
4801548012
#endif
4801648013

@@ -89354,18 +89351,6 @@ static PHP_METHOD(Phalcon_Http_Cookie, __construct){
8935489351
ZVAL_STRING(path, "/", 1);
8935589352
}
8935689353

89357-
if (!secure) {
89358-
PHALCON_INIT_VAR(secure);
89359-
}
89360-
89361-
if (!domain) {
89362-
PHALCON_INIT_VAR(domain);
89363-
}
89364-
89365-
if (!http_only) {
89366-
PHALCON_INIT_VAR(http_only);
89367-
}
89368-
8936989354
if (Z_TYPE_P(name) != IS_STRING) {
8937089355
PHALCON_THROW_EXCEPTION_STR(phalcon_http_cookie_exception_ce, "The cookie name must be string");
8937189356
return;
@@ -89380,15 +89365,15 @@ static PHP_METHOD(Phalcon_Http_Cookie, __construct){
8938089365
phalcon_update_property_this_quick(this_ptr, SL("_path"), path, 3986357393UL TSRMLS_CC);
8938189366
}
8938289367

89383-
if (Z_TYPE_P(secure) != IS_NULL) {
89368+
if (secure && Z_TYPE_P(secure) != IS_NULL) {
8938489369
phalcon_update_property_this_quick(this_ptr, SL("_secure"), secure, 2942644203UL TSRMLS_CC);
8938589370
}
8938689371

89387-
if (Z_TYPE_P(domain) != IS_NULL) {
89372+
if (domain && Z_TYPE_P(domain) != IS_NULL) {
8938889373
phalcon_update_property_this_quick(this_ptr, SL("_domain"), domain, 1152978748UL TSRMLS_CC);
8938989374
}
8939089375

89391-
if (Z_TYPE_P(http_only) != IS_NULL) {
89376+
if (http_only && Z_TYPE_P(http_only) != IS_NULL) {
8939289377
phalcon_update_property_this_quick(this_ptr, SL("_httpOnly"), http_only, 41231174UL TSRMLS_CC);
8939389378
}
8939489379

@@ -89532,7 +89517,7 @@ static PHP_METHOD(Phalcon_Http_Cookie, send){
8953289517
zval *name, *value, *expire, *domain, *path, *secure;
8953389518
zval *http_only, *dependency_injector, *definition;
8953489519
zval *service = NULL, *session, *key, *encryption, *crypt;
89535-
zval *encrypt_value = NULL;
89520+
zval *encrypt_value = NULL, *has_session;
8953689521

8953789522
PHALCON_MM_GROW();
8953889523

@@ -89559,66 +89544,65 @@ static PHP_METHOD(Phalcon_Http_Cookie, send){
8955989544

8956089545
PHALCON_OBS_VAR(dependency_injector);
8956189546
phalcon_read_property_this_quick(&dependency_injector, this_ptr, SL("_dependencyInjector"), 765199457UL, PH_NOISY_CC);
89562-
if (Z_TYPE_P(dependency_injector) != IS_OBJECT) {
89563-
PHALCON_THROW_EXCEPTION_STR(phalcon_http_response_exception_ce, "A dependency injection object is required to access the 'session' service");
89564-
return;
89565-
}
89566-
89567-
PHALCON_INIT_VAR(definition);
89568-
array_init(definition);
89569-
if (!PHALCON_IS_LONG(expire, 0)) {
89570-
phalcon_array_update_quick_string(&definition, SS("expire"), 2190139186UL, &expire, PH_COPY | PH_SEPARATE);
89571-
}
89572-
89573-
if (PHALCON_IS_NOT_EMPTY(path)) {
89574-
phalcon_array_update_quick_string(&definition, SS("path"), 270591026UL, &path, PH_COPY | PH_SEPARATE);
89575-
}
89576-
89577-
if (PHALCON_IS_NOT_EMPTY(domain)) {
89578-
phalcon_array_update_quick_string(&definition, SS("domain"), 542597917UL, &domain, PH_COPY | PH_SEPARATE);
89579-
}
89580-
89581-
if (PHALCON_IS_NOT_EMPTY(secure)) {
89582-
phalcon_array_update_quick_string(&definition, SS("secure"), 2332263372UL, &secure, PH_COPY | PH_SEPARATE);
89583-
}
89584-
89585-
if (PHALCON_IS_NOT_EMPTY(http_only)) {
89586-
phalcon_array_update_quick_string(&definition, SS("httpOnly"), 1056437095UL, &http_only, PH_COPY | PH_SEPARATE);
89587-
}
89588-
89589-
if (phalcon_fast_count_ev(definition TSRMLS_CC)) {
89547+
if (Z_TYPE_P(dependency_injector) == IS_OBJECT) {
8959089548
PHALCON_INIT_VAR(service);
89549+
PHALCON_INIT_VAR(has_session);
8959189550
ZVAL_STRING(service, "session", 1);
89592-
89593-
PHALCON_INIT_VAR(session);
89594-
phalcon_call_method_p1_key(session, dependency_injector, "getshared", service, 1727570332UL);
89595-
89596-
PHALCON_INIT_VAR(key);
89597-
PHALCON_CONCAT_SV(key, "_PHCOOKIE_", name);
89598-
phalcon_call_method_p2_key(NULL, session, "set", key, definition, 2090720177UL);
89551+
89552+
phalcon_call_method_p1_key(has_session, dependency_injector, "has", service, 2090320481UL);
89553+
if (zend_is_true(has_session)) {
89554+
PHALCON_INIT_VAR(definition);
89555+
array_init(definition);
89556+
if (!PHALCON_IS_LONG(expire, 0)) {
89557+
phalcon_array_update_quick_string(&definition, SS("expire"), 2190139186UL, &expire, PH_COPY);
89558+
}
89559+
89560+
if (PHALCON_IS_NOT_EMPTY(path)) {
89561+
phalcon_array_update_quick_string(&definition, SS("path"), 270591026UL, &path, PH_COPY);
89562+
}
89563+
89564+
if (PHALCON_IS_NOT_EMPTY(domain)) {
89565+
phalcon_array_update_quick_string(&definition, SS("domain"), 542597917UL, &domain, PH_COPY);
89566+
}
89567+
89568+
if (PHALCON_IS_NOT_EMPTY(secure)) {
89569+
phalcon_array_update_quick_string(&definition, SS("secure"), 2332263372UL, &secure, PH_COPY);
89570+
}
89571+
89572+
if (PHALCON_IS_NOT_EMPTY(http_only)) {
89573+
phalcon_array_update_quick_string(&definition, SS("httpOnly"), 1056437095UL, &http_only, PH_COPY);
89574+
}
89575+
89576+
if (phalcon_fast_count_ev(definition TSRMLS_CC)) {
89577+
89578+
PHALCON_INIT_VAR(session);
89579+
phalcon_call_method_p1_key(session, dependency_injector, "getshared", service, 1727570332UL);
89580+
89581+
if (Z_TYPE_P(session) != IS_NULL) {
89582+
PHALCON_INIT_VAR(key);
89583+
PHALCON_CONCAT_SV(key, "_PHCOOKIE_", name);
89584+
phalcon_call_method_p2_key(NULL, session, "set", key, definition, 2090720177UL);
89585+
}
89586+
}
89587+
}
8959989588
}
8960089589

8960189590
PHALCON_OBS_VAR(encryption);
8960289591
phalcon_read_property_this_quick(&encryption, this_ptr, SL("_useEncryption"), 2628069468UL, PH_NOISY_CC);
89603-
if (zend_is_true(encryption)) {
89604-
if (PHALCON_IS_NOT_EMPTY(value)) {
89605-
89606-
if (Z_TYPE_P(dependency_injector) != IS_OBJECT) {
89607-
PHALCON_THROW_EXCEPTION_STR(phalcon_http_response_exception_ce, "A dependency injection object is required to access the 'filter' service");
89608-
return;
89609-
}
89610-
89611-
PHALCON_INIT_NVAR(service);
89612-
ZVAL_STRING(service, "crypt", 1);
89613-
89614-
PHALCON_INIT_VAR(crypt);
89615-
phalcon_call_method_p1_key(crypt, dependency_injector, "getshared", service, 1727570332UL);
89616-
89617-
PHALCON_INIT_VAR(encrypt_value);
89618-
phalcon_call_method_p1_key(encrypt_value, crypt, "encryptbase64", value, 681973167UL);
89619-
} else {
89620-
PHALCON_CPY_WRT(encrypt_value, value);
89592+
if (zend_is_true(encryption) && PHALCON_IS_NOT_EMPTY(value)) {
89593+
if (Z_TYPE_P(dependency_injector) != IS_OBJECT) {
89594+
PHALCON_THROW_EXCEPTION_STR(phalcon_http_response_exception_ce, "A dependency injection object is required to access the 'filter' service");
89595+
return;
8962189596
}
89597+
89598+
PHALCON_INIT_NVAR(service);
89599+
ZVAL_STRING(service, "crypt", 1);
89600+
89601+
PHALCON_INIT_VAR(crypt);
89602+
phalcon_call_method_p1_key(crypt, dependency_injector, "getshared", service, 1727570332UL);
89603+
89604+
PHALCON_INIT_VAR(encrypt_value);
89605+
phalcon_call_method_p1_key(encrypt_value, crypt, "encryptbase64", value, 681973167UL);
8962289606
} else {
8962389607
PHALCON_CPY_WRT(encrypt_value, value);
8962489608
}
@@ -97954,6 +97938,52 @@ PHALCON_INIT_CLASS(Phalcon_Config_Exception){
9795497938

9795597939

9795697940

97941+
static inline void phalcon_config_adapter_ini_update_zval_directive(zval **arr, zval *section, zval *directive, zval **value, int flags TSRMLS_DC) {
97942+
zval *temp1 = NULL, *temp2 = NULL, *index = NULL;
97943+
int i, n;
97944+
97945+
n = zend_hash_num_elements(Z_ARRVAL_P(directive));
97946+
97947+
if (Z_TYPE_PP(arr) == IS_ARRAY) {
97948+
phalcon_array_fetch(&temp1, *arr, section, PH_SILENT);
97949+
if (Z_REFCOUNT_P(temp1) > 1) {
97950+
phalcon_array_update_zval(arr, section, &temp1, PH_COPY | PH_CTOR);
97951+
}
97952+
if (Z_TYPE_P(temp1) != IS_ARRAY) {
97953+
convert_to_array(temp1);
97954+
phalcon_array_update_zval(arr, section, &temp1, PH_COPY);
97955+
}
97956+
97957+
for (i = 0; i < n - 1; i++) {
97958+
phalcon_array_fetch_long(&index, directive, i, PH_NOISY);
97959+
97960+
phalcon_array_fetch(&temp2, temp1, index, PH_SILENT);
97961+
if (Z_REFCOUNT_P(temp2) > 1) {
97962+
phalcon_array_update_zval(&temp1, index, &temp2, PH_COPY | PH_CTOR);
97963+
}
97964+
if (Z_TYPE_P(temp2) != IS_ARRAY) {
97965+
convert_to_array(temp2);
97966+
phalcon_array_update_zval(&temp1, index, &temp2, PH_COPY);
97967+
}
97968+
zval_ptr_dtor(&index);
97969+
97970+
if (temp1 != NULL) {
97971+
zval_ptr_dtor(&temp1);
97972+
}
97973+
temp1 = temp2;
97974+
temp2 = NULL;
97975+
}
97976+
97977+
phalcon_array_fetch_long(&index, directive, n - 1, PH_NOISY);
97978+
phalcon_array_update_zval(&temp1, index, value, PH_COPY);
97979+
97980+
zval_ptr_dtor(&index);
97981+
97982+
if (temp1 != NULL) {
97983+
zval_ptr_dtor(&temp1);
97984+
}
97985+
}
97986+
}
9795797987

9795897988
PHALCON_INIT_CLASS(Phalcon_Config_Adapter_Ini){
9795997989

@@ -97966,8 +97996,7 @@ static PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct){
9796697996

9796797997
zval *file_path, *process_sections, *ini_config;
9796897998
zval *exception_message, *config, *directives = NULL;
97969-
zval *section = NULL, *value = NULL, *key = NULL, *directive_parts = NULL, *left_part = NULL;
97970-
zval *right_part = NULL;
97999+
zval *section = NULL, *value = NULL, *key = NULL, *directive_parts = NULL;
9797198000
HashTable *ah0, *ah1;
9797298001
HashPosition hp0, hp1;
9797398002
zval **hd;
@@ -98025,13 +98054,7 @@ static PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct){
9802598054
if (phalcon_memnstr_str(key, SL("."))) {
9802698055
PHALCON_INIT_NVAR(directive_parts);
9802798056
phalcon_fast_explode_str(directive_parts, SL("."), key);
98028-
98029-
PHALCON_OBS_NVAR(left_part);
98030-
phalcon_array_fetch_long(&left_part, directive_parts, 0, PH_NOISY);
98031-
98032-
PHALCON_OBS_NVAR(right_part);
98033-
phalcon_array_fetch_long(&right_part, directive_parts, 1, PH_NOISY);
98034-
phalcon_array_update_zval_zval_zval_multi_3(&config, section, left_part, right_part, &value, 0);
98057+
phalcon_config_adapter_ini_update_zval_directive(&config, section, directive_parts, &value, 0 TSRMLS_CC);
9803598058
} else {
9803698059
phalcon_array_update_multi_2(&config, section, key, &value, 0);
9803798060
}

0 commit comments

Comments
 (0)