Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80651 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29345 invoked from network); 16 Jan 2015 16:55:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jan 2015 16:55:36 -0000 Authentication-Results: pb1.pair.com header.from=nf.laupretre@yahoo.fr; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=nf.laupretre@yahoo.fr; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain yahoo.fr from 212.27.42.2 cause and error) X-PHP-List-Original-Sender: nf.laupretre@yahoo.fr X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:56540] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/11-23044-48249B45 for ; Fri, 16 Jan 2015 11:55:34 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id 00F4A4B0259; Fri, 16 Jan 2015 17:53:08 +0100 (CET) Reply-To: To: "Pierre Joye" , Date: Fri, 16 Jan 2015 17:55:20 +0100 Message-ID: <029e01d031ad$36b3f150$a41bd3f0$@yahoo.fr> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_029F_01D031B5.98796AC0" X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdAxrTZv4onmFeduQxKkKJHToWiYTA== Content-Language: fr X-Antivirus: avast! (VPS 150116-0, 16/01/2015), Outbound message X-Antivirus-Status: Clean Subject: RE: [PHP-DEV] Re: Top 10 Pecl extensions PHP7 compatibility From: nf.laupretre@yahoo.fr ("F & N Laupretre") ------=_NextPart_000_029F_01D031B5.98796AC0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > > De : Pierre Joye [mailto:pierre.php@gmail.com] > > > > I tend to prefer separate files and add the right source at configure time. > > It is then easier to keep fixes, features, etc. in sync. > > > > However both solutions may work, if we decide to go for one or another > > solution. We can add support for the packaging/install in pickle and the > > website. To reply to Pierre's question about the way we choose to keep extensions compatible with 5 and 7, I see that the choice was already made :), we will duplicate the code and maintain two distinct code trees :( As the decision is, hopefully, not official yet, may I suggest another solution ? I am currently working on a PHP extension generator. The objective here, is that the developer writes as few code as possible and that this code uses an abstraction layer as rich as possible to keep it compatible with as many different environments as possible. This allows to lower the skills level and the workload required to develop & maintain a PHP extension, especially when the extension must be compatible with different PHP engines/versions. The future need to port PECL extensions massively to PHP 7 is the perfect occasion to convert them to use such a tool. The existing code should be modified to fit the tool but, once done, the code size is greatly reduced and the same source code can be used for every supported target environment (current scope is PHP 5.x, PHP 7, HHVM). When an extension developer leaves, thanks to the extension synthetic description and to the reduced amount of code, the extension is easier to take over. Last, it makes BC breaks in the C API easier to manage as there are chances that the BC break is abstracted (just need to adapt the generator). In this case, the generator is modified, not the extension source code. The developer just describes the extension (in yaml or json) and writes the function/methods bodies using compatibility macros for as many features as possible. In order to build the extension, a specialized code generator generates 'ready-to-compile' code for the PHP engine/version you chose (code is generated using twig templates, making generator development easier). Finally, the tool, even with a limited abstraction scope, can be used for any existing and future extension as, for the features which are not generated/wrapped yet, the user can provide any C code to be included as- is. Please, have a look at the flaupretre/php-ext-gen repository in github, especially the examples and doc subdirectories, and give me your opinion. Regards Fran ------=_NextPart_000_029F_01D031B5.98796AC0--