Closed ondrejmirtes closed 6 years ago
Pull request would be nice!
OK, I'll try to implement backend based on Nette\Caching\Cache.
Well, pull request will not be so easy to prepare :) Or better said it depends on what exactly you want to store in the filesystem. It is really simple to store the tokenized source codes (token streams). That is possible right away. But it is impossible at the moment to store the reflections classes since they do not support serialization. The biggest problem is probably the fact that every reflections needs to know its Broker instance which means either to inject it after unserialization (no way) of make an own form or "serialization" (better but still pretty painful).
I have reopened #11 which will make this far easier.
I still want to do it :) I will look into that in the nearest month.
I tried to implement caching of the token streams and it's not worth a lot. The token streams still need to parsed every time, so we save some time only on the tokenizing part.
It saved only about 14 seconds (45 -> 31) on a large project.
Here's the implementation (really not considered to be merged :)): https://github.com/ondrejmirtes/PHP-Token-Reflection/tree/cached-backend
No longer relevant
Backend that would not require huge memory_limit increase on big projects would be very nice.
I can prepare a pull request.