Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68547 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43173 invoked from network); 16 Aug 2013 16:36:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Aug 2013 16:36:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=jdavidlists@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jdavidlists@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.173 as permitted sender) X-PHP-List-Original-Sender: jdavidlists@gmail.com X-Host-Fingerprint: 209.85.223.173 mail-ie0-f173.google.com Received: from [209.85.223.173] ([209.85.223.173:37209] helo=mail-ie0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/48-06453-C155E025 for ; Fri, 16 Aug 2013 12:36:44 -0400 Received: by mail-ie0-f173.google.com with SMTP id k5so3716235iea.4 for ; Fri, 16 Aug 2013 09:36:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=xscNmQf1IKJU1TKpW31hFveZs6/p1av/v8VjhcVFiZg=; b=QUNKv7sEfZqkjG2ZRYJlBil1GcpFyKAxQ5bOVqAZBpj47M42MaJ6/LGjqFlXv0wcBS uZAwl0I/R/9+/8At46FGyOV3JnWxqP60IyvDS0hFlnv0sgsmwknaJ/Ud+PFlvnPUeE88 74xkQukEwVKkGZd8KVAEk+P9j0RtI4hJ0yuqHevKbEwuZ2i/I1RIIGOZVVy0hjqqx5ra t+2unBO8CLuZ01hJ7SRgLhjT6rqFc99/RihSLx5e8Etl+zgcOZ9+1v1pAAJFNEyPDCrF PXvWlDQpvmdQPQtcMIWpAZxVkdJ8CV5jDKFe/k8/Pp7lJ93rIJkuTtRPwscg17/wo3hL PT8A== MIME-Version: 1.0 X-Received: by 10.50.178.234 with SMTP id db10mr5652542igc.35.1376671001560; Fri, 16 Aug 2013 09:36:41 -0700 (PDT) Sender: jdavidlists@gmail.com Received: by 10.42.150.196 with HTTP; Fri, 16 Aug 2013 09:36:41 -0700 (PDT) Date: Fri, 16 Aug 2013 12:36:41 -0400 X-Google-Sender-Auth: MNPMi2_UkPr_dq8syfCRT_6PNyY Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Interest in a "null" SAPI for embedding? From: j.david.lists@gmail.com (J David) Hello, We recently successfully embedded PHP into our application using an approach based on the embed SAPI. However, our application is large and complex, written entirely in C++, requires a bit more functionality than the embed SAPI offers. (As an example, however, it was invaluable.) So we needed a customized SAPI, but there was no way it was going to build our live inside the PHP source tree. Our solution was to develop a new pseudo-SAPI we call the null SAPI. All it does is build a complete libphp5.so with no SAPI-related structures or functions in it at all. Then we can build our real embedded SAPI -- with all its extra dependencies and goofy custom I/O handling -- outside the PHP tree and just link to the shared library, rather than entangling our app's source tree and the PHP source tree. This was really very straightforward; creating an empty SAPI was pretty easy and beyond that it only required changes to a couple of build files. Is this something that would be of more general interest? It's not clear if this is exactly the recommended approach, but it certainly did work well for us and we would be happy to contribute the "work" (I use this term loosely given the lack of difficulty) done. Thanks!