Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36063 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65617 invoked from network); 8 Mar 2008 17:24:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Mar 2008 17:24:03 -0000 Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.163 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.163 mail4.netbeat.de Received: from [83.243.58.163] ([83.243.58.163:46893] helo=mail4.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3B/EE-18442-1BBC2D74 for ; Sat, 08 Mar 2008 12:24:03 -0500 Received: (qmail 5268 invoked by uid 507); 8 Mar 2008 17:23:56 -0000 Received: from unknown (HELO ?192.168.1.101?) (postmaster%schlueters.de@82.135.88.201) by mail4.netbeat.de with ESMTPA; 8 Mar 2008 17:23:56 -0000 To: Jacob Santos Cc: internals Mailing List In-Reply-To: <47D2455E.6010501@dragonu.net> References: <47D2455E.6010501@dragonu.net> Content-Type: text/plain Date: Sat, 08 Mar 2008 18:23:53 +0100 Message-ID: <1204997033.3783.6.camel@goldfinger.johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-3.fc8) Content-Transfer-Encoding: 7bit Subject: Re: Loading PHP Files from a PHP Extension From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi Jacob, On Sat, 2008-03-08 at 01:50 -0600, Jacob Santos wrote: > Anyway, I remember once upon a time a PHP extension which loaded PHP files > within the PHP extension MINIT or RINIT function. I had thought it was SPL which > did this, but I appear to be wrong. Searching for material on the subject only > brings up generic PHP Extension writing. It's SDO in pecl, I think. But I don't think it's a good idea to execute a script while still being in the startup. So you should do that carefully. > I thought that php_execute_script() might work, but from the Extending and > Embedding PHP book, it is used within the context of Embedding and not Extending > PHP. Embedding means calling PHP code from some C app, in your case the C app is an extension, but still, that doesn't matter. You could use php_execute_script, the problem there might be that it also executes auto_[pre|ap]pend files not only your script so it might be better to use zend_execute_scripts. johannes