Closed lisachenko closed 4 years ago
@prolic This might be interesting for us I think.
@enumag I have already succeeded with userland implementation of modules and can preserv custom structure (CData) between requests without serialization (not PHP objects, as it is so tricky and even can be impossible at all)
Could I ask you about your purpose? What do your expect from user extensions?
I have learned a lot about PHP native C extensions and it looks possible to implement a mechanism that will provide an API for development of extensions for userland developers. Every extension is registered in the global registry, called
module_registry
. It is a simple hash table that contains key-value pairs of pointers to thezend_module_entry
entry. And there is main API methodzend_register_module_ex
which can be used to register new module. So, it should be doable at least...What is interesting is that combining
FFI
with userland modules can give a way to survive request boundaries and avoid troubles with memory leaks inFFI
itself, because extension can be persistent and PHP will keep it between requests.In practice this means that it will be possible to carry data or even objects between requests.