Re: [PHP-DEV] Re: bug of the day: $this

2002-12-07 Thread Balazs Nagy
On Fri, 2002-12-06 at 22:11, Stig S. Bakken wrote:
 It won't be different in ZE2.  This is not a bug though, but a tricky
 design issue.  The problem is figuring out at runtime when to set $this
 or not in a method.  What most people would probably find intuitive, is
 that $this was set only in methods called in the object, but this would
 require pretty expensive checks for every method call.

Maybe the roots of OO is my problem. PHP does similar, but not exactly.
I don't know whether you like clear things, or is this clear to you, but
I see confusion about handling $this. Excerpt from the documentation:

http://www.php.net/manual/en/language.oop.php

Within a class definition, you do not know under which name the object
will be accessible in your program: at the time the Cart class was
written, it was unknown that the object will be named $cart or
$another_cart later. Thus, you cannot write $cart-items within the Cart
class itself. Instead, in order to be able to access it's own functions
and variables from within a class, one can use the pseudo-variable $this
which can be read as 'my own' or 'current object'. Thus,
'$this-items[$artnr] += $num' can be read as 'add $num to the $artnr
counter of my own items array' or 'add $num to the $artnr counter of the
items array within the current object'.

 Andi can shed more light on this if needed.

Andi, please tell me why.
-- 
jul

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




[PHP-DEV] PHP 4 Bug Summary Report

2002-12-07 Thread php-dev
 PHP 4 Bug Database summary - http://bugs.php.net

 Num Status Summary (1009 total including feature requests)
===[*Configuration Issues]
13561 Assigned   --without-pear prevent install of php-config,phpize,...
19282 Won't fix  Place php4ts.dll into \sapi
20490 Analyzed   enable versioning not supported on OSX
20689 Won\'t fix  php_admin_value disable_functions not working as it should
===[*General Issues]==
20195 Open   make install doesnt set permissions
20604 Feedback   PHP CLI exists always with Segmantation Fault
20806 Feedback   display of rows in browse incorrect due to field names
===[*Languages/Translation]===
11975 Won't fix  mix of hebrew  english
13014 Won't fix  hebrevc ()
20166 Open   Unicode (Slovenian) characters are not displayed correctly
===[*Network Functions]===
15639 Suspended  detecting end of UDP packets
===[Apache related]===
14409 Open   request for nonexistent file does not return 404 error
15529 Open   ap_cleanup_for_exec not used when creating
17837 Won't fix  PHP 'handles' permission problems rather than letting Apache do it
19113 Open   HTTP status 200 returned on HTTP CONNECT when mod_proxy not in use
19292 Critical   random error: open_basedir restriction in effect. File is in wrong 
directory
20053 Open   apachesuexecphp-cgiignore_user_abort - problem with cancelled 
connections
20104 Open   unhandled exception with multiple requests
20190 Critical   Random mem corruption: zend_get_executed_filename() mismatch
20643 Open   long POST fields get truncated
20665 Feedback   Memory leaks on SIGHUP
===[Apache2 related]==
17098 Analyzed   apache sending 304 - not modified header
17414 Open   Segfaults on restart
17566 Open   phpinfo() causes load of 2+
17868 Verified   Doesn't work two and more !--include-- directives of PHP code on 
different OS
18648 Open   Single entry form POST gives incorrect variable content
18957 Won't fix   multiple definitions
19739 Open   php-4.2.3 fails to Install with Apache 2.0.42 on AIX 5.1 ML2
19787 Won\'t fix  Can not load module
19918 Open   no libphp4.so produced
20569 Open   Apache fails when restarting
20701 Feedback   ld: can't locate file for: -laprutiland after
20823 Open   form post results in duplicitous $_REQUEST
===[Arrays related]===
18829 Won\'t fix  array_pop, array_shift, array_push... functions very slow with large 
arrays
20251 Won\'t fix  Can't assign values to array in loop.
===[BC math related]==
13551 Open   BC functions apply decimal places argument also on arguments
===[CCVS related]=
10447 Won\'t fix  ccvs_*() functions segfault when given invalid session ID
===[Class/Object related]=
15675 Suspended  get_class() returns only lower chars
17637 Analyzed   constructors in classes (Back to PHP3)
20520 Open   Nonsymetric data syncronization with references
20531 Open   Object property association broken
20709 Feedback   Session variable getting mysteriously set
===[COM related]==
15771 Suspended  cannot pass value to image field by ado
16375 Suspended  Feature: Support for VARIANT multi dimensional arrays
19150 Open   Overloaded COM Property Set Leaks Memory
20100 Open   Com Performance/Memory issues
20282 Open   COM memory leak
===[Compile Failure]==
1298 Verified   need to use -taso with Netscape LDAP libs
7643 Open   APXS compile fails with not a DSO
10108 Open   cc 1501:218 file XXX contains an incorrect file suffix
14245 Verified   make install fails on apxs
17820 Won't fix  php.ini-dist not copied
18358 Won't fix  Recode doesn't compile with apache2
19555 Feedback   GNU pthreads issue?
19973 Open   compile zlib and pcre as shared fails
20444 Won\'t fix  Various compile warnings and one error.
20546 Feedback   compile with gcc 3.2 fails due to parser errors
20626 Feedback   Fails to build Apache shared module (not mkstemp)
20747 Feedback   Comile of flock_compat.c fauks
20752 Analyzed   Seems like it has something to do with ZEND_API(?).
20768 Won\'t fix  MySql temp file error
20827 Open   stat macro
===[Compile Warning]==
20563 Won\'t fix  GCC 2.96 warning
20762 Open   Warning compiling with mailparse
===[cURL related]=
20263 Suspended  feof doesn't 

