Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68548 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44613 invoked from network); 16 Aug 2013 16:40:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Aug 2013 16:40:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.220.44 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.220.44 mail-pa0-f44.google.com Received: from [209.85.220.44] ([209.85.220.44:34576] helo=mail-pa0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/98-06453-7065E025 for ; Fri, 16 Aug 2013 12:40:40 -0400 Received: by mail-pa0-f44.google.com with SMTP id fz6so2070371pac.31 for ; Fri, 16 Aug 2013 09:40:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=L7bVyF0H0UGRkGxDUS5OWYRKDoBRORdieFt1q2aMZm0=; b=oEByH51UTQ/AHFSmn2R5Pdsz2SDryUwQvE2arC3ZP2dawQVmDUY7GnHQt1QukkVe3N 75Hjn1KXeZk0L7TM3laQa8IKDZYm01+BnqIqTeggkxTbAFJ4zCywfyuzmDTNPiFjLGfg eOnUYlIr5b6tuszGYcDSDWT9PCf1wlgzO9YCE+Y+7s+Itg6lGLP5dHTKTgaJV17kiXbF dkVLsqWt0T3k8YYnfws4bZoNfKfpId0hOT9B034BLsw6//ZOiiYlaUxgAziSyDUM/BRm fc6ygW7lW7R5QLLGGxNhqa0EHuxs4i3RiCCXtXPxWYGd2zNlCPo4/nfaAA288WICpyzm T3bQ== X-Gm-Message-State: ALoCoQmWUWOE7asU++9OyyBysPTOn6SfvVVAJbnBSrEiB7FnQvA8AFDKlLIO/6Z+knR59bssEjh6 MIME-Version: 1.0 X-Received: by 10.66.242.17 with SMTP id wm17mr4084514pac.102.1376671237376; Fri, 16 Aug 2013 09:40:37 -0700 (PDT) Sender: php@golemon.com Received: by 10.70.24.33 with HTTP; Fri, 16 Aug 2013 09:40:37 -0700 (PDT) X-Originating-IP: [75.139.183.187] In-Reply-To: References: Date: Fri, 16 Aug 2013 09:40:37 -0700 X-Google-Sender-Auth: 3wo0AjoFlAEHltiymnQmvlhrOR0 Message-ID: To: J David Cc: PHP internals Content-Type: multipart/alternative; boundary=047d7b11191513a03904e4134039 Subject: Re: [PHP-DEV] Interest in a "null" SAPI for embedding? From: pollita@php.net (Sara Golemon) --047d7b11191513a03904e4134039 Content-Type: text/plain; charset=ISO-8859-1 Apart from managing lifecycles, the SAPI is also resposible for things like directing I/O between the host application, how does null-sapi handle this? On Fri, Aug 16, 2013 at 9:36 AM, J David wrote: > 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! > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --047d7b11191513a03904e4134039--