[PHP-DEV] PHP 4.0 Bug #9414: date() returns error when included in an object

2001-02-22 Thread eric

From: [EMAIL PROTECTED]
Operating system: RedHat 6.2 i686 Apache 1.3.17
PHP version:  4.0.4pl1
PHP Bug Type: Date/time related
Bug description:  date() returns error when included in an object

When I try to use the date() inside of a class in 
PHP4.0.4pl1 an error gets returned. 

Example:

dateTest;

?>

Returns the following error:

Parse error: parse error, expecting `','' or `';'' in 
/path/to/file/date_test.php on line 7

My php.ini has expose tags =  off, and an include path, 
otherwise it's pretty much out of the box php.ini

I did a static build with the following config:
./configure --with-apache=../apache 
--with-mysql=/path/to/mysql --with-openssl=/path/to/ssl 
--with-zlib --with-xml --enable-bcmath

Thanks,
eric







-- 
Edit Bug report at: http://bugs.php.net/?id=9414&edit=1



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] POP3 functions

2001-03-27 Thread Eric

Hello.

Is it possible to submit functions for addition to php?
I have some functions which I've added to my local copy of:
ext/imap/php_imap.c
and prototypes in
ext/imap/php_imap.h

Regards,
Eric



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] phpinfo()

2002-01-09 Thread eric



I'm having a bit of a problem with phpinfo(). Here 
is a link to the page http://shawn.phpsecure.com/info.php 
I'm not sure exactly what its doing but the page code is this  This worked just fine until I upgraded to 4.1.0 then 4.1.1 
Thanks!
 
~ Eric


[PHP-DEV] Bug #15356: Warning when running CGI

2002-02-03 Thread eric

From: [EMAIL PROTECTED]
Operating system: Red Hat Linux 7.2
PHP version:  4.1.0
PHP Bug Type: Scripting Engine problem
Bug description:  Warning when running CGI

I run PHP 4.1.0 as an apache module and as a cgi (for command line and cron
activities). I installed the newest version of the Zend Accelerator and
everything appeared to be working just fine until I tried to run php from
the command line. I get the following warning:

[user@box user]$ php --version
Content-type: text/html

PHP Warning:  (null): Unable to initialize module
Module compiled with debug=96, thread-safety=75 module API=1079959680
PHP compiled with debug=0, thread-safety=0 module API=20010901
These options need to match
 in Unknown on line 0  ¼': Unable to initialize module
Module compiled with debug=144, thread-safety=167 module API=1073877708
PHP compiled with debug=0, thread-safety=0 module API=20010901
These options need to match
 in Unknown on line 0

My code executes correctly from the Web (via module compile) and from
command line (even though I get the error everything executes fine). When
I do phpinfo() from the browser, the Zend Accelerator info displays
correctly.

Here is how I build the cgi (and the commented out line is what I include
to compile the module):

#! /bin/sh
./configure \
--with-mysql=/home/mysql \
--with-gettext=/usr/share \
--with-gd \
--with-freetype-dir=/usr/local/src/freetype-2.0.5 \
--with-jpeg-dir=/usr/local/src/jpeg-6b \
--with-t1lib=/usr/local/src/t1lib-1.3.1 \
--with-zlib-dir=/usr/local/src/zlib-1.1.3 \
--with-png-dir=/usr/local/src/libpng-1.2.1 \
--with-curl=/usr/local/src/curl-7.9.2 \
--with-pspell

#--with-apxs=/home/apache/bin/apxs \

Im running:
Apache 1.3.22
PHP 4.1.0
RedHat 7.2
-- 
Edit bug report at http://bugs.php.net/?id=15356&edit=1
-- 
Fixed in CVS:http://bugs.php.net/fix.php?id=15356&r=fixedcvs
Fixed in release:http://bugs.php.net/fix.php?id=15356&r=alreadyfixed
Need backtrace:  http://bugs.php.net/fix.php?id=15356&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=15356&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=15356&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=15356&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=15356&r=notenoughinfo


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




[PHP-DEV] PHP 4.0 Bug #10190: \t$var = <<

2001-04-05 Thread eric

From: [EMAIL PROTECTED]
Operating system: any
PHP version:  4.0.4pl1
PHP Bug Type: Feature/Change Request
Bug description:  \t$var = <<
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #14292: Bare LF Issue - This time with DETAIL!

2001-11-29 Thread eric

From: [EMAIL PROTECTED]
Operating system: Windows 2000 Server/XP
PHP version:  4.0.6
PHP Bug Type: *Mail Related
Bug description:  Bare LF Issue - This time with DETAIL!

I am running an apache web server using PHP 4.06 on Windows 2000 Server and
Windows XP (so we know it doesn't matter the OS as long as it's MS and
PHP). Now here's my delima.

I can send emails through MS Outlook to my specified mail address just
fine. There's no problems and it gets delivered right away. But when I try
sending an email through a web form, the unix mail server running QMail
rejects it with an error 451 Bare LF.

Here's an example: 

This email was sent from my Outlook Client through Postcast Email Server
Succesfully (I have  out server names for my protection):

Thread 1: 23:51:23 [<---] : HELO .xx.net
Thread 1: 23:51:23 [--->] : 220 gambit.xx.net ESMTP
Thread 1: 23:51:23 [<---] : MAIL FROM: <[EMAIL PROTECTED]>
Thread 1: 23:51:23 [--->] : 250 gambit.xx.net
Thread 1: 23:51:23 [<---] : RCPT TO: <[EMAIL PROTECTED]>
Thread 1: 23:51:23 [--->] : 250 ok
Thread 1: 23:51:23 [<---] : DATA
Thread 1: 23:51:23 [--->] : 250 ok
Thread 1: 23:51:23 [--->] : 354 go ahead
Thread 1: 23:51:23 [<---] : QUIT
Thread 1: 23:51:24 [--->] : 250 ok 1007074661 qp 3355

Now, this email was sent via a php script form through Postcast (I have
 out server names for my protection):

Thread 1: 23:37:55 [<---] : HELO xx.xx.net
Thread 1: 23:37:55 [--->] : 220 gambit.xx.net ESMTP
Thread 1: 23:37:55 [<---] : MAIL FROM: <[EMAIL PROTECTED]>
Thread 1: 23:37:55 [--->] : 250 gambit.x.net
Thread 1: 23:37:55 [<---] : RCPT TO: <[EMAIL PROTECTED]>
Thread 1: 23:37:55 [--->] : 250 ok
Thread 1: 23:37:55 [<---] : DATA
Thread 1: 23:37:55 [--->] : 250 ok
Thread 1: 23:37:56 [--->] : 354 go ahead
Thread 1: 23:37:56 [<---] : QUIT
Thread 1: 23:37:56 [--->] : 451 See http://pobox.com/~djb/docs/smtplf.html.


So what's the problem here? Do you think it could be that PHP 4.06 is
spitting out these bare LF or what? I mean it's obvious that Postmaster
Email Server is sending the mails just fine from Outlook and Outlook is the
source of the mail that sent succesfully, and the PHP script is the one
that sent Unsuccessfully.

I have tried at least 6 different SMTP servers for the win32 operating
systems. They all do the same thing. This is very bad for me because I am
having extreme difficulties running my site if every member signs up that
has a unix email account running on Qmail, pukes on me and I have to send
the emails directly to them. It's strange.

I hope we can figure this one out. I have researched the net but not any
information on this particular configuration.

Thanks,
Eric Rosebrock
http://wolfenstein.3dhavoc.net

-- 
Edit bug report at: http://bugs.php.net/?id=14292&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #14292 Updated: Bare LF Issue - This time with DETAIL!

2001-11-29 Thread eric

ID: 14292
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: *Mail Related
Operating System: Windows 2000 Server/XP
PHP Version: 4.0.6
New Comment:

I would like to add that I have tried a perl script to send emails and it works fine. 
No bare LF. However, I tried to install Sendmail for Windows and I could not get that 
to run from php. So... we are back to square 1. Trying to get the Bare LF out of SMTP.

Previous Comments:


[2001-11-29 18:29:46] [EMAIL PROTECTED]

I am running an apache web server using PHP 4.06 on Windows 2000 Server and Windows XP 
(so we know it doesn't matter the OS as long as it's MS and PHP). Now here's my 
delima.

I can send emails through MS Outlook to my specified mail address just fine. There's 
no problems and it gets delivered right away. But when I try sending an email through 
a web form, the unix mail server running QMail rejects it with an error 451 Bare LF.

Here's an example: 

This email was sent from my Outlook Client through Postcast Email Server Succesfully 
(I have  out server names for my protection):

