RE: [PHP-DEV] [PATCH] include statement in php.ini file

2002-09-28 Thread derick

On Sat, 28 Sep 2002, Zeev Suraski wrote:

> At 19:27 26/09/2002, David Viner wrote:
> >If the term "include" is not a good keyword, I'm also happy to rework the
> >patch to use any keyword the group prefers.  "additional_ini" sounds good to
> >me, and probably doesn't carry the other control-structure baggage.
> 
> I don't think that additional_ini carries any less control-structure 
> baggage;  If you can include various ini files using various statements in 
> php.ini, it begs for adding control structures to perform this task 
> selectively.  I'm very much against it.  It also doesn't make modular 
> deployment that much easier - if you still have to add statements to the 
> php.ini file in order to get it going.
> 
> I think that a dynamic deployment directory makes good sense, I don't think 
> it has a high wtf factor, and it doesn't push us anywhere towards needing 
> control structures.  It becomes a feature of PHP, instead of a feature of 
> the php.ini syntax.  It's something we can even set up during 'make 
> install' with a default being /usr/local/etc/additional_php_inis or 
> something like that.

I agree with this.

Derick

--

---
 Derick Rethans   http://derickrethans.nl/ 
 JDI Media Solutions
--[ if you hold a unix shell to your ear, do you hear the c? ]-


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] getopt function

2002-09-28 Thread derick

On Fri, 27 Sep 2002, Jon Parise wrote:

> I wrote a simply getopt function for PHP (based on the system's
> getopt() call).  This is not meant to compete with the getopt PEAR
> class but rather to provide simple command line parsing capabilities
> to CLI-based PHP scripts.
> 
> If there are no objections, I'd like to commit this over the weekend
> (at which point I'll also write the associated documentation).
> 
> Comments are, of course, welcome.

Sounds useful to me...

Derick

--

---
 Derick Rethans   http://derickrethans.nl/ 
 JDI Media Solutions
--[ if you hold a unix shell to your ear, do you hear the c? ]-


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Apache 1.3, PHP and TSRM question

2002-09-28 Thread Ramesh Shankar

I am trying to port PHP and I am running into a problem with Apache 1.3. 
I am not familiar with the PHP language by itself and I am used to 
working at the O.S. level and so any help would be greatly appreciated. 
I tried to read through mailing list archives, the readmes, FAQs etc, 
but I couldn't find answer for this question:

When PHP is loaded with Apache 1.3 and Apache is shutdown, PHP 4.2.2 
crashes inside the routine _efree() called from bc_free_num(). I found 
the problem to be related to linked list corruption and on further 
investigation, suspected it to be a case of the thread calling 
bc_free_num() to be different from that of the thread that called 
bc_new_num(). I verfied this by enabling TSRM_DEBUG while building zend, 
which enables this detection in _efree(). I also set the 
tsrm_error_level to TSRM_ERROR_LEVEL_ERROR to enable dispalying of TSRM 
messages to the screen. And sure enough, I got an error message from 
_efree() from the following excerpt:

#if defined(ZTS) && TSRM_DEBUG
 if (p->thread_id != tsrm_thread_id()) {
 tsrm_error(TSRM_ERROR_LEVEL_ERROR, "Memory block allocated at 
%s:(%d) on thread %x freed at %s:(%d) on thread %x, ignoring",
 p->filename, p->lineno, p->thread_id,
 __zend_filename, __zend_lineno, tsrm_thread_id());
 return;
 }
#endif

I have ZTS defined thread support in Zend.

I am not able to understand and appreciate all the details of the use of 
the macros to access the globals variables via AG(), CG() etc and from 
what I could figure out, ts_resource_ex()is some kind of thread specific 
data mechanism and would work only if threads are dedicated to PHP.

I am not able to understand who is responsible for ensuring that the 
same thread gets used for a complete request - whether it is some thing 
that I need to do in Apache or whether I need to enable/disable 
something while compiling PHP.

Any help would be greatly appreciated. Please copy me on your reply as well.

Thanks in advance,

S.R.


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Apache 1.3, PHP and TSRM question

2002-09-28 Thread Alan Knowles

Are you dl('')'ing and modules,  - I think Zeev pointed me to a known 
bug with this if you have a memory leak from a dl'ed module it will 
crash on this type of debugging code (I think the filename gets freed 
when you unload the module at shutdown, and hence filename points to an 
out of bounds area)
Regards
Alan

Ramesh Shankar wrote:

> I am trying to port PHP and I am running into a problem with Apache 
> 1.3. I am not familiar with the PHP language by itself and I am used 
> to working at the O.S. level and so any help would be greatly 
> appreciated. I tried to read through mailing list archives, the 
> readmes, FAQs etc, but I couldn't find answer for this question:
>
> When PHP is loaded with Apache 1.3 and Apache is shutdown, PHP 4.2.2 
> crashes inside the routine _efree() called from bc_free_num(). I found 
> the problem to be related to linked list corruption and on further 
> investigation, suspected it to be a case of the thread calling 
> bc_free_num() to be different from that of the thread that called 
> bc_new_num(). I verfied this by enabling TSRM_DEBUG while building 
> zend, which enables this detection in _efree(). I also set the 
> tsrm_error_level to TSRM_ERROR_LEVEL_ERROR to enable dispalying of 
> TSRM messages to the screen. And sure enough, I got an error message 
> from _efree() from the following excerpt:
>
> #if defined(ZTS) && TSRM_DEBUG
> if (p->thread_id != tsrm_thread_id()) {
> tsrm_error(TSRM_ERROR_LEVEL_ERROR, "Memory block allocated at 
> %s:(%d) on thread %x freed at %s:(%d) on thread %x, ignoring",
> p->filename, p->lineno, p->thread_id,
> __zend_filename, __zend_lineno, tsrm_thread_id());
> return;
> }
> #endif
>
> I have ZTS defined thread support in Zend.
>
> I am not able to understand and appreciate all the details of the use 
> of the macros to access the globals variables via AG(), CG() etc and 
> from what I could figure out, ts_resource_ex()is some kind of thread 
> specific data mechanism and would work only if threads are dedicated 
> to PHP.
>
> I am not able to understand who is responsible for ensuring that the 
> same thread gets used for a complete request - whether it is some 
> thing that I need to do in Apache or whether I need to enable/disable 
> something while compiling PHP.
>
> Any help would be greatly appreciated. Please copy me on your reply as 
> well.
>
> Thanks in advance,
>
> S.R.
>
>




-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] RE: #19637 [Opn->Bgs]: .php file truncated

