@@ -43830,8 +43830,6 @@ PHALCON_INIT_CLASS(Phalcon_Mvc_Model_Criteria){
43830
43830
43831
43831
zend_declare_property_null(phalcon_mvc_model_criteria_ce, SL("_model"), ZEND_ACC_PROTECTED TSRMLS_CC);
43832
43832
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);
43835
43833
zend_declare_property_long(phalcon_mvc_model_criteria_ce, SL("_hiddenParamNumber"), 0, ZEND_ACC_PROTECTED TSRMLS_CC);
43836
43834
43837
43835
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){
44768
44766
zval *dependency_injector, *model_name, *data;
44769
44767
zval *conditions, *service, *meta_data, *model;
44770
44768
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;
44772
44770
HashTable *ah0;
44773
44771
HashPosition hp0;
44774
44772
zval **hd;
@@ -44846,16 +44844,16 @@ static PHP_METHOD(Phalcon_Mvc_Model_Criteria, fromInput){
44846
44844
44847
44845
}
44848
44846
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);
44851
44848
if (phalcon_fast_count_ev(conditions TSRMLS_CC)) {
44852
44849
PHALCON_INIT_VAR(join_conditions);
44853
44850
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);
44856
44853
}
44857
44854
44858
- RETURN_CTOR(criteria);
44855
+ phalcon_call_method_p1_key(NULL, return_value, "setmodelname", model_name, 3112384035UL);
44856
+ RETURN_MM();
44859
44857
}
44860
44858
44861
44859
static PHP_METHOD(Phalcon_Mvc_Model_Criteria, execute){
@@ -48010,7 +48008,6 @@ static PHP_METHOD(Phalcon_Mvc_Model_Relation, getIntermediateReferencedFields){
48010
48008
48011
48009
48012
48010
48013
-
48014
48011
#ifdef HAVE_CONFIG_H
48015
48012
#endif
48016
48013
@@ -89354,18 +89351,6 @@ static PHP_METHOD(Phalcon_Http_Cookie, __construct){
89354
89351
ZVAL_STRING(path, "/", 1);
89355
89352
}
89356
89353
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
-
89369
89354
if (Z_TYPE_P(name) != IS_STRING) {
89370
89355
PHALCON_THROW_EXCEPTION_STR(phalcon_http_cookie_exception_ce, "The cookie name must be string");
89371
89356
return;
@@ -89380,15 +89365,15 @@ static PHP_METHOD(Phalcon_Http_Cookie, __construct){
89380
89365
phalcon_update_property_this_quick(this_ptr, SL("_path"), path, 3986357393UL TSRMLS_CC);
89381
89366
}
89382
89367
89383
- if (Z_TYPE_P(secure) != IS_NULL) {
89368
+ if (secure && Z_TYPE_P(secure) != IS_NULL) {
89384
89369
phalcon_update_property_this_quick(this_ptr, SL("_secure"), secure, 2942644203UL TSRMLS_CC);
89385
89370
}
89386
89371
89387
- if (Z_TYPE_P(domain) != IS_NULL) {
89372
+ if (domain && Z_TYPE_P(domain) != IS_NULL) {
89388
89373
phalcon_update_property_this_quick(this_ptr, SL("_domain"), domain, 1152978748UL TSRMLS_CC);
89389
89374
}
89390
89375
89391
- if (Z_TYPE_P(http_only) != IS_NULL) {
89376
+ if (http_only && Z_TYPE_P(http_only) != IS_NULL) {
89392
89377
phalcon_update_property_this_quick(this_ptr, SL("_httpOnly"), http_only, 41231174UL TSRMLS_CC);
89393
89378
}
89394
89379
@@ -89532,7 +89517,7 @@ static PHP_METHOD(Phalcon_Http_Cookie, send){
89532
89517
zval *name, *value, *expire, *domain, *path, *secure;
89533
89518
zval *http_only, *dependency_injector, *definition;
89534
89519
zval *service = NULL, *session, *key, *encryption, *crypt;
89535
- zval *encrypt_value = NULL;
89520
+ zval *encrypt_value = NULL, *has_session ;
89536
89521
89537
89522
PHALCON_MM_GROW();
89538
89523
@@ -89559,66 +89544,65 @@ static PHP_METHOD(Phalcon_Http_Cookie, send){
89559
89544
89560
89545
PHALCON_OBS_VAR(dependency_injector);
89561
89546
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) {
89590
89548
PHALCON_INIT_VAR(service);
89549
+ PHALCON_INIT_VAR(has_session);
89591
89550
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
+ }
89599
89588
}
89600
89589
89601
89590
PHALCON_OBS_VAR(encryption);
89602
89591
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;
89621
89596
}
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);
89622
89606
} else {
89623
89607
PHALCON_CPY_WRT(encrypt_value, value);
89624
89608
}
@@ -97954,6 +97938,52 @@ PHALCON_INIT_CLASS(Phalcon_Config_Exception){
97954
97938
97955
97939
97956
97940
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
+ }
97957
97987
97958
97988
PHALCON_INIT_CLASS(Phalcon_Config_Adapter_Ini){
97959
97989
@@ -97966,8 +97996,7 @@ static PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct){
97966
97996
97967
97997
zval *file_path, *process_sections, *ini_config;
97968
97998
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;
97971
98000
HashTable *ah0, *ah1;
97972
98001
HashPosition hp0, hp1;
97973
98002
zval **hd;
@@ -98025,13 +98054,7 @@ static PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct){
98025
98054
if (phalcon_memnstr_str(key, SL("."))) {
98026
98055
PHALCON_INIT_NVAR(directive_parts);
98027
98056
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);
98035
98058
} else {
98036
98059
phalcon_array_update_multi_2(&config, section, key, &value, 0);
98037
98060
}
0 commit comments