You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP usually provides extensions; like pcntl, hprose, sockets and alike.
In order to reproduce these within Uniter, this is what I would suggest:
varExtension=require("uniter-extension");varcURL=newExtension();cURL.function("curl_init",function(){// Implement curl_init});functioncURLClass(args){}// a cURL class}cURL.addClass("cURL",cURLClass);module.exports=cURL;
Now, we could extend Uniter by an additional function. Currently, we have .install() to install functions, constants and classes into the system. As far as I remember, they all go into global scope. Extensions could be registered similarily:
PHP usually provides extensions; like pcntl, hprose, sockets and alike.
In order to reproduce these within Uniter, this is what I would suggest:
Now, we could extend Uniter by an additional function. Currently, we have
.install()
to install functions, constants and classes into the system. As far as I remember, they all go into global scope. Extensions could be registered similarily:This would also provide the
extension_loaded
function to Uniter. Also, we might be able to usedl()
.To summarize:
Extension
support to Uniter, so that native PHP extensions can be emulated.extension_loaded($extName)
dl($extName)
Implementation is up to you, the above are just pseudo-code examples :) But i bet you get what I meant.
The text was updated successfully, but these errors were encountered: