Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:1314 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45072 invoked from network); 6 May 2003 15:06:43 -0000 Received: from unknown (HELO web12805.mail.yahoo.com) (216.136.174.40) by pb1.pair.com with SMTP; 6 May 2003 15:06:43 -0000 Message-ID: <20030506150642.44449.qmail@web12805.mail.yahoo.com> Received: from [128.122.155.151] by web12805.mail.yahoo.com via HTTP; Tue, 06 May 2003 08:06:42 PDT X-RocketYMMF: zaunere Date: Tue, 6 May 2003 08:06:42 -0700 (PDT) Reply-To: hans@nyphp.org To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: streams, stderr/out and zend_fprintf ? From: hans@nyphp.org (Hans Zaunere) I'm developing an extension that talks to a serial device (under RedHat 7.3). The dynamic module will then be loaded into a CLI PHP, which will use an ncurses interface, MySQL connectivity, etc. to make the application complete. In light of recent talk about streams in extensions, I have a couple of questions (I haven't done much extension programming yet, so forgive any naiveness and hopefully I haven't missed anything in the mail archives): -- With most console C programs I use the builtin stdin/stdout/stderr macros with functions like fprintf. As a PHP extension, should I still be using these, or does php_streams implement something different (ie, a php_stderr macro)? -- I'm seeing there is a zend_printf() but no zend_fprintf(). Am I missing something, or should I just be using the standard C lib functions? -- Should I be using php_stream_* functions to explicitly open the standard I/O streams? Please say no. For the extension I'm developing now, I can see how much of this is irrelevant; it's a CLI based application, and when the process ends, so will everything else, thanks to the kernel. However, I would like to design the extension so that if I were to load it into an Apache DSO PHP, it'd be working "the right way" and utilize all that's modern PHP extension development (yes, I would have a reason to talk a serial device protocol from a web server :) Any pointers on these types of best practices would be greatly appreciated. Thank you, Hans