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_streamsOK, 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
--
To
unsubscribe, visit: http://www.php.net/unsub.php