[PHP-DEV] Latest ZE2 changes

2002-12-07 Thread Marcus Börger
Hi Zeev,

I have changed the test files and encountered some problems with the way 
you modified my patch:

1) private_002.phpt fails  with
004- Fatal error: Call to private method pass::show() from context 'fail' 
in %s on line %d
004+ Fatal error: Call to public method fail::show() from context 'fail' in 
/usr/src/php4-HEAD/tests/classes/private_002.php on line 18

The new error message is wrong. We are trying to access pass::show and not 
fail::show().

2) private_007.phpt and private_007b.phpt both fail with the message
Fatal error: Cannot redeclare private bar::priv() as public foo::priv()

That means the children know about their parents privates what is in 
contrast to
our discussion. The reason they do is because you skipped the part of the patch
where in zend_do_inheritance() a modified version of zend_hash_merge_ex() was
used to prevent this. But you also do not search for the private method in 
the calling
scope. In other words you mainly used the first version of my patch. So i 
tried to
strip down zend_hash_merge_with_argument_if() to the portion we need and tried
to skip copying zje privates. But since privates are no longer looked up in 
the
calling scope this fails.

3) You left in some snippets of the 'final' patch. Does this mean we are 
going to have
final? A new patch is also available.

Testfiles and patches can be downloaded here:
http://marcus-boerger.de/php/ext/ze2/

regards
marcus

By the way what does ZEND_ACC_xxx stand for?


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



Re: [PHP-DEV] Default Return-Path with mail() and qmail

2002-12-07 Thread Daniel Lorch
hi,

Here's an improved version of this patch, which doesn't SEGFAULT on invalid
input. Someone just brought up this topic on php-de and qmail, so I thought
there is some interest in this patch .. Everbody else just ignore me :)

-daniel

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


Re: [PHP-DEV] Default Return-Path with mail() and qmail

2002-12-07 Thread Daniel Lorch
--- php-4.2.3/ext/standard/mail.c   Sat Aug 24 13:38:13 2002
+++ php-4.2.3-daniel/ext/standard/mail.cMon Dec  2 01:24:35 2002
@@ -21,6 +21,7 @@
 #include stdlib.h
 #include ctype.h
 #include stdio.h
+#include string.h
 #include php.h
 #include ext/standard/info.h
 #if !defined(PHP_WIN32)
@@ -124,6 +125,84 @@
 }
 /* }}} */
 