2002-09-28 Thread James Moore


> (Do we have HOWTO for getting backtrace from Windows?)

No we don't because its quite complex although we could make it easier.
If we were to build PHP with symbols enabled and perhaps also provide
.pdg and .dbg files (we would have to make sure we always build in
c:\php4 or some such) then we could probably make it possible for people
without MSVC to create backtraces with just dr watson. Ill have a look
into this further and see if it is viable as soon as I get a chance..
Which may be a few days from now.

- James


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Apache 1.3, PHP and TSRM question

2002-09-28 Thread Ramesh Shankar

Thanks for your reply.

I think the issue is more fundamental than that. How and who is to 
guarantee that the thread which called bc_new_num() will be the same as 
the thread which called bc_free_num()? bc_new_num() is called when the 
Apache PHP module gets loaded by some thread in Apache and bc_free_num() 
gets called at shutdown time from some other thread. When _efree() is 
called, the memory being freed is blindly attempted to be removed from 
the list hanging off one of the AG() fields (AG(head), AG(phead)) and 
the node being removed is not in the list in the first place (as it is 
the "wrong" thread).

Any help would be greatly appreciated.

Thanks,

S.R.

Alan Knowles wrote:
> Are you dl('')'ing and modules,  - I think Zeev pointed me to a known 
> bug with this if you have a memory leak from a dl'ed module it will 
> crash on this type of debugging code (I think the filename gets freed 
> when you unload the module at shutdown, and hence filename points to an 
> out of bounds area)
> Regards
> Alan
> 
> Ramesh Shankar wrote:
> 
>> I am trying to port PHP and I am running into a problem with Apache 
>> 1.3. I am not familiar with the PHP language by itself and I am used 
>> to working at the O.S. level and so any help would be greatly 
>> appreciated. I tried to read through mailing list archives, the 
>> readmes, FAQs etc, but I couldn't find answer for this question:
>>
>> When PHP is loaded with Apache 1.3 and Apache is shutdown, PHP 4.2.2 
>> crashes inside the routine _efree() called from bc_free_num(). I found 
>> the problem to be related to linked list corruption and on further 
>> investigation, suspected it to be a case of the thread calling 
>> bc_free_num() to be different from that of the thread that called 
>> bc_new_num(). I verfied this by enabling TSRM_DEBUG while building 
>> zend, which enables this detection in _efree(). I also set the 
>> tsrm_error_level to TSRM_ERROR_LEVEL_ERROR to enable dispalying of 
>> TSRM messages to the screen. And sure enough, I got an error message 
>> from _efree() from the following excerpt:
>>
>> #if defined(ZTS) && TSRM_DEBUG
>> if (p->thread_id != tsrm_thread_id()) {
>> tsrm_error(TSRM_ERROR_LEVEL_ERROR, "Memory block allocated at 
>> %s:(%d) on thread %x freed at %s:(%d) on thread %x, ignoring",
>> p->filename, p->lineno, p->thread_id,
>> __zend_filename, __zend_lineno, tsrm_thread_id());
>> return;
>> }
>> #endif
>>
>> I have ZTS defined thread support in Zend.
>>
>> I am not able to understand and appreciate all the details of the use 
>> of the macros to access the globals variables via AG(), CG() etc and 
>> from what I could figure out, ts_resource_ex()is some kind of thread 
>> specific data mechanism and would work only if threads are dedicated 
>> to PHP.
>>
>> I am not able to understand who is responsible for ensuring that the 
>> same thread gets used for a complete request - whether it is some 
>> thing that I need to do in Apache or whether I need to enable/disable 
>> something while compiling PHP.
>>
>> Any help would be greatly appreciated. Please copy me on your reply as 
>> well.
>>
>> Thanks in advance,
>>
>> S.R.
>>
>>
> 
> 
> 


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Apache 1.3, PHP and TSRM question

2002-09-28 Thread Ramesh Shankar

One further piece of information:

We can cleanly shutdown Apache 2.0 running the same PHP binaries (except 
for the apache2filter module replacing the apache 1.3 module) without 
any issues. I just now confirmed that with Apache 2.0, the thread which 
is calling bc_new_num() is the *same* as the thread which calls 
bc_free_num(). bc_new_num() gets called 3 times by the *same* thread at 
PHP load time and gets called 3 times by the *same* thread at PHP unload 
time. This means that there must be way someway to "instruct" Apache 1.3 
to use the same thread for all related activities.

Any ideas?

Thanks,

S.R.


Ramesh Shankar wrote:
> Thanks for your reply.
> 
> I think the issue is more fundamental than that. How and who is to 
> guarantee that the thread which called bc_new_num() will be the same as 
> the thread which called bc_free_num()? bc_new_num() is called when the 
> Apache PHP module gets loaded by some thread in Apache and bc_free_num() 
> gets called at shutdown time from some other thread. When _efree() is 
> called, the memory being freed is blindly attempted to be removed from 
> the list hanging off one of the AG() fields (AG(head), AG(phead)) and 
> the node being removed is not in the list in the first place (as it is 
> the "wrong" thread).
> 
> Any help would be greatly appreciated.
> 
> Thanks,
> 
> S.R.
> 
> Alan Knowles wrote:
> 
>> Are you dl('')'ing and modules,  - I think Zeev pointed me to a known 
>> bug with this if you have a memory leak from a dl'ed module it will 
>> crash on this type of debugging code (I think the filename gets freed 
>> when you unload the module at shutdown, and hence filename points to 
>> an out of bounds area)
>> Regards
>> Alan
>>
>> Ramesh Shankar wrote:
>>
>>> I am trying to port PHP and I am running into a problem with Apache 
>>> 1.3. I am not familiar with the PHP language by itself and I am used 
>>> to working at the O.S. level and so any help would be greatly 
>>> appreciated. I tried to read through mailing list archives, the 
>>> readmes, FAQs etc, but I couldn't find answer for this question:
>>>
>>> When PHP is loaded with Apache 1.3 and Apache is shutdown, PHP 4.2.2 
>>> crashes inside the routine _efree() called from bc_free_num(). I 
>>> found the problem to be related to linked list corruption and on 
>>> further investigation, suspected it to be a case of the thread 
>>> calling bc_free_num() to be different from that of the thread that 
>>> called bc_new_num(). I verfied this by enabling TSRM_DEBUG while 
>>> building zend, which enables this detection in _efree(). I also set 
>>> the tsrm_error_level to TSRM_ERROR_LEVEL_ERROR to enable dispalying 
>>> of TSRM messages to the screen. And sure enough, I got an error 
>>> message from _efree() from the following excerpt:
>>>
>>> #if defined(ZTS) && TSRM_DEBUG
>>> if (p->thread_id != tsrm_thread_id()) {
>>> tsrm_error(TSRM_ERROR_LEVEL_ERROR, "Memory block allocated at 
>>> %s:(%d) on thread %x freed at %s:(%d) on thread %x, ignoring",
>>> p->filename, p->lineno, p->thread_id,
>>> __zend_filename, __zend_lineno, tsrm_thread_id());
>>> return;
>>> }
>>> #endif
>>>
>>> I have ZTS defined thread support in Zend.
>>>
>>> I am not able to understand and appreciate all the details of the use 
>>> of the macros to access the globals variables via AG(), CG() etc and 
>>> from what I could figure out, ts_resource_ex()is some kind of thread 
>>> specific data mechanism and would work only if threads are dedicated 
>>> to PHP.
>>>
>>> I am not able to understand who is responsible for ensuring that the 
>>> same thread gets used for a complete request - whether it is some 
>>> thing that I need to do in Apache or whether I need to enable/disable 
>>> something while compiling PHP.
>>>
>>> Any help would be greatly appreciated. Please copy me on your reply 
>>> as well.
>>>
>>> Thanks in advance,
>>>
>>> S.R.
>>>
>>>
>>
>>
>>
> 


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Latest cvs: error in mbstring

2002-09-28 Thread Martin Jansen

On Don Sep 26, 2002 at 09:3505 +0200, Martin Jansen wrote:
> The following error occurs when building latest CVS:
> 
> ext/mbstring/mbstring.lo: In function `zif_mb_convert_case':
> /home/martin/cvs/php/php4/ext/mbstring/mbstring.c:2499: undefined
> reference to `php_unicode_convert_case'
> collect2: ld returned 1 exit status
> make: *** [sapi/cli/php] Error 1

Ok, this problem was fairly easy to solve as I in fact forgot to run
./buildconf. But now the next one occurs:

"make" fails with:

l_functions_cli.lo -lmysqlclient -lcrypt -lresolv -lm -ldl -lnsl -lcrypt -ldl -o 
sapi/cli/php
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

What's wrong there? The system is Debian Woody, Kernel 2.4.18 and I'm
using Debian's precompiled MySQL 3.23.52.

-- 
- Martin   Martin Jansen
http://martinjansen.com/

-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Latest cvs: error in mbstring

2002-09-28 Thread Melvyn Sopacua

At 12:35 28-9-2002, you wrote:

>Ok, this problem was fairly easy to solve as I in fact forgot to run
>./buildconf. But now the next one occurs:
>
>"make" fails with:
>
> l_functions_cli.lo -lmysqlclient -lcrypt -lresolv -lm -ldl -lnsl 
> -lcrypt -ldl -o sapi/cli/php
> /usr/bin/ld: cannot find -lz
> collect2: ld returned 1 exit status
> make: *** [sapi/cli/php] Error 1
>
>What's wrong there? The system is Debian Woody, Kernel 2.4.18 and I'm
>using Debian's precompiled MySQL 3.23.52.