Thread 1: 23:51:23 [<---] : HELO .xx.net
Thread 1: 23:51:23 [--->] : 220 gambit.xx.net ESMTP
Thread 1: 23:51:23 [<---] : MAIL FROM: <[EMAIL PROTECTED]>
Thread 1: 23:51:23 [--->] : 250 gambit.xx.net
Thread 1: 23:51:23 [<---] : RCPT TO: <[EMAIL PROTECTED]>
Thread 1: 23:51:23 [--->] : 250 ok
Thread 1: 23:51:23 [<---] : DATA
Thread 1: 23:51:23 [--->] : 250 ok
Thread 1: 23:51:23 [--->] : 354 go ahead
Thread 1: 23:51:23 [<---] : QUIT
Thread 1: 23:51:24 [--->] : 250 ok 1007074661 qp 3355

Now, this email was sent via a php script form through Postcast (I have  out 
server names for my protection):

Thread 1: 23:37:55 [<---] : HELO xx.xx.net
Thread 1: 23:37:55 [--->] : 220 gambit.xx.net ESMTP
Thread 1: 23:37:55 [<---] : MAIL FROM: <[EMAIL PROTECTED]>
Thread 1: 23:37:55 [--->] : 250 gambit.x.net
Thread 1: 23:37:55 [<---] : RCPT TO: <[EMAIL PROTECTED]>
Thread 1: 23:37:55 [--->] : 250 ok
Thread 1: 23:37:55 [<---] : DATA
Thread 1: 23:37:55 [--->] : 250 ok
Thread 1: 23:37:56 [--->] : 354 go ahead
Thread 1: 23:37:56 [<---] : QUIT
Thread 1: 23:37:56 [--->] : 451 See http://pobox.com/~djb/docs/smtplf.html. 

So what's the problem here? Do you think it could be that PHP 4.06 is spitting out 
these bare LF or what? I mean it's obvious that Postmaster Email Server is sending the 
mails just fine from Outlook and Outlook is the source of the mail that sent 
succesfully, and the PHP script is the one that sent Unsuccessfully.

I have tried at least 6 different SMTP servers for the win32 operating systems. They 
all do the same thing. This is very bad for me because I am having extreme 
difficulties running my site if every member signs up that has a unix email account 
running on Qmail, pukes on me and I have to send the emails directly to them. It's 
strange.

I hope we can figure this one out. I have researched the net but not any information 
on this particular configuration.

Thanks,
Eric Rosebrock
http://wolfenstein.3dhavoc.net






Edit this bug report at http://bugs.php.net/?id=14292&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] How do I access a hash from an extention/module?

2002-06-06 Thread eric

Hi,

I have posted this message before to the general list, but it seems
nobody there can help me so I hope someone here might know...

I am a bit stuck right now, I want to access the values of a global hash
(actually it is a session variable) from within my PHP extention/module.
So I want to be able to see which keys are defined in a hash, and what
the corresponding value in this hash is for each key.

Could someone please give me a small example how this is done? I have
looked in the source code of the other extentions but I couldn't find
anything that could be of any help (I might have missed it though).

-- 
#!perl #   Life ain't fair, but root passwords help.
# Eric Veldhuyzen  [EMAIL PROTECTED]
$!=$;=$_+(++$_);($:,$~,$/,$^,$*,$@)=$!=~   # Perl Monger
/.(.)...(.)(.)(.)..(.)..(.)/;`$^$~$/$: $^$*$@$~ $_>&$;`

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




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

2003-02-11 Thread Eric Lambart
I originally posted this about 20 hours ago, and it has still not
appeared on the newsgroup.  I assume something went wrong, and apologize
if it appears twice.

In my original message, I neglected to mention that I am compiling code
this with PHP 4.2.3, though I have had similar problems with an earlier
version of this extension (on another dev server) with 4.3.0.

---

Hello all,
I have scoured the php.dev group, reading most of the messages I could
find regarding extensions and modules, but could not find any other
reports of this problem anywhere.  I have a feeling there is an obvious
answer.

I have a PHP_FUNCTION() defined within my extension, which is in turn 
calling a standard C function (called "getDataReply()") which is passed 
the standard return_value zval*.  My getDataReply() function initializes 
a Zend object (which I have defined) using object_init_ex(), then calls 
the object's constructor, and then assigns some values to the members of 
the object.

That is all well and good.  Everything works great.  I can use a
php_var_dump() and everything looks as it should.  I even do another
php_var_dump(&return_value, 1 TSRMLS_CC) within my PHP_FUNCTION(), and
sure enough... return_value still contains the proper data structure (see
below).

The problem occurs as soon as control returns to the script.  In my test
script, I do a var_dump() and the data is corrupted!  I have looked at
the Zend internals but forgive me, I don't have the time or patience to 
to step line-by-line through code (using gdb) that has few comments and 
which I don't understand very well.

Can anyone please give me some ideas as to what I could be doing wrong
here?  NOTE that I have discovered that if I perform a deep copy using 
zend_copy_ctor(return_value) before returning to the script, my data is
undamaged... but then I have a big memory leak.  I also anticipate having
very large data sets within my objects, and deep-copying all of that 
every time would be very expensive.

Here is a how I am calling my C function from within my PHP function:

  PHP_FUNCTION(eo_create_object)
  {
..
.. do stuff
..

/* let's see what the server has to say */
temp = getDataReply(conn, return_value);

if ( temp )
{
  .. in this case return_value is set based on the value of temp, a
  .. fairly simple data structure (but this code is NOT being reached;
  .. see below.  return_value is only being modified by the above 
  .. function.
}
else
{
  printf("temp is NULL\n");
}

printf("done with getDataReply()\n");

/* this php_var_dump() returns uncorrupted data */

php_var_dump(&return_value, 1 TSRMLS_CC);

  } // end eo_create_object()

I don't see why it should make any difference, but in another source file,
getDataReply() is declared like this:

  variant *getDataReply(eo_connection *conn, zval *return_value)
  {
.. do stuff, init return_value as eo_table class, init it, and fill w/data
  }

The following are the exact results of the php_var_dump() from within 
zif_eo_create_object(), _immediately_ before returning control to the 
script.
---
  temp is NULL
  done with getDataReply()
  object(eo_table)(10) {
["serverId"]=>
string(14) "N^VESoDMN(94)"
["rows"]=>
int(0)
["cols"]=>
int(0)
["namedCols"]=>
bool(false)
["errorText"]=>
string(0) ""
["errorItem"]=>
string(0) ""
["errorId"]=>
int(0)
["flags"]=>
int(0)
["colNames"]=>
NULL
["table"]=>
NULL
  }

Those data are correct, everything looks PERFECT.

-

Here is what I am doing in the test script (PHP code):

  

And here are the results of the last var_dump():
  object(eo_table)(10) {
["serverId"]=>
&UNKNOWN:0
["rows"]=>
&UNKNOWN:0
["cols"]=>
int(0)
["namedCols"]=>
bool(false)
["errorText"]=>
string(0) ""
["errorItem"]=>
string(0) ""
["errorId"]=>
int(0)
["flags"]=>
int(0)
["colNames"]=>
NULL
["table"]=>
NULL
  }

...as you can see, some of the values have been corrupted.  As soon as I try 
to access $table->serverId, PHP segfaults in erealloc().  I will not include 
the backtrace here as it seems irrelevant; serverId no longer has a legitimate 
value, so of course it cannot be accessed.

This is a simple example.  The member variable "table", when it has a value, 
contains an associative array.  Sometimes those values are OK, sometimes they
are corrupted.  I have had other strange corruptions in returned values, and 
I do not understand why.

Thanks for any help you can offer,
Eric

-- 
This message was created in a marvelously Microsoft-free computing environment.

To email me, ADD "spam" before the "bo"

-- 
PHP Development Mailing List <http://www.php.net/>
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
 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 objects and call their
> constructors, so take a look at that code for some hints.

I have 4.3 on the other dev server, I will check that out.

> If you are returning strings, make sure that any that need to be
> duplicated are duplicated etc. etc.
> 
> Using the source is your best option if you don't want (or are not
> allowed) to show us your source.

I've shown you what I can, I don't think you want to see it all :)

> The zend api docs http://www.php.net/manual/en/zend.php, although not
> complete, should be good enough for what you need to do.

Unfortunately, I couldn't have gotten near to what I've been able to do
without pouring through the Zend, PHP, extension source code, and
newsgroup posts.  I tried everything I could before posting.

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.

Eric

-- 
This message was created in a Microsoft-free computing environment.



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




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

2003-02-13 Thread Eric Lambart
On Wed, 12 Feb 2003 13:40:09 -0800, Eric Lambart wrote:

UPDATE...
If you ask me, this is stranger still.  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.

OK, here's an update.  I was not entirely correct about the ( becoming '
being some sort of simple character substitution.