+char *get_header_value(char *line)
+{
+   while(*line  *line != ':')
+   line++;
+
+   if(!*line)
+   return NULL;
+
+   line++;
+   
+   while(isspace(*line))
+   line++;
+
+   return strdup(line);
+}
+
+char *get_header(char *header_name, char *headers)
+{
+   char *line, *value=NULL;
+   int header_name_len = strlen(header_name);
+   int len=0;
+   
+   do {
+   if(*headers == '\n' || *headers == '\0') {
+   if(len  header_name_len) {
+   len = 0;
+   continue;
+   }
+   
+   if((line = (char *)malloc(len + 1)) == NULL)
+   return NULL;
+   
+   headers -= len;
+
+   strncpy(line, headers, len);
+   line[len] = '\0';
+
+   headers += len;
+   
+   if(strncmp(line, header_name, header_name_len) == 0) {
+   value = get_header_value(line);
+   }
+   
+   free(line);
+   
+   len = 0;
+   } else {
+   ++len;
+   }
+   } while(*headers++  value == NULL);
+   
+   return value;
+}
+
+char *extract_address(char *address)
+{
+   char *start, *stop, *tmp;
+   
+   if((start = stop = strchr(address, '@')) == NULL)
+   return NULL;
+   
+   while(start = address  !isspace(*start)  *start != '')
+   start--;
+   
+   start++;
+   
+   while(*stop  !isspace(*stop)  *stop != '')
+   stop++;
+   
+   if((tmp = (char *)malloc(stop - start + 1)) == NULL)
+   return NULL;
+   
+   strncpy(tmp, start, stop - start);
+   tmp[stop-start] = '\0';
+   
+   return tmp;
+}
+
 /* {{{ php_mail
  */
 PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char 
*extra_cmd)
@@ -135,6 +214,8 @@
int ret;
char *sendmail_path = INI_STR(sendmail_path);
char *sendmail_cmd = NULL;
+   char *return_path;
+   char *address;
 
if (!sendmail_path) {
 #ifdef PHP_WIN32
@@ -169,6 +250,25 @@
fprintf(sendmail, To: %s\n, to);
fprintf(sendmail, Subject: %s\n, subject);
if (headers != NULL) {
+
+   /* Existing Return-Path should not be overwritten */
+   if((return_path = get_header(Return-Path, headers)) != NULL) 
+{
+   free(return_path);
+   }
+   else {
+
+   if((return_path = get_header(From, headers)) != 
+NULL) {
+   
+   if((address = extract_address(return_path)) != 
+NULL) {
+   fprintf(sendmail, Return-Path: 
+%s\n, address);
+   free(address);
+   }
+
+   free(return_path);
+
+   }
+   }
+
fprintf(sendmail, %s\n, headers);
}
fprintf(sendmail, \n%s\n, message);

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




[PHP-DEV] Re: Latest ZE2 changes

2002-12-07 Thread Zeev Suraski
At 17:02 07/12/2002, Marcus Börger wrote:

Hi Zeev,

I have changed the test files and encountered some problems with the way 
you modified my patch:

1) private_002.phpt fails  with
004- Fatal error: Call to private method pass::show() from context 'fail' 
in %s on line %d
004+ Fatal error: Call to public method fail::show() from context 'fail' 
in /usr/src/php4-HEAD/tests/classes/private_002.php on line 18

I see the problem.  It should be fixed.


The new error message is wrong. We are trying to access pass::show and not 
fail::show().

2) private_007.phpt and private_007b.phpt both fail with the message
Fatal error: Cannot redeclare private bar::priv() as public foo::priv()

That means the children know about their parents privates what is in 
contrast to
our discussion. The reason they do is because you skipped the part of the 
patch
where in zend_do_inheritance() a modified version of zend_hash_merge_ex() was
used to prevent this. But you also do not search for the private method in 
the calling
scope. In other words you mainly used the first version of my patch. So i 
tried to
strip down zend_hash_merge_with_argument_if() to the portion we need and tried
to skip copying zje privates. But since privates are no longer looked up 
in the
calling scope this fails.

I implement PPP in a different way altogether (it's very loosely based on 
your patch, the actual implementation is very different), in order to avoid 
having two hash lookups for every method call.  I left a comment in the 
code that says we may want to improve the error messages, but the current 
implementation is quite intentional - it's much more efficient.

3) You left in some snippets of the 'final' patch. Does this mean we are 
going to have
final? A new patch is also available.

No, we're not going to add final, at least not for now.  I may have 
forgotten to remove the scanner part of the patch but it's meaningless :)

Zeev


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



Re: [PHP-DEV] Default Return-Path with mail() and qmail

2002-12-07 Thread Andi Gutmans
Are you sure you should be using malloc()/free() and not emalloc()/efree()?
Also please use strlcpy() instead of strncpy(). (Weird I mentioned it twice 
in one day :)
http://www.courtesan.com/todd/papers/strlcpy.html

Andi


At 04:54 PM 12/7/2002 +0100, Daniel Lorch wrote:
--- php-4.2.3/ext/standard/mail.c   Sat Aug 24 13:38:13 2002
+++ php-4.2.3-daniel/ext/standard/mail.cMon Dec  2 01:24:35 2002
@@ -21,6 +21,7 @@
 #include stdlib.h
 #include ctype.h
 #include stdio.h
+#include string.h
 #include php.h
 #include ext/standard/info.h
 #if !defined(PHP_WIN32)
@@ -124,6 +125,84 @@
 }
 /* }}} */

+char *get_header_value(char *line)
+{
+   while(*line  *line != ':')
+   line++;
+
+   if(!*line)
+   return NULL;
+
+   line++;
+
+   while(isspace(*line))
+   line++;
+
+   return strdup(line);
+}
+
+char *get_header(char *header_name, char *headers)
+{
+   char *line, *value=NULL;
+   int header_name_len = strlen(header_name);
+   int len=0;
+
+   do {
+   if(*headers == '\n' || *headers == '\0') {
+   if(len  header_name_len) {
+   len = 0;
+   continue;
+   }
+
+   if((line = (char *)malloc(len + 1)) == NULL)
+   return NULL;
+
+   headers -= len;
+
+   strncpy(line, headers, len);
+   line[len] = '\0';
+
+   headers += len;
+
+   if(strncmp(line, header_name, header_name_len) == 0) {
+   value = get_header_value(line);
+   }
+
+   free(line);
+
+   len = 0;
+   } else {
+   ++len;
+   }
+   } while(*headers++  value == NULL);
+
+   return value;
+}
+
+char *extract_address(char *address)
+{
+   char *start, *stop, *tmp;
+
+   if((start = stop = strchr(address, '@')) == NULL)
+   return NULL;
+
+   while(start = address  !isspace(*start)  *start != '')
+   start--;
+
+   start++;
+
+   while(*stop  !isspace(*stop)  *stop != '')
+   stop++;
+
+   if((tmp = (char *)malloc(stop - start + 1)) == NULL)
+   return NULL;
+
+   strncpy(tmp, start, stop - start);
+   tmp[stop-start] = '\0';
+
+   return tmp;
+}
+
 /* {{{ php_mail
  */
 PHPAPI int php_mail(char *to, char *subject, char *message, char 
*headers, char *extra_cmd)
@@ -135,6 +214,8 @@
int ret;
char *sendmail_path = INI_STR(sendmail_path);
char *sendmail_cmd = NULL;
+   char *return_path;
+   char *address;

if (!sendmail_path) {
 #ifdef PHP_WIN32
@@ -169,6 +250,25 @@
fprintf(sendmail, To: %s\n, to);
fprintf(sendmail, Subject: %s\n, subject);
if (headers != NULL) {
+
+   /* Existing Return-Path should not be overwritten */
+   if((return_path = get_header(Return-Path, 
headers)) != NULL) {
+   free(return_path);
+   }
+   else {
+
+   if((return_path = get_header(From, 
headers)) != NULL) {
+
+   if((address = 
extract_address(return_path)) != NULL) {
+   fprintf(sendmail, 
Return-Path: %s\n, address);
+   free(address);
+   }
+
+   free(return_path);
+
+   }
+   }
+
fprintf(sendmail, %s\n, headers);
}
fprintf(sendmail, \n%s\n, message);

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


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




[PHP-DEV] Re: Default Return-Path with mail() and qmail

2002-12-07 Thread Daniel Lorch
Hi Andi,

 Are you sure you should be using malloc()/free() and not emalloc()/efree()?
 Also please use strlcpy() instead of strncpy(). (Weird I mentioned it twice 
 in one day :)
 http://www.courtesan.com/todd/papers/strlcpy.html

Probably there are even more things broken in my patch :) I'm quite new to C
and I'm happy it works without segfaulting. strlcpy looks interesting and
I'll read through the link as soon as I find some free time.

Oh, this patch is explicitly *NOT* meant to go into the main branch. It's
just an additional patch for whoever needs it, sorry for not pointing this
out more explicitly.

-daniel

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




[PHP-DEV] FR: echo line

2002-12-07 Thread Jari Vuoksenranta
I have a feature request: I'd like to have '#' comment like
macro which would expand _ foo to ? foo\n?php.

Has this been requested before?  If so, why it wasn't implented?

e.g.

?php
for(..) {
_   td
}
?

would echo \ttd\n to page.

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




Re: [PHP-DEV] FR: echo line

2002-12-07 Thread Brad LaFountain
Do you realize how ugly that is? What benifit would that have over something
way more readable like:
?php
for(..) {
echo \ttd\n;
}
?
-Brad

--- Jari Vuoksenranta [EMAIL PROTECTED] wrote:
 I have a feature request: I'd like to have '#' comment like
 macro which would expand _ foo to ? foo\n?php.
 
 Has this been requested before?  If so, why it wasn't implented?
 
 e.g.
 
 ?php
   for(..) {
   _   td
   }
 ?
 
 would echo \ttd\n to page.
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




RE: [PHP-DEV] FR: echo line

2002-12-07 Thread John Coggeshall

-1, no way...

-Original Message-
From: Jari Vuoksenranta [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, December 07, 2002 11:57 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DEV] FR: echo line


I have a feature request: I'd like to have '#' comment like 
macro which would expand _ foo to ? foo\n?php.

Has this been requested before?  If so, why it wasn't implented?

e.g.

?php
   for(..) {
   _   td
   }
?

would echo \ttd\n to page.

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




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




Re: [PHP-DEV] Re: Default Return-Path with mail() and qmail

2002-12-07 Thread Sara Golemon
 Are you sure you should be using malloc()/free() and not
 emalloc()/efree()? Also please use strlcpy() instead of strncpy().
 (Weird I mentioned it twice  in one day :)
 http://www.courtesan.com/todd/papers/strlcpy.html

 Probably there are even more things broken in my patch :) I'm quite new
 to C and I'm happy it works without segfaulting. strlcpy looks
 interesting and I'll read through the link as soon as I find some free
 time.

 Oh, this patch is explicitly *NOT* meant to go into the main branch.
 It's just an additional patch for whoever needs it, sorry for not
 pointing this out more explicitly.

Good because I havn't seen any positive responses to this and I'm still
negative on it.

Apart from disagreement with the prinicipal here I'd also ask: Where is
the portion of the patch to support Win32 SMTP via the MAPI interface?
((as opposed to sendmail_path interface which you've covered on all
platforms))

A more generalized fix would be to append the Return-Path to the headers
string at the top of the php_mail function so that it's caught by both the
sendmail block and by the TSendMail call (MAPI).

Any modification to behavior which effects one platform should affect all
platforms equally.  While Win32/sendmail is kept equal, Win32/MAPI (used
by the majority of Win32 users) is not.

-Pollita




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




Re: [PHP-DEV] Re: Default Return-Path with mail() and qmail

2002-12-07 Thread Daniel Lorch
hi,

 Good because I havn't seen any positive responses to this and I'm still
 negative on it.

You don't have to use it.

 Apart from disagreement with the prinicipal here I'd also ask: Where is
 the portion of the patch to support Win32 SMTP via the MAPI interface?
 ((as opposed to sendmail_path interface which you've covered on all
 platforms))

This is not necessary, at least not with qmail. qmail-smtpd DOES already
use the From-Header to write the Return-Path -- compared to qmail-inject,
which DOESN'T, and instead uses a default address (such as
Return-Path: [EMAIL PROTECTED]).

 A more generalized fix would be to append the Return-Path to the headers
 string at the top of the php_mail function so that it's caught by both the
 sendmail block and by the TSendMail call (MAPI).
 
 Any modification to behavior which effects one platform should affect all
 platforms equally.  While Win32/sendmail is kept equal, Win32/MAPI (used
 by the majority of Win32 users) is not.

I'm just providing a working solution to a more or less common problem. I
know there are others who are having the same problem, so I am providing
a solution to everyone interested.

Feel free to post an improved version of my patch. Andi kindly did some
code auditing, so there are many things that can be rewritten much nicer :)

-daniel

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




[PHP-DEV] php.exe - php-cgi.exe

2002-12-07 Thread Christoph Grottolo
Hi

In the NEWS file for 4.3.0 there should definitly be an entry about renaming
php.exe to php-cgi.exe on win32, maybe this should even be mentioned on the
download page together with the release. If not, there will be many bug
reports about HTTP 500 errors and premature end of script headers after
having installed PHP 4.3.0 as CGI on Win32.

