Re: [PHP-DEV] Re: ob_get_level

2002-03-25 Thread Jan Lehnardt

Hi,
On Sun, 24 Mar 2002 19:29:07 -0500
Yasuo Ohgaki [EMAIL PROTECTED] wrote:

 I guess you are writing test scripts, right?
bingo ;)
 There are cases you need to consider.
 
 If you enable output_buffer
 ob_get_level() == 1
 
 If you enable zlib.output_compression
 ob_get_level() == 2
 
 If you enalbe zlib.output_compression and trans-sid is active
 ob_get_level() == 3
 
 ob_start() increment buffer level by 1.
 So if you are writing test script, you probably want to get diff
 of level before and after ob_start().

then PHP_4_2_0 is broken for this case.

My test script for this issue:
?php
echo ini_get('session.use_trans_sid');
echo ini_get('zlib.output_compression');
echo ob_get_level();
ob_start();
echo ob_get_level();
echo \n;
?

ini-settingsoutput
session.use_trans_sid = 0, zlib.output_compression = Off  -012
# right, the echo ini_get('zlib.output_compression'); does not output
anything

session.use_trans_sid = 1, zlib.output_compression = Off  -112   

session.use_trans_sid = 1, zlib.output_compression = On   -112   

session.use_trans_sid = 0, zlib.output_compression = On   -112   

I hope I don't miss something.

Jan
-- 
Q: Thank Jan? A: http://geschenke.an.dasmoped.net/

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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Kristian Köhntopp

Edin Kadribasic wrote:
 That's ok.  Calling function to set it should still work though.
 We should really get started on the IfModule .. 
 thing for php.ini.

Actually, no.

A SAPI version of PHP should get configuration values the way a
webserver does. It is running in the context of a webserver and
should be handling things as webbish as they come.

A CLI version of PHP is a kind of scripting shell at the same
level as awk, perl and other scripting languages are. It should
not behave webbish at all, but shelly instead. It should not
output a content type by default (automatic -q option), it should
read /etc/php.ini and $HOME/.php.ini.

Please get this right the first time you do it.

Kristian

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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Markus Fischer

On Mon, Mar 25, 2002 at 10:45:04AM +0100, Kristian Köhntopp wrote : 
 Edin Kadribasic wrote:
  That's ok.  Calling function to set it should still work though.
  We should really get started on the IfModule .. 
  thing for php.ini.
 
 Actually, no.
 
 A SAPI version of PHP should get configuration values the way a
 webserver does. It is running in the context of a webserver and
 should be handling things as webbish as they come.
 
 A CLI version of PHP is a kind of scripting shell at the same
 level as awk, perl and other scripting languages are. It should
 not behave webbish at all, but shelly instead. It should not
 output a content type by default (automatic -q option), it should
 read /etc/php.ini and $HOME/.php.ini.
 
 Please get this right the first time you do it.

Mindreader, you ;)

Actually, we're a bit late (and I complained that already in
other places). 4.2.0 is already half-way out of the door with
the CLI version and we don't have a proper setup for it yet.

And I fear people in charge don't think it's critical enough
to re-think the 4.2.0 release plan to get things done right
the first time.

- Markus

-- 
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc

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




Re: [PHP-DEV] Re: ob_get_level

2002-03-25 Thread Yasuo Ohgaki

Jan Lehnardt wrote:
 Hi,
 On Sun, 24 Mar 2002 19:29:07 -0500
 Yasuo Ohgaki [EMAIL PROTECTED] wrote:
 
 
I guess you are writing test scripts, right?
 
 bingo ;)
 
There are cases you need to consider.

If you enable output_buffer
ob_get_level() == 1

If you enable zlib.output_compression
ob_get_level() == 2

If you enalbe zlib.output_compression and trans-sid is active
ob_get_level() == 3

ob_start() increment buffer level by 1.
So if you are writing test script, you probably want to get diff
of level before and after ob_start().
 

trans sid buffer is registered at level 1.
This makes result wrong and trans sid does not work :(

IIRC, there is a bug report from user that trans sid
does not work when zlib.output compression is enabled.
(I forgot about the bug when I wrote previous mail)

So your result is right. PHP is not working right :)

--
Yasuo Ohgaki

 
 then PHP_4_2_0 is broken for this case.
 
 My test script for this issue:
 ?php
 echo ini_get('session.use_trans_sid');
 echo ini_get('zlib.output_compression');
 echo ob_get_level();
 ob_start();
 echo ob_get_level();
 echo \n;
 ?
 
 ini-settingsoutput
 session.use_trans_sid = 0, zlib.output_compression = Off  -012
 # right, the echo ini_get('zlib.output_compression'); does not output
 anything
 
 session.use_trans_sid = 1, zlib.output_compression = Off  -112   
 
 session.use_trans_sid = 1, zlib.output_compression = On   -112   
 
 session.use_trans_sid = 0, zlib.output_compression = On   -112   
 
 I hope I don't miss something.
 
 Jan



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




[PHP-DEV] Re: Bug #8744 Updated: call to header() causes CGI error

2002-03-25 Thread Yasuo Ohgaki

Comment to lists, since this is marked as Critical already.

According to multiple user bug reports, it seems this bug is
preventing saving session variables, when user redirect via.
header(). Apache/Linux users are reporting this.

This crash may be happening any OS/SAPI.

--
Yasuo Ohgaki


[EMAIL PROTECTED] wrote:
  ID:   8744
  Updated by:   [EMAIL PROTECTED]
  Reported By:  [EMAIL PROTECTED]
  Status:   Critical
  Bug Type: IIS related
  Operating System: Windows 2000
  PHP Version:  4.1.1
  New Comment:
 
 Hi to all,
 
 I have one Point to add. I use two copies of a WebSite on a Server
 running IIS (Test  Real). One of them dosn't have this Problem at all,
 but the Second one Produces this error. Both use the same Database
 Server. I compared the IIS Web Configuration, but both are the same! I
 can not find the error!
 
 Kiumars Ansari / Hamburg
 




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




Re: [PHP-DEV] Re: ob_get_level

2002-03-25 Thread Jan Lehnardt

Hi,
On Mon, 25 Mar 2002 05:02:38 -0500
Yasuo Ohgaki [EMAIL PROTECTED] wrote:

 trans sid buffer is registered at level 1.
even if session.use_trans_sid = 0 ?

 This makes result wrong and trans sid does not work :(
 
 IIRC, there is a bug report from user that trans sid
 does not work when zlib.output compression is enabled.
 (I forgot about the bug when I wrote previous mail)
from my tests zlib.output_compression does not affect the ob level at
all.
 
 So your result is right. PHP is not working right :)
what now? derick?

Jan
-- 
Q: Thank Jan? A: http://geschenke.an.dasmoped.net/

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




[PHP-DEV] Re: [PHP-QA] Re: Bug #8744 Updated: call to header() causes CGIerror

2002-03-25 Thread Sascha Schumann

On Mon, 25 Mar 2002, Yasuo Ohgaki wrote:

 Comment to lists, since this is marked as Critical already.

 According to multiple user bug reports, it seems this bug is
 preventing saving session variables, when user redirect via.
 header(). Apache/Linux users are reporting this.

The bug report already contains a plausible explanation for
that behaviour.

Have you verified/falsified it?

[18 Mar 5:15pm] [EMAIL PROTECTED]

I read your errors and found:

FATAL:  erealloc():  Unable to allocate 1043162510 bytes

this seems to me like a MSSQL-PHP issue which comes along with the use
of MSSQLs NTEXT and NVARCHAR Fields, after connecting to the
MSSQL-database you must launch a SQL statement which limits the
returning size fo this fields eg. 'SET TEXTSIZE 10'.

hope this helps

Gustav Graf

- Sascha Experience IRCG
  http://schumann.cx/http://schumann.cx/ircg


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




Re: [PHP-DEV] Session patch for ID created by handler

2002-03-25 Thread Derick Rethans

Mark,

On Sun, 24 Mar 2002 [EMAIL PROTECTED] wrote:

 I am submitting a patch that will enable a session handler to override the 
 default session id creation routine.

Looks ok to me!

regards,
Derick

-
PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED]
All your branches are belong to me!
   SRM: Script Running Machine - www.vl-srm.net
-





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




[PHP-DEV] Re: [PHP-QA] PHP Test results

2002-03-25 Thread Derick Rethans

Hello Rene,

Which version of Apache 2 are you using, and what is your configure line?

groeten,
Derick

On 24 Mar 2002 [EMAIL PROTECTED] wrote:

 array (
   'user_name' = 'Rene Aaij',
   'email' = '[EMAIL PROTECTED]',
   'package' = '4.2.0-RC1',
   'testcase' = '0',
   'status' = 'Fail',
   'os' = 'Linux i386',
   'sapi' = 'Apache 2.x DSO',
   'automake' = '14',
   'autoconf' = '252',
   'libtool' = '141',
   'bison' = '128',
   'openssl' = 'on',
   'pgsql' = 'on',
   'wddx' = 'on',
   'test' = 'Configure
 make',
   'problems' = 
'++
 | WARNING: Your /usr/beta/apache/bin/apxs script is most likely broken.
 ||
 | Please go read http://www.php.net/manual/en/faq.build.php#AEN61338 |
 | and make the changes described there and try again.|
 ++
 
 sapi_apache.c: In function `apache_php_module_main\':
 sapi_apache.c:81: `NOT_FOUND\' undeclared (first use in this function)
 sapi_apache.c:81: (Each undeclared identifier is reported only once
 sapi_apache.c:81: for each function it appears in.)
 mod_php4.c:78: parse error before `pool\'
 mod_php4.c:82: parse error before `pool\'
 mod_php4.c: In function `sapi_apache_header_handler\':
 mod_php4.c:206: warning: assignment makes pointer from integer without a cast
 mod_php4.c: In function `sapi_apache_register_server_variables\':
 mod_php4.c:240: `array_header\' undeclared (first use in this function)
 mod_php4.c:240: (Each undeclared identifier is reported only once
 -- more errors',
   'bugids' = '',
   'remarks' = '',
 )
 
 -- 
 PHP Quality Assurance Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Derick Rethans

-
PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED]
All your branches are belong to me!
   SRM: Script Running Machine - www.vl-srm.net
-



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




Re: [PHP-DEV] Re: ob_get_level

2002-03-25 Thread Yasuo Ohgaki

For ob_get_level test, it's okay to test if ob_start()
increments a nesting level by one. ob_get_level()
returns OG(nesting_level) basically.

At a moment, I don't have time to take a look
at what is really going on with trans sid and
zlib.output_compression.
You may need to use real web server SAPI.

Jan Lehnardt wrote:
 Hi,
 On Mon, 25 Mar 2002 05:02:38 -0500
 Yasuo Ohgaki [EMAIL PROTECTED] wrote:
 
 
trans sid buffer is registered at level 1.
 
 even if session.use_trans_sid = 0 ?

No. Session module registers buffer when trans sid
is active. session.use_trans_sid=1 does not mean
there is trans sid buffer.

 
 
This makes result wrong and trans sid does not work :(
 
  
 
IIRC, there is a bug report from user that trans sid
does not work when zlib.output compression is enabled.
(I forgot about the bug when I wrote previous mail)
 
 from my tests zlib.output_compression does not affect the ob level at
 all.

Did you try with web server SAPI? (i.e. other than CLI, CGI SAPI)
Anyway, if zlib.output_compression=On and ob_get_level() does not
return more than 2, otuput compression is not enabled.

--
Yasuo Ohgaki

  
 
So your result is right. PHP is not working right :)
 
 what now? derick?
 
 Jan



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




Re: [PHP-DEV] Re: ob_get_level

2002-03-25 Thread Jan Lehnardt

Hi,
On Mon, 25 Mar 2002 06:53:15 -0500
Yasuo Ohgaki [EMAIL PROTECTED] wrote:

  even if session.use_trans_sid = 0 ?
 
 No. Session module registers buffer when trans sid
 is active. session.use_trans_sid=1 does not mean
 there is trans sid buffer.
huh? session.use_trans_sid = 1 enables trans sid, so the session module
should register a buffer; for session.use_trans_sid = 0 it should not.
What am I missing?


 Did you try with web server SAPI? (i.e. other than CLI, CGI SAPI)
 Anyway, if zlib.output_compression=On and ob_get_level() does not
 return more than 2, otuput compression is not enabled.
not yet.

Jan
-- 
Q: Thank Jan? A: http://geschenke.an.dasmoped.net/

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




[PHP-DEV] Re: [PHP-QA] Re: Bug #8744 Updated: call to header() causes CGI

2002-03-25 Thread Yasuo Ohgaki

Sascha Schumann wrote:
 On Mon, 25 Mar 2002, Yasuo Ohgaki wrote:
 
 
Comment to lists, since this is marked as Critical already.

According to multiple user bug reports, it seems this bug is
preventing saving session variables, when user redirect via.
header(). Apache/Linux users are reporting this.
 
 
 The bug report already contains a plausible explanation for
 that behaviour.
 
 Have you verified/falsified it?

No. I've just seen enough complaints about not saving session vars with
redirection.

Currently, I have time to read/reply mails, but don't have look into
code/tests.

 
 [18 Mar 5:15pm] [EMAIL PROTECTED]
 
 I read your errors and found:
 
 FATAL:  erealloc():  Unable to allocate 1043162510 bytes

:)

--
Yasuo Ohgaki

 
 this seems to me like a MSSQL-PHP issue which comes along with the use
 of MSSQLs NTEXT and NVARCHAR Fields, after connecting to the
 MSSQL-database you must launch a SQL statement which limits the
 returning size fo this fields eg. 'SET TEXTSIZE 10'.
 
 hope this helps
 
 Gustav Graf
 
 - Sascha Experience IRCG
   http://schumann.cx/http://schumann.cx/ircg
 



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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread derick

On Mon, 25 Mar 2002, Markus Fischer wrote:

 Mindreader, you ;)
 
 Actually, we're a bit late (and I complained that already in
 other places). 4.2.0 is already half-way out of the door with
 the CLI version and we don't have a proper setup for it yet.
 
 And I fear people in charge don't think it's critical enough
 to re-think the 4.2.0 release plan to get things done right
 the first time.

I agree it should be done right the first time, but for me the release 
plan is fixed. ANother possibility is to take the CLI out of 4.2.0, but I 
think that will only cause more problems.

Derick

---
  PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


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




[PHP-DEV] Re: [PHP-QA] Re: PHP Test results

2002-03-25 Thread derick

On Mon, 25 Mar 2002, Yasuo Ohgaki wrote:

 It's available as PECL module. Look for it under
 
 http://cvs.php.net/cvs.php/pear/PECL
 
 Most extensions will be PECL modules in the future.

That's very nice, but doesn't help Windows users. I think we still should 
supply the PECLed extensions with a release.

Derick

---
  PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Markus Fischer

On Mon, Mar 25, 2002 at 12:56:21PM +0100, [EMAIL PROTECTED] wrote : 
 On Mon, 25 Mar 2002, Markus Fischer wrote:
 
  Mindreader, you ;)
  
  Actually, we're a bit late (and I complained that already in
  other places). 4.2.0 is already half-way out of the door with
  the CLI version and we don't have a proper setup for it yet.
  
  And I fear people in charge don't think it's critical enough
  to re-think the 4.2.0 release plan to get things done right
  the first time.
 
 I agree it should be done right the first time, but for me the release 
 plan is fixed. ANother possibility is to take the CLI out of 4.2.0, but I 
 think that will only cause more problems.

Actually, I think that would be a good idea to remove it. Do
not release something which is not completely well thought
and finished. People have lived without CLI for a while; they
can wait. But don't create another/new headache with some
broken system to which we have to be backwards compatible :/

- Markus

-- 
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc

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




[PHP-DEV] HELP ME PLEASE: php not run on IIS 4.0

2002-03-25 Thread Berlina

Hi,

Im trying to install PHP 4.1.2 under Windows 2000 Server and IIS 4.0

* If I configure PHP as a MODULE, all run but SESSIONS DON'T WORK
* If I configure PHP as a CGI, SESSIONS WORK but ORACLE MODULE for PHP not
load

Any ideas?
Anybody can help me?

Advanced thanks,
Berli

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




RE: [PHP-DEV] Resume of my problem

2002-03-25 Thread mlwmohawk

I am assuming that he is making a very simple example for something much 
larger, written in C. 

 erm, it would make more sense to use php:
 
 ?php
 
 $c = 1 + 2;
 
 print (Value C is $c);
 
 ?
 
 
 You need to make an extension. Look in the ext/ directory. Those are
 all  PHP extensions.
 
  HI,
  
  I have a functino write in c, like as:
  
  void addvalue ( int a, int b, int *c )
  {
*c = a + b;
  }
  
 in php
  
  ?
  
phpinclude (alexlib);
addvalue ( 1, 2, c );
print ( Value c = $c );
  
  ?
  
  what the procedure to make this ?
  
  
  
  
  -- 
  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 Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Re: [PHP-QA] Re: Bug #8744 Updated: call to header() causes CGI

2002-03-25 Thread Sascha Schumann

 No. I've just seen enough complaints about not saving session vars with
 redirection.

That's because people forget to embed SID into their URLs.
That does not happen automatically.

That issue is completely unrelated to this bug report.

- Sascha Experience IRCG
  http://schumann.cx/http://schumann.cx/ircg


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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Kristian Köhntopp

[EMAIL PROTECTED] wrote:
 ANother possibility is to take the CLI out of 4.2.0, 

+1 from me.

We have lived without the CLI for some time now. If we introduce
it, it should be done right (correct defaults, reading
preferences the right way).

Kristian

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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Marcus Börger

At 12:56 25.03.2002, [EMAIL PROTECTED] wrote:
On Mon, 25 Mar 2002, Markus Fischer wrote:

  Mindreader, you ;)
 
  Actually, we're a bit late (and I complained that already in
  other places). 4.2.0 is already half-way out of the door with
  the CLI version and we don't have a proper setup for it yet.
 
  And I fear people in charge don't think it's critical enough
  to re-think the 4.2.0 release plan to get things done right
  the first time.

I agree it should be done right the first time, but for me the release
plan is fixed. ANother possibility is to take the CLI out of 4.2.0, but I
think that will only cause more problems.

Derick

It seems that CLI does work but a lot of discussion about it's behaviour
has started right now (seems just now people start playing around with
it). So we should take the time until 4.3. For me especially both considered
ideas $HOME/.php.ini and ifModule are a must have.

marcus


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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Jan Lehnardt

Hi,
On Mon, 25 Mar 2002 12:56:21 +0100 (CET)
[EMAIL PROTECTED] wrote:

 
 I agree it should be done right the first time, but for me the release

 plan is fixed. ANother possibility is to take the CLI out of 4.2.0,
but I 
 think that will only cause more problems.
 
+1 for removing cli from 4.2. It is quite impossible to provide QA for
something that does not have a defined expected behaviour.

Jan
-- 
Q: Thank Jan? A: http://geschenke.an.dasmoped.net/

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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread php4

** Reply to note from Kristian =?iso-8859-1?Q?K=F6hntopp?= [EMAIL PROTECTED] Mon, 25 Mar 
2002 10:45:04 +0100


 A CLI version of PHP is a kind of scripting shell at the same level
 as awk, perl and other scripting languages are. It should not behave
 webbish at all, but shelly instead. 

 It should not output a content type by default (automatic -q option), 

+1

 it should read /etc/php.ini and $HOME/.php.ini.

+maxint


Of course if you specify a php.ini file location when you ./configure
that should override /etc/php.ini.


Rick
 

Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com

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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Wez Furlong

On 25/03/02, Kristian Köhntopp [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] wrote:
  ANother possibility is to take the CLI out of 4.2.0, 
 +1 from me.

+1 here too.
 
 We have lived without the CLI for some time now. If we introduce
 it, it should be done right (correct defaults, reading
 preferences the right way).

+1 also.
We can (and should) wait for it to be right before releasing/supporting it.

--Wez.



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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Edin Kadribasic

 [EMAIL PROTECTED] wrote:
  ANother possibility is to take the CLI out of 4.2.0,

 +1 from me.

 We have lived without the CLI for some time now. If we introduce
 it, it should be done right (correct defaults, reading
 preferences the right way).

I have to disagree with you guys here. We are, after all, past RC1 at this
point and doing a major surgery on php and its build and test systems is
irresponsible. I hate to say it, but there were plenty of opportunities to
bring up the issues with CLI in the past several months.

I could go the long way and repeat the motivatiom behind the creation of CLI
at this point, but instead I would like to recommend that we take
evolutionary approach. First make CLI a CGI without all the CGI garbage.
Always build it with PHP. (this is where we are now). The next step is
moving PHP in the direction of general purpose scripting language.

Edin


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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread derick

On Mon, 25 Mar 2002, Edin Kadribasic wrote:

 I have to disagree with you guys here. We are, after all, past RC1 at this
 point and doing a major surgery on php and its build and test systems is
 irresponsible.

A very big point, I totally agree with you on this. This is not an option 
after all.

 I hate to say it, but there were plenty of opportunities to
 bring up the issues with CLI in the past several months.
 
 I could go the long way and repeat the motivatiom behind the creation of CLI
 at this point, but instead I would like to recommend that we take
 evolutionary approach. First make CLI a CGI without all the CGI garbage.
 Always build it with PHP. (this is where we are now). The next step is
 moving PHP in the direction of general purpose scripting language.

And what if we disable the CLI by default for 4.2.0 and make a switch 
--enable-cli to enable building of the CLI. This makes it more clear that 
it's still experimental. In 4.3.0 we simply change the default to always 
build the CLI.

Derick

---
  PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


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




[PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Compile Failure

2002-03-25 Thread derick

On Sat, 23 Mar 2002, Edin Kadribasic wrote:

 You're testing with the latest cvs which is broken at the moment. Please
 test PHP_4_2_0 branch.
 
 Derick please revert read_uploaded_file patch... It's not needed, plus it
 broke the build.

hmmm, I already did that I think.

Derick

 
 Edin
 
 - Original Message -
 From: Andrew Lindeman [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Saturday, March 23, 2002 11:34 PM
 Subject: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Compile Failure
 
 
  I knew I forgot something while submitting this.
 
  I am running (Red Hat) Linux (7.2)
  gcc 2.96
 
  It has never failed like this before.  I have gotten some errors like this
  before, but it has never has it totally failed (like this).
 
  --Andrew
 
 
  On Saturday 23 March 2002 04:37 pm, [EMAIL PROTECTED] wrote:
   Hello,
  
   what platform are you on? I get this too while linking, but it doesn't
   fail.
  
   Derick
  
   On Sat, 23 Mar 2002, Andrew Lindeman wrote:
I'm getting these errors while compiling the latest CVS...
   
using
./configure --with-zlib --with-mysql --with-imap --with-kerberos
--with-imap-ssl --with-gd --with-crypt
   
--Andrew
   
   
   
 /usr/local/src/latestcvs/php4-200203231200/ext/standard/basic_functions.c
   : In function `zif_read_uploaded_file':
   
   
 /usr/local/src/latestcvs/php4-200203231200/ext/standard/basic_functions.c
   :23 80: warning: assignment makes pointer from integer without a cast
   
 /usr/local/src/latestcvs/php4-200203231200/ext/standard/var_unserializer.
   c: In function `php_var_unserialize':
   
   
 /usr/local/src/latestcvs/php4-200203231200/ext/standard/var_unserializer.
   c:3 00: warning: comparison is always false due to limited range of
 data
type /usr/local/src/latestcvs/php4-200203231200/main/streams.c:884:
warning: initialization from incompatible pointer type
   
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libc-client.a(osdep.o):
In function `ssl_onceonlyinit':
 /usr/src/build/51160-i386/BUILD/imap-2001a/c-client/osdep.c:286: the
 use
of `tmpnam' is dangerous, better use `mkstemp'
ext/mysql/libmysql/my_tempnam.o: In function `my_tempnam':
   
 /usr/local/src/latestcvs/php4-200203231200/ext/mysql/libmysql/my_tempnam.
   c:86
   
: the use of `tempnam' is dangerous, better use `mkstemp'
   
 ext/standard/basic_functions.o: In function `zif_read_uploaded_file':
   
   
 /usr/local/src/latestcvs/php4-200203231200/ext/standard/basic_functions.c
   :23 80: undefined reference to `php_fopen_wrapper' collect2: ld
 returned 1
exit status
make: *** [php] Error 1
make: [install-sapi] Error 1 (ignored)
cp: cannot stat `php': No such file or directory
make: *** [install-sapi] Error 1
   
--
When you finally buy enough memory, you will not have enough disk
 space.
-- Murphy's Computer Laws n°3
   
--
PHP Quality Assurance Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php
  
   ---
 PHP: Scripting the Web - [EMAIL PROTECTED]
   All your branches are belong to me!
   SRM: Script Running Machine - www.vl-srm.net
   ---
 
  --
  We come to bury DOS, not to praise it.
  (Paul Vojta, [EMAIL PROTECTED], paraphrasing a quote of Shakespeare)
 
  --
  PHP Quality Assurance Mailing List http://www.php.net/
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 

---
  PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


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




[PHP-DEV] Confused About Classes

2002-03-25 Thread arti

I do not understand why I am getting the error Undefined variable this in
this snippet of code (note for brevity I cut out a lot of code):

?php
class standardquestion
{
var $private;

function standardquestion($xmlfilename)
{

 $this-private=FALSE;

 skip some stuff here

}

function startElementHandler($parser, $name, $attribs)
{
 if ($name==private)
  $this-private = TRUE;

 if ($this-private==FALSE)  //  Undefined variable
this
  return;
}



As you can see, I initialize the variable as the first line in the
constructor.  But, why is this suddenly undefined?  I presume I'm doing
something stupid, but I am new to PHP and am missing something here.

Thanks,

-- Brian



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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Marcus Börger

At 15:30 25.03.2002, Edin Kadribasic wrote:
  [EMAIL PROTECTED] wrote:
   ANother possibility is to take the CLI out of 4.2.0,
 
  +1 from me.
 
  We have lived without the CLI for some time now. If we introduce
  it, it should be done right (correct defaults, reading
  preferences the right way).

I have to disagree with you guys here. We are, after all, past RC1 at this
point and doing a major surgery on php and its build and test systems is
irresponsible. I hate to say it, but there were plenty of opportunities to
bring up the issues with CLI in the past several months.

I could go the long way and repeat the motivatiom behind the creation of CLI
at this point, but instead I would like to recommend that we take
evolutionary approach. First make CLI a CGI without all the CGI garbage.
Always build it with PHP. (this is where we are now). The next step is
moving PHP in the direction of general purpose scripting language.

Edin

Ithink we all know this - but what you wrote *is* the reason to remove CLI
from 4.2 - we all seem unhappy with its current behaviour so why not wait
until we have made CLI that general purpose scripting language.

To derick as RM:

I think removing a feature is less a problem that adding but we are on RC1.
So it's up to you!

marcus



--
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] CLI max_execution_time

2002-03-25 Thread derick

On Mon, 25 Mar 2002, Marcus Börger wrote:

 Ithink we all know this - but what you wrote *is* the reason to remove CLI
 from 4.2 - we all seem unhappy with its current behaviour so why not wait
 until we have made CLI that general purpose scripting language.
 
 To derick as RM:
 
 I think removing a feature is less a problem that adding but we are on RC1.
 So it's up to you!

The CLI has too many roots into the build system. Removing it would be 
problematic. It's not an option to me.

Derick

---
  PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


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




RE: [PHP-DEV] question

2002-03-25 Thread Joseph Tate

a) Yes, if and only if memory has been allocated and you have to deallocate
it.  Otherwise a memory leak occurs.

b) No if a is not the case.

 -Original Message-
 From: Vergoz Michael (SYSDOOR) [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, March 24, 2002 6:00 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DEV] question


 look this code :

 char  buffer[MAXPATHLEN];
 char *p;

 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ) == FAILURE)
 return;

 if((p = VCWD_GETCWD(buffer, MAXPATHLEN)) == NULL) {
 POSIX_G(last_error) = errno;
 RETURN_FALSE;
 }

 RETURN_STRING(buffer, 1);

 in this code the char pointer 'p' is really needed ?

 michael


 --
 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] Unsigned Right Shift Sould there be a matching left shift?

2002-03-25 Thread Joseph Tate

-1 Even if it does make for consistency (which is debatable) anyone who uses
the  operator will also know that  is the same as  (one less
character to type too).

 -Original Message-
 From: Jason Greene [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, March 24, 2002 2:37 AM
 To: PHP-Dev
 Cc: Andi Gutmans
 Subject: [PHP-DEV] Unsigned Right Shift Sould there be a matching left
 shift?


 Hello everyone,

 Andi and I have been talking offline regarding my unsigned right shift
 operator patch. We have decided to implement this change in ZE2;
 however, there is one thing left to be resolved before the functionality
 can be added.

 Currently the Unsigned Right Shift patch implements 2 new operators:
   (Unsigned Shift)
 = (Unsigned Shift Assign)

 In my initial patch I did not include the equivalent left shift
 operators because sign only affects a right shift. However, this does
 introduce a consistency problem, and so the question is should we
 implement  and = and have them just be aliases to  and =?

 Thanks,
 -Jason





 --
 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] CLI max_execution_time

2002-03-25 Thread Jan Lehnardt

Hi,
On Mon, 25 Mar 2002 15:36:38 +0100 (CET)
[EMAIL PROTECTED] wrote:

 And what if we disable the CLI by default for 4.2.0 and make a switch 
 --enable-cli to enable building of the CLI. This makes it more clear
that 
 it's still experimental. In 4.3.0 we simply change the default to
always 
 build the CLI.
ok, then +1 on that. It seems to be a fair compromise.

Jan
-- 
Q: Thank Jan? A: http://geschenke.an.dasmoped.net/

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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Edin Kadribasic

 I could go the long way and repeat the motivatiom behind the creation of
CLI
 at this point, but instead I would like to recommend that we take
 evolutionary approach. First make CLI a CGI without all the CGI garbage.
 Always build it with PHP. (this is where we are now). The next step is
 moving PHP in the direction of general purpose scripting language.
 
 Edin

 Ithink we all know this - but what you wrote *is* the reason to remove CLI
 from 4.2 - we all seem unhappy with its current behaviour so why not wait
 until we have made CLI that general purpose scripting language.

You cannot make that happen overnight. Thus the evolutionary appoach. Do
you know that the changes to the build system so that stand alone php binary
was always built was added to PHP4 TODO list on April 28, 2000 (that's
before 4.0.0 was released)?

Edin


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




Re: [PHP-DEV] Confused About Classes

2002-03-25 Thread Markus Fischer

On Mon, Mar 25, 2002 at 09:59:12AM -0500, arti wrote : 
 I do not understand why I am getting the error Undefined variable this in
 this snippet of code (note for brevity I cut out a lot of code):
 
 ?php
 class standardquestion
 {
 var $private;
 
 function standardquestion($xmlfilename)
 {
 
  $this-private=FALSE;
 
  skip some stuff here
 
 }
 
 function startElementHandler($parser, $name, $attribs)
 {
  if ($name==private)
   $this-private = TRUE;
 
  if ($this-private==FALSE)  //  Undefined variable
 this
   return;
 }

You're missing the relevant which calls this method.


 As you can see, I initialize the variable as the first line in the
 constructor.  But, why is this suddenly undefined?  I presume I'm doing
 something stupid, but I am new to PHP and am missing something here.

For the future, such things should be targeted at
[EMAIL PROTECTED] ; NOT php-dev@

-- 
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc

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




[PHP-DEV] Disabling CLI for 4.2.0

2002-03-25 Thread Sascha Schumann

The CLI does not have many roots.. it might take literally
one or two changes to disable it generally in the 4.2.0
branch.

- Sascha Experience IRCG
  http://schumann.cx/http://schumann.cx/ircg


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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Markus Fischer

On Mon, Mar 25, 2002 at 04:20:13PM +0100, Jan Lehnardt wrote : 
 Hi,
 On Mon, 25 Mar 2002 15:36:38 +0100 (CET)
 [EMAIL PROTECTED] wrote:
 
  And what if we disable the CLI by default for 4.2.0 and make a switch 
  --enable-cli to enable building of the CLI. This makes it more clear
 that 
  it's still experimental. In 4.3.0 we simply change the default to
 always 
  build the CLI.
 ok, then +1 on that. It seems to be a fair compromise.

Then please (derick) put a big fat bold red flashing note
next to the configure line and say it's experifuckingmental .
. . :)

- Markus

-- 
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc

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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Jan Lehnardt

Hi,
On Mon, 25 Mar 2002 16:21:58 +0100
Edin Kadribasic [EMAIL PROTECTED] wrote:

 You cannot make that happen overnight. Thus the evolutionary
appoach. Do
 you know that the changes to the build system so that stand alone php
binary
 was always built was added to PHP4 TODO list on April 28, 2000 (that's
 before 4.0.0 was released)?

that does not allow us release unthought things as stable. I hope we can
agree on the --disable-cli approach for 4.2 and fully integrate CLI into
4.3.

Jan
-- 
Q: Thank Jan? A: http://geschenke.an.dasmoped.net/

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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Edin Kadribasic

  I have to disagree with you guys here. We are, after all, past RC1 at
this
  point and doing a major surgery on php and its build and test systems is
  irresponsible.

 A very big point, I totally agree with you on this. This is not an option
 after all.

  I hate to say it, but there were plenty of opportunities to
  bring up the issues with CLI in the past several months.
 
  I could go the long way and repeat the motivatiom behind the creation of
CLI
  at this point, but instead I would like to recommend that we take
  evolutionary approach. First make CLI a CGI without all the CGI garbage.
  Always build it with PHP. (this is where we are now). The next step is
  moving PHP in the direction of general purpose scripting language.

 And what if we disable the CLI by default for 4.2.0 and make a switch
 --enable-cli to enable building of the CLI. This makes it more clear that
 it's still experimental. In 4.3.0 we simply change the default to always
 build the CLI.

I still think that people need to adjust to some major changes CLI brings
(not chdiring into the scripts directory, etc.)...

But... if you insist.

Disabling it is not good due to the test suite, etc. Instead:

1. Mark it experimental.
2. Change make install not to install it.
3. Change make install on cgi to install it in {BINDIR}/php as it used to.

In that way people will not notice its presence, and even if they do its
marked experimental. The changes we need to make to the build system are
minimal.

Edin



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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Edin Kadribasic


 that does not allow us release unthought things as stable. I hope we can
 agree on the --disable-cli approach for 4.2 and fully integrate CLI into
 4.3.

Is it unstable? I was under the impression that we're talking about feature
set.

Edin


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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Edin Kadribasic

   that does not allow us release unthought things as stable. I hope we
 can
   agree on the --disable-cli approach for 4.2 and fully integrate CLI
 into
   4.3.
 
  Is it unstable? I was under the impression that we're talking about
 feature
  set.
 here: stable as in we have some kind of agenda what CLI does in certain
 cases. We don't have this right now, so I call it unstable. That
 regards to the changes that need to be made to make a
 real-shell-application out of CLI, not to CLI in general.

Well I had an agenda for the first release of CLI and the current
implementation fullfills that agenda. Nobody objected to it until today.
Therefore I assumed that it was accepted.

Edin



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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Markus Fischer

On Mon, Mar 25, 2002 at 04:54:08PM +0100, Edin Kadribasic wrote : 
that does not allow us release unthought things as stable. I hope we
  can
agree on the --disable-cli approach for 4.2 and fully integrate CLI
  into
4.3.
  
   Is it unstable? I was under the impression that we're talking about
  feature
   set.
  here: stable as in we have some kind of agenda what CLI does in certain
  cases. We don't have this right now, so I call it unstable. That
  regards to the changes that need to be made to make a
  real-shell-application out of CLI, not to CLI in general.
 
 Well I had an agenda for the first release of CLI and the current
 implementation fullfills that agenda. Nobody objected to it until today.
 Therefore I assumed that it was accepted.

The inconsistency was just yet discovered. Free working
volunteers do not have time when you finish somethin for
testing. No response/objections doesn't mean everything is
fine ;-)

Anyway, I hope you can fix the issue witht he maximum
execution time properly.

- Markus

-- 
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc

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




Re: [PHP-DEV] Advice on design issues (long)...

2002-03-25 Thread l0t3k


John Lim [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 I have always wondered, how do you pronounce L0t3k?
actually low-tech. most days i dream of woodworking g

 Seriously, if you are duplicating Metabase's effort, but in C,
 why not work with the Manuel Lemos then? This will fix any speed issues
 that Metabase has, and you will get his feedback.
the DB abstraction problem is a much larger one, which Manuel (and yourself)
have been struggling against with serious handicaps. for instance, one of
the reasons Manuel had to put so much work into Metabase is that the
original extension writers did not provide metadata which is readily
available from the database itself, or the metadata supplied is inconsistent
across back-ends.

the current database extensions were written as needed, so there was no
over-arching and unifiying design.
im attempting to consolidate and refactor the code in the existing
extensions into a framework which makes driver development much easier and a
lot more flexible. the upshot is that features can be implemented in the
core that
are immediately available across DB backends (like disconnected resultsets,
resultset serialization, and XML import/export which is nearly done).  in
addition, features like connection management can be handled consistently
across supported backends.

 Many db abstraction classes I have seen are skewed towards
mysql/postgresql,
 so prove to be useless when migrating to mssql or oracle.
ive done quite a lot of legwork on this, and i think i have a framework
which accomodates everything from MySQL to Oracle. i did MySQL first because
1) the API is simple 2) i needed to quickly write a driver to test some
basic design decisions (navigation and bulk-fetching).

Manuel really
 knows a lot about databases and can teach everyone a lot about these
issues.

 Or if you or anyone else would like to port ADOdb to a C extension,
 let me know.
i actually wrote to Manuel about this last summer, but he was (justifiably)
skeptical about the doability of the project and the prospects of its
adoption, given its scope and the fact that most people were comfortably
either using the base extensions, or something like Metabase, PEAR or ADODB.
instead of long discussions, i decided to wait until i had something
tangible to demonstrate. im very near to that point right now.

note that i dont think that Metabase or ADOdb will necessarily go away if
this extension works out. there are things that you and Manuel do that i
think belong in user-space and not in an extension. for instance your
sequence emulation code modifies the DB schema, which crosses the line of an
access layer. also Manuel's schema abstraction and transformation is another
example. i only really care at this point about data and metadata acess
abstraction. what it means though, is that your PHP code will be
considerably smaller and faster ( i think i can eliminate the need for at
least 65% of Metabase's code).

l0t3k



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




Re: [PHP-DEV] Advice on design issues (long)...

2002-03-25 Thread l0t3k


Lukas Smith [EMAIL PROTECTED] wrote in message
008a01c1d2fb$952b4630$4d00a8c0@vandal">news:008a01c1d2fb$952b4630$4d00a8c0@vandal...

 There is currently an effort underway to merge Metabase with PEAR DB.
 I have just commited the first code into the pear cvs (package is called
 MDB for now). The merge is still not complete. But the idea was that
 this merged DB abstraction layer could down the road be ported to C ...
 the sooner the better.
ive downloaded alreay. i keep track of development of PEAR::DB, Metabase and
ADOdb.


 In terms of how to abstract things, its quite obvious that Metabase is
 very far ahead (is there even something similar in other languages?). So
 I guess Metabase, or MDB when its ready, will be the best place to turn
 to if you seek this knowledge for a C Extension.
the abstraction work is primarily done, the blob spec is the main thing
pending. the hard part now is producing a set of test drivers.

 Anyways if you are interested then you may want to join the discussion
 on this new package. All discussion goes to the binarycloud, metabase
 and pear-dev mailinglists, since there is no dedicated mailinglist for
 this project, but all of the above the mailinglists are participating.
im an active lurker on the binarycloud and metabase lists. i throw my $0.02
in periodically.

l0t3k




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




[PHP-DEV] Re: Bug #16265: Multiply-defined functions in classes not reported

2002-03-25 Thread Derick Rethans

Hello,

the attched patch fixes this for me, but I'm sure it will impact a lot of 
other things. Andi, can you shed some light on it?

Derick

On 25 Mar 2002 [EMAIL PROTECTED] wrote:

 From: [EMAIL PROTECTED]
 Operating system: Linux
 PHP version:  4.1.2
 PHP Bug Type: Scripting Engine problem
 Bug description:  Multiply-defined functions in classes not reported
 
 PHP does not report multiply-defined errors for class member functions. For
 example, the following script below, when executed, only outputs two,
 with no errors.
 
 Instead, PHP should be giving error messages since the function bar has
 been defined multiple times.
 
 ?
 class foo
 {
 function bar() {echo one\n;}
 function bar() {echo two\n;}
 }
 
 $f = new foo();
 $f-bar();
 -- 
 Edit bug report at http://bugs.php.net/?id=16265edit=1
 -- 
 Fixed in CVS:http://bugs.php.net/fix.php?id=16265r=fixedcvs
 Fixed in release:http://bugs.php.net/fix.php?id=16265r=alreadyfixed
 Need backtrace:  http://bugs.php.net/fix.php?id=16265r=needtrace
 Try newer version:   http://bugs.php.net/fix.php?id=16265r=oldversion
 Not developer issue: http://bugs.php.net/fix.php?id=16265r=support
 Expected behavior:   http://bugs.php.net/fix.php?id=16265r=notwrong
 Not enough info: http://bugs.php.net/fix.php?id=16265r=notenoughinfo
 Submitted twice: http://bugs.php.net/fix.php?id=16265r=submittedtwice
 


Index: Zend/zend_compile.c
===
RCS file: /repository/Zend/zend_compile.c,v
retrieving revision 1.225
diff -u -r1.225 zend_compile.c
--- Zend/zend_compile.c 14 Feb 2002 03:55:20 -  1.225
+++ Zend/zend_compile.c 25 Mar 2002 19:13:17 -
@@ -732,7 +732,9 @@
op_array.return_reference = return_reference;
 
if (is_method) {
-   zend_hash_update(CG(active_class_entry)-function_table, name, 
name_len+1, op_array, sizeof(zend_op_array), (void **) CG(active_op_array));
+   if (zend_hash_add(CG(active_class_entry)-function_table, name, 
+name_len+1, op_array, sizeof(zend_op_array), (void **) CG(active_op_array)) == 
+FAILURE) {
+   zend_error(E_ERROR, Cannot redeclare %s(), name);
+   }
} else {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
 


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


Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread J Smith


I'd kind of agree with this. I use both the apache SAPI module and the CLI 
side by side in a single system (the web server does it's thing, and the 
CLI powers the search engine, which the web server can use on a per-request 
basis and ties the two together with XML/XSLT). One of the problems I had 
when playing around with PHP-4.2.0dev (I believe, it might have been 
4.3dev) was that the CLI was built by default, yet I use very different set 
ups for the apache module and the CLI module. There are a lot of extensions 
that aren't shared between the two, and it basically meant compiling the 
CLI twice -- once when I built the apache module and again to get the CLI 
executable I needed. 

I'd also like to see that automatic -q header hiding and, as has been 
discussed before, a separation of the web server's php.ini file and the 
CLI's, as I always have trouble with the two. (For instance, in the apache 
module, I always have output buffering set to something liek 4K, but on the 
CLI, I don't want output buffering at all. Little things like that.)

My opinion, for all it's worth.

J


Markus Fischer wrote:
 
 Actually, I think that would be a good idea to remove it. Do
 not release something which is not completely well thought
 and finished. People have lived without CLI for a while; they
 can wait. But don't create another/new headache with some
 broken system to which we have to be backwards compatible :/
 
 - Markus
 



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




[PHP-DEV] Re: Bug #16265: Multiply-defined functions in classes not reported

2002-03-25 Thread Andi Gutmans

Looks like a good fix to me. I'd just change the error message to  Cannot 
redeclare method %s()
The patch can go into Engine 1 and 2.

Andi

At 20:10 25/03/2002 +0100, Derick Rethans wrote:
Hello,

the attched patch fixes this for me, but I'm sure it will impact a lot of
other things. Andi, can you shed some light on it?

Derick

On 25 Mar 2002 [EMAIL PROTECTED] wrote:

  From: [EMAIL PROTECTED]
  Operating system: Linux
  PHP version:  4.1.2
  PHP Bug Type: Scripting Engine problem
  Bug description:  Multiply-defined functions in classes not reported
 
  PHP does not report multiply-defined errors for class member functions. For
  example, the following script below, when executed, only outputs two,
  with no errors.
 
  Instead, PHP should be giving error messages since the function bar has
  been defined multiple times.
 
  ?
  class foo
  {
  function bar() {echo one\n;}
  function bar() {echo two\n;}
  }
 
  $f = new foo();
  $f-bar();
  --
  Edit bug report at http://bugs.php.net/?id=16265edit=1
  --
  Fixed in CVS:http://bugs.php.net/fix.php?id=16265r=fixedcvs
  Fixed in release:http://bugs.php.net/fix.php?id=16265r=alreadyfixed
  Need backtrace:  http://bugs.php.net/fix.php?id=16265r=needtrace
  Try newer version:   http://bugs.php.net/fix.php?id=16265r=oldversion
  Not developer issue: http://bugs.php.net/fix.php?id=16265r=support
  Expected behavior:   http://bugs.php.net/fix.php?id=16265r=notwrong
  Not enough info: http://bugs.php.net/fix.php?id=16265r=notenoughinfo
  Submitted twice: http://bugs.php.net/fix.php?id=16265r=submittedtwice
 


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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Edin Kadribasic

 I'd kind of agree with this. I use both the apache SAPI module and the CLI
 side by side in a single system (the web server does it's thing, and the
 CLI powers the search engine, which the web server can use on a
per-request
 basis and ties the two together with XML/XSLT). One of the problems I had
 when playing around with PHP-4.2.0dev (I believe, it might have been
 4.3dev) was that the CLI was built by default, yet I use very different
set
 ups for the apache module and the CLI module. There are a lot of
extensions
 that aren't shared between the two, and it basically meant compiling the
 CLI twice -- once when I built the apache module and again to get the CLI
 executable I needed.

 I'd also like to see that automatic -q header hiding and, as has been
 discussed before, a separation of the web server's php.ini file and the
 CLI's, as I always have trouble with the two. (For instance, in the apache
 module, I always have output buffering set to something liek 4K, but on
the
 CLI, I don't want output buffering at all. Little things like that.)

Are you sure you were testing it with CLI? Header hiding (-q) has been in
there since the first check-in back in Jan 6.

If you have sufficiently different setups, there is no way but to configure
and compile PHP twice. Building of CLI creates no big overhead (just two c
files and one extra link step).

Yes, there was a discussion about separating php.ini file for cli
(php-cli.ini). At the end most people said that their configurations were
sufficiently similar and that the content of those two files would be mostly
the same. Derick promised to implement some sort of IfModule ...
mechanism, but I guess he was busy with other things.

Edin


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




[PHP-DEV] RE: [PHP-QA] PHP Test results

2002-03-25 Thread derick

Hello Ian,

I encountered the same thing here very weird (from PHPMyAdmin):

Error

MySQL said:

Host 'localhost.localdomain' is not allowed to connect to this MySQL 
server


I would very appreciate it if you could find what is exactly going wrong 
with MySQL here. I also wonder what is different from php 4.1.x with this.
Can you also please file a bug report for this?

Derick



On Tue, 26 Mar 2002, Ian Metcalfe wrote:

 Hi Derick,
 
 Here's a snippet from when I try to fireup MyAdmin 2.1.0 using 4.2.0rc1.
 ACID 0.9.6b11 suffers a similar fate.
 
 
 
 Warning: Host 'localhost.localdomain' is not allowed to connect to this
 MySQL server in /var/www/html/admin/phpMyAdmin/lib.inc.php on line 255
 
 Warning: MySQL Connection Failed: Host 'localhost.localdomain' is not
 allowed to connect to this MySQL server in /var/www/html/admin/phpMyAdmin/
 lib.inc.php on line 255
 Error
 
 MySQL said: Host 'localhost.localdomain' is not allowed to connect to this
 MySQL server
 
 
 
 I believe in prior versions, it passes 'localhost' rather than
 'localhost.localdomain'?
 
 Ian
 
 
 -Original Message-
 From: Derick Rethans [mailto:[EMAIL PROTECTED]]
 Sent: Monday, 25 March 2002 02:45
 To: [EMAIL PROTECTED]
 Cc: PHP Quality Assurance Team Mailing List
 Subject: Re: [PHP-QA] PHP Test results
 
 
 Hello Ian,
 
 what error do you get when you try to connect?
 
 Derick
 
 On 22 Mar 2002 [EMAIL PROTECTED] wrote:
 
  array (
'user_name' = 'Ian Metcalfe',
'email' = '[EMAIL PROTECTED]',
'package' = '4.2.0-RC1',
'testcase' = '0',
'status' = 'Good',
'os' = 'Linux i386',
'sapi' = 'Apache 1.3.x DSO',
'automake' = '14',
'autoconf' = '213',
'libtool' = '140',
'bison' = '128',
'db' = 'on',
'dba' = 'on',
'dbase' = 'on',
'gd' = 'on',
'imap' = 'on',
'mysql' = 'on',
'xml' = 'on',
'zip' = 'on',
'zlib' = 'on',
'test' = '',
'problems' = 'Unable to connect to mysql database with code that
 continues to work fine with v4.1.1
  ',
'bugids' = '',
'remarks' = '',
  )
 
  --
  PHP Quality Assurance Mailing List http://www.php.net/
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 Derick Rethans
 
 -
 PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED]
 All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
 -
 
 

---
  PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread derick

On Mon, 25 Mar 2002, Edin Kadribasic wrote:

 Are you sure you were testing it with CLI? Header hiding (-q) has been in
 there since the first check-in back in Jan 6.
 
 If you have sufficiently different setups, there is no way but to configure
 and compile PHP twice. Building of CLI creates no big overhead (just two c
 files and one extra link step).
 
 Yes, there was a discussion about separating php.ini file for cli
 (php-cli.ini). At the end most people said that their configurations were
 sufficiently similar and that the content of those two files would be mostly
 the same. Derick promised to implement some sort of IfModule ...
 mechanism, but I guess he was busy with other things.

I can't rememberr I promised it :) but I looked into it. It's not at all 
that simple I'm afraid :(

Derick


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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread Edin Kadribasic

 I can't rememberr I promised it :) but I looked into it. It's not at all
 that simple I'm afraid :(

Let me refresh you memory then:

http://groups.google.com/groups?hl=enth=1a4afc1bc6afa8a4seekm=Pine.LNX.4.3
3.0202281357200.522-10%40kossu.office.jdimedia.nlframe=off

Edin


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




[PHP-DEV] RE: [PHP-QA] PHP Test results

2002-03-25 Thread derick

On Tue, 26 Mar 2002, Ian Metcalfe wrote:

 Sure... this evening as after work I'll do just that. :)
 
 I did a bit of grepping and diffing, and while there are some changes
 relating to added support for unix sockets and specifying ports in the PEAR
 code, nothing leaps out as the culprit.
 
 I'll spend some more time on it tonight if I get that chance, and let you
 know if I come up with anything.

Cool and good luck!

Derick

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, 26 March 2002 07:45
 To: Ian Metcalfe
 Cc: PHP Quality Assurance Team Mailing List; [EMAIL PROTECTED]; PHP
 Developers Mailing List
 Subject: RE: [PHP-QA] PHP Test results
 
 
 Hello Ian,
 
 I encountered the same thing here very weird (from PHPMyAdmin):
 
 Error
 
 MySQL said:
 
 Host 'localhost.localdomain' is not allowed to connect to this MySQL
 server
 
 
 I would very appreciate it if you could find what is exactly going wrong
 with MySQL here. I also wonder what is different from php 4.1.x with this.
 Can you also please file a bug report for this?
 
 Derick
 
 
 
 On Tue, 26 Mar 2002, Ian Metcalfe wrote:
 
  Hi Derick,
 
  Here's a snippet from when I try to fireup MyAdmin 2.1.0 using 4.2.0rc1.
  ACID 0.9.6b11 suffers a similar fate.
 
  
 
  Warning: Host 'localhost.localdomain' is not allowed to connect to this
  MySQL server in /var/www/html/admin/phpMyAdmin/lib.inc.php on line 255
 
  Warning: MySQL Connection Failed: Host 'localhost.localdomain' is not
  allowed to connect to this MySQL server in /var/www/html/admin/phpMyAdmin/
  lib.inc.php on line 255
  Error
 
  MySQL said: Host 'localhost.localdomain' is not allowed to connect to this
  MySQL server
 
  
 
  I believe in prior versions, it passes 'localhost' rather than
  'localhost.localdomain'?
 
  Ian
 
 
  -Original Message-
  From: Derick Rethans [mailto:[EMAIL PROTECTED]]
  Sent: Monday, 25 March 2002 02:45
  To: [EMAIL PROTECTED]
  Cc: PHP Quality Assurance Team Mailing List
  Subject: Re: [PHP-QA] PHP Test results
 
 
  Hello Ian,
 
  what error do you get when you try to connect?
 
  Derick
 
  On 22 Mar 2002 [EMAIL PROTECTED] wrote:
 
   array (
 'user_name' = 'Ian Metcalfe',
 'email' = '[EMAIL PROTECTED]',
 'package' = '4.2.0-RC1',
 'testcase' = '0',
 'status' = 'Good',
 'os' = 'Linux i386',
 'sapi' = 'Apache 1.3.x DSO',
 'automake' = '14',
 'autoconf' = '213',
 'libtool' = '140',
 'bison' = '128',
 'db' = 'on',
 'dba' = 'on',
 'dbase' = 'on',
 'gd' = 'on',
 'imap' = 'on',
 'mysql' = 'on',
 'xml' = 'on',
 'zip' = 'on',
 'zlib' = 'on',
 'test' = '',
 'problems' = 'Unable to connect to mysql database with code that
  continues to work fine with v4.1.1
   ',
 'bugids' = '',
 'remarks' = '',
   )
  
   --
   PHP Quality Assurance Mailing List http://www.php.net/
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
  Derick Rethans
 
  -
  PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED]
  All your branches are belong to me!
 SRM: Script Running Machine - www.vl-srm.net
  -
 
 
 
 ---
   PHP: Scripting the Web - [EMAIL PROTECTED]
 All your branches are belong to me!
 SRM: Script Running Machine - www.vl-srm.net
 ---
 
 

---
  PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


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




[PHP-DEV] openssl_get_privatekey ignores passphrase

2002-03-25 Thread James Blast

Hi,

hope this question has not been answered too often, but search is
offline :(

I have a problem with openssl_get_privatekey. Im trying to generate an
private-key, writing it encrypted to disk and using it later to decrypt
a secret message.
The functions works without a password like a charm, but if I'm trying
to read the private key with a password nothing seems to work. 
In a browser I get errors fprom openssl_open because it has no valid
key-resource (how without a password .. works as designed) and with the
cgi-verion on command-line, the openssl callback pops up and prompts me
for a password. If I enter there the passphrase the message gets
decrypted. 
I'm going nuts on this ... resource openssl_get_privatekey ( mixed key
[, string passphrase]) ist not that complicated :(

Here're some code-snippets (very simple, just inteded to verifiy basic
functionality)

Generating the key :
---snip---
$passphrase = banana;
$privkey = openssl_pkey_new($dn);
openssl_pkey_export_to_file($privkey, /tmp/banana/pkey1.pem,
$passphrase);
---snip---

Loading the key and decoding something
---snip---
$passphrase = banana;
$fp = fopen(/tmp/banana/pkey1.pem, r);
$pkey = fread($fp, 8192);
fclose($fp);
$key = openssl_get_privatekey($pkey,$passphrase);
...
openssl_open($sealed,$open,$ekey,$key);
---snip---

Output on command-line :

vincent:/w3/data/ssltest# php decrypt.php 
X-Powered-By: PHP/4.3.0-dev
Content-type: text/html; charset=iso-8859-15

Enter PEM pass phrase:

Used versions :

php4-200203240600
openssl-0.9.6c
openssl-0.9.7-stable-SNAP-20020324
apache_1.3.24

Also tries gcc-2.95.4 and gcc-3.0.4 with and without -O3
compile-arguments ... nothing :(

Any Ideas Folks ?


TIA  Greetz

James





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




Re: [PHP-DEV] CLI max_execution_time

2002-03-25 Thread J Smith


You're right about the -q thing, I didn't notice it the first time. (I kind 
of just run -q now without thinking about it.)

It's not a big thing to do the separate compiles, so it's no worry. Just a 
little annoyance, but I'll live. 

This isn't a big issue or anything, sort of a nice-to-have. But if I'm in 
the minority for wanting this, that's fine, I'll live.

J


Edin Kadribasic wrote:

 
 Are you sure you were testing it with CLI? Header hiding (-q) has been in
 there since the first check-in back in Jan 6.
 
 If you have sufficiently different setups, there is no way but to
 configure and compile PHP twice. Building of CLI creates no big overhead
 (just two c files and one extra link step).
 
 Yes, there was a discussion about separating php.ini file for cli
 (php-cli.ini). At the end most people said that their configurations were
 sufficiently similar and that the content of those two files would be
 mostly the same. Derick promised to implement some sort of IfModule ...
 mechanism, but I guess he was busy with other things.
 
 Edin


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




Re: [PHP-DEV] Re: ob_get_level

2002-03-25 Thread Yasuo Ohgaki

Jan Lehnardt wrote:
 Hi,
 On Mon, 25 Mar 2002 06:53:15 -0500
 Yasuo Ohgaki [EMAIL PROTECTED] wrote:
 
 
even if session.use_trans_sid = 0 ?

No. Session module registers buffer when trans sid
is active. session.use_trans_sid=1 does not mean
there is trans sid buffer.
 
 huh? session.use_trans_sid = 1 enables trans sid, so the session module
 should register a buffer; for session.use_trans_sid = 0 it should not.
 What am I missing?

trans sid = 1 means use trans sid buffer when it is needed.

For instance,
trans sid = 1 and usec cookie = 1, browser support it? no buffer
trans sid = 1, but not --enable-trans-sid, no buffer.

 
 
 
Did you try with web server SAPI? (i.e. other than CLI, CGI SAPI)
Anyway, if zlib.output_compression=On and ob_get_level() does not
return more than 2, otuput compression is not enabled.
 
 not yet.
 
 Jan

You should. You need content negotiation to zlib.output compress
to register buffers :)

--
Yasuo Ohgaki



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




[PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: ob_get_level

2002-03-25 Thread derick

On Mon, 25 Mar 2002, Yasuo Ohgaki wrote:

 Jan Lehnardt wrote:
  Hi,
  On Mon, 25 Mar 2002 06:53:15 -0500
  Yasuo Ohgaki [EMAIL PROTECTED] wrote:
  
  
 even if session.use_trans_sid = 0 ?
 
 No. Session module registers buffer when trans sid
 is active. session.use_trans_sid=1 does not mean
 there is trans sid buffer.
  
  huh? session.use_trans_sid = 1 enables trans sid, so the session module
  should register a buffer; for session.use_trans_sid = 0 it should not.
  What am I missing?
 
 trans sid = 1 means use trans sid buffer when it is needed.
 
 For instance,
 trans sid = 1 and usec cookie = 1, browser support it? no buffer
 trans sid = 1, but not --enable-trans-sid, no buffer.

Now in English? (sorry, but I couldn't understand this :)

Derick

---
  PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


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




[PHP-DEV] CVS Account Request: phallstrom

2002-03-25 Thread Philip Hallstrom

Need to maintain the application database on gtk.php.net.  Andrei Zmievski asked that 
I request an account.

Thanks.

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




[PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: ob_get_level

2002-03-25 Thread Yasuo Ohgaki

[EMAIL PROTECTED] wrote:
 On Mon, 25 Mar 2002, Yasuo Ohgaki wrote:
 
 
Jan Lehnardt wrote:

Hi,
On Mon, 25 Mar 2002 06:53:15 -0500
Yasuo Ohgaki [EMAIL PROTECTED] wrote:



even if session.use_trans_sid = 0 ?

No. Session module registers buffer when trans sid
is active. session.use_trans_sid=1 does not mean
there is trans sid buffer.

huh? session.use_trans_sid = 1 enables trans sid, so the session module
should register a buffer; for session.use_trans_sid = 0 it should not.
What am I missing?

trans sid = 1 means use trans sid buffer when it is needed.

For instance,
trans sid = 1 and use cookie = 1, browser support it? no buffer
trans sid = 1, but not --enable-trans-sid, no buffer.
 
 
 Now in English? (sorry, but I couldn't understand this :)
 

:) I mean,

Even if trans_sid = 1, it does not mean there is trans_sid buffer when
use_cookie = 1 and browser supports cookie, or PHP is not compiled with
--enable-trans-sid, for example. (Second one is likey)

--
Yasuo Ohgaki


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




[PHP-DEV] Re: [PHP-QA] Re: PHP Test results

2002-03-25 Thread Yasuo Ohgaki

[EMAIL PROTECTED] wrote:
 On Mon, 25 Mar 2002, Yasuo Ohgaki wrote:
 
 
It's available as PECL module. Look for it under

http://cvs.php.net/cvs.php/pear/PECL

Most extensions will be PECL modules in the future.
 
 
 That's very nice, but doesn't help Windows users. I think we still should 
 supply the PECLed extensions with a release.
 

Good idea. +1.

--
Yasuo Ohgaki


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




Re: [PHP-DEV] openssl_get_privatekey ignores passphrase

2002-03-25 Thread Wez Furlong

Hi James,

No, this question has never been asked not answered AFAICT.
You are correct: the passphrase _is_ being ignored; I'll
fix it in CVS; the fix should also make it into PHP 4.2 (but RC2,
not the current one).

Thanks for reporting this problem: I have had virtually no feedback
on the newer functions in the openssl extension (perhaps because the
docs are not all that great right now).

BTW: some of the alternative methods of getting the key might work
for your current build, so you could try something like this:

$passphrase = banana;
$key = openssl_pkey_get_private(
   array(
  file:///tmp/banana/pkey1.pem,
  $passphrase
   )
);

which saves you the fopen() call.
openssl_pkey_get_private is the preferred name for the function;
openssl_get_privatekey is a backwards compatible alias.

--Wez.


On 26/03/02, James Blast [EMAIL PROTECTED] wrote:
 Hi,
 
 hope this question has not been answered too often, but search is
 offline :(
 
 I have a problem with openssl_get_privatekey. Im trying to generate an
 private-key, writing it encrypted to disk and using it later to decrypt
 a secret message.
 The functions works without a password like a charm, but if I'm trying
 to read the private key with a password nothing seems to work. 
 In a browser I get errors fprom openssl_open because it has no valid
 key-resource (how without a password .. works as designed) and with the
 cgi-verion on command-line, the openssl callback pops up and prompts me
 for a password. If I enter there the passphrase the message gets
 decrypted. 
 I'm going nuts on this ... resource openssl_get_privatekey ( mixed key
 [, string passphrase]) ist not that complicated :(
 
 Here're some code-snippets (very simple, just inteded to verifiy basic
 functionality)
 
 Generating the key :
 ---snip---
 $passphrase = banana;
 $privkey = openssl_pkey_new($dn);
 openssl_pkey_export_to_file($privkey, /tmp/banana/pkey1.pem,
 $passphrase);
 ---snip---
 
 Loading the key and decoding something
 ---snip---
 $passphrase = banana;
 $fp = fopen(/tmp/banana/pkey1.pem, r);
 $pkey = fread($fp, 8192);
 fclose($fp);
 $key = openssl_get_privatekey($pkey,$passphrase);
 ...
 openssl_open($sealed,$open,$ekey,$key);
 ---snip---
 
 Output on command-line :
 
 vincent:/w3/data/ssltest# php decrypt.php 
 X-Powered-By: PHP/4.3.0-dev
 Content-type: text/html; charset=iso-8859-15
 
 Enter PEM pass phrase:
 
 Used versions :
 
 php4-200203240600
 openssl-0.9.6c
 openssl-0.9.7-stable-SNAP-20020324
 apache_1.3.24
 
 Also tries gcc-2.95.4 and gcc-3.0.4 with and without -O3
 compile-arguments ... nothing :(
 
 Any Ideas Folks ?
 
 
 TIA  Greetz
 
 James
 
 
 
 
 
 -- 
 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] Crypto++ extension alpha release

2002-03-25 Thread J Smith


I've finally gotten the Crypto++ extension I've been working on up to the 
point where I think a release is warranted. At least, an alpha release.

The Crypto++ extension provides a number of cryptographic algorithms, 
including some 27 block cipher algorithms and 13 hash algorithms. At this 
point, you can pretty easily encrypt and decrypt text using a variety of 
block cipher modes along with a bunch of other options, as well as hash and 
validate hashed text.

I'm considering this alpha-quality right now, as I'm the only one who's 
tested it, and I'd like some others to start looking at it and telling me 
what they think. It's coded mostly in C++ with some C to talk to PHP. It's 
not an overly complex extension, but it works pretty well. Out of 360-some 
tests (taken from the Crypto++ validation suite), only 8 fail, and I 
already know why. (Not sure if I'm going to bother fixing it, though.)

Anyways, to try out the extension, head to http://209.202.82.229/software. 
To view the extension's manual, head to 
http://209.202.82.229/software/cryptopp/. To download the extension 
directly, try 
http://209.202.82.229/software/download.php/cryptopp-php-0.0.1.tar.gz. 

So far, I've only tested the extension on Linux (2.4.9 kernel using gcc/g++ 
2.96 and on Solaris 8 using gcc/g++ 2.95). It should work on Windows, but I 
haven't tested it yet. (If anybody gets it working on win32, please let me 
know.)

J

p.s. Derick -- what's the word on that abstracted crypto API you mentioned a 
while back? I'm still interested.

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




[PHP-DEV] RE: [PHP-DB] ODBC -- Setting ApplicationID

2002-03-25 Thread Andrew Hill

Bruce,

It looks like you were on the right track initially, the problem is that PHP
has a major bug - odbc_setoption is coded specific to ODBC statement handle
(connection id), which means that trying to use odbc_setoption the way you
want attempts to set a SQLSetConnectOption AFTER the connection is open -
which is bogus and will give you ODBC function sequence errors.

On the other hand, the error message you were getting is a bit misleading;
we are fixing that now.

So... you can unfortunately not do this via Application ID, but since you
are using the OpenLink Rules Book, you can still affect Session-based
connection management with any of the other connection criteria:

Here is one way to do it:
--
Setup your session attributes by configuring the Session Rules Book Aliases
section of the Multi-Tier OpenLink Admin Assistant.
(http://servername:8000).

You can configure session rules for any combination of Domain, Database,
User, Operating System, Client Machine, Client Application, etc., and can
control any connection options at the server side based on the session.

Using Database as an example, add a Database Alias with a new database
name and configure a session mapping rule to point to the original database
name, but change the connection attributes from Read / Write to Read
Only in the options for the  connection session.

On the PHP side, simply choose between two DSN's in the odbc.ini - one is
the normal DSN, with default settings, and one will have an alternate
database name, name_readonly or somesuch, that will cause the oplrqb to
instantiate the appropriate connection attributes.

If you run into problems, you should probably open a support case at
http://www.openlinksw.com/support/suppindx.htm, as this is getting somewhat
off-topic for PHP.

Hope this helps!

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access  Data Integration Technology Providers





I was thinking of using the usernames, but as people come and go, that might
mean messing around with the oplrqb.ini file too much.  I'd really like to
do
this based on application.  What variable do I pass with the PHP script?
( I'm
not sure what you mean ).  Can I use a variable in PHP that passes the
application name to the server?

Thanks,

Bruce

Andrew Hill wrote:

 Hi Bruce,

 The setoption error is being thrown because you cannot use
 SQLSetConnectOption that way.
 Passing arbitrary info to be used by your application isn't really what
this
 is for, but instead can be used to modify parameters in the ODBC API.

 This means you can modify things like SQL_ACCESS_MODE, SQL_AUTOCOMMIT,
 SQL_ODBC_CURSORS, etc., (check the 2.x spec - there are several metadata
 items that you can control with this API call.)

 I'd recommend you just pass a variable to your PHP script, and perhaps
 change the username to a read-only/read-write user with  a case statement
or
 somesuch, based on the application.

 Again, I'd strongly recommend you upgrade the OpenLink UDA version as
well;
 1.5 is something like 5 years old or more.

 Best regards,
 Andrew Hill
 Director of Technology Evangelism
 http://www.openlinksw.com/virtuoso/whatis.htm
 OpenLink Virtuoso Internet Data Integration Server

  -Original Message-
  From: Bruce S. Garlock [mailto:[EMAIL PROTECTED]]
  Sent: Monday, March 25, 2002 10:48 AM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] ODBC -- Setting ApplicationID
 
 
  Sure, I'm simply trying to have PHP pass an ApplicationID to the
  ODBC server.
  When a PHP script access the ODBC database, it does not set the
  application:
 
  10:46:04   connectopts= user=webuser opsys=unix machine=linux
application=
 
  As you can see, application= is NULL.  I would like the script to pass
  something, so that my mapping rules on the server would allow
  write access to
  the db, if the PHP application sends a certain name.  Currently our
Win32
  applications, like MS Access, send application names.  e.g. Access,
sends:
  application=MSACCESS.
 
  Thanks for your help,
 
  Bruce
 
  Andrew Hill wrote:
 
   Bruce,
  
   I'm not sure what you are trying to do - could you clarify?
   You may be able to simply use the OpenLink Rules Book to set
role-based
   authentication on domain, ip, application, etc.
  
   Also, the ODBC Driver version (1.5) you are using is _very_ old and
   unsupported.
   I suggest you upgrade to 4.2
  
   Best regards,
   Andrew Hill
   Director of Technology Evangelism
   OpenLink Software  http://www.openlinksw.com
   Universal Data Access  Data Integration Technology Providers
  
-Original Message-
From: Bruce S. Garlock [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 11:02 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] ODBC -- Setting ApplicationID
   
   
I am trying to set the ApplicationID, when connecting to an ODBC
datasource.  I have tried:
   
odbc_setoption 

[PHP-DEV] File Upload

2002-03-25 Thread David McInnis

I wrote s script to upload a file.  The script works, but when I point
my browser to the file it downloads, but I can no longer open the file
in MS Word.  What is happening to my file?  My client is Windows and the
server is Linux.

David McInnis




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




Re: [PHP-DEV] Crypto++ extension alpha release

2002-03-25 Thread derick

On Mon, 25 Mar 2002, J Smith wrote:

 p.s. Derick -- what's the word on that abstracted crypto API you mentioned a 
 while back? I'm still interested.

I've been too busy with QA and the RCs, but I'm certainly planning to make 
a general encryption extension for PHP5.

Derick

---
  PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


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