Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33218 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66103 invoked by uid 1010); 17 Nov 2007 08:23:11 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 66088 invoked from network); 17 Nov 2007 08:23:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Nov 2007 08:23:10 -0000 Authentication-Results: pb1.pair.com smtp.mail=magreenblatt@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=magreenblatt@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.146.181 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: magreenblatt@gmail.com X-Host-Fingerprint: 209.85.146.181 wa-out-1112.google.com Received: from [209.85.146.181] ([209.85.146.181:54120] helo=wa-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/91-51194-EE4AE374 for ; Sat, 17 Nov 2007 03:23:10 -0500 Received: by wa-out-1112.google.com with SMTP id l24so1406361waf for ; Sat, 17 Nov 2007 00:23:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=Abvjeu/dhb2qsMHqWshGiLypSh89WXFgMtyHzA7y+o4=; b=Vfmx4RgNDkaEng6fI1oATT2uUojr3lCZUw2eKbdwtpMhgQRpSMn8TKk0/K2uITegWOmS1ZFdDKPKUNpPbZ8h9Wllx+9S77C7nRt0a+omVSqRAbYdMqtelxfYkQVgjkhHEVAWkO1526/Gq7zFAFN8IT2pubbXbjltBFpT4sjcNGg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=qVKkjbXBORs6FuQwjlugJsRCydxRI+325EsTmZV65IdofJXwTkP+yp6CjKr9S3sYxtQ3cvawG+M9xY50kKGYRv7YjpgI5/b18VlHSjdkXEnHFKyxi7C1zV+QN/jMeOnqV4pk9TxWKkhK/r7IxocP7S6AnCNjAtcTVwqQm1EC8i4= Received: by 10.114.159.1 with SMTP id h1mr636552wae.1195287786275; Sat, 17 Nov 2007 00:23:06 -0800 (PST) Received: by 10.115.110.10 with HTTP; Sat, 17 Nov 2007 00:23:06 -0800 (PST) Message-ID: Date: Sat, 17 Nov 2007 03:23:06 -0500 To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Getting path of currently executing file from within stream_opener handler From: magreenblatt@gmail.com ("Marshall Greenblatt") Hi All, I have a stream wrapper implementation that needs to properly resolve relative paths. For example, say I have a file structure like the following: file1.php dir/file2.php dir/file3.php file4.php file1.php contains: file2.php contains: My implementation of php_stream_wrapper_ops.stream_opener will see a path value of "dir/file2.php" for the first include request and a path value of "file3.php" for the second include request. When receiving the second include request, I need to know that the file currently being processed is "dir/file2.php" so that I can properly resolve "file3.php" to "dir/file3.php". I can't simply "remember" the last value passed to stream_opener because I have no way of knowing when processing of a particular file has ended. For instance: file1.php contains: file2.php contains: Is there a method that can be used from within the stream_opener handler function to retrieve the path of the file currently being processed? Alternately, is there a way to hook into the code processing routines so that I can keep track of when execution of a particular file begins and ends? Or is there an even better option that I'm missing? Any thoughts would be greatly appreciated :-). Thanks, Marshall