First of all, I have recompiled my extension under PHP 4.3.0 and the
problem persists; exactly the same thing happens.  It is therefore not an 
issue with 4.2.3.

I am no longer using --enable-debug since it was not revealing any memory 
leaks anyway, and the problem with the single-character substitution seemed a
little less abstract than the strings getting completely clobbered, as
with debug enabled.

Second of all, I have narrowed the problem down a bit.  It has nothing to
do with parentheses or single-quotes (surprise!).  Seriously... I just
observed it mangling another string, but what seemed stranger yet, it
changed "\037N^VESOBJ(4)" to "\037N^VESOBJ(3)" (this is output from gdb,
so that's ASCII octal 37, which isn't a printable character and
didn't show up in my previous console output).

So what does this have in common with changing "\037N^VESoDMN(107)" to
"\037N^VESoDMN'107)"?  Simple: it is the 11th character of the string that
is getting changed.  Moreover, it is getting decremented by one.  Just as 3
precedes 4 in the ASCII table, ' precedes ).  These strings that are
getting mangled are not the same variables... not the same zvals or memory
locations or anything.

And in the case of 4 becoming 3, the circumstances are completely
different. It has nothing (at least directly) to do with my extension 
functions.  The only thing they have in common is the location: 
((my zval*)->value->str.val) + 11

Check out this code from my test script:

  $arrayClass = eo_invoke_method($conn, $objPtr, $method, 0, $params);
  echo "arrayClass='$arrayClass'\n";
  $method = "Interface";
  echo "arrayClass='$arrayClass'\n";
  $params = array();
  echo "arrayClass='$arrayClass'\n";

Which produces this console output:

arrayClass='N^VESOBJ(4)'
arrayClass='N^VESOBJ(4)'
arrayClass='N^VESOBJ(3)'

Now to me, this is really baffling.  Right before my variable changes, I am 
initializing the variable $params to be a new array() object (fwiw, $params 
already _was_ an array() containing one value; I am just re-using the variable).
So, in the process of initializing a standard PHP array(), something in the 
Zend engine is mangling my seemingly unrelated variable, $arrayClass... and I 
swear I'm not telling it to!  $arrayClass, coincidentally, refers to an object 
stored on a remote database server, and never contains, nor is ever contained 
IN, a PHP array.  It is just a simple PHP string.

Running trusty (?) old gdb, I set read and write watches on 
$arrayClass->value->str.val, but can't seem to catch where it's changing.  
The read watch is only triggered by PHP processing each echo statement which 
displays $arrayClass's value, the write watchpoint is never caught.

But what could be doing this?  Does the number 11 hold any special significance?
And why is the 11th character being decremented?  Could Zend be trying to 
decrement the refcount for something and pointing to the wrong part of memory?  
I suppose it could be decrementing just about anything, but why the 11th 
character of several different string-containing zvals?  This is obviously 
not completely random.

Please help me before I lose what's left of my mind!

TIA
Eric

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




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

2003-02-14 Thread Eric Lambart
On Thu, 13 Feb 2003 09:02:44 -0800, Eric Lambart wrote:

> Second of all, I have narrowed the problem down a bit.  It has nothing
> to do with parentheses or single-quotes (surprise!).  Seriously... I
> just observed it mangling another string, but what seemed stranger yet,
> it changed "\037N^VESOBJ(4)" to "\037N^VESOBJ(3)" (this is output from
> gdb, so that's ASCII octal 37, which isn't a printable character and
> didn't show up in my previous console output).
> 
> So what does this have in common with changing "\037N^VESoDMN(107)" to
> "\037N^VESoDMN'107)"?  Simple: it is the 11th character of the string
> that is getting changed.  Moreover, it is getting decremented by one.
> Just as 3 precedes 4 in the ASCII table, ' precedes ).  These strings
> that are getting mangled are not the same variables... not the same
> zvals or memory locations or anything.

OK, another update, although I fear I am just adding noise to the list.
Not sure if anyone is reading this thread!

Further investigation on my part has revealed a workaround which "fixes"
this ONE problem:  if I use erealloc() to make my string just ONE byte
longer, the string does not get corrupted.

I first suspected this had nothing to do with actually extending the 
string, but that the pointer was getting assigned to a completely new
address; but I have disproved that by printing the pointer address before
and after the erealloc(), which can remain unchanged and the problem
nevertheless goes away.

If this solved the problem, this would be an acceptable workaround for me
at this point.  But the problem of the other object field getting
corrupted remains:

php_var_dump() from C:
object(eo_table)(10) {
  ["serverId"]=>
  string(15) "N^VESoDMN(192)"
  ["rows"]=>
  int(0)
  ["cols"]=>
  int(0)
  ["namedCols"]=>
  bool(false)
  ["errorText"]=>
  string(0) ""
  ["errorItem"]=>
  string(0) ""
  ["errorId"]=>
  int(0)
  ["flags"]=>
  int(0)
  ["colNames"]=>
  NULL
  ["table"]=>
  NULL
}

var_dump() from PHP script immediately afterwards:
object(eo_table)(10) {
  ["serverId"]=>
  string(15) "N^VESoDMN(192)"
  ["rows"]=>
  &UNKNOWN:0
  ["cols"]=>
  int(0)
  ["namedCols"]=>
  bool(false)
  ["errorText"]=>
  string(0) ""
  ["errorItem"]=>
  string(0) ""
  ["errorId"]=>
  int(0)
  ["flags"]=>
  int(0)
  ["colNames"]=>
  NULL
  ["table"]=>
  NULL
}

As you can see, the "rows" field is becoming undefined.  Again, here I
have found another clue.
If I repeat the add_property_long() for "rows", like this:
add_property_long(return_value, "rows", rows);
add_property_long(return_value, "rows", rows);

"rows" is OK, but the "&UNKNOWN:0" moves to the next field ("cols")

If I repeat both, exactly like this,
add_property_long(return_value, "rows", rows);
add_property_long(return_value, "rows", rows);
add_property_long(return_value, "cols", cols);
add_property_long(return_value, "cols", cols);

...no data is getting corrupted... AT THE MOMENT.

I don't trust this.  I shouldn't have to trust this.  It's not the
ugliest hack, but it's very much a hack.  I really think something in 
either zend_hash.c is mishandling the object's hash table...
or in the case of the string getting corrupted, perhaps it's something in
zend_alloc.c or somewhere within the memory manager/garbage collector.

At this point, can anyone give me any reason to doubt that the problem
lies within the Zend engine?  Please refer to my earlier posts on this
thread for more (though less-informed and -investigated) details.

This is all very strange to me, ESPECIALLY the 11th-character thing.

Again, I am compiling this extension into PHP 4.3.0.
gcc version 2.96 2731 (Red Hat Linux 7.2 2.96-112.7.1)
Intel P4 CPU

Thanks for your time--and for Wez and others on the dev team, thanks for
your work on Zend/PHP!

Eric

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




[PHP-DEV] bug in zend_API.c (with patch)

2003-03-07 Thread Eric Lambart
Hello.

After a short bout of hair-pulling, I have discovered the source (in the
Zend engine) of a recent problem, and have fixed it.

BACKGROUND:
As I have mentioned previously on this list, I am developing a complex
PHP extension, which among many other things creates its own PHP
classes, and when these classes are instantiated, I manually call the
class constructor (as one must) from my C code.

I am creating the extension from existing C++ and Java versions of the
same system, so I am trying to maintain things as much as possible,
including names (including capitalization) of classes and functions
(although I am prefixing them all with "eo_" to avoid potential
conflicts with functions and classes from other PHP extensions).

Thus, I have classes such as "eo_list", "eo_table" and "eo_NVList".  

THE SYMPTOM:
I had no trouble instantiating and calling the constructors for the
first two classes, but when I tried to do it for eo_NVList,
call_user_function_ex() was returning FAILURE, which I discovered can
occur for one of seven reasons.

I tracked down the problem to a failure of zend_hash_find() to lookup
the function.  Using zend_hash_display() I was able to verify that the
eo_NVList constructor was indeed contained in the function table for the
eo_NVList class.

THE PROBLEM:
call_user_function_ex() is converting the requested function name to
lower case (at zend_execute_API.c:463) before performing the
zend_hash_find(), but zend_register_functions() (in zend_API.c) does NOT
convert the function names to lower case before storing them in the
function table--so call_user_function_ex() was searching for a function
called "eo_nvlist" and could never find "eo_NVList"!

Class lookups worked fine of course, because object_init_ex() takes a
pointer to the class entry rather than a name.

Additionally, zend_register_internal_class() (also in zend_API.c)
converts all class names to lower case, and execute() (in
zend_execute.c) does the same when looking up a class to instantiate it
from a script.

I haven't looked into script-driven function registration and execution,
but presumably case-insensitivity is properly supported there, or I'm
sure you would have heard of it long ago!

MY SOLUTION:
I present the following little patch for your approval.

I apologize that it is done against 4.3.1 rather than the latest CVS but
I do not have time to deal with CVS at this time, as my project is
already behind schedule and of course I need to work with a stable
engine.  If zend_API.c has changed since the 4.3.1 release, it should be
trivial to change these few lines of code (yes, I'm sure they all say
that!). =)

I didn't find any patch submission guidlines in a quick web search; I'm
afraid you'll have to change the file/pathnames in the first lines.  If
you don't want to deal with that, point me to the guidelines and I will
resubmit the patch.  For now I will get back to work.

Respectfully,
Eric Lambart

--- Zend/OLD_zend_API.c Wed Oct  9 07:17:52 2002
+++ Zend/zend_API.c Fri Mar  7 13:10:38 2003
@@ -1039,6 +1039,12 @@
internal_function->type = ZEND_INTERNAL_FUNCTION;

while (ptr->fname) {
+/* store all function names in lower case so they will always be found by
+ * call_user_function_ex() */
+size_t fname_len = strlen(ptr->fname);
+char *lowercase_name = zend_strndup(ptr->fname, fname_len);
+zend_str_tolower(lowercase_name, fname_len);
+
internal_function->handler = ptr->handler;
internal_function->arg_types = ptr->func_arg_types;
internal_function->function_name = ptr->fname;
@@ -1047,7 +1053,7 @@
zend_unregister_functions(functions, count, 
target_function_table TSRMLS_CC);
return FAILURE;
}
-   if (zend_hash_add(target_function_table, ptr->fname, 
strlen(ptr->fname)+1, &function, sizeof(zend_function), NULL) == FAILURE) {
+   if (zend_hash_add(target_function_table, lowercase_name, fname_len+1, 
&function, sizeof(zend_function), NULL) == FAILURE) {
unload=1;
break;
}



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



Re: [PHP-DEV] bug in zend_API.c (with patch)

2003-03-07 Thread Eric Lambart
On Fri, 2003-03-07 at 14:24, Brad LaFountain wrote:
> Why can't you just simply name your classes all lowercase.

Because then I wouldn't have discovered the bug! =)

> All of the extensions currently do this and it works fine.

Apparently that is the case--that's probably why I had the pleasure of
discovering this bug myself.  Although we are not currently developing
this extension for public release, it may be open-sourced in the future,
and for that reason I have followed the CODING_STANDARDS document fairly
closely.

We could, of course, give all classes and functions lower case names,
but as I explained in my previous post, we are porting an existing
application that exists in C++ and Java and the developers of those
original versions chose to use CamelCaps.  AFAIC, the less changes
needed to the code, the better.

Personally, I'd rather have case-sensitive class and function names in
PHP, but the whole point is, if the Zend engine is going to try and look
them up them in lowercase, IMHO it'd be really nice if it'd store it the
same way :)

BTW, since my first post I have discovered the  README.SUBMITTING_PATCH
file.  I still don't have the time now to deal with CVS, though if
pushed I will do so, sometime in the future.  Nonetheless, I am
re-submitting the patch here as requested in the form of a MIME
attachment.  FWIW I also performed a "make test" with no FAILs, though I
did not create a new test case for this bug.

Let me know if there's anything else I can do to help.  If this patch
will not be accepted SOLEY due to the fact that it's not done on CVS,
please let me know and I will take care of that when I have time, and
resubmit it.

For now, I have spent enough time on this problem already.

Regards,
Eric

--- Zend/OLD_zend_API.c Wed Oct  9 07:17:52 2002
+++ Zend/zend_API.c Fri Mar  7 14:49:36 2003
@@ -1039,6 +1039,12 @@
internal_function->type = ZEND_INTERNAL_FUNCTION;

while (ptr->fname) {
+   /* store all function names in lower case so they will always be found 
by
+* call_user_function_ex() */
+   size_t fname_len = strlen(ptr->fname);
+   char *lowercase_name = zend_strndup(ptr->fname, fname_len);
+   zend_str_tolower(lowercase_name, fname_len);
+
internal_function->handler = ptr->handler;
internal_function->arg_types = ptr->func_arg_types;
internal_function->function_name = ptr->fname;
@@ -1047,7 +1053,7 @@
zend_unregister_functions(functions, count, 
target_function_table TSRMLS_CC);
return FAILURE;
}
-   if (zend_hash_add(target_function_table, ptr->fname, 
strlen(ptr->fname)+1, &function, sizeof(zend_function), NULL) == FAILURE) {
+   if (zend_hash_add(target_function_table, lowercase_name, fname_len+1, 
&function, sizeof(zend_function), NULL) == FAILURE) {
unload=1;
break;
}

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

Re: [PHP-DEV] bug in zend_API.c (with patch)

2003-03-07 Thread Eric Lambart
On Fri, 2003-03-07 at 15:30, Wez Furlong wrote:
> It's not a bug; PHP is a case-IN-sensitive language when it comes to
> function and class names.

I understand that, and if my message implied anything differently, I
apologize.  That is precisely the problem I am addressing; when storing
the function names, Zend is doing half of the job of compliance with the
requirement of case-insensitivity; when retrieving them *from within an
extension*, it falls down.

> Adding strtolower calls will only slow down the whole language.

You are of course correct, but whoever chose to make class and function
names case-insensitive effectively required that the engine does
strtolower every time a class or function name is stored and retrieved.
Although this seems like excessive overhead to me, I would never suggest
changing this aspect of the language.

I presume this is one big reason why variable names are NOT case
insensitive in PHP--the overhead involved in case-conversion the name
for every single use every single variable would be silly.  Class and
function references, of course, occur far less frequently and thus I
guess the overhead was decided to be acceptable?

Anyway, enough idle speculation on my part.

So... if I'm not mistaken, the opcode ZEND_INIT_FCALL_BY_NAME is what is
being triggered when a user function is called from a PHP script.

Is this correct?

If that's right, then you can see that line 1501 (4.3.1 release) of
zend_execute.c is where the Zend is, as you say, "slowing down the whole
language" on EVERY instance of a *script-based* function call:

  tmp = *function_name;
  zval_copy_ctor(&tmp);
  convert_to_string(&tmp);
  function_name = &tmp;
HERE->zend_str_tolower(tmp.value.str.val, tmp.value.str.len);

As I mentioned before, a similar conversion takes place for the 
ZEND_NEW opcode for instantiating classes.  All I am suggesting here is
that compliance with the language standard (in re case insensitivity) is
made complete for function calls *by PHP extensions*

My old friend grep tells me that in the 4.3.1 distribution there are
exactly 49 uses of call_user_function[_ex] spread between only 23 of the
88 "stock" extensions.  Of course, I have no idea how many times these
calls are actually encountered in the use of these extensions, but my
point is the overhead involved cannot possibly rival the amount already
created by the zend_str_tolower() calls within zend_execute.c, which is
surely encountered far more often in everyday use of PHP.

Does what I am suggesting make sense, now?

> Using lowercase function and class names is the best solution.

I may very well change them if my employer does not object, because I
find C-style function names more aesthetically pleasing (and because
CODING_STANDARDS suggests it for PHP extensions).  They are as they are
now because the code was ported from another language.

But as I have seen no warnings or admonitions about using one or more
upper case letters in a function or class name in the available
extension-writing documentation (either online, or in the book
"Programming PHP"), I would expect them to work as documented for the
PHP language in general (on, for instance, at the bottom of page 62 of
that book, First Edition, March 2002).

By spending a not inconsiderable amount of time, I have discovered both
a workaround (use all lowercase function names--there IS currently no
problem with mixed-case class names--they are zend_str_tolower()d), and
a suggested solution (attached to my previous post) to this problem.  

Using a workaround will fix my problem; making a small change to Zend
will potentially and probably save other extension developers the
trouble of having to discover workaround on their own, if they are even
capable of doing so.  I would like to save them that trouble.

Most sincerely,
Eric



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



Re: [PHP-DEV] show_source()

2002-11-14 Thread Eric Coleman
I would actually love to see that :)


"John Coggeshall" <[EMAIL PROTECTED]> wrote in message
news:000701c28c5e$ac9cb200$9d10fea9@;coogle...

If no one has an objection, I'll look into making some of that happen.

John


|-Original Message-
|From: [EMAIL PROTECTED] [mailto:nicos@;php.net]
|Sent: Thursday, November 14, 2002 10:15 PM
|To: [EMAIL PROTECTED]
|Subject: [PHP-DEV] show_source()
|
|
|Hello,
|
|Some users are requesting some new arguments in
|show_source() like having the line numbers, having a link to
|the php manual when a function is called... (see  #12442 )
|
|What do you think of that?
|
|Regards.
|M.CHAILLAN Nicolas
|[EMAIL PROTECTED]
|www.WorldAKT.com Hébergement de sites internets.
|
|
|
|
|--
|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] unset isn't a function anymore...

2002-12-04 Thread Eric Coleman
Well since it isn't a function, shouldn't it be able to be used without
braces?

Require/Include/Echo/Print all work that way?

Also, would it be easy to add something like ASP's sub to PHP?

Basically like a function, but no return value.  where the user could choose
to call it without parenthases?

-eric



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




[PHP-DEV] Re: Warning in wrong parameter

2002-12-24 Thread Eric Coleman
AFAIK, it's supposed to allow for more parameters anyway ;)

Eric

"Michel 'Ziobudda' Morelli" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi, I have installed php 4.2.1 and error_reporting = ALL.
>
> I write a function called foo() that accept only 1 parameter.
>
> Now if I write:
>
>  $result = foo("bar");
> ?>
>
> All is ok.
>
> If I write:
>
>  $result = foo("bar","bar2");
> ?>
>
> All is ok, but for me that is not OK because my function foo() accept
> only 1 parameters and no 2 o 3 or more. Is there any possibility that
> PHP return me a warning with the message (e.g.) "Warning parameter
> number for [function name] in [page.php] line [line number]" ???
>
> Tnx in advance. And sorry for this stupid question and for my bad
> english.
>
> Happy "all".
> --
>  Ti desidero, voglio trascinarti a letto, piegarti, farti sudare,
> prenderti da farti incendiare il corpo...
> Ti aspetto: Tua, Influenza.
> --
> Michel  Morelli   [EMAIL PROTECTED]
>
> ICQ UIN: 58351764   PR of Linux in Italy
> http://www.ziobudda.net http://www.phpdev.it
>



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




[PHP-DEV] C++ module and Zend C headers

2001-02-05 Thread Eric Callier

Hello,
I'm new to php-dev.

I noticed that compile cpp files raise some difficulties:
All functions declared in the Zend/zen_API.h files aren't declare as extern
"C", so gcc raise errro at link time when you try use these functions :
error like:  undefined function _array_init(...) etc.

Everything work fine when you add BEGIN_EXTERN_C() / END_EXTERN_C() macros
in zend_API.h.

If someone can modify this header in the cvs, I think that C++ developpers
will be  please :-)