BTW, I still don't understand why php-cli cannot be called php-cli.exe on
win32. Like this, many users would guess how the problem cgi and 4.3.0 can
be solved even if they don't read php-dev (or the release notes).

Christoph




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




Re: [PHP-DEV] php.exe - php-cgi.exe

2002-12-07 Thread Marcus Börger
At 00:02 08.12.2002, Christoph Grottolo wrote:

Hi

In the NEWS file for 4.3.0 there should definitly be an entry about renaming
php.exe to php-cgi.exe on win32, maybe this should even be mentioned on the
download page together with the release. If not, there will be many bug
reports about HTTP 500 errors and premature end of script headers after
having installed PHP 4.3.0 as CGI on Win32.

BTW, I still don't understand why php-cli cannot be called php-cli.exe on
win32. Like this, many users would guess how the problem cgi and 4.3.0 can
be solved even if they don't read php-dev (or the release notes).

Christoph


Simply because calling the command line interface should be easy - as easy
as calling awk or perl or whatever. Every server api module like cgi must be
installed, so the name does not matter there. But having long names for
command line utils is a bad idea.

marcus


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




[PHP-DEV] CVS Account Request: haiaw

2002-12-07 Thread piotr drewnik
translating the documentation from english into polish

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




Re: [PHP-DEV] Re: Latest ZE2 changes

2002-12-07 Thread Marcus Börger
At 16:48 07.12.2002, Zeev Suraski wrote:

At 17:02 07/12/2002, Marcus Börger wrote:

Hi Zeev,

I have changed the test files and encountered some problems with the way 
you modified my patch:

1) private_002.phpt fails  with
004- Fatal error: Call to private method pass::show() from context 'fail' 
in %s on line %d
004+ Fatal error: Call to public method fail::show() from context 'fail' 
in /usr/src/php4-HEAD/tests/classes/private_002.php on line 18

I see the problem.  It should be fixed.


Fixed now, thanks.




The new error message is wrong. We are trying to access pass::show and 
not fail::show().

2) private_007.phpt and private_007b.phpt both fail with the message
Fatal error: Cannot redeclare private bar::priv() as public foo::priv()

That means the children know about their parents privates what is in 
contrast to
our discussion. The reason they do is because you skipped the part of the 
patch
where in zend_do_inheritance() a modified version of zend_hash_merge_ex() was
used to prevent this. But you also do not search for the private method 
in the calling
scope. In other words you mainly used the first version of my patch. So i 
tried to
strip down zend_hash_merge_with_argument_if() to the portion we need and 
tried
to skip copying zje privates. But since privates are no longer looked up 
in the
calling scope this fails.

I implement PPP in a different way altogether (it's very loosely based on 
your patch, the actual implementation is very different), in order to 
avoid having two hash lookups for every method call.  I left a comment in 
the code that says we may want to improve the error messages, but the 
current implementation is quite intentional - it's much more efficient.

However this is about what i did in my first patches and gave up after 
discussion with Andi.
Since he was right that the performance loss by the required checks is 
outweighted by the
fact that otherwise classes know about private details of their ancestors. 
And i remeber having
an agreement on this. And yes you did the execute part in another way but 
until now i see
many problems in your way.


3) You left in some snippets of the 'final' patch. Does this mean we are 
going to have
final? A new patch is also available.

No, we're not going to add final, at least not for now.  I may have 
forgotten to remove the scanner part of the patch but it's meaningless :)

Zeev


After the patches today some more things need to be revisited:

4)  You allow changing the visibility. In most languages it is only allowed to
decrease the visibility or it is even disallowed. Increasing the visibility 
is a
very unfamiliar feature.

5) When you look at test private_007b.phpt you will see that the wrong
method is called. This is a consequence of 2. It seems you optimized to
much.

