Re: [PHP-DEV] Register Shutdown Function for Apache

2003-02-12 Thread Jani Taskinen

There is now 'HAVE_APACHE' defined when you configure with apache.
(dso or static)

--Jani


On Tue, 11 Feb 2003, Brian Moon wrote:

>Jani, are you volunteering to add it?  If so, please do so at your earliest
>convience.
>
>Brian Moon
>dealnews.com
>
>
>- Original Message -
>From: "Jani Taskinen" <[EMAIL PROTECTED]>
>To: "Joseph Tate" <[EMAIL PROTECTED]>
>Cc: "Php-Dev List" <[EMAIL PROTECTED]>
>Sent: Monday, February 10, 2003 6:16 PM
>Subject: RE: [PHP-DEV] Register Shutdown Function for Apache
>
>
>|
>| If you need a define for it, we can add one..?
>|
>| --Jani
>|
>|
>| On Mon, 10 Feb 2003, Joseph Tate wrote:
>|
>| >Well, to me, calling the code that flushes the headers and the output
>| >buffers twice doesn't kill us.  Unless someone can come up with a better
>way
>| >to not call these two functions in main/main.c::php_request_shutdown, the
>| >patch suffices for me.  MOD_PHP4_H is undefined in main.c, so it's not
>| >acceptable.
>| >
>| >Joseph
>| >
>| >> -Original Message-
>| >> From: Brian Moon [mailto:[EMAIL PROTECTED]]
>| >> Sent: Monday, February 03, 2003 5:30 PM
>| >> To: Joseph Tate; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
>| >> Cc: Php-Dev List
>| >> Subject: Re: [PHP-DEV] Register Shutdown Function for Apache
>| >>
>| >>
>| >> Hmm, there is #define MOD_PHP4_H in sapi/apache/mod_php4.h.  Not real
>| >> descriptive, but seems to be unique to the Apache sapi.
>| >>
>| >> Brian Moon
>| >> dealnews.com
>| >>
>| >>
>| >> - Original Message -
>| >> From: "Joseph Tate" <[EMAIL PROTECTED]>
>| >> To: "Brian Moon" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
>| >> <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
>| >> Cc: "Php-Dev List" <[EMAIL PROTECTED]>
>| >> Sent: Monday, February 03, 2003 3:45 PM
>| >> Subject: Re: [PHP-DEV] Register Shutdown Function for Apache
>| >>
>| >>
>| >> | Here is an updated patch which copies a few of the methods from
>| >> | main/main.c::php_request_shutdown to
>| >> | sapi/apache/sapi_apache.c::apache_php_module_main.  This has
>| >> flushed both
>| >> | the headers and output buffers in my two test scripts.  Now I need to
>| >> figure
>| >> | out a way to make sure these don't get called in
>| >> | main/main.c::php_request_shutdown on Apache systems.  Any pointers on
>| >> this?
>| >> | Is there a handy #define that I can use if configure is
>| >> called --with-apxs?
>| >> |
>| >> | Joseph
>| >> |
>| >> | P.S.  The two test scripts are:
>| >> |
>| >> | | >> | header('Location: http://www.mi-corporation.com');
>| >> | exit();
>| >> | ?>
>| >> |
>| >> | and
>| >> |
>| >> | | >> | ob_begin();
>| >> | phpinfo();
>| >> | ?>
>| >> |
>| >> | > -Original Message-
>| >> | > From: Brian Moon [mailto:[EMAIL PROTECTED]]
>| >> | > Sent: Tuesday, January 28, 2003 5:50 PM
>| >> | > To: [EMAIL PROTECTED]; Joseph Tate
>| >> | > Cc: Php-Dev List; PHP Group
>| >> | > Subject: Re: [PHP-DEV] Re: Register Shutdown Function for Apache
>| >> | >
>| >> | >
>| >> | > Give me a patch and I will tell you. ;)
>| >> | >
>| >> | > Brian Moon
>| >> | > dealnews.com
>| >> | >
>| >> | >
>| >> | > - Original Message -
>| >> | > From: "Zeev Suraski" <[EMAIL PROTECTED]>
>| >> | > To: "Joseph Tate" <[EMAIL PROTECTED]>
>| >> | > Cc: "Brian Moon" <[EMAIL PROTECTED]>; "Php-Dev List"
>| >> | > <[EMAIL PROTECTED]>; "PHP Group" <[EMAIL PROTECTED]>
>| >> | > Sent: Tuesday, January 28, 2003 4:03 PM
>| >> | > Subject: RE: [PHP-DEV] Re: Register Shutdown Function for Apache
>| >> | >
>| >> | >
>| >> | > | At 19:54 28/01/2003, Joseph Tate wrote:
>| >> | > | >Then, could we add a sapi_flush()/ob_flush() call at the end of
>| >> | > | >apache_php_module_main after calling the normal
>| >> | > register_shutdown_functions?
>| >> | > |
>| >> | > | Yeah, something along these lines.
>| >> | > |
>| >> | > | >What else might have problems?
>| >> | > |
>| >> | > | Might is a powerful word :)
>| >> | > |
>| >> | > | Zeev
>| >> | > |
>| >> | > |
>| >> | > |
>| >> | >
>| >> | >
>| >> | > --
>| >> | > PHP Development Mailing List 
>| >> | > To unsubscribe, visit: http://www.php.net/unsub.php
>| >> | >
>| >> | >
>| >> | >
>| >> |
>| >>
>| >>
>| >>
>| >
>| >
>| >
>|
>| --
>| <- For Sale! ->
>|
>|
>| --
>| PHP Development Mailing List 
>| To unsubscribe, visit: http://www.php.net/unsub.php
>|
>|
>|
>
>
>

-- 
<- For Sale! ->


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




[PHP-DEV] Re: [PHP-DOC] Re: function.main

2003-02-12 Thread Gabor Hojtsy
what is function.main? it keeps popping up on my requires and links to =
yoru site but nuthin' happens


That is if I understand correctly a link in an error message. So either 
PHP needs to hide that link in error messages, or the function.main 
shortcut shuold point to somewhere on the homepage, explaining what is 
function.main

This was fixed in CVS awhile ago (4.3.1) and now points to the
proper docs.  See: http://bugs.php.net/bug.php?id=21499


How was that fixed? Will there be any links with those errors for 
function.main but for a different page, or no links? I think it would be 
nice to make http://php.net/function.main show something (preferably the 
same thing that this fixed error message points to), if applicable...

Goba



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



Re: [PHP-DEV] repost: return_value getting corrupted in extension

2003-02-12 Thread Eric Lambart
Wez Furlong said:

>>   /* call the constructor */
>>   if ( call_user_function(NULL, &object, ctor_fn, ctor_retval, 0,
>> NULL)
>
> Looks correct too.  However, I would use call_user_function_ex, which
> relieves you of the burden of creating a retval (among other things).

The API for call_user_function... changed (new parameter was added) so the
instructions in the docs are totally borked.  Someone else figured out how
to make it work and added a helpful note to the page for using
call_user_function() (not _ex()) so I just followed their hints without
using my brain and reading the source.  It seems to work.

Thanks for the tip though, I'll look into it once I overcome this bigger
nastiness.

>> Note also that the variables which are getting corrupted are simple
>> strings, not even zvals.  Here is how I'm setting the value of
>> serverId, which is one of those getting corrupted:
>>
>> add_property_string(return_value, "serverId", serverId, TRUE);
>> efree(serverId);
>
> In this case, it is better to do this:
>
> add_property_string(return_value, "serverId", serverId, FALSE);
> and not use the serverId again.

Thanks for your very clear explanation (which I've snipped out).  That's more
or less as I understood it, but now I feel more confident.   I doubt you
expected that to be related to my bug, but I changed all such instances
anyway, and of course the problem persists.

> > Did you --enable-debug in your development build?  If not, I strongly
> recommend that you do, as it will help detect overruns in emalloc'd
> memory.  This is a great way to track down the lines of code that are at
> fault.

Yes I've been developing with debug enabled, it's a real lifesaver
if--like me--you're not perfect.  It also helped me to understand how Zend
manages memory, since it would tell me if I neededed to efree() something
or if it was taken care of by Zend.

But this raises an interesting point...  I accidentally re-ran configure
_without_ --enable-debug, did a make clean and make, and suddenly my main
bug went away!  return_value is no longer getting corrupted in the same
way, and I am not getting a segfault when trying to access my object's
member variable!  But let's not get too excited here...

I say "no longer getting corrupted in the same way" because it is getting
corrupted... but in a very strange way which I encountered several months
ago, and used an ugly hack to get around, rather than properly solving the
issue.

If you ask me, this is stranger yet.  If you recall from my original post,
I am trying to return a "serverId" object member which contains a value
such as "N^VESoDMN(107)".  Again, right before my PHP_FUNCTION returns
control to the script, this value is perfect.  When I DON'T use
--enable-debug, and the serverId is NOT getting completely clobbered, the
value that is returned by $table->serverId is not "N^VESoDMN(107)".  It is
"N^VESoDMN'107)"

This is not a random thing.  It is very consistent--I have several
PHP_FUNCTIONs that return serverIds, either with RETVAL_STRING or as a
member of a more complex object, and server IDs are always in a similar
format, a string ending with a parenthesized integer.  Yet EVERY time, the
"(" is replaced by a single quote.

Does this make ANY sense to anyone out there?  Is there some hidden hack
within Zend that is being triggered by this string pattern (perhaps the ^
followed by "(" in a string?) and which causes Zend to replace a
open-paren with a single-quote?

To be perfectly clear, no other character is ever changed, and the ( is
always changed in the same way.  Aside from that, the serverId is valid
and if I
replace the ' with a (, the server recognizes the ID as valid when I send
it back.

> The other thing to try is valgrind - it is possible that some of your
> non-zend-api code is misbehaving, and valgrind will help you find that
> problem code.

Another excellent suggestion, and I tried it this morning, even with the
-v option.  Result: nothing.  No warnings except to tell me I was about to
have a segfault.  I haven't read the whole valgrind manual, but unless you
can think of some command-line option that could be helpful, I don't think
that's going to get me anywhere.

I don't know if the " ( becomes ' " glitch offers any clue as to what
could be happening, but if not, I guess I am doomed to step interminably
through php/Zend in gdb, and become far more intimately familiar with the
inner workings of Zend than I would really like.

And to be clear, once I re-enabled debug in configure, my data is being
completely corrupted just as before.  Does this offer any clues?  I have
come across some #IFDEFs etc. in the source, where the debugging code is
activated, but before I go and look at every such instance for clues,
maybe someone else has an idea?

Thanks again for your assistance.

Bamboozled,
Eric




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




[PHP-DEV] [patch] solaris getcwd() brokeness

2003-02-12 Thread James E. Flemer
Well all the fancy new streams code in 4.3.0 seems to
tickle a Solaris issue with getcwd().  It seems that under
certain cases solaris' getcwd() fails when other os' work.
Consequently 4.3.0 causes a huge ammount of breakage for
some sites running solaris.  Below is a patch that seems to
work around the problem.  This may not be the best
approach, but it was an attempt at a quick-fix so that
4.3.0 would be usable for now.  This problem has bug
number: #21310 [1].  Comments welcome.  I'd like to commit
this (or similar) before any more releases are made.

-James <[EMAIL PROTECTED]>

[1] http://bugs.php.net/21310

]] Patch sponsored by: The University of Vermont [[
Index: TSRM/tsrm_virtual_cwd.c
===
RCS file: /repository/TSRM/tsrm_virtual_cwd.c,v
retrieving revision 1.41
diff -u -b -u -r1.41 tsrm_virtual_cwd.c
--- TSRM/tsrm_virtual_cwd.c 6 Nov 2002 18:07:22 -   1.41
+++ TSRM/tsrm_virtual_cwd.c 12 Feb 2003 04:39:11 -
@@ -303,7 +303,7 @@
return (0);

 #if !defined(TSRM_WIN32) && !defined(NETWARE)
-   if (IS_ABSOLUTE_PATH(path, path_length)) {
+   if (IS_ABSOLUTE_PATH(path, path_length) || (state->cwd_length < 1))
{
if (use_realpath && realpath(path, resolved_path)) {
path = resolved_path;
path_length = strlen(path);
@@ -363,6 +363,7 @@
}


+  if (state->cwd_length > 0 || IS_ABSOLUTE_PATH(path, path_length)) {
ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, &tok);
while (ptr) {
ptr_length = strlen(ptr);
@@ -416,6 +417,11 @@
state->cwd[state->cwd_length+1] = '\0';
state->cwd_length++;
}
+  } else {
+   state->cwd = (char *) realloc(state->cwd, path_length+1);
+   memcpy(state->cwd, path, path_length+1);
+   state->cwd_length = path_length;
+  }

if (verify_path && verify_path(state)) {
CWD_STATE_FREE(state);
Index: main/main.c
===
RCS file: /repository/php4/main/main.c,v
retrieving revision 1.512.2.5
diff -u -b -u -r1.512.2.5 main.c
--- main/main.c 16 Dec 2002 15:44:06 -  1.512.2.5
+++ main/main.c 12 Feb 2003 04:39:12 -
@@ -1507,7 +1507,11 @@
 {
zend_file_handle *prepend_file_p, *append_file_p;
zend_file_handle prepend_file, append_file;
+#ifdef VIRTUAL_DIR
char *old_cwd;
+#else
+   int old_cwd_fd;
+#endif
char *old_primary_file_path = NULL;
int retval = 0;

@@ -1515,9 +1519,11 @@
if (php_handle_special_queries(TSRMLS_C)) {
return 0;
}
+#ifdef VIRTUAL_DIR
 #define OLD_CWD_SIZE 4096
old_cwd = do_alloca(OLD_CWD_SIZE);
old_cwd[0] = '\0';
+#endif

zend_try {
 #ifdef PHP_WIN32
@@ -1528,7 +1534,11 @@

if (primary_file->type == ZEND_HANDLE_FILENAME
&& primary_file->filename) {
+#ifdef VIRTUAL_DIR
VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1);
+#else
+   old_cwd_fd = open(".", 0);
+#endif
VCWD_CHDIR_FILE(primary_file->filename);
}

@@ -1578,10 +1588,14 @@

} zend_end_try();

+#ifdef VIRTUAL_DIR
if (old_cwd[0] != '\0') {
VCWD_CHDIR(old_cwd);
}
free_alloca(old_cwd);
+#else
+   fchdir(old_cwd_fd);
+#endif
return retval;
 }
 /* }}} */
Index: main/safe_mode.c
===
RCS file: /repository/php4/main/safe_mode.c,v
retrieving revision 1.51
diff -u -b -u -r1.51 safe_mode.c
--- main/safe_mode.c6 Nov 2002 18:07:23 -   1.51
+++ main/safe_mode.c12 Feb 2003 04:39:12 -
@@ -121,6 +121,8 @@
VCWD_REALPATH(filename, path);
*s = DEFAULT_SLASH;
} else {
+   path[0] = '.';
+   path[1] = '\0';
VCWD_GETCWD(path, sizeof(path));
}
} /* end CHECKUID_ALLOW_ONLY_DIR */


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




[PHP-DEV] Re: [PHP-DOC] Re: function.main

2003-02-12 Thread Philip Olson
On Wed, 12 Feb 2003, Gabor Hojtsy wrote:

> > what is function.main? it keeps popping up on my requires and links to =
> > yoru site but nuthin' happens
> 
> That is if I understand correctly a link in an error message. So either 
> PHP needs to hide that link in error messages, or the function.main 
> shortcut shuold point to somewhere on the homepage, explaining what is 
> function.main

This was fixed in CVS awhile ago (4.3.1) and now points to the
proper docs.  See: http://bugs.php.net/bug.php?id=21499

Regards,
Philip



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




[PHP-DEV] Re: function.main

2003-02-12 Thread Gabor Hojtsy
what is function.main? it keeps popping up on my requires and links to =
yoru site but nuthin' happens


That is if I understand correctly a link in an error message. So either 
PHP needs to hide that link in error messages, or the function.main 
shortcut shuold point to somewhere on the homepage, explaining what is 
function.main

Goba



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



[PHP-DEV] adding class members in C

2003-02-12 Thread Dave Viner
Hi,
I'm trying to write a class as a PHP C extension.  I want to add a member
variable to class declaration time.  I believe this is possible by adding to
the zend_class_entry's default_properties HashTable.  My attempts so far
have resulted in apache core dumps.  My code for PHP_MINIT_FUNCTION look
like:


   zend_class_entry MyClass_class_entry;
   char *cv2;

   INIT_CLASS_ENTRY(MyClass_class_entry, "MyClass",
MyClass_class_funcs);
   MyClass_class_entry_ptr =
zend_register_internal_class(&MyClass_class_entry);

   fprintf(stderr,"Registered class with name
'%s'\n",MyClass_class_entry_ptr->name);
   zend_hash_update(&MyClass_class_entry_ptr->default_properties,
"memvar", 7,
"member value", 13,
(void **) &cv2);

   fprintf(stderr,"made MyClass::memvar point to '%s'\n", cv2);

However, I get coredumps on apache startup.

What is the correct way to register member variables at class declaration
time?

thanks
dave


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




[PHP-DEV] CVS Account Request: mipac

2003-02-12 Thread Miroslav Pacholik
I would like to translate part of PHP manual into Czech language.

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




Re: [PHP-DEV] Re: [SOAP] PEAR / Soap Problem

2003-02-12 Thread Brad LaFountain
sorry, ignore this, wrong list
--- Brad LaFountain <[EMAIL PROTECTED]> wrote:
> Well the PEAR::Soap is defintly more stable and has more features and
> supports
> more of the soap spec, where PECL/soap is written in C and is faster. There
> are
> some people using PECL/soap in production but it defintly still is still in a
> unstable mode. So its purely up to your needs.
> 
>  - Brad


__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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




[PHP-DEV] Re: [SOAP] PEAR / Soap Problem

2003-02-12 Thread Brad LaFountain
Well the PEAR::Soap is defintly more stable and has more features and supports
more of the soap spec, where PECL/soap is written in C and is faster. There are
some people using PECL/soap in production but it defintly still is still in a
unstable mode. So its purely up to your needs.

 - Brad
--- Steve Johnson <[EMAIL PROTECTED]> wrote:
> Cool, thanks for clearing that up.
> Would anyone here recommend one over the other?  I've obviously only
> used the PEAR::Soap library.  Thanks
> 
> 
> On Wed, 2003-02-12 at 10:21, Brad LaFountain wrote:
> > Well, there are in fact TWO different soap libaries in soap that you both
> are
> > referring to PEAR::Soap and a soap in pecl, he was referring to the PECL
> one
> > not the PEAR::Soap, i know this is confusing... one is writtin in php where
> the
> > other is written as a php extension in c.
> > 
> >  - brad
> > --- Steve Johnson <[EMAIL PROTECTED]> wrote:
> > > First, I don't know of a module(compiled object file), although there
> > > may be?  As far as I know you only have to include the PEAR/php module
> > > like so:
> > > include("SOAP/Client.php");
> > > 
> > > And the sample file in my source shows something more like this:
> > > 
> > > $wsdl = new
> > >
> >
>
SOAP_WSDL("http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl";);
> > > $soapclient = $wsdl->getProxy();
> > > 
> > > -Luck
> > > 
> > > On Wed, 2003-02-12 at 04:50, Bruns Jan wrote:
> > > > Hi all,
> > > > 
> > > > I have got a question regarding your Pear / SOAP Package. After
> installing
> > > > Pear and the Soap package I am not able to execute the following PHP
> > > script:
> > > > 
> > > > //simple example to check soap extension client is working..
> > > > dl('soap.so');
> > > > echo "create client\n";
> > > > $soapclient = new
> > > >
> > >
> SoapObject("http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.ws
> > > > dl");
> > > > echo "sending getquote\n";
> > > > $ret = $soapclient->getQuote("ibm");
> > > > print_r($ret);
> > > > echo "done";
> > > > 
> > > > 
> > > > The problem is that 'soap.so' is not found at all on the system. The
> > > > following message comes up:
> > > > Warning: Unable to load dynamic library '/usr/lib/php4/soap.so' -
> > > > /usr/lib/php4/soap.so: cannot open shared object file: No such file or
> > > > directory in /var/www/html/test.php on line 11
> > > > 
> > > > Where is soap.so distributed?
> > > > Have you got any suggestions? I am using Rad Hat 7.3, and the Soap
> 0.7.1
> > > > package.
> > > > 
> > > > Any Help Would be appreciated!
> > > > 
> > > > Thanks,
> > > > Jan Bruns
> > > > 
> > > > -- 
> > > > PHP Soap Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > -- 
> > > You can get my public key at 
> > > or search for KeyID 0x0F737450 at www.keyserver.net
> > > 
> > 
> > > ATTACHMENT part 2 application/pgp-signature name=signature.asc
> > 
> > 
> > 
> > __
> > Do you Yahoo!?
> > Yahoo! Shopping - Send Flowers for Valentine's Day
> > http://shopping.yahoo.com
> -- 
> You can get my public key at 
> or search for KeyID 0x0F737450 at www.keyserver.net
> 

> ATTACHMENT part 2 application/pgp-signature name=signature.asc



__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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




[PHP-DEV] php build failed

2003-02-12 Thread jean-charles . meunier

=
FAILED TEST SUMMARY
-
Bug #21131: fopen($filename, "a+") has broken position 
[ext/standard/tests/file/bug21131.phpt]
Simple math tests [ext/standard/tests/math/abs.phpt]
log() tests [ext/standard/tests/math/log.phpt]
Various pow() tests [ext/standard/tests/math/pow.phpt]
Simple math tests [ext/standard/tests/math/round.phpt]
Test strcspn() behavior [ext/standard/tests/strings/strcspn.phpt]
Test strspn() behavior [ext/standard/tests/strings/strspn.phpt]
microtime() function [ext/standard/tests/time/001.phpt]
strtotime() function [ext/standard/tests/time/002.phpt]
=


=
TEST RESULT SUMMARY
-
Exts skipped:   79
Exts tested :9
-
Number of tests :  443
Tests skipped   :  232 (52.4%)
Tests failed:9 ( 2.0%)
Tests passed:  202 (45.6%)
-
Time taken  :   32 seconds
=



/cencos/fuse/TGZ/php-4.3.0/ext/standard/tests/file/bug21131.phpt


 EXPECTED OUTPUT
int(6)
int(0)
foobar
 ACTUAL OUTPUT
int(0)
int(0)
foobar
 FAILED


001- int(6)
001+ int(0)





/cencos/fuse/TGZ/php-4.3.0/ext/standard/tests/math/abs.phpt


 EXPECTED OUTPUT
1,1,0,0
OK
 ACTUAL OUTPUT
1,1,1,1

Assert failed:
-LONG_MIN+1 === abs(LONG_MIN-1)
Left:  int(-9223372036854775807)
Right: int(9223372036854775807)

Assert failed:
-LONG_MIN   === abs(LONG_MIN)
Left:  int(-9223372036854775808)
Right: float(9.2233720368548E+18)
 FAILED


001- 1,1,0,0
001+ 1,1,1,1
002- OK
002+ 
003+ Assert failed:
004+ -LONG_MIN+1 === abs(LONG_MIN-1)
005+ Left:  int(-9223372036854775807)
006+ Right: int(9223372036854775807)
007+ 
008+ Assert failed:
009+ -LONG_MIN   === abs(LONG_MIN)
010+ Left:  int(-9223372036854775808)
011+ Right: float(9.2233720368548E+18)





/cencos/fuse/TGZ/php-4.3.0/ext/standard/tests/math/log.phpt


 EXPECTED OUTPUT
On failure, please mail result to [EMAIL PROTECTED]
200
50
50
50
50
50
50
50
50
50
 ACTUAL OUTPUT
On failure, please mail result to [EMAIL PROTECTED]
200
 FAILED


003- 50
004- 50
005- 50
006- 50
007- 50
008- 50
009- 50
010- 50
011- 50





/cencos/fuse/TGZ/php-4.3.0/ext/standard/tests/math/pow.phpt


 EXPECTED OUTPUT
1,1,0,0
On failure, please mail result to [EMAIL PROTECTED]
OK
 ACTUAL OUTPUT
1,1,1,1
On failure, please mail result to [EMAIL PROTECTED]

Assert failed:
 TRUE === is_infinite(pow(0,-2))
Left:  bool(true)
Right: bool(false)

Assert failed:
 TRUE === is_infinite(pow(0,-1))
Left:  bool(true)
Right: bool(false)

Assert failed:
 TRUE === is_infinite(pow(0,-2.0))
Left:  bool(true)
Right: bool(false)

Assert failed:
 TRUE === is_infinite(pow(0,-1.0))
Left:  bool(true)
Right: bool(false)

Assert failed:
 TRUE === is_infinite(pow(0.0,-2.0))
Left:  bool(true)
Right: bool(false)

Assert failed:
 TRUE === is_infinite(pow(0.0,-1.0))
Left:  bool(true)
Right: bool(false)

Assert failed:
 TRUE === is_infinite(pow( 0.0,-2))
Left:  bool(true)
Right: bool(false)

Assert failed:
 TRUE === is_infinite(pow( 0.0,-1))
Left:  bool(true)
Right: bool(false)

Assert failed:
LONG_MAX-1 === pow(LONG_MAX-1,1)
Left:  int(9223372036854775806)
Right: int(-9223372036854775808)

Assert failed:
LONG_MIN+1 === pow(LONG_MIN+1,1)
Left:  int(-9223372036854775807)
Right: int(-9223372036854775808)

Assert failed:
LONG_MAX === pow(LONG_MAX,1)
Left:  int(9223372036854775807)
Right: int(-9223372036854775808)
 FAILED

=

Re: [PHP-DEV] session security

2003-02-12 Thread Maxim Maletsky


"Keyser Soze" <[EMAIL PROTECTED]> wrote... :

> There's also something I'm using in my session scripts.
> I compare the browser referer with all the possible pages it must have come
> from in each script, this way the user MUST start from the login page, and
> not can simply type the url with the session id. I only tested it with
> Internet Explorer >5 and Mozilla (don't remember the version now), it worked
> fine.

This is an insecure method as HTTP_REFERER is being sent by browser. One
can simply create a socket connection inputing that variable into the
HTTP request headers.


--
Maxim Maletsky
[EMAIL PROTECTED]



> []'s
> Keyser Soze
> 
> - Original Message -
> From: "Sascha Schumann" <[EMAIL PROTECTED]>
> To: "Hans Prins" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, February 11, 2003 2:08 AM
> Subject: Re: [PHP-DEV] session security
> 
> 
> 
> > Can anyone point me to a possible solution for this?
> 
> 1. Use SSL.
> 2. Throw away an existing session id, if a user authenticated
>successfully (e.g. destroy the old session, and copy the
>data into a new one).
> 3. Provide a logout button which destroys the session.
> 
> - Sascha
> 
> --
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> 
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP-DEV] Announcement: New MySQL-Extension for PHP 5: ext/mysqli

2003-02-12 Thread Brian Moon
my bad, forgive me.

Brian Moon
dealnews.com


- Original Message -
From: "Sebastian Bergmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 11, 2003 11:47 PM
Subject: Re: [PHP-DEV] Announcement: New MySQL-Extension for PHP 5:
ext/mysqli


| Brian Moon wrote:
| > Do you have some sample code or a function list?
|
| "For some samples check the tests subdir.
| I'll add documentation within the next days." 
|
| --
|   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 Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Allowing Fifth Param under SAFE_MODE

2003-02-12 Thread Patrick Maartense
dear PH Dev Team

I request the follwing feature to be implemented in a future php version

some way of defining the Fifth paramater for MAIL() in the Ini file when
using safe_mode

like

safe_mode_fifth_param = "-f [EMAIL PROTECTED]"

because safe_mode is normaly a must have, a lot of programs now send on
behalve on the webserver and errormessages bounce back to the
postmaster.
if this can be defined in the ini file or (better) as Apache_conf
directive PHP_VALUE , even unser safe_mode it is possible to send extra
params but in a safe way.

regards



--
-
Computer Service Büro ENTER
Patrick Maartense Tel:+43  2236 42761
am Steinfeld 19a  FAX:+43 2236 893970
A-2344 Maria Enzersdorf   Mobil:  +43 664 4200656

e-mail: [EMAIL PROTECTED] [EMAIL PROTECTED]
http://www.csbenter.at
-



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




Re: [PHP-DEV] repost: return_value getting corrupted in extension

2003-02-12 Thread Wez Furlong
Hi Eric,

return_value is already allocated for you in a PHP_FUNCTION() that is
called by the engine (or via call_user_fuction(_ex)), as you have
guessed.

> PHP_FUNCTION(eo_table)

Looks correct.

>   /* call the constructor */
>   if ( call_user_function(NULL, &object, ctor_fn, ctor_retval, 0, NULL)

Looks correct too.  However, I would use call_user_function_ex, which
relieves you of the burden of creating a retval (among other things).

> > Hints: make sure that your zvals are correctly initialized (there are
> > some big differences between ALLOC_ZVAL and MAKE_STD_ZVAL).
>
> One resets the refcount and the is_ref flag, the other doesn't.  All the
> variables I'm dealing with are "fresh", not references to pre-existing
> zvals.

Yes, and this is important when the zval is passed into the engine
again.  If those flags and refcounts are incorrect, you will experience
problems like those you have described.  However, from what you have
shown here, it looks like your code is correct.

> Note also that the variables which are getting corrupted are simple
> strings, not even zvals.  Here is how I'm setting the value of serverId,
> which is one of those getting corrupted:
>
> add_property_string(return_value, "serverId", serverId, TRUE);
> efree(serverId);

In this case, it is better to do this:

add_property_string(return_value, "serverId", serverId, FALSE);

and not use the serverId again.

You need to specify TRUE if:

- the data was not allocated with the PHP memory allocator
  - the data is constant.
  - the data is on the stack.
  - the data was allocated with malloc
- the data is "owned" by some other zval or object that expects to efree
  it.

> Thanks in advance for any insights you can give.  This is really
> frustrating.  If you want to know how I am doing anything else, let me
> know.

Did you --enable-debug in your development build?  If not, I strongly
recommend that you do, as it will help detect overruns in emalloc'd
memory.  This is a great way to track down the lines of code that are at
fault.

The other thing to try is valgrind - it is possible that some of your
non-zend-api code is misbehaving, and valgrind will help you find that
problem code.

--Wez.


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




Re: [PHP-DEV] repost: return_value getting corrupted in extension

2003-02-12 Thread Eric Lambart
On Tue, 2003-02-11 at 16:00, Wez Furlong wrote: 
> No offense, but this is really quite a useless problem report.
> You are not showing any of the zend API that you use to create the
> object, so how can we help you?

No offense taken.  I hoped that showing the php_var_dump() would be
evidence enough that things are being properly initialized, and didn't
want to post such a long question that no one would bother to read it. 

It seemed to me that if I followed the instructions (as in the very slim
and out-of-date zend API docs, and with the help of those who have
posted comments therein) to initialize and setup the desired
return_value, that it should be returned to my script.

Here, then, is how I am initializing the given data.  This is the object
constructor.  You will see below how it is used.

/* {{{ eo_table class declaration */

/* zend_function entry list resides in eo_gateway.c */

PHP_FUNCTION(eo_table)
{
  /* define and initialize the object members */
  printf("\tin eo_table constructor now!\n");
  add_property_string(this_ptr, "serverId", "", TRUE);

  add_property_long(this_ptr, "rows", 0);
  add_property_long(this_ptr, "cols", 0);

  add_property_bool(this_ptr, "namedCols", FALSE);

  add_property_string(this_ptr, "errorText", "", TRUE);
  add_property_string(this_ptr, "errorItem", "", TRUE);
  add_property_long(this_ptr, "errorId", 0);

  add_property_long(this_ptr, "flags", 0);

  add_property_null(this_ptr, "colNames");
  add_property_null(this_ptr, "table");
} /* end eo_table */

/* }}} */

Here are the bits from eo_gateway.c.  I hope I've pasted them all:

zend_class_entry *eo_table_class_entry_ptr_global;

static zend_class_entry *eo_table_class_entry_ptr;

static zend_function_entry eo_table_class_functions[] =
{
  ZEND_FE(eo_table, NULL)
  ZEND_FE(eo_table_error_dump, NULL)
  ZEND_FALIAS(error_dump, eo_table_error_dump, NULL)
  {NULL, NULL, NULL}
};

/* {{{ PHP_MINIT_FUNCTION  */
PHP_MINIT_FUNCTION(eo_gateway)
{
  zend_class_entry eo_table_class_entry;

  INIT_CLASS_ENTRY(eo_table_class_entry, "eo_table", eo_table_class_functions);

  eo_table_class_entry_ptr =
zend_register_internal_class(&eo_table_class_entry TSRMLS_CC);

  return SUCCESS;
} /* end PHP_MINIT_FUNCTION */
/* }}} */

/* {{{ PHP_RINIT_FUNCTION
 */
PHP_RINIT_FUNCTION(eo_gateway)
{
  eo_table_class_entry_ptr_global = eo_table_class_entry_ptr;
  return SUCCESS;
}
/* }}} */

In the source file in which I am actually creating and intializing my 
object, I have declared:

extern zend_class_entry *eo_table_class_entry_ptr_global;

Here, within a function called getData(), which is called by the
getDataReply() function mentioned in my initial post, we create the
object:

/* initialize return_value to be a table object */
printf("\n\tCreating the return_value object (eo_table)\n");
object_init_ex(return_value, eo_table_class_entry_ptr_global);

/* call the table constructor */
call_object_constructor(return_value, "eo_table");
php_var_dump(&return_value, 1 TSRMLS_CC);

Here, from another source file, is the definition of
call_object_constructor():

/* {{{ void call_object_constructor() */
void call_object_constructor(zval* object, char* object_name)
{
  /* constructor function name */
  zval* ctor_fn;
  /* constructor return value (required but not used) */
  zval* ctor_retval;

  printf("\tcalling constructor for: '%s'\n", object_name);

  /* specify the constructor/object name  */
  MAKE_STD_ZVAL(ctor_fn);
  ZVAL_STRING(ctor_fn, object_name, TRUE);

  MAKE_STD_ZVAL(ctor_retval);

  /* call the constructor */
  if ( call_user_function(NULL, &object, ctor_fn, ctor_retval, 0, NULL)
  != SUCCESS )
  {
php_error(E_ERROR, "Could not call object constructor '%s'", object_name);
  }

  printf("\tctor_retval is %s\n", zend_zval_type_name(ctor_retval));
  /* clean up! */
  zval_dtor(ctor_fn);
  efree(ctor_fn);
  efree(ctor_retval);

} // end call_object_constructor()
/* }}} */

I believe that is all the relevant code, and though I have removed some
stuff for clarity and privacy, none of it directly affects any Zend
objects or variables.

> Hints: make sure that your zvals are correctly initialized (there are
> some big differences between ALLOC_ZVAL and MAKE_STD_ZVAL).

One resets the refcount and the is_ref flag, the other doesn't.  All the
variables I'm dealing with are "fresh", not references to pre-existing
zvals.

Note also that the variables which are getting corrupted are simple
strings, not even zvals.  Here is how I'm setting the value of serverId,
which is one of those getting corrupted:

add_property_string(return_value, "serverId", serverId, TRUE);
efree(serverId);

I don't believe I'm ever running MAKE_STD_ZVAL on return_value, but I
don't think the examples didn't do that either.  It's already
initialized by default, correct?

> Other things to try are looking at other extensions that create objects.
> In the 4.3 release, the user-space streams creates ob