N.B: I use php4.0.3pl1/linux

Eric CALLIER - Information Systems
Elf Trading SA
World Trade Center 1  Tel:   +41-22-710-12-77
Case postale 276  Fax:   +41-22-710-18-58
CH-1215 Geneva 15 Telex: 415 535 ets ch
Switzerland   Email: [EMAIL PROTECTED]


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] php module and CORBA

2001-02-14 Thread Eric Callier

I'm currently writing a php4 extension module with omniORB (multithreaded
CORBA)

When I compile php in standalone with my php module everythings work fine.
But when I compile php as an apache module my module hang on the following
line:
orb = CORBA::ORB_init(nb,params,"omniORB3");

I saw in the omniORB archive that some user have same problem with apache
module:
the ORB_init method hang when it is call from a non-worker process.

Is some one known how to call ORB_init from the worker process of apache
throw a php module?

Eric CALLIER



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Hey? 4 copies?

2001-03-08 Thread Woolhiser, Eric

I just joined the mailist yesterday, any idea why I get 4 copies of each
message posted to this list?

-- 
Eric WoolhiserBMC Software Inc
NT Build Meister  880 Winter St. Bldg 4 rm. 2.227
781-663-4646 (or x34646 internally)   Waltham, Ma 02454-9111
http://midwatch.org/pgp-key.html  http://www.bmc.com
http://www.tuxedo.org/~esr/ecsl



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] wrong weeknr in strftime?