add --with-zlib-dir=/path/to/zlibprefix

Check with ldd /path/to/mysql/libmysqlclient.so which zlib is linked. Might 
be a version
conflict (libz.so.1 should be in there).



Met vriendelijke groeten / With kind regards,

Webmaster IDG.nl
Melvyn Sopacua


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] CGI SAPI binary location

2002-09-28 Thread Yasuo Ohgaki
Currently, CGI binary is built as "php" under source
root and copied as "php-cgi" when it is installed.

I would like to move CGI binary build location from
source root to sapi/cgi and change binary name from
php to php-cgi to avoid possible confusion.

Attached patch is supposed to do the job.
Does anyone find problem in this patch?

--
Yasuo Ohgaki

Index: Makefile.global
===
RCS file: /repository/php4/Makefile.global,v
retrieving revision 1.24
diff -u -r1.24 Makefile.global
--- Makefile.global 16 Aug 2002 00:36:05 -  1.24
+++ Makefile.global 28 Sep 2002 11:37:00 -
@@ -16,7 +16,7 @@
 libs/libphp4.bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
$(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) 
$(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) 
$(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp4.so
 
-php: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
+sapi/cgi/php-cgi: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
$(BUILD_CGI)

 sapi/cli/php: $(PHP_GLOBAL_OBJS) $(PHP_CLI_OBJS)
@@ -64,7 +64,7 @@
 clean:
find . -name \*.lo -o -name \*.o -o -name \*.la -o -name \*.a| xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
-   rm -f libphp4.la php sapi/cli/php modules/* libs/*
+   rm -f libphp4.la sapi/cgi/php-cgi sapi/cli/php modules/* libs/*
 
 distclean: clean
rm -f config.cache config.log config.status Makefile.objects 
Makefile.fragments libtool main/php_config.h stamp-h php4.spec 
sapi/apache/libphp4.module buildmk.stamp
Index: acinclude.m4
===
RCS file: /repository/php4/acinclude.m4,v
retrieving revision 1.205
diff -u -r1.205 acinclude.m4
--- acinclude.m46 Sep 2002 10:27:26 -   1.205
+++ acinclude.m428 Sep 2002 11:37:01 -
@@ -814,7 +814,7 @@
 dnl PHP_BUILD_PROGRAM
 dnl
 AC_DEFUN(PHP_BUILD_PROGRAM,[
-  OVERALL_TARGET=php
+  OVERALL_TARGET=sapi/cgi/php-cgi
   php_c_pre='$(CC)'
   php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
   php_c_post=' && echo > $[@]'
Index: configure.in
===
RCS file: /repository/php4/configure.in,v
retrieving revision 1.372
diff -u -r1.372 configure.in
--- configure.in6 Sep 2002 17:18:16 -   1.372
+++ configure.in28 Sep 2002 11:37:03 -
@@ -215,7 +215,7 @@
 dnl -
 
 dnl paths to the targets are relative to the build directory
-SAPI_PROGRAM=php
+SAPI_PROGRAM=sapi/cgi/php-cgi
 SAPI_SHARED=libs/libphp4.$SHLIB_SUFFIX_NAME
 SAPI_STATIC=libs/libphp4.a
 SAPI_LIBTOOL=libphp4.la
Index: sapi/cgi/config.m4
===
RCS file: /repository/php4/sapi/cgi/config.m4,v
retrieving revision 1.18
diff -u -r1.18 config.m4
--- sapi/cgi/config.m4  4 Sep 2002 18:47:26 -   1.18
+++ sapi/cgi/config.m4  28 Sep 2002 11:37:07 -
@@ -100,10 +100,10 @@
 
 case $host_alias in
   *darwin*)
-BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) 
\$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) 
\$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o php"
+BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) 
+\$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) 
+\$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o sapi/cgi/php-cgi"
 ;;
   *)
-BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) 
\$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) 
\$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o php"
+BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) 
+\$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) 
+\$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o sapi/cgi/php-cgi"
 ;;
 esac
 PHP_SUBST(BUILD_CGI)


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DEV] CGI SAPI binary location

2002-09-28 Thread Jan Lehnardt

Hi,
On Sat, Sep 28, 2002 at 09:03:29PM +0900, Yasuo Ohgaki wrote:
> Does anyone find problem in this patch?
I think 'make test' must be adjusted to these changes, not sure though.

Jan
-- 
Q: Thank Jan? A: http://geschenke.an.dasmoped.net/
Got an old and spare laptop? Please send me a mail.
Key7BCC EB86 8313 DDA9 25DF  
Fingerprint1805 ECA5 BCB7 BB96 56B0

-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] getopt function

2002-09-28 Thread Sander Roobol

On Fri, Sep 27, 2002 at 10:25:56PM -0400, Jon Parise wrote:
> I wrote a simply getopt function for PHP (based on the system's
> getopt() call).  This is not meant to compete with the getopt PEAR
> class but rather to provide simple command line parsing capabilities
> to CLI-based PHP scripts.
> 
> If there are no objections, I'd like to commit this over the weekend
> (at which point I'll also write the associated documentation).
> 
> Comments are, of course, welcome.
 
+1

Sander

-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] CGI SAPI binary location

2002-09-28 Thread Yasuo Ohgaki

Jan Lehnardt wrote:
> Hi,
> On Sat, Sep 28, 2002 at 09:03:29PM +0900, Yasuo Ohgaki wrote:
> 
>>Does anyone find problem in this patch?
> 
> I think 'make test' must be adjusted to these changes, not sure though.
> 

AFAIK, "make test" depends on CLI sapi now and run-tests.php
can only be executed by CLI sapi.

We are better to make run-tests.php runs under CGI sapi.
Otherwise, some tests must be skipped always.

Is there way to execute run-tests.php with CGI sapi?
I don't follow run-tests.php changes well recently.

export TEST_PHP_EXECUTABLE=./sapi/cgi/php-cgi; ./sapi/cgi/php-cgi -c 
php.ini-dist -q -f ./run-tests.php

does not work at least.

--
Yasuo Ohgaki



-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] export data to text file

2002-09-28 Thread Diana Castillo

Hi, I want to export some fields on a regular basis from a table to a text
file, preferable to the users local computer. I tried writing to a file with
fopen but I get "permission denied" when I try to open it for writing.
What is the best solution?
Thanks,
Diana

--
See my web page:
http://www.netrox.net/%7Ecastillo/



-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] CGI SAPI binary location

2002-09-28 Thread Marcus Börger

At 15:43 28.09.2002, Yasuo Ohgaki wrote:
>Jan Lehnardt wrote:
>>Hi,
>>On Sat, Sep 28, 2002 at 09:03:29PM +0900, Yasuo Ohgaki wrote:
>>
>>>Does anyone find problem in this patch?
>>I think 'make test' must be adjusted to these changes, not sure though.
>
>AFAIK, "make test" depends on CLI sapi now and run-tests.php
>can only be executed by CLI sapi.
>
>We are better to make run-tests.php runs under CGI sapi.
>Otherwise, some tests must be skipped always.
>
>Is there way to execute run-tests.php with CGI sapi?
>I don't follow run-tests.php changes well recently.
>
>export TEST_PHP_EXECUTABLE=./sapi/cgi/php-cgi; ./sapi/cgi/php-cgi -c 
>php.ini-dist -q -f ./run-tests.php
>
>does not work at least.

Only set the executable to the cgi and it works.

 >export TEST_PHP_EXECUTABLE=./sapi/cgi/php-cgi

or call it directly

 >./sapi/cgi/php-cgi -c php.ini-dist -q -f ./run-tests.php

The handling of the ini file is *hi* because the script tests which ini 
file itself uses but not
which ini file is used for the tests :-(

I do not have the time now but i keep this in mind.

marcus


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] naming of new streams functions for 4.3

2002-09-28 Thread Andrei Zmievski

On Sat, 28 Sep 2002, Wez Furlong wrote:
> Hi All,
> 
> I'm in two minds about what to call the functions introduced by streams
> to user-space.
> 
> Some of them are called file_xxx to emphasize the fact that they operate
> on files, while some of them are called stream_xxx to emphasize that they
> are not limited to just files.
> 
> Example: streams now allows for (non)blocking mode to be set on "regular"
> files and not just sockets; so socket_set_blocking should now be named
> file_set_blocking. But streams allows for any stream to support
> this operation, so should we call the function stream_set_blocking?
> 
> I think all of the new streams related functions should be named consistently,
> but I'm not sure if they should all be named file_xxx or stream_xxx; I think
> we touched on this topic a few months back and, IIRC, the only real issue is
> with the users not realizing that they could/should use the stream_xxx
> functions.
> 
> I'd like to get this right before we branch for 4.3; comments please!

I think that having them called stream_* would be more consistent with
the implementation. Making users aware of how these functions work is a
matter of documentation.

-Andrei   http://www.gravitonic.com/
* A feature is a bug with seniority. *

-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] naming of new streams functions for 4.3

2002-09-28 Thread Zeev Suraski

At 21:40 28/09/2002, Andrei Zmievski wrote:
>I think that having them called stream_* would be more consistent with
>the implementation. Making users aware of how these functions work is a
>matter of documentation.

I agree.

Zeev


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Feature request -- feedback welcomed.

2002-09-28 Thread Lamont R. Peterson

All:

I can't hardly wait for PHP 4.3 (Zend 2.0) to hit the streets.  I can't 
express how anxiously I've been waiting for the class model to be reworked.  
Great job!

I would, however, like to see a couple of simple additions to the planned 
release (if these are already coming, then I just haven't seen is talked 
about anywhere).  I would love to have "method" as an alias for "function" 
and "member" as an alias for "var".  These could be just plain aliases, but 
it would be nice if these aliases were only valid within a class definition.

I would love to hear peoples thoughts on this one.  Where I work, the kind of 
software we write on PHP,  it only makes sense to use objects.  However, we 
do mix in plain functions liberally when there is no need for the features of 
an object.  I've worked this way with PHP ever since 4.0.0 was released.
-- 
Sincerely,
Lamont R. Peterson <[EMAIL PROTECTED]>
801-580-7323 [cell]

--
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Feature request -- feedback welcomed.

2002-09-28 Thread derick

On Sat, 28 Sep 2002, Lamont R. Peterson wrote:

> All:
> 
> I can't hardly wait for PHP 4.3 (Zend 2.0) to hit the streets.  I can't 
> express how anxiously I've been waiting for the class model to be reworked.  
> Great job!

Uhm... 4.3.0 will not ship with Zend 2.0, that will b ethe honour of PHP 
5.0.0.

> I would, however, like to see a couple of simple additions to the planned 
> release (if these are already coming, then I just haven't seen is talked 
> about anywhere).  I would love to have "method" as an alias for "function" 
> and "member" as an alias for "var".  These could be just plain aliases, but 
> it would be nice if these aliases were only valid within a class definition.
>
> I would love to hear peoples thoughts on this one.  Where I work, the kind of 
> software we write on PHP,  it only makes sense to use objects.  However, we 
> do mix in plain functions liberally when there is no need for the features of 
> an object.  I've worked this way with PHP ever since 4.0.0 was released.

What is the reasoning to add aliases? IMO it just pollutes the language.

regards,
Derick

--

---
 Derick Rethans   http://derickrethans.nl/ 
 JDI Media Solutions
--[ if you hold a unix shell to your ear, do you hear the c? ]-


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] export data to text file

2002-09-28 Thread Pierre-Alain Joye

On Sat, 28 Sep 2002 16:02:43 +0200
"Diana Castillo" <[EMAIL PROTECTED]> wrote:

> What is the best solution?

Asking it on php-general, this list is for the development of php
itself, not with php.

Check the permission of the destination folder.

hth

pa

-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Feature request -- feedback welcomed.

2002-09-28 Thread Lamont R. Peterson

Derek & All:

[NOTE: The root message of this thread is the first I've read with this list.  
Therefore, I don't know what's been talked about here.  I'll happily admit 
that this makes it much easier for me to look stupid when asking questions.]

On Saturday 28 September 2002 13:50, [EMAIL PROTECTED] wrote:
> Uhm... 4.3.0 will not ship with Zend 2.0, that will b ethe honour of PHP
> 5.0.0.

From www.php.net:
"[30-Jun-2002]  The second alpha release of PHP w/Zend Engine 2 is now 
available.  It is based on the current PHP 4 CVS (4.3.0-dev) and includes the 
new scripting engine which greatly improces the object model..."

Re-reading this announcement in the light of your comment above, I can see 
that this does not state that PHP 4.3.0 will be with Zend 2.0.  However, I 
haven't seen on www.php.net nor www.zend.com anything that ever even mentions 
PHP 5.0.0.

I've hunted down everything I could find to read (including some PDF files) 
about the objects (and other things) in Zend 2.0. If there is such 
information in these public places, please, tell me where I can read it.

> What is the reasoning to add aliases? IMO it just pollutes the language.

I would have to agree; IMO, PHP is riddled with such aliases.  However, I can 
fully understand & appreciate how and why most of them have come to be.

I suggest them as aliases for thwo reasons:  1)  I don't see any true 
functionality differences needed; and 2) I don't want peoples classes written 
with "var" & "function" to melt down when they move their code to PHP on Zend 
2.0.
-- 
Sincerely,
Lamont R. Peterson <[EMAIL PROTECTED]>
801-580-7323 [cell]

--
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Feature request -- feedback welcomed.

2002-09-28 Thread Sebastian Bergmann

"Lamont R. Peterson" wrote:
> Derek & All:

  His name is "Derick", like the TV inspector.

-- 
  Sebastian Bergmann
  http://sebastian-bergmann.de/ http://phpOpenTracker.de/

  Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/

-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Feature request -- feedback welcomed.

2002-09-28 Thread Pierre-Alain Joye

On Sat, 28 Sep 2002 22:23:08 +0200
Sebastian Bergmann <[EMAIL PROTECTED]> wrote:

>   His name is "Derick", like the TV inspector.

yup, but he s more funny ;-)

-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Feature request -- feedback welcomed.

2002-09-28 Thread Sebastian Bergmann

Sebastian Bergmann wrote:
> His name is "Derick", like the TV inspector.

  +almost (my bad, http://us.imdb.com/Title?0070981)

-- 
  Sebastian Bergmann
  http://sebastian-bergmann.de/ http://phpOpenTracker.de/

  Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/

-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Very cool -= Code Generator =- !!!

2002-09-28 Thread johnny1b1g

Use Codejay as your web assistant.
Create ASP , PHP, COLDFUSION , ASP.NET
web applications
Save time and money.

Visit  www.codejay.com



-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] CGI SAPI binary location

2002-09-28 Thread Yasuo Ohgaki

Marcus Börger wrote:
> At 15:43 28.09.2002, Yasuo Ohgaki wrote:
>>> On Sat, Sep 28, 2002 at 09:03:29PM +0900, Yasuo Ohgaki wrote:
>> We are better to make run-tests.php runs under CGI sapi.
>> Otherwise, some tests must be skipped always.
>>
>> Is there way to execute run-tests.php with CGI sapi?
>> I don't follow run-tests.php changes well recently.
>>
>> export TEST_PHP_EXECUTABLE=./sapi/cgi/php-cgi; ./sapi/cgi/php-cgi -c 
>> php.ini-dist -q -f ./run-tests.php
>>
>> does not work at least.
> 
> 
> Only set the executable to the cgi and it works.
> 
>  >export TEST_PHP_EXECUTABLE=./sapi/cgi/php-cgi
> 
> or call it directly
> 
>  >./sapi/cgi/php-cgi -c php.ini-dist -q -f ./run-tests.php
> 
> The handling of the ini file is *hi* because the script tests which ini 
> file itself uses but not
> which ini file is used for the tests :-(
> 
> I do not have the time now but i keep this in mind.

I tested as follows

 >> export TEST_PHP_EXECUTABLE=./sapi/cgi/php-cgi; ./sapi/cgi/php-cgi -c
 >> php.ini-dist -q -f ./run-tests.php

and I get following errors for each test script.

PHP Fatal error:  Unknown(): Unable to open  in Unknown on line 0
Unknown(0) : Fatal error - Unknown(): Unable to open
FAIL ctype on integers (001.phpt)

It could be temporary(?) error with CVS source, though.
Does/did it work for you?

--
Yasuo Ohgaki



-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Feature request -- feedback welcomed.

2002-09-28 Thread Sascha Cunz


> Uhm... 4.3.0 will not ship with Zend 2.0, that will b ethe honour of PHP
> 5.0.0.

But one can compile Zend 2.0 into PHP 4 - i think Zeev posted an HowTo some 
weeks ago.

Regards Sascha

--
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] php/embed

2002-09-28 Thread Edin Kadribasic

Hello,

I have just committed initial work on enabling embedding PHP into C/C++ 
applications. It is mostly complete, but there a few pieces missing, namely 
the installation part. The modification of the build system adds another 
target, so in order to test the new functionality you need to configure php 
in the usual manner, and then do "make", "make install" and "make libs". 
Since libs are not installed by "make install" you need to copy libphp.so 
manually to appropriate directory.

The best way to explain how this works is to show you some code examples.

pembed.c

#include 

int main(int argc, char **argv)
{
  char *php_code = "echo \"Hello, World!\\n\";";

  PHP_EMBED_START_BLOCK(argc, argv);
  zend_eval_string(php_code, NULL, "Embedded code" TSRMLS_CC);
  PHP_EMBED_END_BLOCK();

  return 0;
}

Makefile (unix)
===
LIBS=-lphp $(shell php-config --libs)
INCLUDES=$(shell php-config --includes)
LIBDIRS=-L$(shell php-config --prefix)/lib
PHP_EXE=$(shell php-config --prefix)/bin/php
CC=gcc
CFLAGS=-g -Wall

pembed: pembed.o
$(CC) $(CFLAGS) $(LIBDIRS) -o pembed $(LIBS) pembed.o

pembed.o: pembed.c
$(CC) $(CFLAGS) $(INCLUDES) -c pembed.c

clean:
rm -f *.o pembed

Makefile (win32)

# Put your compiled php source here
ROOT=u:\projects\php\php4.sdk
LIBS=php4ts.lib phpembed.lib
INCLUDES=-I "$(ROOT)" -I "$(ROOT)\main" -I "$(ROOT)\Zend" -I "$(ROOT)\TSRM"
LIBDIRS=/libpath:"$(ROOT)\Release_TS"
CC=cl
LD=link
CFLAGS=-MD -D ZTS -D PHP_WIN32 -D ZEND_WIN32

pembed.exe: pembed.obj
$(LD) $(LIBDIRS) /out:pembed.exe $(LIBS) pembed.obj

pembed.obj: pembed.c
$(CC) $(CFLAGS) $(INCLUDES) -c pembed.c

clean:
-del *.obj
-del pembed.exe


As you can see from the example pembed.c file it is not very difficult to get 
the PHP engine started using php/embed. There are some things that you need 
to notice: you should think of PHP_EMBED_START_BLOCK() and 
PHP_EMBED_END_BLOCK() as {} block, so take care not to intersect with other 
{} blocks. If this is too great a limitiation, functions 

int php_embed_init(int argc, char **argv PTSRMLS_DC);
void php_embed_shutdown(TSRMLS_D);

should be used instead.

I'm looking forward to your feedback and help to get the "make install" part 
working.

Edin


--
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] php/embed

2002-09-28 Thread George Schlossnagle

very cool.

On Saturday, September 28, 2002, at 10:56 PM, Edin Kadribasic wrote:

> Hello,
>
> I have just committed initial work on enabling embedding PHP into C/C++
> applications. It is mostly complete, but there a few pieces missing, 
> namely
> the installation part. The modification of the build system adds another
> target, so in order to test the new functionality you need to configure 
> php
> in the usual manner, and then do "make", "make install" and "make libs".
> Since libs are not installed by "make install" you need to copy 
> libphp.so
> manually to appropriate directory.
>
> The best way to explain how this works is to show you some code 
> examples.
>
> pembed.c
> 
> #include 
>
> int main(int argc, char **argv)
> {
>   char *php_code = "echo \"Hello, World!\\n\";";
>
>   PHP_EMBED_START_BLOCK(argc, argv);
>   zend_eval_string(php_code, NULL, "Embedded code" TSRMLS_CC);
>   PHP_EMBED_END_BLOCK();
>
>   return 0;
> }
>
> Makefile (unix)
> ===
> LIBS=-lphp $(shell php-config --libs)
> INCLUDES=$(shell php-config --includes)
> LIBDIRS=-L$(shell php-config --prefix)/lib
> PHP_EXE=$(shell php-config --prefix)/bin/php
> CC=gcc
> CFLAGS=-g -Wall
>
> pembed: pembed.o
> $(CC) $(CFLAGS) $(LIBDIRS) -o pembed $(LIBS) pembed.o
>
> pembed.o: pembed.c
> $(CC) $(CFLAGS) $(INCLUDES) -c pembed.c
>
> clean:
> rm -f *.o pembed
>
> Makefile (win32)
> 
> # Put your compiled php source here
> ROOT=u:\projects\php\php4.sdk
> LIBS=php4ts.lib phpembed.lib
> INCLUDES=-I "$(ROOT)" -I "$(ROOT)\main" -I "$(ROOT)\Zend" -I 
> "$(ROOT)\TSRM"
> LIBDIRS=/libpath:"$(ROOT)\Release_TS"
> CC=cl
> LD=link
> CFLAGS=-MD -D ZTS -D PHP_WIN32 -D ZEND_WIN32
>
> pembed.exe: pembed.obj
> $(LD) $(LIBDIRS) /out:pembed.exe $(LIBS) pembed.obj
>
> pembed.obj: pembed.c
> $(CC) $(CFLAGS) $(INCLUDES) -c pembed.c
>
> clean:
> -del *.obj
> -del pembed.exe
>
>
> As you can see from the example pembed.c file it is not very difficult 
> to get
> the PHP engine started using php/embed. There are some things that you 
> need
> to notice: you should think of PHP_EMBED_START_BLOCK() and
> PHP_EMBED_END_BLOCK() as {} block, so take care not to intersect with 
> other
> {} blocks. If this is too great a limitiation, functions
>
> int php_embed_init(int argc, char **argv PTSRMLS_DC);
> void php_embed_shutdown(TSRMLS_D);
>
> should be used instead.
>
> I'm looking forward to your feedback and help to get the "make install" 
> part
> working.
>
> Edin
>
>
> --
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
// George Schlossnagle
// Principal Consultant
// OmniTI, Inc  http://www.omniti.com
// (c) 240.460.5234   (e) [EMAIL PROTECTED]
// 1024D/1100A5A0  1370 F70A 9365 96C9 2F5E 56C2 B2B9 262F 1100 A5A0


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Re: php/embed

2002-09-28 Thread Yasuo Ohgaki

Edin Kadribasic wrote:
> Hello,
> 
> I have just committed initial work on enabling embedding PHP into C/C++ 
> applications. It is mostly complete, but there a few pieces missing, namely 
> the installation part. The modification of the build system adds another 
> target, so in order to test the new functionality you need to configure php 
> in the usual manner, and then do "make", "make install" and "make libs". 
> Since libs are not installed by "make install" you need to copy libphp.so 
> manually to appropriate directory.


Great :)
I was thinking similar thing to implement PlPhp for PostgreSQL.
I cannot test drive until next month, but I'll try it then.

--
Yasuo Ohgaki


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] patch for imagecopyresampled()

2002-09-28 Thread Tim

This patch fixes a problem with imagecopyresampled() when copying an image 
with a non-constant alpha layer. If nobody objects, I'll commit this.

Tim


Index: gd.c
===
RCS file: /repository/php4/ext/gd/libgd/gd.c,v
retrieving revision 1.15
diff -u -r1.15 gd.c
--- gd.c	22 Aug 2002 16:21:32 -	1.15
+++ gd.c	29 Sep 2002 06:36:35 -
@@ -2038,6 +2038,7 @@
 	  float sx, sy;
 	  float spixels = 0.0f;
 	  float red = 0.0f, green = 0.0f, blue = 0.0f, alpha = 0.0f;
+	  float alpha_factor, alpha_sum = 0.0f, contrib_sum = 0.0f;
 	  sy1 = ((float)(y - dstY)) * (float)srcH /
 	(float)dstH;
 	  sy2 = ((float)(y + 1 - dstY)) * (float) srcH /
@@ -2095,10 +2096,13 @@
 		 src,
 		 (int) sx + srcX,
 		 (int) sy + srcY);
-		  red += gdTrueColorGetRed (p) * pcontribution;
-		  green += gdTrueColorGetGreen (p) * pcontribution;
-		  blue += gdTrueColorGetBlue (p) * pcontribution;
+		  alpha_factor = ((gdAlphaMax - gdTrueColorGetAlpha(p))) * pcontribution;
+		  red += gdTrueColorGetRed (p) * alpha_factor;
+		  green += gdTrueColorGetGreen (p) * alpha_factor;
+		  blue += gdTrueColorGetBlue (p) * alpha_factor;
 		  alpha += gdTrueColorGetAlpha (p) * pcontribution;
+		  alpha_sum += alpha_factor;
+		  contrib_sum += pcontribution;
 		  spixels += xportion * yportion;
 		  sx += 1.0f;
 		}
@@ -2113,6 +2117,13 @@
 	  blue /= spixels;
 	  alpha /= spixels;
 	}
+  if ( alpha_sum != 0.0f)
+{
+  if( contrib_sum != 0.0f ) alpha_sum /= contrib_sum;
+  red /= alpha_sum;
+  green /= alpha_sum;
+  blue /= alpha_sum;
+}
 	  /* Clamping to allow for rounding errors above */
 	  if (red > 255.0f)
 	{



-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php