From 05589eca37bc0ddc8f195cb2508b7070af14e2dc Mon Sep 17 00:00:00 2001 From: Anton Vasiliev <1695147@gmail.com> Date: Tue, 15 Aug 2023 15:58:10 +0000 Subject: [PATCH 1/6] Remove set of 'application' service This causes memory leak --- phalcon/Mvc/Micro.zep | 7 ------- 1 file changed, 7 deletions(-) diff --git a/phalcon/Mvc/Micro.zep b/phalcon/Mvc/Micro.zep index 721da8801e..e1de0685f3 100644 --- a/phalcon/Mvc/Micro.zep +++ b/phalcon/Mvc/Micro.zep @@ -1142,13 +1142,6 @@ class Micro extends Injectable implements ArrayAccess, EventsAwareInterface */ public function setDI( container) -> void { - /** - * We automatically set ourselves as application service - */ - if !container->has("application") { - container->set("application", this); - } - let this->container = container; } From 3fc5700870f6b51328e3dc4d8114c1bab785c8f9 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev <1695147@gmail.com> Date: Tue, 15 Aug 2023 16:12:07 +0000 Subject: [PATCH 2/6] Remove redundant tests --- tests/integration/Mvc/Micro/HasServiceCest.php | 8 -------- tests/integration/Mvc/Micro/OffsetExistsCest.php | 11 ----------- 2 files changed, 19 deletions(-) diff --git a/tests/integration/Mvc/Micro/HasServiceCest.php b/tests/integration/Mvc/Micro/HasServiceCest.php index d8db383dc9..54bd06cf5f 100644 --- a/tests/integration/Mvc/Micro/HasServiceCest.php +++ b/tests/integration/Mvc/Micro/HasServiceCest.php @@ -33,9 +33,7 @@ public function mvcMicroHasService(IntegrationTester $I) $I->wantToTest('Mvc\Micro - hasService()'); $micro = new Micro(); - $di = new Di(); - $micro->setDi($di); @@ -43,10 +41,6 @@ public function mvcMicroHasService(IntegrationTester $I) $micro->hasService('fake') ); - $I->assertTrue( - $micro->hasService('application') - ); - $I->assertFalse( $micro->hasService('escaper') ); @@ -57,7 +51,6 @@ public function mvcMicroHasService(IntegrationTester $I) $escaper = new Escaper(); - $micro->setService('escaper', $escaper); $I->assertTrue( @@ -75,7 +68,6 @@ public function mvcMicroHasService(IntegrationTester $I) $router = new Router(); - $di->set('router', $router); $I->assertTrue( diff --git a/tests/integration/Mvc/Micro/OffsetExistsCest.php b/tests/integration/Mvc/Micro/OffsetExistsCest.php index cee1d0a947..fcca5ef9e9 100644 --- a/tests/integration/Mvc/Micro/OffsetExistsCest.php +++ b/tests/integration/Mvc/Micro/OffsetExistsCest.php @@ -33,9 +33,7 @@ public function mvcMicroOffsetExists(IntegrationTester $I) $I->wantToTest('Mvc\Micro - offsetExists()'); $micro = new Micro(); - $di = new Di(); - $micro->setDi($di); @@ -43,10 +41,6 @@ public function mvcMicroOffsetExists(IntegrationTester $I) isset($micro['fake']) ); - $I->assertTrue( - isset($micro['application']) - ); - $I->assertFalse( isset($micro['escaper']) ); @@ -57,25 +51,20 @@ public function mvcMicroOffsetExists(IntegrationTester $I) $escaper = new Escaper(); - $micro->setService('escaper', $escaper); $I->assertTrue( isset($micro['escaper']) ); - $dispatcher = new Dispatcher(); - $micro['dispatcher'] = $dispatcher; $I->assertTrue( isset($micro['dispatcher']) ); - $router = new Router(); - $di->set('router', $router); $I->assertTrue( From cf60c93b1c4987966dc297f2ccb892f4fde93969 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev <1695147@gmail.com> Date: Tue, 15 Aug 2023 16:53:49 +0000 Subject: [PATCH 3/6] Fix typo --- CHANGELOG-5.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG-5.0.md b/CHANGELOG-5.0.md index a3ddaa7ac0..9aeb46e682 100644 --- a/CHANGELOG-5.0.md +++ b/CHANGELOG-5.0.md @@ -16,7 +16,7 @@ ### Fixed - Parse multipart/form-data from PUT request [#16271](https://github.com/phalcon/cphalcon/issues/16271) -- Set Dynamic Update by default system wide [#16343](https://github.com/phalcon/cphalcon/issues/16343) +- Set Dynamic Update by default system-wide [#16343](https://github.com/phalcon/cphalcon/issues/16343) ### Added From c2ddce67cc78490e32b10aa1e9b444c52384aaa3 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev <1695147@gmail.com> Date: Tue, 15 Aug 2023 16:57:06 +0000 Subject: [PATCH 4/6] Update changelog --- CHANGELOG-5.0.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG-5.0.md b/CHANGELOG-5.0.md index 9aeb46e682..11eb42ebdc 100644 --- a/CHANGELOG-5.0.md +++ b/CHANGELOG-5.0.md @@ -3,24 +3,24 @@ ## [5.2.4](https://github.com/phalcon/cphalcon/releases/tag/v5.2.4) (xxxx-xx-xx) ### Added -- Added `Phalcon\Mvc\Model::appendMessagedFrom` for code consistency and to add messages from another another model. [#16391](https://github.com/phalcon/cphalcon/issues/16391) + +- Added `Phalcon\Mvc\Model::appendMessagedFrom` for code consistency and to add messages from another model [#16391](https://github.com/phalcon/cphalcon/issues/16391) - Added `Phalcon\Autoload\Loader::isRegistered` for debugging purposes [#16391](https://github.com/phalcon/cphalcon/issues/16391) - Added `Phalcon\Mvc\Model\Metadata::initializeMetadata` [#16393] (https://github.com/phalcon/cphalcon/issues/16393) - Added `Phalcon\Mvc\Model\Metadata::getMetaDataUniqueKey` [#16393] (https://github.com/phalcon/cphalcon/issues/16393) - Added `Phalcon\Mvc\Model\Metadata::getColumnMapUniqueKey` [#16393] (https://github.com/phalcon/cphalcon/issues/16393) +- Added `Phalcon\Encryption\Security\JWT\Builder::addHeader()` to allow adding custom headers [#16396](https://github.com/phalcon/cphalcon/issues/16396) ### Changed -- Refactored `Phalcon\Mvc\Model::doLowUpdate` and `Phalcon\Mvc\Model::postSaveRelatedRecords` for better code logic and a clearer seperation of behaviour although it lead to partially repeated code.[#16391](https://github.com/phalcon/cphalcon/issues/16391) + +- Refactored `Phalcon\Mvc\Model::doLowUpdate` and `Phalcon\Mvc\Model::postSaveRelatedRecords` for better code logic and a clearer separation of behaviour, although it lead to partially repeated code. [#16391](https://github.com/phalcon/cphalcon/issues/16391) - Cleaned `Phalcon\Mvc\Model\Metadata::initialize` [#16393] (https://github.com/phalcon/cphalcon/issues/16393) ### Fixed - Parse multipart/form-data from PUT request [#16271](https://github.com/phalcon/cphalcon/issues/16271) - Set Dynamic Update by default system-wide [#16343](https://github.com/phalcon/cphalcon/issues/16343) - -### Added - -- Added `Phalcon\Encryption\Security\JWT\Builder::addHeader()` to allow adding custom headers [#16396](https://github.com/phalcon/cphalcon/issues/16396) +- Fixed memory leak in Micro application [#16404](https://github.com/phalcon/cphalcon/pull/16404) ## [5.2.3](https://github.com/phalcon/cphalcon/releases/tag/v5.2.3) (2023-07-26) From 3532098f4454c8c6bdfaac449c428d8e6e101324 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev <1695147@gmail.com> Date: Tue, 15 Aug 2023 17:35:34 +0000 Subject: [PATCH 5/6] Change next version to `5.3.0` --- CHANGELOG-5.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG-5.0.md b/CHANGELOG-5.0.md index 11eb42ebdc..d0e3cfa366 100644 --- a/CHANGELOG-5.0.md +++ b/CHANGELOG-5.0.md @@ -1,6 +1,6 @@ # Changelog -## [5.2.4](https://github.com/phalcon/cphalcon/releases/tag/v5.2.4) (xxxx-xx-xx) +## [5.3.0](https://github.com/phalcon/cphalcon/releases/tag/v5.2.4) (xxxx-xx-xx) ### Added From 60d0829c8d3425fc949040201bbd55c34ebc6ec5 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev <1695147@gmail.com> Date: Tue, 15 Aug 2023 17:36:01 +0000 Subject: [PATCH 6/6] Change next version to `5.3.0` --- CHANGELOG-5.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG-5.0.md b/CHANGELOG-5.0.md index d0e3cfa366..5e2609368b 100644 --- a/CHANGELOG-5.0.md +++ b/CHANGELOG-5.0.md @@ -1,6 +1,6 @@ # Changelog -## [5.3.0](https://github.com/phalcon/cphalcon/releases/tag/v5.2.4) (xxxx-xx-xx) +## [5.3.0](https://github.com/phalcon/cphalcon/releases/tag/v5.3.0) (xxxx-xx-xx) ### Added