6) zend_execute.c, line 2350 should be
if (!(EX(fbc)-op_array.fn_flags  (ZEND_ACC_PROTECTED | 
ZEND_ACC_PRIVATE))) {
instead of
if (EX(fbc)-op_array.fn_flags  ZEND_ACC_PUBLIC) {
as we allow (fn_flags  ZEND_FN_PPP_MASK) == 0 being matched to public as well.

marcus


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



Re: [PHP-DEV] php.exe - php-cgi.exe

2002-12-07 Thread Marcus Börger
At 00:35 08.12.2002, Christoph Grottolo wrote:

Marcus Börger wrote:
 Christoph Grottolo wrote:

 BTW, I still don't understand why php-cli cannot be called
 php-cli.exe on win32. Like this, many users would guess how the
 problem cgi and 4.3.0 can be solved even if they don't read php-dev
 (or the release notes).

 Christoph

 Simply because calling the command line interface should be easy - as
 easy as calling awk or perl or whatever. Every server api module like
 cgi must be installed, so the name does not matter there. But having
 long names for command line utils is a bad idea.

 marcus

I understand the reason why cli has to get a short name (the lazyness of
good programmers). What i don't understand is why it has to be called
php.exe. You force each and every user of php-cgi on win32 to change his
webserver configuration when switching to 4.3.0.


yes but they will have to touch their ini files any way.



Imagine if your favorite bar would rename wodka to gin because the barmen
like wodka over gin and therefore want to give wodka a shorter name. For the
next couple of months they will have to explain to every gin drinker that he
now gets wodka when he orders gin and to every wodka drinker that he has to
order gin when he wants wodka... know what i mean?


I got your point (even though your example is slightly different as we do 
not exchange
cgi and apache verwsion here).

How many bug reports do you expect? 100? 500?


Yes that could happen...maybe we should have another *big* message for the
configure part and a *huge* message in the release notes and news entries.

marcus



Christoph



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




RE: [PHP-DEV] php.exe - php-cgi.exe

2002-12-07 Thread John Coggeshall

Yes that could happen...maybe we should have another *big* 
message for the configure part and a *huge* message in the 
release notes and news entries.

This is no different than when register_globals suddenly got turned off.
I think a big ole' message at the end of ./configure will drastically
reduce the number of problems. Also, perhaps a check could be put in the
CLI version of PHP that would throw an error message if it is being used
as a CGI...

John


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




Re: [PHP-DEV] php.exe - php-cgi.exe

2002-12-07 Thread Christoph Grottolo
Marcus Börger wrote:

 I understand the reason why cli has to get a short name (the
 lazyness of good programmers). What i don't understand is why it has
 to be called php.exe. You force each and every user of php-cgi on
 win32 to change his webserver configuration when switching to 4.3.0.

 yes but they will have to touch their ini files any way.

But not the webserver configuration. And: all the existing PHP HOWTOs will
give them wrong information, some of them will never be updated...

 How many bug reports do you expect? 100? 500?

 Yes that could happen...maybe we should have another *big* message
 for the configure part and a *huge* message in the release notes and
 news entries.

that's what i was asking for.

Christoph



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




Re: [PHP-DEV] php.exe - php-cgi.exe

2002-12-07 Thread Alexander Wagner
On Sunday 08 December 2002 01:02, John Coggeshall wrote:
 I think a big ole' message at the end of ./configure will drastically
 reduce the number of problems.

With php.exe? *g*

 Also, perhaps a check could be put in the
 CLI version of PHP that would throw an error message if it is being used
 as a CGI...

A _meaningful_ error-message in the right place would be the right thing (tm). 
Too many people don't read release-notes.

regards
Wagner

-- 
codito ergo sum

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




Re: [PHP-DEV] Re: Default Return-Path with mail() and qmail

2002-12-07 Thread Melvyn Sopacua
At 21:06 7-12-2002, you wrote:


A more generalized fix would be to append the Return-Path to the headers
string at the top of the php_mail function so that it's caught by both the
sendmail block and by the TSendMail call (MAPI).


Setting Return-Path is useless. It's stripped by sendmail, unless it's allowed
in the cf file explicetely. Same for postfix version of sendmail.

You simply need to setup your mailserver correctly and php accordingly, ie:
let the webserver user be allowed to use the '-f' sendmail flag and provide
this in the arguments of mail() or via ini_set.

In no way, should mail() by default equal the RCPT TO user to the From: 
header -
if I would host users, I would like to know, if they start spammin' or have
buggy scripts. What ever the reason - the final control of this option should
remain with the mailserver administrator, not the mail user.


With kind regards,

Melvyn Sopacua
?php include(not_reflecting_employers_views.txt); ?


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



[PHP-DEV] CVS Account Request: porcupine

2002-12-07 Thread Robin Chiu
I can't find the chinese document in this website. I want to know if there is somebody 
try to translate it to chinese. I think I can help him. I have a question are 
traditional chinese and simply chinese different?. I prefer traditional chinese. 

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