Re: [RFC] Preloading

From: Date: Thu, 25 Oct 2018 07:47:31 +0000
Subject: Re: [RFC] Preloading
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-103385@lists.php.net to get a copy of this message
On 20/10/2018 15:06, Dmitry Stogov wrote: > > > On Oct 19, 2018 5:20 PM, Sara Golemon <pollita@php.net> wrote: > On Fri, Oct 19, 2018 at 3:17 AM Dmitry Stogov <dmitry@zend.com> wrote: >> I would like to start discussion on a Preloadng RFC >> https://wiki.php.net/rfc/preload >> > 4) "In conjunction with ext/FFI (dangerous extension), we may allow > FFI functionality only in preloaded PHP files, but not in regular > ones." Is there any interest in something like HHVM's HNI interface? > FFI always sounds nice in theory, but complex types mean that a little > bit of glue code is often a plus. As always when it comes to PHP and FFI I'd like to point out ext-psi [1] which uses a different approach than other PHP FFIs until now. It parses PSI files at startup, which basically are C header files augmented with the PHP userland interface decls, see for example the PSI file for time.h [2] As you can see, marshalling from and to native types has been taken seriously, and while we're capable of recursively unmarshalling e.g. addrinfo structs [3] and handling sqlite callbacks [4] it's still not possible yet for something like curl_easy_setopt. [1] https://github.com/m6w6/ext-psi [2] https://github.com/m6w6/ext-psi/blob/master/psi.d/time.psi [3] https://github.com/m6w6/ext-psi/blob/master/psi.d/netdb.psi#L70 [3] https://github.com/m6w6/ext-psi/blob/master/tests/netdb/gai001.phpt [4] https://github.com/m6w6/ext-psi/blob/master/tests/sqlite/sqlite.psi#L56 [4] https://github.com/m6w6/ext-psi/blob/master/tests/sqlite/sqlite001.phpt -- Regards, Mike

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.internals (#103385) next »