Skip to content

Comments

Added support for including anon classes multiple times per execution#109

Merged
LukeTowers merged 2 commits intodevelopfrom
jaxwilko-patch-1
Sep 1, 2022
Merged

Added support for including anon classes multiple times per execution#109
LukeTowers merged 2 commits intodevelopfrom
jaxwilko-patch-1

Conversation

@jaxwilko
Copy link
Member

@jaxwilko jaxwilko commented Sep 1, 2022

require_once will fail to load anon classes on subsequent requests. This patch adds a caching layer that allows included classes and object to he held in memory and returned as needed

@bennothommo
Copy link
Member

@jaxwilko I reckon we don't need to treat concrete classes any differently from anonymous classes. You could probably just create a cached instance of those classes as well, then there's no need to keep checking if it's an object or not when retrieving from the cache.

@jaxwilko
Copy link
Member Author

jaxwilko commented Sep 1, 2022

@bennothommo yeah, was just trying to reduce memory usage by holding class references rather than the objects where possible but I guess it shouldn't make a massive difference :)

@LukeTowers
Copy link
Member

@bennothommo I'd prefer not to, it's unnecessary memory usage to avoid having to initialize a new instance. I'm fine with this approach as it is.

@LukeTowers LukeTowers added this to the 1.2.1 milestone Sep 1, 2022
@LukeTowers LukeTowers merged commit 66c4800 into develop Sep 1, 2022
@LukeTowers LukeTowers deleted the jaxwilko-patch-1 branch September 1, 2022 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants