Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14929 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21498 invoked by uid 1010); 14 Feb 2005 21:17:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 21481 invoked from network); 14 Feb 2005 21:17:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2005 21:17:12 -0000 X-Host-Fingerprint: 80.189.92.203 smtp6.global.net.uk Solaris 9 Received: from ([80.189.92.203:54656] helo=smtp6.global.net.uk) by pb1.pair.com (ecelerity 1.2.11 (r4403)) with SMTP id EE/53-59700-45511124 for ; Mon, 14 Feb 2005 16:17:09 -0500 Message-ID: Received: from ps.189.43.29.dial.global.net.uk ([80.189.43.29] helo=bagpuss) by smtp6.global.net.uk with esmtp (Exim 4.30) id 1D0naI-00073C-Oc for internals@lists.php.net; Mon, 14 Feb 2005 21:16:47 +0000 Reply-To: To: "PHP Internals" Date: Mon, 14 Feb 2005 21:18:29 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 thread-index: AcUQ962ve8Xj7ePISLaMy5rcpgf18wB4v53g Authenticated-Sender: Subject: FW: [PHP-DEV] Re: A question about php_streams From: frak@totalise.co.uk ("Mikey") So, no takers for this question then? :-( > -----Original Message----- > From: Mikey [mailto:frak@totalise.co.uk] > Sent: 12 February 2005 11:41 > To: PHP Internals > Subject: [PHP-DEV] Re: A question about php_streams > > OK, I have built apache and php from scratch (was only php > that I built myself before and have a much more complete backtrace: > > #0 0x403c8f7f in zend_hash_index_update_or_next_insert > (ht=0x40464848, h=0, pData=0xbffff490, > > nDataSize=12, pDest=0x0, flag=1) at > /usr/local/src/php-4.3.10/Zend/zend_hash.c:390 > > #1 0x403cb75f in zend_list_insert (ptr=0x80c1044, type=2) at > /usr/local/src/php-4.3.10/Zend/zend_list.c:45 > #2 0x403cb8c2 in zend_register_resource (rsrc_result=0x0, > rsrc_pointer=0x80c1044, rsrc_type=2) at > /usr/local/src/php-4.3.10/Zend/zend_list.c:98 > #3 0x403971dc in _php_stream_alloc (ops=0x40441220, > abstract=0x80bffe8, > persistent_id=0x0,mode=0x40401c58 "r", > __php_stream_call_depth=0,__zend_filename=0x404016c0 > "/usr/local/src/php-4.3.10/main/streams.c", > __zend_lineno=2439,__zend_orig_filename=0x0, __zend_orig_lineno=0) at > /usr/local/src/php-4.3.10/main/streams.c:281 > #4 0x4039b52d in php_plain_files_dir_opener > (wrapper=0x4044125c, path=0x80b4640 "/tmpl",mode=0x40401c58 > "r", options=4, opened_path=0x0, context=0x0, > __php_stream_call_depth=1,__zend_filename=0x404016c0 > "/usr/local/src/php-4.3.10/main/streams.c", > __zend_lineno=2584,__zend_orig_filename=0x403fe2a0 > "/usr/local/src/php-4.3.10/ext/tmpl/tmpl.c",__zend_orig_lineno=150) at > /usr/local/src/php-4.3.10/main/streams.c:2439 > #5 0x4039bb0f in _php_stream_opendir (path=0x80b4640 "/tmpl", > options=12, context=0x0,__php_stream_call_depth=0, > __zend_filename=0x403fe2a0 > "/usr/local/src/php-4.3.10/ext/tmpl/tmpl.c", > __zend_lineno=150,__zend_orig_filename=0x0, __zend_orig_lineno=0) at > /usr/local/src/php-4.3.10/main/streams.c:2582 > #6 0x4037c09f in do_reload () at > /usr/local/src/php-4.3.10/ext/tmpl/tmpl.c:150 > #7 0x4037bf17 in zm_startup_tmpl (type=1, module_number=5) at > /usr/local/src/php-4.3.10/ext/tmpl/tmpl.c:94 > #8 0x403c6b8f in zend_startup_module (module=0x4043fb00) at > /usr/local/src/php-4.3.10/Zend/zend_API.c:1005 > #9 0x4038a682 in php_startup_extensions (ptr=0x40445930, count=28) at > /usr/local/src/php-4.3.10/main/main.c:1044 > #10 0x403df808 in php_startup_internal_extensions () at > main/internal_functions.c:99 > #11 0x4038abbe in php_module_startup (sf=0x40445580, > additional_modules=0x404458c0, num_additional_modules=1) at > /usr/local/src/php-4.3.10/main/main.c:1217 > #12 0x403dd298 in php_apache_startup (sapi_module=0x40445580) at > /usr/local/src/php-4.3.10/sapi/apache/mod_php4.c:266 > #13 0x403de33c in php_init_handler (s=0x80948fc, p=0x80948c4) at > /usr/local/src/php-4.3.10/sapi/apache/mod_php4.c:889 > #14 0x0805633e in ap_init_modules () > #15 0x080613d3 in main () > > Now, even to my untrained eye, I can see that the php.ini > value is indeed valid and being read correctly by the > function from #5. The code that I have written is really > little more than in my original post and only differs in what > is written after this failing function call. I include the > whole function here again for easy reference: > > int do_reload () > > { > > // My declares > > php_stream *base_dir = NULL; > > php_stream_context *context = NULL; > > int count = 0; > > // Zend declares > > TSRMLS_FETCH(); > > // Start from scratch > > TMPL_G(tmpl_loaded) = 0; > > if (TMPL_G(template_dir) != NULL) > > base_dir = php_stream_opendir (TMPL_G(template_dir), > ENFORCE_SAFE_MODE|REPORT_ERRORS, context); > > TMPL_G(tmpl_dir_valid) = (base_dir) ? 1 : 0; > > count = count_files (TMPL_G(template_dir), TMPL_G(template_mask)); > > // TODO > > return 1; > > } > > Tia, > > Mikey > > -- > PHP Internals - PHP Runtime Development Mailing List To > unsubscribe, visit: http://www.php.net/unsub.php > >