2002-02-18 Thread Eric Persson

Hi !

I have experienced a error in the strftime function, it appears to be 
that the weeknumber returned is current_week-1.


This returns "week:07" when its really 08.

Is this a bug?

I'm running php4.0.6 under apache and linux and YES, i have the right 
time in the system. :)

Thanks for your time,
Eric


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




[PHP-DEV] Bugs: mod_php, w3c-libwww, "content-length", "chunked" and RFC 2068

2001-06-28 Thread Eric Kidd

So, I was using w3c-libwww to download some XML documents generated by
mod_php, and I kept losing the last 5 or 6 bytes.  Ethereal said those
bytes were on the wire, so I dug into w3c-libwww's guts.

Half a day later, here's what I've learned:

  mod_php will happily generate messages that include both a content-length
  and a "chunked" transfer encoding *if* a script supplies a
  "content-length" header.  The content-length header will not include the
  bytes used to specify the chunk size.  I don't know where or how this
  happens in mod_php.

  w3c-libwww 5.2.8 does not respond gracefully to messages which have both
  a content-length and a "chunked" transfer encoding.  And I *think* this
  problem exists in CVS, too, but I'm not entirely sure.

According to RFC 2068:

  Messages MUST NOT include both a Content-Length header field and the
  "chunked" transfer coding. If both are received, the Content-Length
  MUST be ignored.

But w3c-libwww gets this precisely backwards.  If, for example, a server
sends an illegal message of the form:

  Transfer-Encoding: chunked\r\n
  Content-Type: text/xml\r\n
  Content-length: 32\r\n
  \r\n
  20\r\n
  (32 characters in body)
  0\r\n
  \r\n

...then w3c-libwww feeds it through HTMIME, which honors the content-length
header, and chops off four trailing bytes to make up for the "20\r\n".  (It
then does various unspeakable things with the last four bytes of the
message and the five trailer bytes, but this isn't important.)

So this is technically a bug in mod_php *and* w3c-libwww. ;-)

Cheers,
Eric

(If you need any more information from me, please contact me via e-mail.
I'm not on the php-dev or w3c-libwww mailing lists.)

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] RE: PHP 4.0 Bug #6734 Updated: SQL Error In using ODBC connection to Oracle

2001-04-09 Thread Eric Ballou

Last time I checked it was still valid.  I was still unable to access on the
NT 4.0 SP6/Windows 2000 box.

Sincerely,

Eric Ballou

-Original Message-
From: Bug Database [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 09, 2001 11:08 AM
To: [EMAIL PROTECTED]
Subject: PHP 4.0 Bug #6734 Updated: SQL Error In using ODBC connection to
Oracle

ID: 6734
Updated by: kalowsky
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Feedback
Bug Type: ODBC related
Assigned To:
Comments:

Is this still valid in the current PHP releases?

Second, if it is, is your Oracle setup configured to allow your Win98
machine access?

Previous Comments:
---

[2000-09-14 01:23:04] [EMAIL PROTECTED]
Installed PHP4.02 on NT 4 and 98.  NT has IIS3/PWS and 98 has PWS.  Install
went fine on 98 after following numerous notes.  After installing on NT
scripts are able to run, however I am unable to connect to Oracle DB.  I
haven't figured out where the oracle module is (or how to install it for
PHP) so I use ODBC connection and script.  Granted the code isn't pretty as
I get errors with the output, but it works on the 98 machine fine.

I get the following error:

Warning: SQL error: [Oracle][ODBC][Ora]Server rejected the connection., SQL
state 08004 in SQLConnect in D:Reportsbad.php on line 19
Error in odbc_connect
Warning: Supplied argument is not a valid ODBC result resource in
D:Reportsbad.php on line 14

Suggestions and instructions needed.

Code also follows:

idnomn";
$nbrow=0;

// fetch the succesive result rows
while( odbc_fetch_row( $cur ) )
{
$nbrow++;
// get the field "id"
$id= odbc_result( $cur, 1 );
// get the field "nom"
$nom= odbc_result( $cur, 2 );
echo "$id$nomn";
}

echo "$nbrow entries ";

// close the connection. important if persistent connection
are "On"
odbc_close( $cnx);

?>



---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=6734&edit=2


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] shared extension module and 4.0.5

2001-05-01 Thread Eric Callier

Hello,
I just upgrade from php4.04pl1 to 4.05. And now I got undefined symbol in
my extension module on array_init function.

My module is an shared object link with php4 library
gcc -shared -fPIC -DPIC   -L/usr/src/php/.libs  -rdynamic -fexceptions  -o
php_mymodule.so  $(MY_OBJECTS_LIST) -lpthread -lphp4

# /usr/local/bin/php -f test.php
try open
open ok
/usr/local/bin/php: error in loading shared libraries:
/usr/src/ec/php_mymodule.so: undefined symbol:
_array_init__FP12_zval_struct

array_init function was working with with php4.0.4pl1.
Does any one can told me what I'm doing wrong ?

Eric.




-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP segfaults??

2001-11-15 Thread Eric Terstegen

PHP Version: 4.0.6

I am working on a PHP extension which will basically be a 
wrapper for a library dealing with DECnet..  

PHP is compiled as a module for Apache 1.3.20 with apxs 
and no special arguments.  Also, I am compiling the 
extension by hand as illustrated in the Zend API docs (simple makefile).

The php extension links to 2 shared libraries (both are 
C++).  The main library contains a function (called from 
the extension) which creates a new instance of a class, 
and then returns this newly created class to the PHP 
extension as a (typdef void *), since the extension is 
straight C.  The class used in the main library is defined 
in the second library.  

After adding some code to implement resources (a basic 
MINIT, destructor, and handle) the extension segfaults 
every time.

If I take out the code for the resource it runs perfectly fine HOWEVER if 
I leave the resource code in and comment out the call to the function it runs 
perfectly fine as well... So it only happens when both resources and the call 
are made...

The most interesting thing is that I never actually use the resources (in 
this code), meaning I never call a zend_list_delete or a return_resource, it 
is just enough that the minit and destructor are there.

The backtrace usually looks like this:

Program received signal SIGSEGV, Segmentation fault.
0x40229aa7 in ?? ()
(gdb) bt
#0  0x40229aa7 in ?? ()
#1  0x4022cfa8 in ?? ()
#2  0x4022d14c in ?? ()
#3  0x40228ab1 in ?? ()
#4  0x4023adf0 in ?? ()
#5  0x4023855c in ?? ()
#6  0x08051461 in run_cleanups () at eval.c:41
#7  0x0804fad5 in ap_clear_pool () at eval.c:41
#8  0x0804fb57 in ap_destroy_pool () at eval.c:41
#9  0x080603c3 in child_main () at eval.c:41
#10 0x08060521 in make_child () at eval.c:41
#11 0x0806069c in startup_children () at eval.c:41
#12 0x08060d0c in standalone_main () at eval.c:41
#13 0x0806153c in main () at eval.c:41
#14 0x40095177 in __libc_start_main (main=0x80611a4 , argc=2,
ubp_av=0xb97c, init=0x804e9ac <_init>, fini=0x8096e70 <_fini>,
rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xb96c)
at ../sysdeps/generic/libc-start.c:129

I have very basic and stripped down code for both libraries and the 
module and can zip them up and send them if need be.

Thanks,
Eric Terstegen

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Segmentation faults still :(

2001-11-27 Thread Eric Terstegen

Hello all,

I am still having some problems with segmentation faults (making an
extension), and this is with the latest release (4.1.0RC3) ...

Maybe I am just stupid and the code is screwed up, but if anyone would take
a
look at this I would greatly apprectiate it..

Bascially i am making a wrapper for a Decnet library and this is where I
first encountered the problem.  I hacked the code down to just some bare
simple things (no decnet required :)..

It is mainly two C++ libraries (pretty bare) and the extension is using
resources..  The first library holds a class and the second library creates
an instance of this class and returns it as a typdef void * to the straight
C
extension, which really does nothing with it

I stuck the code on our site at www.kingscredit.com/die_ext.zip and
www.kingscredit.com/die_libs.zip
(Sorry for the lack of a makefile in the libs but there is a small bash
script)

PHP is compiled with the axps thing for apache 1.3.20 and no other special
options (on RedHat 7.1)

--Thanks
Eric Terstegen


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Zend License

2002-03-07 Thread Eric Thelin

I read a few months ago that the zend engine was changing its license to
a BSD-style license.  But I have heard nothing about it since and the
license file still states that it is released under the QPL.  So my
question is when will this change take place.  I know some of some
resistance to using PHP until this change takes place.  Has a specific
license been chosen?  Wouldn't it be simplest to just release it under
the PHP License.

Eric

-- 
Eric Thelin  [EMAIL PROTECTED]
   AZtechBiz.com: Where Arizona Does Tech Business


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




[PHP-DEV] php-4.1.2 compile error with gd

2002-03-11 Thread Eric Persson

Hi,

I'm about to compile the 4.1.2 version found on php.net. I have the
following configure command:
./configure --with-apache=../apache_1.3.23 --with-mysql
--with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib-dir
--with-freetype-dir --with-gd --enable-gd-native-ttf --with-tiff-dir
--with-dom --with-mnogosearch --with-pdflib --with-ftp
--enable-gd-imgstrttf --with-gettext

The configurepart runs fine. But when I get to the makepart i get the
following when its doing something with gd:
Making all in gd
make[2]: Entering directory `/opt/install/php-4.1.2/ext/gd'
make[3]: Entering directory `/opt/install/php-4.1.2/ext/gd'
gcc -I. -I/opt/install/php-4.1.2/ext/gd -I/opt/install/php-4.1.2/main
-I/opt/install/php-4.1.2 -I/opt/install/apache_1.3.23/src/include
-I/opt/install/apache_1.3.23/src/os/unix -I/opt/install/php-4.1.2/Zend
-I/usr/local/include/freetype2/freetype -I/usr/local/mnogosearch/include
-I/opt/install/php-4.1.2/ext/mysql/libmysql
-I/opt/install/php-4.1.2/ext/xml/expat  -I/opt/install/php-4.1.2/TSRM -g
-O2  -c gd.c && touch gd.lo
gd.c: In function `zm_startup_gd':
gd.c:271: `gdArc' undeclared (first use in this function)
gd.c:271: (Each undeclared identifier is reported only once
gd.c:271: for each function it appears in.)
gd.c:272: `gdPie' undeclared (first use in this function)
gd.c:273: `gdChord' undeclared (first use in this function)
gd.c:274: `gdNoFill' undeclared (first use in this function)
gd.c:275: `gdEdged' undeclared (first use in this function)
gd.c: In function `zif_imagecreatetruecolor':
gd.c:556: warning: assignment makes pointer from integer without a cast
gd.c: In function `zif_imagecolorat':
gd.c:1594: structure has no member named `tpixels'
make[3]: *** [gd.lo] Error 1
make[3]: Leaving directory `/opt/install/php-4.1.2/ext/gd'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/install/php-4.1.2/ext/gd'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/install/php-4.1.2/ext'
make: *** [all-recursive] Error 1
[root@localhost php-4.1.2]#


The gdlib thats compiled is gd2.01 and is linked with freetype 2.0.5. It
might be worth to mention, if I try the same configure command on php
version 4.0.6 it "makes" fine.

I compared /ext/gd from the 4.1.2 and 4.0.6 and seems to be some
difference.

Does anyone know a soloution to this? Feel free to contact me if you
need more information to solve this.

Best regards,
 Eric


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




[PHP-DEV] Proposed new mail function "mailfx()"

2002-03-20 Thread Eric Dynamic

I've written another mail function to deal with one of our ISP clients' needs.
I don't know if the functionality is found elsewhere - nowhere in the documentation
that I have seen, though.

The standard mail function is

mail( to, subject, message, optional-headers )

The client had two issues. First is not a big deal, they had a file to send but mail()
wants a string for the body. A file can be read into a string, so that's not major, but
still it'd be nice to be able to read the content from a file, especially when the 
content
is large.
Second issue was more critical. We need for the user to coerce their identity for
sendmail using "-f", but there's no way to pass additional parameters to the mailer
with mail(). The php.ini is sitewide and the users need to submit different values for 
"-f".

I've written and done preliminary testing for a function

mailfx( to, subject, filename, optional-headers, optional-parameters )

where "mailfx" means "mail from file, extended".

The optional parameters are appended to the mailer path before the mailer is invoked,
so that allows "-f username" for sendmail. The length of the mailer path plus the
parameters is verified not to exceed the length of the buffer used to do this.
The optional headers are used as with mail().
The filename replaces the string. Now, the file is checked and opened (code ripped off
from ext/standard/file.c), and the contents are read in and written to the mailer.

The version I have works on Unix. I've left the relevant ifdef WIN32's in place for a
Windows person to complete the Windows version (since I won't assume parameters are
handled the same on Windows.) Hopefully not much work there.

Having the parameter version read a file and the normal version use a string is a 
little
awkward, maybe a better thing to do is make an extended function that provides a flag
to indicate if the source is a file or a string. Yet another argument... Anyway, this
thing works for me as an integral part of PHP4 - I used the code of php-4.0.3pl1 to do 
this.

Something like this would be generally useful. If PHP core team is interested, let me 
know
what I need to submit for review for possible inclusion.

-ecsd

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




Re: [PHP-DEV] Proposed new mail function "mailfx()"

2002-03-20 Thread Eric Dynamic

Markus Fischer wrote:
> 
> Current mail() implementation already has fifth optional
> argument which does exactly what you want.
> 
> And, for the 'file', it's as easy as writing:
> 
> mail('To', 'Subject', join('',file('filename')), ...
> 
> not that hard ...
> 
> I don't think another mail*() function whith no significat
> enhancements is a good idea.
> 
> - Markus

Okay. In the books and as of the last time I checked the online doc,
there was no 5th parameter. Since that's the primary purpose of the
new function, and since the input of a file versus a string is trivial,
scratch the new function.

-ecsd

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




[PHP-DEV] Process/Thread question

2002-04-05 Thread Eric Liedtke

Hello,
 I'm about 1 week past the reading of the php extensions section of the
manual and have been working on some ext stuff and had an
implementation type question. I did read the fairly recent thread on
threading support in php.Which I believe I grokked, however does php
being non-reentrant mean I can't use threading in an extension I write
for php? Let me give you an example of what I am trying to get at here.

Suppose I wanted to add and extension the creates a "service".
For example I wanted to create a "service" that pings a host 20 times
once every 10 minutes and saves the average ping time to a file. I also
want to be able to change aspects of this service while its running.
Like
the number of pings to use or the time between pings.I would also
want to be able to run multiple "copies" of this service that ping
different hosts.So I would obviously be exporting start and stop
functions for this "service". And possibly a single "control" function
that
supports changing all the aspects of the running service that I might
want to change.However, I am a little in the dark on what my options
are for spawning off a new process/thread that will continue working in
the background so the exported function can return in the script and go
on it's merry way. I'm hoping  a more experienced crowd might have
some suggestions for an implementation of this type. Any pointers to
more info, modules that do something similiar or suggestions would be
very welcome.

Eric Liedtke


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




Re: [PHP-DEV] Process/Thread question

2002-04-05 Thread Eric Liedtke



Daniel Lorch wrote:

> Hi,
>
> > Eric Liedtke <[EMAIL PROTECTED]>
> > [..] However, I am a little in the dark on what my options
> > are for spawning off a new process/thread that will continue working in
> > the background so the exported function can return in the script and go
> > on it's merry way. I'm hoping  a more experienced crowd might have
> > some suggestions for an implementation of this type. Any pointers to
> > more info, modules that do something similiar or suggestions would be
> > very welcome. [..]
>
> The most reasonable way of doing this is to write a *seperate* daemon
> which completes this task. Your PHP script would then connect to this
> daemon via an interface (sockets).
>

Thanks for the info. Just to clarify, for me, my daemon would have to be
started and stopped independently of php and would merely expose a
socket interface for control functionality? My ultimate goal was to wrap
libshout up and expose an integrated mp3 streamer into php and to build
a "personalized radio station" app around it. Everything that is out there has
so many pieces I was hoping to make it all available under php only, but I suppose
that will have to wait.I was looking to reproduce "Radio Free Pete" a Zope app,
so I wouldn't have to run an app server. Thanks again.

-eric

>
> There are "Process Control" Functions http://www.php.net/manual/en/ref.pcntl.php
> which would allow you to fork a new process, but it is
>
> 1. experimental
> 2. only available for CGI/CLI and not mod_php
>
> .. and overall not a good idea. Your script would anyway have to wait
> for the PINGs to complete - whether it's in a seperate process or not.
>
> daniel


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




[PHP-DEV] Sockets Question

2002-04-05 Thread Eric Liedtke

I'm new in town here, so to speak, so I'm not sure about
proper protocol here, but I found,what I feel is  a problem
in the socket extension code. Specifically in the socket_bind
function. I was working with a friends code and it was
trying to bind to port 80, however when I would check with
sockstat it was showing the process bound to a random port.
So I started poking around and found that if the addr argument,
(which by the way defaults to 0 in the code I was working with)
wasn't a valid name the bind function was set to fail because
the gethostbyname test would fail. I would propose that if
the sock_family is AF_INET the addr arg should be a valid
ip address and that a gethostbyname function be made
available to do name to ip conversion if a user needs it.
We already know we are binding an AF_INET family socket
by the case statement so all we should need to do is fill in the
address and the AF_INET into the sockaddr. I'd be happy
to provide an implementation, but wanted to see others
opinions before I did anything.

Eric Liedtke


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




Re: [PHP-DEV] Sockets Question

2002-04-06 Thread Eric Liedtke



Eric Liedtke wrote:

> I'm new in town here, so to speak, so I'm not sure about
> proper protocol here, but I found,what I feel is  a problem
> in the socket extension code. Specifically in the socket_bind
> function. I was working with a friends code and it was
> trying to bind to port 80, however when I would check with
> sockstat it was showing the process bound to a random port.
> So I started poking around and found that if the addr argument,
> (which by the way defaults to 0 in the code I was working with)
> wasn't a valid name the bind function was set to fail because
> the gethostbyname test would fail. I would propose that if
> the sock_family is AF_INET the addr arg should be a valid
> ip address and that a gethostbyname function be made
> available to do name to ip conversion if a user needs it.
> We already know we are binding an AF_INET family socket
> by the case statement so all we should need to do is fill in the
> address and the AF_INET into the sockaddr. I'd be happy
> to provide an implementation, but wanted to see others
> opinions before I did anything.
>
> Eric Liedtke
>
> --
> 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] Sockets Question

2002-04-06 Thread Eric Liedtke

Oops forgot the message body on the last one

Ok so after sleeping on it I don't think my solution was
totally in line with the beauty and simplicity of php, I
expect you should be able to pass either a hostname
or a valid ip in the addr arg. Anyway the other part
that confused me is that in the case of the gethostbyname
failure I would have thought that the inability to bind and
the PHP_SOCKET_ERROR and return FALSE should
have killed the sript, but somehow the script continued
and what's more confusing is that the system still manaed
to bind a random port? I'll through it some more..

-e

Eric Liedtke wrote:

> I'm new in town here, so to speak, so I'm not sure about
> proper protocol here, but I found,what I feel is  a problem
> in the socket extension code. Specifically in the socket_bind
> function. I was working with a friends code and it was
> trying to bind to port 80, however when I would check with
> sockstat it was showing the process bound to a random port.
> So I started poking around and found that if the addr argument,
> (which by the way defaults to 0 in the code I was working with)
> wasn't a valid name the bind function was set to fail because
> the gethostbyname test would fail. I would propose that if
> the sock_family is AF_INET the addr arg should be a valid
> ip address and that a gethostbyname function be made
> available to do name to ip conversion if a user needs it.
> We already know we are binding an AF_INET family socket
> by the case statement so all we should need to do is fill in the
> address and the AF_INET into the sockaddr. I'd be happy
> to provide an implementation, but wanted to see others
> opinions before I did anything.
>
> Eric Liedtke
>
> --
> 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] Sockets Question

2002-04-06 Thread Eric Liedtke

Uhhh nevermind. I just grabbed 4.2.0RC2 and found that
a slew of fixes have already been commited.

-e
Eric Liedtke wrote:

>Oops forgot the message body on the last one
>
>Ok so after sleeping on it I don't think my solution was
>totally in line with the beauty and simplicity of php, I
>expect you should be able to pass either a hostname
>or a valid ip in the addr arg. Anyway the other part
>that confused me is that in the case of the gethostbyname
>failure I would have thought that the inability to bind and
>the PHP_SOCKET_ERROR and return FALSE should
>have killed the sript, but somehow the script continued
>and what's more confusing is that the system still manaed
>to bind a random port? I'll through it some more..
>
>-e
>
>Eric Liedtke wrote:
>
>>I'm new in town here, so to speak, so I'm not sure about
>>proper protocol here, but I found,what I feel is  a problem
>>in the socket extension code. Specifically in the socket_bind
>>function. I was working with a friends code and it was
>>trying to bind to port 80, however when I would check with
>>sockstat it was showing the process bound to a random port.
>>So I started poking around and found that if the addr argument,
>>(which by the way defaults to 0 in the code I was working with)
>>wasn't a valid name the bind function was set to fail because
>>the gethostbyname test would fail. I would propose that if
>>the sock_family is AF_INET the addr arg should be a valid
>>ip address and that a gethostbyname function be made
>>available to do name to ip conversion if a user needs it.
>>We already know we are binding an AF_INET family socket
>>by the case statement so all we should need to do is fill in the
>>address and the AF_INET into the sockaddr. I'd be happy
>>to provide an implementation, but wanted to see others
>>opinions before I did anything.
>>
>>Eric Liedtke
>>
>>--
>>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] CVS Account Request: ekilfoil

2002-05-11 Thread Eric Kilfoil

I plan to develop and maintain PEAR packages, and Stig S. Bakken from the pear-dev 
mailing list said i need a PHP cvs account.  I assume i'll only need access to the 
/pear directory until pear's CVS is split from php.  I already have some modules at 
http://www.ypass.net/php, and I am planning on making the php-dns module pear 
compliant.  php-dns is a resolver library written in PHP which supports dynamic DNS 
updates.  It was ported from the Net::DNS PERL module.

Please let me know if you have any questions.

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




Re: [PHP-DEV] How do I access a hash from an extention/module?

2002-06-06 Thread Eric Veldhuyzen

On Thu, Jun 06, 2002 at 11:27:06AM +0200, Markus Fischer wrote:
> You can fech the zval * for _SESSION from the
> EG(symbol_table), e.g. something like this (untested):
> 
> zval **z_sess;
> if (zend_hash_find(&EG(symbol_table), "_SESSION", sizeof("_SESSION")-1, 
>(void**)&z_sess) == SUCCESS) {
> ...
> }

Well, this doesn't work. The _SESSION thing is something of another ext
module (the session module), and I haven't been able to access anything
from that directly.

But I have worked around that, I can simply check whether a variable is
registered in a session by calling the session_is_registered function
from the session module (by using the call_user_function_ex() function).
I don't think it is very pretty, but it works...

Normal variables can then be fetched by using this zend_hash_find()
function. But if it is an array or a hash the zend_hash_find function
fails. I've got no idea why.  And even if it would work I would still
have no clue about how the access the key/value pairs in this
array/hash.

It would be nice it there was some REAL documentation about the API...

-- 
#!perl #   Life ain't fair, but root passwords help.
# Eric Veldhuyzen  [EMAIL PROTECTED]
$!=$;=$_+(++$_);($:,$~,$/,$^,$*,$@)=$!=~   # Perl Monger
/.(.)...(.)(.)(.)..(.)..(.)/;`$^$~$/$: $^$*$@$~ $_>&$;`

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




Re: [PHP-DEV] How do I access a hash from an extention/module?

2002-06-06 Thread Eric Veldhuyzen

On Thu, Jun 06, 2002 at 03:45:08PM +0200, Markus Fischer wrote:
> On Thu, Jun 06, 2002 at 09:36:29AM -0400, fabwash wrote : 
> > > It would be nice it there was some REAL documentation about the API...
> > >
> > Amen to that!!!.. I spent exactely 5 1/2 hours yesterday trying to create a
> > resource that is a structure which contains a set of pointers to an array of
> > objects (yeah it's complicated but it's great when it works !), then later
> > retrieve the array, walk throught it, get the objects back from the hash,
> > and do something with them.
> > 
> > Works fine for now (although i'm sure i have major memory leaks for now
> > because i'm not sure how to deallocate and when to do it, when to add
> > references and remove references), but some documentation would have reduced
> > my research, trial and error, multiple compilations, tests, other source
> > reading, debugging time, etc..
> > 
> > I get great help from people here on specific issues, but i'd rather read
> > some documentation before asking stupid questions.
> 
> Actually, there is: http://www.php.net/manual/en/zend.php

I've read that. Multiple times. But it is hardly anything close to real
documentation. Claiming that this is real documentation is like explaining
how to write a 'hello world' program in C is real documateion about how
to write real programs in C. It is a nice primer, but nothing more than
that. It explains how to werite a VERY basic extention and then stops.

Not my idea of real documentation.

I would settle for a small summary of all the functions one might want
to call, with a short description of its function and the parameters it
acceepts. That would be terrific.

> I've seen quite a few people in the last months writing
> extenions and therefore they "know" how it is for a
> newcommer. Yet no one asked if he can help out with the
> documentation.

To write documentation you first have to know how it works. And I am
nowhere near that. I have written some code that seems to work, but
since none of tha parameters are described and there is hardly any
comment in de PHP source code it is very hard to be able to understand
how it all works.

-- 
#!perl #   Life ain't fair, but root passwords help.
# Eric Veldhuyzen  [EMAIL PROTECTED]
$!=$;=$_+(++$_);($:,$~,$/,$^,$*,$@)=$!=~   # Perl Monger
/.(.)...(.)(.)(.)..(.)..(.)/;`$^$~$/$: $^$*$@$~ $_>&$;`

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




Re: [PHP-DEV] How do I access a hash from an extention/module?

2002-06-06 Thread Eric Veldhuyzen

On Thu, Jun 06, 2002 at 09:36:29AM -0400, fabwash wrote:
> > It would be nice it there was some REAL documentation about the API...
> >
> Amen to that!!!.. I spent exactely 5 1/2 hours yesterday trying to create a
> resource that is a structure which contains a set of pointers to an array of
> objects (yeah it's complicated but it's great when it works !), then later
> retrieve the array, walk throught it, get the objects back from the hash,
> and do something with them.

Well, I think you might be able to help me then. I want to retrieve an
array and walk throught it. Should be pretty simple, right?

> I get great help from people here on specific issues, but i'd rather read
> some documentation before asking stupid questions.

Exactly.

-- 
#!perl #   Life ain't fair, but root passwords help.
# Eric Veldhuyzen  [EMAIL PROTECTED]
$!=$;=$_+(++$_);($:,$~,$/,$^,$*,$@)=$!=~   # Perl Monger
/.(.)...(.)(.)(.)..(.)..(.)/;`$^$~$/$: $^$*$@$~ $_>&$;`

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




[PHP-DEV] PHP 4.0 Bug #8655: Inactive Connections on Oracle

2001-01-11 Thread eric . poisse

From: [EMAIL PROTECTED]
Operating system: Linux RedHat 6.0 2.2.5-15smp
PHP version:  4.0.4
PHP Bug Type: OCI8 related
Bug description:  Inactive Connections on Oracle 

I use OCI function inside  PHP programs.
I can see inactive connections running on Oracle (select username, process, machine, 
status from v$session) when I use OCILogon (and OCIPlogon) even if I use OCILogoff.

The Version of Oracle is 8.1.5.0.2. (On the same server than Apache and PHP)
The Version of Apache is 1.3.9

PHP is compiled with the --enable-sigchild, --with-apache, --enable-track-vars, 
--enable-ftp  and --with-oci8 options.
Apache is compiled with --enable-module=most, -- activate-module=libphp4.a

Is it an Oracle or PHP problem ?


-- 
Edit Bug report at: http://bugs.php.net/?id=8655&edit=1



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #8655 Updated: Inactive Connections on Oracle

2001-01-11 Thread eric . poisse

ID: 8655
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: OCI8 related
Description: Inactive Connections on Oracle

Apache is working with 2 virtual hosts. I remember (but i'm
not sure) that I've not the problem when i have no virtual
hosts, ie only one server (no virtual).

Previous Comments:
---

[2001-01-11 11:01:28] [EMAIL PROTECTED]
I use OCI function inside  PHP programs.
I can see inactive connections running on Oracle (select username, process, machine, 
status from v$session) when I use OCILogon (and OCIPlogon) even if I use OCILogoff.

The Version of Oracle is 8.1.5.0.2. (On the same server than Apache and PHP)
The Version of Apache is 1.3.9

PHP is compiled with the --enable-sigchild, --with-apache, --enable-track-vars, 
--enable-ftp  and --with-oci8 options.
Apache is compiled with --enable-module=most, -- activate-module=libphp4.a

Is it an Oracle or PHP problem ?

---


Full Bug description available at: http://bugs.php.net/?id=8655


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #8655 Updated: Inactive Connections on Oracle

2001-01-12 Thread eric . poisse

ID: 8655
User Update by: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Bug Type: OCI8 related
Description: Inactive Connections on Oracle

It's not au BUG... Sorry. 
It's happend only with OCIPlogon. With OCILogon and OCILogoff (or not), it works very 
well.
I don't know the use of OCIPlogon, but it's not for what i've to do ...


Previous Comments:
---

[2001-01-11 14:44:03] [EMAIL PROTECTED]
Apache is working with 2 virtual hosts. I remember (but i'm
not sure) that I've not the problem when i have no virtual
hosts, ie only one server (no virtual).

---

[2001-01-11 11:01:28] [EMAIL PROTECTED]
I use OCI function inside  PHP programs.
I can see inactive connections running on Oracle (select username, process, machine, 
status from v$session) when I use OCILogon (and OCIPlogon) even if I use OCILogoff.

The Version of Oracle is 8.1.5.0.2. (On the same server than Apache and PHP)
The Version of Apache is 1.3.9

PHP is compiled with the --enable-sigchild, --with-apache, --enable-track-vars, 
--enable-ftp  and --with-oci8 options.
Apache is compiled with --enable-module=most, -- activate-module=libphp4.a

Is it an Oracle or PHP problem ?

---


Full Bug description available at: http://bugs.php.net/?id=8655


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]