[PHP-DEV] CVS Account Request: guang

2002-04-08 Thread guang_chen_us

I try to learn some more php from you.

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




[PHP-DEV] PHP_4_2_0 Win32

2002-04-08 Thread Edin Kadribasic

Hi Sebastian,

Could you please change back the name of cgi executable from php-cgi.exe to
php.exe in the PHP_4_2_0 branch? This in order to synchronize with the Unix
build where it was decided to hide the cli version. I would do it myself but
I don't feel confident messing with win32 build system. If you cannot make
it in time for RC3 I would give it a try.

Edin


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




[PHP-DEV] Re: [PHP-CVS] cvs: php4 /ext/mysql/libmysql strto.c strtoll.c strtoull.c

2002-04-08 Thread Sebastian Bergmann

Andi Gutmans wrote:
 andiSun Apr  7 16:49:10 2002 EDT

 Modified files:
   /php4/ext/mysql/libmysqlstrto.c strtoll.c strtoull.c
 Log:
 - Fix build with Visual Studio .NET. The MySQL team said they'll commit
 - their fix a long time ago and never did. One day they'll update the
 - whole MySQL client library.

  MFH?

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

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

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




[PHP-DEV] Re: aggregate() und overload()

2002-04-08 Thread Kristian Köhntopp

Andrei Zmievski wrote:
 Please expound on this. I would like to hear specific 
 problems you see existing with __get_x() callbacks.

As of now, this is just an unspecified bad feeling of mine.
I only can back up this with the two times we had special names
which were variable in PHP: Both attempts at them failed
horribly:

- We had (have, until ZE 2, if I am not mistaken) variable
  named constructors (ctors named after the class). These 
had a number of design flaws in PHP 3, which were fixed in
PHP 4, at the cost of an overly complex ruleset for 
constructor names.

Had we chosen stable names for constructors, we'd gotten the
same effect with a single rule for ctor names.

- We had (until very recently) variable names for imported
  variables amidst our global namespace. We earned a number
of security problems due to admittedly stupid code, which
swayed the PTBs to finally disable registering globals by
default.

I cannot come up with a bomb script right now, but I am
reasonably sure that __get_x() will backfire at some time
as well.

Kristian

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




[PHP-DEV] PATH_INFO doesn't work

2002-04-08 Thread Thomas Hommel

hi
I've got a problem with the PATH_INFO environment variable on various
servers.
If I try to call a script named 'info.php' the following way
'/info.php/xyz', the PATH_INFO variable should contain 'xyz', right?
But it doesn't work in all cases. Seems like it's OK on servers with PHP
compiled as Apache module. But if PHP is installed as CGI, on some
servers it works, but in most cases I get an Error 500 or an Error 404.
Can anybody tell me the reason for this behaviour? Perhaps a
configuration issue?

Thanks
Tom


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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Stig S. Bakken

On Mon, 2002-04-08 at 02:50, brad lafountain wrote:
 
 --- Stig S. Bakken [EMAIL PROTECTED] wrote:
  On Sun, 2002-04-07 at 20:35, brad lafountain wrote:
   
What would be wrong with having the *_SQL_* objects be a member of the
   *_Connection* classes?
  
  What you're describing here is object aggregation.
 
 What do you mean... Im saying that the SQL implementation is a member or the
 connection class.. Nothing to do with aggergation. aggergation would mean the
 methods of the sql imp would be apart of the connection class not a member.
 
 Im still not convinced that aggergation is usefull.

Object aggregation in general is a technique where you have some
functionality in objects you forward calls to, a pretty common
technique.  You can of course do that in PHP today, but it's slow (lots
of userland method calls) and high on maintenance (if an aggregated
class gets a new method, you must make a new wrapper in the forwarding
class, etc).  In my opinion, providing native support for this in an
efficient way makes a lot of sense for PHP.

 - Stig


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




[PHP-DEV] Re: cvs: php4 /main main.c

2002-04-08 Thread Yasuo Ohgaki

Jani Taskinen wrote:
 sniperMon Apr  8 03:58:47 2002 EDT
 
   Modified files:  
 /php4/mainmain.c 
   Log:
   upload_max_filesize can only be set in php.ini

There should be a NEWS entry, too.
There may be some bug reports for this change,
especially from hosting service users.

--
Yasuo Ohgaki





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




Re: [PHP-DEV] Re: cvs: php4 /main main.c

2002-04-08 Thread derick

On Mon, 8 Apr 2002, Yasuo Ohgaki wrote:

 Jani Taskinen wrote:
  sniper  Mon Apr  8 03:58:47 2002 EDT
  
Modified files:  
  /php4/main  main.c 
Log:
upload_max_filesize can only be set in php.ini
 
 There should be a NEWS entry, too.
 There may be some bug reports for this change,
 especially from hosting service users.

I dont think that's needed... it did never work anyways. It makes little 
sense to set it after the script received the upload uploads are even 
received before the script is compiled.

regards,

Derick

---
 Did I help you? Consider a gift:
  http://www.amazon.co.uk/exec/obidos/registry/SLCB276UZU8B
---
  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: CVS Account Request: guang

2002-04-08 Thread Yasuo Ohgaki

Guang_chen_us wrote:
 I try to learn some more php from you.

You don't need CVS account to learn :)

--
Yasuo Ohgaki


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




Re: [PHP-DEV] Re: cvs: php4 /main main.c

2002-04-08 Thread Yasuo Ohgaki

[EMAIL PROTECTED] wrote:
 On Mon, 8 Apr 2002, Yasuo Ohgaki wrote:
 
 
Jani Taskinen wrote:

sniper   Mon Apr  8 03:58:47 2002 EDT

  Modified files:  
/php4/main   main.c 
  Log:
  upload_max_filesize can only be set in php.ini

There should be a NEWS entry, too.
There may be some bug reports for this change,
especially from hosting service users.
 
 
 I dont think that's needed... it did never work anyways. It makes little 
 sense to set it after the script received the upload uploads are even 
 received before the script is compiled.
 
 regards,
 
 Derick

Ah. Ok if it didn't work, no need to mention :)

I know file should be recieved fist. It's not the
point for upload_max_filesize, I suppose.

What about per dir setting?
It didn't work, also?

--
Yasuo Ohgaki


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




[PHP-DEV] declaring arrays.

2002-04-08 Thread Vasoczki Ferenc

Hi!

I am new on this list, and i have no big experiences in php.
Now i am writing a script, what is counting some records in 5 MySQL table.

Like:

1st table: i will have  some date format string: 2000-11, and 2001-05
2nd table: 2000-11
3rd table: 2001-05, 2002-03

etc..

i need to collect all the different dates.
I thought i will collect them into an array.

How can i declare an array dinamically ?

/If this question could be better on another list, please write me/

I also tried to search in the archive, but i confused there...

Thx

Vaso

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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Kristian Köhntopp

brad lafountain wrote:
 Unless someone could give me a real reason that 
 aggerate is better than MI.

Aggregation does at runtime what MI does at compile time.
Delaying the decision to do something is usually an enable for
specific applications. 

Examples are the signal/slot  mechanism based call-models  in
Gnome and Qt vs. virtual function tables in C++. The decision
which implementation for a method is being called is delayed to
the actual point in time when a call is being made, enabling a
much more flexible component model and much better reuse.

The cost for doing things late is worse typechecking, errors are
potentially caught only at call-time, not at compile-time (with
Qt, it probably is link-time, due to the way it is implemented).

The same goes with aggregation. Aggregation allows me to write a
class Soaping, which implements a SOAP RPC Client and a
SOAPFactory class, which manufactures objects of any class and
aggregates Soaping into them:

I could include_once() any unknown class, create an instance
and use PHPs introspective functions to create a list of 
functions and instance variables in this class. By adding 
Soaping functionality to the class, and with the help of 
getters, setters and wrappers provided by overload(), I 
can intercept all accesses to this instance, turn them into
SOAP calls to some remote instance of that object, and
marshall the results back into my application.

The beauty of this is, that I can do this at run-time, and that I
can do this generically with any old class, using two miniscule
additions to the system, aggregate() and overload(). Yet for the
user this is probably transparent.

 Class definition is defined at design time not run time!

No, it isn't. Unless you are stuck with C++.

PHP is for rapid prototyping. That may turn into rabid
prototyping (SCNR the pun) if you do not know how to use it, but
it may also be an extremely powerful tool as I have shown. 

Generally speaking, it allows you to design metaclasses and
metasystems, which add some general function to the language
itself.

Kristian

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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Kristian Köhntopp

Stig S. Bakken wrote:
 Example set of classes using aggregate to customize at runtime:
 
 DB_Connection  generic connection object
 DB_Connection_odbc layer interfacing to PHP's odbc functions
 DB_Connection_oracle   ditto for Oracle
 DB_Connection_mysqlditto for MySQL
 DB_SQL_oracle  SQL portability layer for Oracle
 DB_SQL_mysql   ditto for MySQL
 
 If the user requests a connection to an Oracle database, 
 the connect function returns an instance of DB_Connection 
 that has aggregated DB_Connection_oracle and DB_SQL_oracle.
 
 But if the user requests a connection to Oracle through ODBC, the
 connect function returns an instance of DB_Connection that has
 aggregated DB_Connection_odbc.  After connecting to the database,
 DB_Connection_odbc detects that it is used against Oracle and 
 aggregates DB_SQL_oracle.

You can do all this almost the same way you have shown using MI
and a factory object. You would premix your classes to get a
static (determined at compile time) mix, and have the factory
return the appropriately mixed class.

That's why I was using a generic RPC proxy and a Soaping mixin in
my example. In my example the actual classes being mixed are not
fixed, and are in fact not known until include_once() time
(runtime). Aggegration allows you to mix functionality into
existing classes dynamically, include_once() allows you to load
code dynamically. Thus, any attempt to solve this at compiletime
is doomed.

Generally speaking it is about class and type. A type describes
what an object can do, it's signature. The signature is a canonic
serialization of all its instance variable names and function
signatures. A class is where the object got these instance
variables and functions from.

In languages where class == type, functionality is either
inherited or locally defined. But there are languages where
functionality is not restricted to these sources but may be
provided in other ways. Aggregation is one way to get
functionality besides inheriance, and makes PHP a language where
class != type, if desired.

Traditionally, PHP always was class != type when it came to
instance variables. $this-$b was a valid construct for any $b
containing a valid variable name (and many invalid ones as well).
Traditionally PHP also was limited in how it could aquire
functions in objects, so it was class == type for functions of an
object. Aggregate fixed that by providing the missing API.

Stig's first attempt at aggregate() broke serialization and thus
sessions, because serialze() assumes that is enough to note the
class of an object in order to describe its type. That assumption
had always been false, but there was no API to break it. For
instance variables, serialize() always recorded the type, but for
methods it recorded the class as a reasonable shortcut.

In fact we could keep Stig's first version of aggregate(), if
serialize() recorded the type of an object for its methods, too.
It would have to write a log that describes how the object
aquired its functionality in order to recreate that upon
deserialization() (in PHPLIB terms, change

$o = new Class;
# aggregate($o, anotherClass);

$o-slot = 17;

so that the aggregate statement is recorded and generated in the
session data)

It is only because of the uglyness of this approach that Stig
revised his implementation of aggregate() so that it does not
break the (actually false) assumption of serialize() that class
== type for methods.

Kristian

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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Yasuo Ohgaki

Kristian Köhntopp wrote:
 brad lafountain wrote:
 
Unless someone could give me a real reason that 
aggerate is better than MI.
 
 
 Aggregation does at runtime what MI does at compile time.
 Delaying the decision to do something is usually an enable for
 specific applications. 

I agree. It would be useful some application.

Brad,
Having aggregate will affects MI support at script engine
level?

If it affects or may affect, we are better to make it a
experimental at least. We don't have to limit ourself
at this point, right?

--
Yasuo Ohgaki

 
 Examples are the signal/slot  mechanism based call-models  in
 Gnome and Qt vs. virtual function tables in C++. The decision
 which implementation for a method is being called is delayed to
 the actual point in time when a call is being made, enabling a
 much more flexible component model and much better reuse.
 
 The cost for doing things late is worse typechecking, errors are
 potentially caught only at call-time, not at compile-time (with
 Qt, it probably is link-time, due to the way it is implemented).
 
 The same goes with aggregation. Aggregation allows me to write a
 class Soaping, which implements a SOAP RPC Client and a
 SOAPFactory class, which manufactures objects of any class and
 aggregates Soaping into them:
 
 I could include_once() any unknown class, create an instance
 and use PHPs introspective functions to create a list of 
 functions and instance variables in this class. By adding 
 Soaping functionality to the class, and with the help of 
 getters, setters and wrappers provided by overload(), I 
 can intercept all accesses to this instance, turn them into
 SOAP calls to some remote instance of that object, and
 marshall the results back into my application.
 
 The beauty of this is, that I can do this at run-time, and that I
 can do this generically with any old class, using two miniscule
 additions to the system, aggregate() and overload(). Yet for the
 user this is probably transparent.
 
 
Class definition is defined at design time not run time!
 
 
 No, it isn't. Unless you are stuck with C++.
 
 PHP is for rapid prototyping. That may turn into rabid
 prototyping (SCNR the pun) if you do not know how to use it, but
 it may also be an extremely powerful tool as I have shown. 
 
 Generally speaking, it allows you to design metaclasses and
 metasystems, which add some general function to the language
 itself.
 
 Kristian
 




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




Re: [PHP-DEV] classes, instances objects in ZE2

2002-04-08 Thread Kristian Köhntopp

Marcus Börger wrote:
 - we have private, what about final, public, protected and
 abstract (can we remove/hide a method from an object)?

Do we in ZE2? What use it is?

In my book, private is only of very limited use, because there
always must be a way around it. 

Introducing private (in C++) immediately called for the
introduction of protected and friend, with protected being a
mechanism to break privacy along the lines of the inheritance
hierarchy and friend being a mechanism to break privacy across
inheritance hierarchies, at compile time.

Since PHP does many things at run time which C++ does at compile
time, there must be a mechanism to break privacy at run time,
which makes it pretty pointless to have private variables in the
first place.

I'd rather go for a warning that is being triggered whenever I
access $a-_slot, but not when I access $this-_slot (Access to
private object member). I could suppress this warning by writing
$a-_slot as $a-_slot instead.

Providing stronger privacy would only force the addition of even
more syntactic candy (such as a get_private($o, $slot) and
set_private($o, $slot)). Functions to break privacy are needed 
in order to write Metafunctionality such as a serialization
agent, or a RPC proxy like the Soaping mixin class I introduced
in another mail to this list.

 - do we allow to reduce visability (replace protected by
 private as long as we don't have it):
   class A {
 public function f()..
   }
   class B extends A {
 protected function f()...
   }

Same reasoning as above. Make it a warning, do not delve into BD
language realms. PHP does things at run time, because we are in
the rapid prototyping area and flexibility comes before compile
type checking and static bindings. And anyway, class != type in
PHP.

Kristian

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




Re: [PHP-DEV] declaring arrays.

2002-04-08 Thread Jan Lehnardt

Hi,
On Mon, 8 Apr 2002 13:55:38 +0200 
Vasoczki Ferenc [EMAIL PROTECTED] wrote:

 I am new on this list, and i have no big experiences in php.
 Now i am writing a script, what is counting some records in 5 MySQL
table.
this is not the appropriate list for questions about development with
PHP, but of PHP.
Please ask such questions on [EMAIL PROTECTED] and please have a
close to the Manual (http://php.net/array)

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] RFC: stream notification handlers

2002-04-08 Thread Jan Lehnardt

Hi,
On Mon,  8 Apr 2002 13:15:27 +0100
Wez Furlong [EMAIL PROTECTED] wrote:

 proto resource fopen(string filename, string mode
   [, bool use_include_path [, resource context]])
context is only optional if you use use_include_path in this proto. Is
that desired? Don't you mean

proto resource fopen(string filename, string mode
   [, bool use_include_path]  [, resource context])

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] instance of mssql

2002-04-08 Thread Carl Levesque

It is possible to connect  php server at  secondary instance of mssql
(mssql 2000)
if you have the solution, please i would like sample please

thanks


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




[PHP-DEV] gmmktime fails because of bug! any solutions?

2002-04-08 Thread Patrick Sibenaler



After some sleepless nights and a DB with messed-up GMT-Epoch-timestamps,
I tried to figure out the problem with gmmktime and only then found that 
the bug persists since quite a while:

   http://bugs.php.net/bug.php?id=14391

At this point you CANNOT RELY ON GMT-TIMESTAMPS created by gmmktime(). They 
fail on w2k with the switch from/to DST and are the respective hour off... 
See problem description and examples in the link above.

Does anyone know workarounds for this?

I can help by providing testcases or testing grounds if that is nessesary,
but I propose that this should be fixed asap. The clock is ticking and the 
next moment where the php-epoch-stamps will go crazy again is Oct 26th, 2002 


greets.

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




Re: [PHP-DEV] RFC: stream notification handlers

2002-04-08 Thread Markus Fischer

On Mon, Apr 08, 2002 at 03:43:57PM +0200, Jan Lehnardt wrote : 
 Hi,
 On Mon,  8 Apr 2002 13:15:27 +0100
 Wez Furlong [EMAIL PROTECTED] wrote:
 
  proto resource fopen(string filename, string mode
[, bool use_include_path [, resource context]])
 context is only optional if you use use_include_path in this proto. Is
 that desired? Don't you mean
 
 proto resource fopen(string filename, string mode
[, bool use_include_path]  [, resource context])

An optional parameter following an optional parameter means
to set the second optional parameter you _have_ to give the
first parameter a value too hence in that context it's not
optional anymore. So, writing

stirng mode [, bool use_path [, resource ctx]]

is correct (as long as PHP does not have a place holder to
leave out consecutive optional parameters.

- Markus

-- 
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
Mind if I MFH ? What QA did you do on it? the usual? ah... none :)

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




Re: [PHP-DEV] RFC: stream notification handlers

2002-04-08 Thread Wez Furlong

Well, since you cant skip optional parameters, those protos
are equivalent.

:-)

On 08/04/02, Jan Lehnardt [EMAIL PROTECTED] wrote:
 Hi,
 On Mon,  8 Apr 2002 13:15:27 +0100
 Wez Furlong [EMAIL PROTECTED] wrote:
 
  proto resource fopen(string filename, string mode
[, bool use_include_path [, resource context]])
 context is only optional if you use use_include_path in this proto. Is
 that desired? Don't you mean
 
 proto resource fopen(string filename, string mode
[, bool use_include_path]  [, resource context])
 
 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] RFC: stream notification handlers

2002-04-08 Thread Jan Lehnardt

Hi,
On Mon,  8 Apr 2002 15:22:59 +0100
Wez Furlong [EMAIL PROTECTED] wrote:

 Well, since you cant skip optional parameters, those protos
 are equivalent.
my fault, sorry (also to Markus ;)

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] RFC: stream notification handlers

2002-04-08 Thread Markus Fischer

Heh, not until some clever brain comes up with a place holder
to leave out optional parameters (I remember some discussions
about it in my dark half of my brain).

- Markus ;)

On Mon, Apr 08, 2002 at 03:22:59PM +0100, Wez Furlong wrote : 
 Well, since you cant skip optional parameters, those protos
 are equivalent.
 
 :-)
 
 On 08/04/02, Jan Lehnardt [EMAIL PROTECTED] wrote:
  Hi,
  On Mon,  8 Apr 2002 13:15:27 +0100
  Wez Furlong [EMAIL PROTECTED] wrote:
  
   proto resource fopen(string filename, string mode
 [, bool use_include_path [, resource context]])
  context is only optional if you use use_include_path in this proto. Is
  that desired? Don't you mean
  
  proto resource fopen(string filename, string mode
 [, bool use_include_path]  [, resource context])
  
  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

-- 
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
Mind if I MFH ? What QA did you do on it? the usual? ah... none :)

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




[PHP-DEV] Re: cvs: php4 /pear Makefile.frag

2002-04-08 Thread Yasuo Ohgaki

Yasuo Ohgaki wrote:
 yohgaki   Mon Apr  8 10:17:31 2002 EDT
 
   Modified files:  
 /php4/pearMakefile.frag 
   Log:
   Make pgsql header available for PECL module(s)

It's better to have a way to install PECL module's
header, so that we can make most modules into PECL.

--
Yasuo Ohgaki


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




[PHP-DEV] diff for 4.2.0RC2 to compile against Apache 2.0.35-dev

2002-04-08 Thread Rose, Billy

Here's a context diff of changes needed to compile against Apache 2.0.35-dev
(or newer I assume).

Billy Rose

*** php-4.2.0RC2/sapi/apache2filter/sapi_apache2.c  Thu Mar 14 04:57:00
2002
--- ../php-4.2.0RC2/sapi/apache2filter/sapi_apache2.c   Mon Apr  8 09:21:46
2002
***
*** 55,64 
  
if (str_length == 0) return 0;

!   bb = apr_brigade_create(ctx-f-r-pool);
while (str_length  0) {
now = MIN(str_length, 4096);
!   b = apr_bucket_transient_create(str, now);
APR_BRIGADE_INSERT_TAIL(bb, b);
str += now;
str_length -= now;
--- 55,64 
  
if (str_length == 0) return 0;

!   bb = apr_brigade_create(ctx-f-r-pool,ctx-f-c-bucket_alloc);
while (str_length  0) {
now = MIN(str_length, 4096);
!   b = apr_bucket_transient_create(str,
now,ctx-f-c-bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, b);
str += now;
str_length -= now;
***
*** 171,178 
 * all further flush buckets.
 */

!   bb = apr_brigade_create(ctx-f-r-pool);
!   b = apr_bucket_flush_create();
APR_BRIGADE_INSERT_TAIL(bb, b);
if (ap_pass_brigade(ctx-f-next, bb) != APR_SUCCESS) {
php_handle_aborted_connection();
--- 171,178 
 * all further flush buckets.
 */

!   bb = apr_brigade_create(ctx-f-r-pool,ctx-f-c-bucket_alloc);
!   b = apr_bucket_flush_create(ctx-f-c-bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, b);
if (ap_pass_brigade(ctx-f-next, bb) != APR_SUCCESS) {
php_handle_aborted_connection();
***
*** 234,240 
if (ctx == NULL) { \
/* Initialize filter context */ \
SG(server_context) = ctx = apr_pcalloc(f-r-pool,
sizeof(*ctx));  \
!   ctx-bb = apr_brigade_create(f-c-pool); \
}
  
  static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb, 
--- 234,240 
if (ctx == NULL) { \
/* Initialize filter context */ \
SG(server_context) = ctx = apr_pcalloc(f-r-pool,
sizeof(*ctx));  \
!   ctx-bb = apr_brigade_create(f-c-pool,f-c-bucket_alloc);
\
}
  
  static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb, 
***
*** 383,389 

  #define PHP_NO_DATA The PHP Filter did not receive suitable input data

!   eos =
apr_bucket_transient_create(PHP_NO_DATA, sizeof(PHP_NO_DATA)-1);
APR_BRIGADE_INSERT_HEAD(bb, eos);
}
}
--- 383,389 

  #define PHP_NO_DATA The PHP Filter did not receive suitable input data

!   eos =
apr_bucket_transient_create(PHP_NO_DATA,
sizeof(PHP_NO_DATA)-1,ctx-f-c-bucket_alloc);
APR_BRIGADE_INSERT_HEAD(bb, eos);
}
}
***
*** 392,398 
  
SG(server_context) = 0;
/* Pass EOS bucket to next filter to signal end of request
*/
!   eos = apr_bucket_eos_create();
APR_BRIGADE_INSERT_TAIL(bb, eos);

return ap_pass_brigade(f-next, bb);
--- 392,398 
  
SG(server_context) = 0;
/* Pass EOS bucket to next filter to signal end of request
*/
!   eos = apr_bucket_eos_create(ctx-f-c-bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, eos);

return ap_pass_brigade(f-next, bb);

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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread brad lafountain


--- Kristian Köhntopp [EMAIL PROTECTED] wrote:
 brad lafountain wrote:
  Unless someone could give me a real reason that 
  aggerate is better than MI.
 
 Aggregation does at runtime what MI does at compile time.
 Delaying the decision to do something is usually an enable for
 specific applications. 
 
 Examples are the signal/slot  mechanism based call-models  in
 Gnome and Qt vs. virtual function tables in C++. The decision
 which implementation for a method is being called is delayed to
 the actual point in time when a call is being made, enabling a
 much more flexible component model and much better reuse.

 Im not familure with this can you please explain.

 
 The cost for doing things late is worse typechecking, errors are
 potentially caught only at call-time, not at compile-time (with
 Qt, it probably is link-time, due to the way it is implemented).
 
 The same goes with aggregation. Aggregation allows me to write a
 class Soaping, which implements a SOAP RPC Client and a
 SOAPFactory class, which manufactures objects of any class and
 aggregates Soaping into them:
 
 I could include_once() any unknown class, create an instance
 and use PHPs introspective functions to create a list of 
 functions and instance variables in this class. By adding 
 Soaping functionality to the class, and with the help of 
 getters, setters and wrappers provided by overload(), I 
 can intercept all accesses to this instance, turn them into
 SOAP calls to some remote instance of that object, and
 marshall the results back into my application.
 
 The beauty of this is, that I can do this at run-time, and that I
 can do this generically with any old class, using two miniscule
 additions to the system, aggregate() and overload(). Yet for the
 user this is probably transparent.

 I have made this exact soap client and server as a php extension. It works
fine without aggregation.

 
  Class definition is defined at design time not run time!
 
 No, it isn't. Unless you are stuck with C++.
 
 PHP is for rapid prototyping. That may turn into rabid
 prototyping (SCNR the pun) if you do not know how to use it, but
 it may also be an extremely powerful tool as I have shown. 
 
 Generally speaking, it allows you to design metaclasses and
 metasystems, which add some general function to the language
 itself.
 

 I guess my biggest argument is that aggergration will cause some problems like
serizliation and Im still not convinced that aggergration does any good when
you are designing a class libary.

 Basically I don't want aggergation to be the only way that a user can have MI
just because MI isn't implemented. I can see users doing this.

class A;
class B;
class C;

$c = new C;
aggergate($c, A);
aggergate($c, B);

Just because they can. Not be cause it makes sence or its readable. I guess
it would aleviate my conserns if MI was included as well as aggergation.

- Brad

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP-DEV] classes, instances objects in ZE2

2002-04-08 Thread Marcus Börger

At 15:36 08.04.2002, Kristian Köhntopp wrote:
Marcus Börger wrote:
  - we have private, what about final, public, protected and
  abstract (can we remove/hide a method from an object)?

Do we in ZE2? What use it is?

In my book, private is only of very limited use, because there
always must be a way around it.

So that book is your own meaning. I do more like accepted books on
computer language theory (for OO languages there is only one book:
A Theory on Objects; Martin Abadi, Luca Cardelli, Springer).


Introducing private (in C++) immediately called for the
introduction of protected and friend, with protected being a
mechanism to break privacy along the lines of the inheritance
hierarchy and friend being a mechanism to break privacy across
inheritance hierarchies, at compile time.

Yes it does call for it. But please do not use break.
A private method is a method that cannot be used for inheritance.
Thus you cannot implement it another way in a derived class/object.
A protected method is a method that can be used for inheritance but
is not accessible from other classes. A friend is a method/class that
is allowed to handle private/protected members of another class (here
breaking could be used).


Since PHP does many things at run time which C++ does at compile
time, there must be a mechanism to break privacy at run time,
which makes it pretty pointless to have private variables in the
first place.

Does not because inheritance does not necessary have to be implemented
at compile time. This can be handled using the same words at runtime, too.
The one reason for handling inheritance at compile time is that you can
easier achive type strictness at compile time (but like C++ we don't have 
that).


I'd rather go for a warning that is being triggered whenever I
access $a-_slot, but not when I access $this-_slot (Access to
private object member). I could suppress this warning by writing
$a-_slot as $a-_slot instead.

We could do this by issuing an error instead of a warning (and we should)!


Providing stronger privacy would only force the addition of even
more syntactic candy (such as a get_private($o, $slot) and
set_private($o, $slot)). Functions to break privacy are needed
in order to write Metafunctionality such as a serialization
agent, or a RPC proxy like the Soaping mixin class I introduced
in another mail to this list.

As already mentioned above we could use friend or referring to the
other OO discussion going on we could use aggregation to achieve
this. So there is no need for get/Set_private().


  - do we allow to reduce visability (replace protected by
  private as long as we don't have it):
class A {
  public function f()..
}
class B extends A {
  protected function f()...
}

Same reasoning as above. Make it a warning, do not delve into BD
language realms. PHP does things at run time, because we are in
the rapid prototyping area and flexibility comes before compile
type checking and static bindings. And anyway, class != type in
PHP.

Rapid prototyping does not necessary need to have bad design. And
of cause when not using private/protected you can do dirty prototyping
just like without it - BUT you can do really good design. And i thought
we all would like PHP to become *the* solution for web applications.

Kristian

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


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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread brad lafountain


--- Stig S. Bakken [EMAIL PROTECTED] wrote:
 On Mon, 2002-04-08 at 02:50, brad lafountain wrote:
  
  --- Stig S. Bakken [EMAIL PROTECTED] wrote:
   On Sun, 2002-04-07 at 20:35, brad lafountain wrote:

 What would be wrong with having the *_SQL_* objects be a member of the
*_Connection* classes?
   
   What you're describing here is object aggregation.
  
  What do you mean... Im saying that the SQL implementation is a member or
 the
  connection class.. Nothing to do with aggergation. aggergation would mean
 the
  methods of the sql imp would be apart of the connection class not a member.
  
  Im still not convinced that aggergation is usefull.
 
 Object aggregation in general is a technique where you have some
 functionality in objects you forward calls to, a pretty common
 technique.  You can of course do that in PHP today, but it's slow (lots
 of userland method calls) and high on maintenance (if an aggregated
 class gets a new method, you must make a new wrapper in the forwarding
 class, etc).  In my opinion, providing native support for this in an
 efficient way makes a lot of sense for PHP.

 Ok, Im still not convinced that I personally will ever use aggregation but im
sure someone out there somewhere would want to use it. But my consern is that
people will start using aggregation instead of normal MI. Aggregation should
only be used at certin times not just for MI.

(as i said in another post)

 Basically I don't want aggergation to be the only way that a user can have MI
just because MI isn't implemented. I can see users doing this.

class A;
class B;
class C;

$c = new C;
aggergate($c, A);
aggergate($c, B);

Just because they can. Not be cause it makes sence or its readable. I guess
it would aleviate my conserns if MI was included as well as aggergation.

(as i said in another post)


- Brad

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Kristian Koehntopp

On Mon, Apr 08, 2002 at 08:59:39AM -0700, brad lafountain wrote:
 class A;
 class B;
 class C;
 
 $c = new C;
 aggergate($c, A);
 aggergate($c, B);
 
 Just because they can.

Yes of course, but how is this better than

class D extends A, B, C;
$d = new D;

for the same reasons (i.e. because you can as opposed to it makes sense???)

Kristian

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




Re: [PHP-DEV] classes, instances objects in ZE2

2002-04-08 Thread Wez Furlong

I agree with Kristian here; it is quite common to need to break
the protected/privacy rules when the class hierarchy is badly designed.
I'm referring to Delphi here where code like this is required because
someone didn't make something public when they should have.
It's a double issue: 1) is that the class is badly designed, 2) is
that this hack is even possible.

/* psuedo code */
class ImageList {
   protected HImageList; /* should be public, or have a getter */
};

// In some other code that uses winapi and needs the handle
class ImageListHack {
   public HImageList;
};

handle = ((ImageListHack)imlist)-HImageList;

On 09/04/02, Marcus Börger [EMAIL PROTECTED] wrote:
 At 15:36 08.04.2002, Kristian Köhntopp wrote:
 Introducing private (in C++) immediately called for the
 introduction of protected and friend, with protected being a
 mechanism to break privacy along the lines of the inheritance
 hierarchy and friend being a mechanism to break privacy across
 inheritance hierarchies, at compile time.
 
 Yes it does call for it. But please do not use break.
 A private method is a method that cannot be used for inheritance.
 Thus you cannot implement it another way in a derived class/object.
 A protected method is a method that can be used for inheritance but
 is not accessible from other classes. A friend is a method/class that
 is allowed to handle private/protected members of another class (here
 breaking could be used).




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




[PHP-DEV] php_odbc.c patch

2002-04-08 Thread Andrew Hill

Hi folks,

Attached please find a zip file containing both a diff and a modified
php_odbc.c file that cleans up some problems with Connection in Use errors
our customers (and others) were having with PHP.

The patch was made against PHP 4.1.2

Can Dan et. al. check it over and commit please?

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




php-odbc-patch.zip
Description: application/applefile


php-odbc-patch.zip
Description: Macintosh archive

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


[PHP-DEV] Re: aggregate() und overload()

2002-04-08 Thread Andrei Zmievski

__get_x() is simply a shortcut, I don't see how it can backfire on us in
the overload framework. It is very helpful if you have a couple of
variables that are more frequently accessed and you want to split up
their processing from the rest. They are pretty much analogous to
get/set property handlers in C#, except that those get converted to
__prop_get/set() names by the compiler.

If you are worried about its interaction with aggregate(), there is no
problem. Aggregate() will not import methods that start with '_'.

On Mon, 08 Apr 2002, Kristian Köhntopp wrote:
 As of now, this is just an unspecified bad feeling of mine.
 I only can back up this with the two times we had special names
 which were variable in PHP: Both attempts at them failed
 horribly:
 
 - We had (have, until ZE 2, if I am not mistaken) variable
   named constructors (ctors named after the class). These 
 had a number of design flaws in PHP 3, which were fixed in
 PHP 4, at the cost of an overly complex ruleset for 
 constructor names.
 
 Had we chosen stable names for constructors, we'd gotten the
 same effect with a single rule for ctor names.
 
 - We had (until very recently) variable names for imported
   variables amidst our global namespace. We earned a number
 of security problems due to admittedly stupid code, which
 swayed the PTBs to finally disable registering globals by
 default.
 
 I cannot come up with a bomb script right now, but I am
 reasonably sure that __get_x() will backfire at some time
 as well.
 
 Kristian



-Andrei
* On the keyboard of life, always keep one finger on the escape key. *

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




Re: [PHP-DEV] php_odbc.c patch

2002-04-08 Thread derick

Hello Andrew,

as I dont kno wfor sure when Dan will read his mail, I'll respond here. 
Can you please make a patch against the current CVS version, and provide 
it as either a .zip or .tar.gz format? apple files are not readable by me 
and most other people.

regards,
Derick

On Mon, 8 Apr 2002, Andrew Hill wrote:

 Hi folks,
 
 Attached please find a zip file containing both a diff and a modified
 php_odbc.c file that cleans up some problems with Connection in Use errors
 our customers (and others) were having with PHP.
 
 The patch was made against PHP 4.1.2
 
 Can Dan et. al. check it over and commit please?
 
 Best regards,
 Andrew Hill
 Director of Technology Evangelism
 OpenLink Software  http://www.openlinksw.com
 Universal Data Access  Virtuoso Universal Server
 
 

---
 Did I help you? Consider a gift:
  http://www.amazon.co.uk/exec/obidos/registry/SLCB276UZU8B
---
  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] php_odbc.c patch

2002-04-08 Thread Dan Kalowsky

Hey Andrew,

Dont mind any bad typing by me, I am not used to German keyboard layouts.

Your patch .diff file does seem to do anything though except a whitespace
change.  Is that the proper diff file?

Derick the message is a .zip btw.

This message took 20 minutes to write... sorry for brevity.


On Mon, 8 Apr 2002, Andrew Hill wrote:

 Hi folks,

 Attached please find a zip file containing both a diff and a modified
 php_odbc.c file that cleans up some problems with Connection in Use errors
 our customers (and others) were having with PHP.

 The patch was made against PHP 4.1.2

 Can Dan et. al. check it over and commit please?

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



---
Dan KalowskyThe record shows, I took the blows.
http://www.deadmime.org/~dankAnd did it my way.
[EMAIL PROTECTED]- My Way, Frank Sinatra


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




[PHP-DEV] Upload alert

2002-04-08 Thread Rodolfo Silva

Hi! 

I need a  php script to alert me (with a pop up window or something like that) when a 
certain web page is modified. Is it possible? Where can I find that? 

Tks in advance, 
Rodolfo Silva

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




Re: [PHP-DEV] Upload alert

2002-04-08 Thread Sander Roobol

You're asking on the wrong place (again).
This list is for developing PHP, not for developing WITH PHP. Send 
support questions to [EMAIL PROTECTED]

Sander

On 2002.04.08 19:07 Rodolfo Silva wrote:
 Hi!
 
 I need a  php script to alert me (with a pop up window or something
 like that) when a certain web page is modified. Is it possible? Where
 can I find that?
 
 Tks in advance,
 Rodolfo Silva
 
 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 

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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread brad lafountain


--- Kristian Koehntopp [EMAIL PROTECTED] wrote:
 On Mon, Apr 08, 2002 at 08:59:39AM -0700, brad lafountain wrote:
  class A;
  class B;
  class C;
  
  $c = new C;
  aggergate($c, A);
  aggergate($c, B);
  
  Just because they can.
 
 Yes of course, but how is this better than
 
 class D extends A, B, C;
 $d = new D;
 
 for the same reasons (i.e. because you can as opposed to it makes sense???)

 Yeah now they can use D over and over agian with out having to aggregate it
over and over again because it IS defineable at compile time.

class circle;
class square;
class 3d_object;
class 2d_object;

class 3d_circle extends circle, 3d_object;
class 2d_square extends square, 2d_object;
class 3d_square extends square, 3d_object;

$obj1 = new 3d_circle;
$obj2 = new 2d_square;
$obj3 = new 3d_square;

that is way eaiser to read than..
class circle;
class square;
class 3d_object;
class 2d_object;

$obj1 = new circle;
aggregate($obj1, 3d_object);
$obj2 = new square;
aggregate($obj2, 2d_object);
$obj3 = new square;
aggregate($obj3, 3d_object);

Besides that you can re-use your 3d shapes over and over again. 

 Im saying that aggregate can be used (not too often) but having aggregate and
not MI would lead to the above code. Users using aggregate as an alternative to
MI. When it makes sence to do the inheritance at compile time not run time.

 - Brad

 
 Kristian


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




[PHP-DEV] Memory leak and possible cause of bug #15333

2002-04-08 Thread Joseph Tate

in the copy_zend_constant function it reads:

void copy_zend_constant(zend_constant *c)
{
c-name = zend_strndup(c-name, c-name_len);
if (!(c-flags  CONST_PERSISTENT)) {
zval_copy_ctor(c-value);
if (c-flags  CONST_EFREE_PERSISTENT) { /* persist_alloc()'d data */
persist_alloc(c-value);
}
}
}

I draw your attention to the first line in the function:
c-name = zend_strndup(c-name, c-name_len);

First of all, why is this string duplicated only to store it to the same
location?  Secondly, is c-name freed somewhere else?  Cause I can't see it
being freed.  Seems like this line can be removed...

Joseph


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




Re: [PHP-DEV] Memory leak and possible cause of bug #15333

2002-04-08 Thread brad lafountain


--- Joseph Tate [EMAIL PROTECTED] wrote:
 in the copy_zend_constant function it reads:
 
 void copy_zend_constant(zend_constant *c)
 {
   c-name = zend_strndup(c-name, c-name_len);
   if (!(c-flags  CONST_PERSISTENT)) {
   zval_copy_ctor(c-value);
   if (c-flags  CONST_EFREE_PERSISTENT) { /* persist_alloc()'d data */
   persist_alloc(c-value);
   }
   }
 }
 
 I draw your attention to the first line in the function:
 c-name = zend_strndup(c-name, c-name_len);
 
 First of all, why is this string duplicated only to store it to the same
 location?  Secondly, is c-name freed somewhere else?  Cause I can't see it
 being freed.  Seems like this line can be removed...
 

So c points to the old value and you need to copy the name and the value to
the new one, name and value. and the way hashes and emalloc works the memory
will be freed automatically.


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


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




RE: [PHP-DEV] Memory leak and possible cause of bug #15333

2002-04-08 Thread Joseph Tate

I don't follow you.  Why does it need to be copied?  c-name already
contains the value.  Old?  New?  c is c is c.  Commenting out the code
causes other problems elsewhere (or seems to).  I just don't understand why
it has to be done.

 -Original Message-
 --- Joseph Tate [EMAIL PROTECTED] wrote:
  in the copy_zend_constant function it reads:
 
  void copy_zend_constant(zend_constant *c)
  {
  c-name = zend_strndup(c-name, c-name_len);
  if (!(c-flags  CONST_PERSISTENT)) {
  zval_copy_ctor(c-value);
  if (c-flags  CONST_EFREE_PERSISTENT) { /*
 persist_alloc()'d data */
  persist_alloc(c-value);
  }
  }
  }
 
  I draw your attention to the first line in the function:
  c-name = zend_strndup(c-name, c-name_len);
 
  First of all, why is this string duplicated only to store it to the same
  location?  Secondly, is c-name freed somewhere else?  Cause I
 can't see it
  being freed.  Seems like this line can be removed...
 

 So c points to the old value and you need to copy the name and
 the value to
 the new one, name and value. and the way hashes and emalloc
 works the memory
 will be freed automatically.




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




RE: [PHP-DEV] Memory leak and possible cause of bug #15333

2002-04-08 Thread brad lafountain

hmm
ok

zend_constant *c, *b;
char *sname = myname;

c-name = name; // the c-name is just a pointer to the sname
//c-name = strdup(sname); // c-name would have it's own memory

b = c; //now b-name points to sname

free(b-name); // would try and free b-name which can't be done, segfault!

so now you do this:

zend_constant *c, *b;
char *sname = myname;
c-name = strdup(sname); // c-name would have it's own memory

b = c; //now b-name points to a copy of sname
copy_zend_constant(b); //now b-name has its own memory

free(b-name); // now this will work no segfaults here

and if you look where copy_zend_constant it is only called when you want to
copy constants from one hash to another.


- Brad
--- Joseph Tate [EMAIL PROTECTED] wrote:
 I don't follow you.  Why does it need to be copied?  c-name already
 contains the value.  Old?  New?  c is c is c.  Commenting out the code
 causes other problems elsewhere (or seems to).  I just don't understand why
 it has to be done.
 
  -Original Message-
  --- Joseph Tate [EMAIL PROTECTED] wrote:
   in the copy_zend_constant function it reads:
  
   void copy_zend_constant(zend_constant *c)
   {
 c-name = zend_strndup(c-name, c-name_len);
 if (!(c-flags  CONST_PERSISTENT)) {
 zval_copy_ctor(c-value);
 if (c-flags  CONST_EFREE_PERSISTENT) { /*
  persist_alloc()'d data */
 persist_alloc(c-value);
 }
 }
   }
  
   I draw your attention to the first line in the function:
   c-name = zend_strndup(c-name, c-name_len);
  
   First of all, why is this string duplicated only to store it to the same
   location?  Secondly, is c-name freed somewhere else?  Cause I
  can't see it
   being freed.  Seems like this line can be removed...
  
 
  So c points to the old value and you need to copy the name and
  the value to
  the new one, name and value. and the way hashes and emalloc
  works the memory
  will be freed automatically.
 
 
 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




RE: [PHP-DEV] Memory leak and possible cause of bug #15333

2002-04-08 Thread Joseph Tate

Gotcha.  Guess I missed that there was another copy somewhere.  I'm trying
to track down a problem with ISAPI that causes php to die and take down
everything with it.  Thought I might have a handle on it.  Thanks for the
clarification.

Joseph

 -Original Message-
 From: brad lafountain [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 08, 2002 4:25 PM
 To: Joseph Tate; Php-Dev List
 Subject: RE: [PHP-DEV] Memory leak and possible cause of bug #15333


 hmm
 ok

 zend_constant *c, *b;
 char *sname = myname;

 c-name = name; // the c-name is just a pointer to the sname
 //c-name = strdup(sname); // c-name would have it's own memory

 b = c; //now b-name points to sname

 free(b-name); // would try and free b-name which can't be done,
 segfault!

 so now you do this:

 zend_constant *c, *b;
 char *sname = myname;
 c-name = strdup(sname); // c-name would have it's own memory

 b = c; //now b-name points to a copy of sname
 copy_zend_constant(b); //now b-name has its own memory

 free(b-name); // now this will work no segfaults here

 and if you look where copy_zend_constant it is only called when
 you want to
 copy constants from one hash to another.


 - Brad
 --- Joseph Tate [EMAIL PROTECTED] wrote:
  I don't follow you.  Why does it need to be copied?  c-name already
  contains the value.  Old?  New?  c is c is c.  Commenting out the code
  causes other problems elsewhere (or seems to).  I just don't
 understand why
  it has to be done.
 
   -Original Message-
   --- Joseph Tate [EMAIL PROTECTED] wrote:
in the copy_zend_constant function it reads:
   
void copy_zend_constant(zend_constant *c)
{
c-name = zend_strndup(c-name, c-name_len);
if (!(c-flags  CONST_PERSISTENT)) {
zval_copy_ctor(c-value);
if (c-flags  CONST_EFREE_PERSISTENT) { /*
   persist_alloc()'d data */
persist_alloc(c-value);
}
}
}
   
I draw your attention to the first line in the function:
c-name = zend_strndup(c-name, c-name_len);
   
First of all, why is this string duplicated only to store
 it to the same
location?  Secondly, is c-name freed somewhere else?  Cause I
   can't see it
being freed.  Seems like this line can be removed...
   
  
   So c points to the old value and you need to copy the name and
   the value to
   the new one, name and value. and the way hashes and emalloc
   works the memory
   will be freed automatically.
  
  
 


 __
 Do You Yahoo!?
 Yahoo! Tax Center - online filing with TurboTax
 http://taxes.yahoo.com/

 --
 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] php_odbc.c patch

2002-04-08 Thread Andrew Hill

Hi Dan,

Yes, the .diff whitespace change is relevant, as preprocessor codes have to
start in the first column.

I've asked the iODBC maintainer (who produced this patch) to look at 4.2.0.

And these weren't Mac files - should be fine on *nix platforms.

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


 -Original Message-
 From: Dan Kalowsky [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 08, 2002 1:17 PM
 To: Andrew Hill
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DEV] php_odbc.c patch


 Hey Andrew,

 Dont mind any bad typing by me, I am not used to German keyboard layouts.

 Your patch .diff file does seem to do anything though except a whitespace
 change.  Is that the proper diff file?

 Derick the message is a .zip btw.

 This message took 20 minutes to write... sorry for brevity.


 On Mon, 8 Apr 2002, Andrew Hill wrote:

  Hi folks,
 
  Attached please find a zip file containing both a diff and a modified
  php_odbc.c file that cleans up some problems with Connection
 in Use errors
  our customers (and others) were having with PHP.
 
  The patch was made against PHP 4.1.2
 
  Can Dan et. al. check it over and commit please?
 
  Best regards,
  Andrew Hill
  Director of Technology Evangelism
  OpenLink Software  http://www.openlinksw.com
  Universal Data Access  Virtuoso Universal Server
 
 

 ---
 Dan Kalowsky  The record shows, I took the blows.
 http://www.deadmime.org/~dank  And did it my way.
 [EMAIL PROTECTED]  - My Way, Frank Sinatra


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






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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Zeev Suraski

Having both makes very little sense.  Compile-time vs. run-time in PHP 
doesn't make any real difference as far as functionality goes, because the 
stages are linked together immediately.
I don't think MI will make it into PHP, now that aggregation was introduced...

At 18:59 08/04/2002, brad lafountain wrote:

--- Stig S. Bakken [EMAIL PROTECTED] wrote:
  On Mon, 2002-04-08 at 02:50, brad lafountain wrote:
  
   --- Stig S. Bakken [EMAIL PROTECTED] wrote:
On Sun, 2002-04-07 at 20:35, brad lafountain wrote:

  What would be wrong with having the *_SQL_* objects be a member 
 of the
 *_Connection* classes?
   
What you're describing here is object aggregation.
  
   What do you mean... Im saying that the SQL implementation is a member or
  the
   connection class.. Nothing to do with aggergation. aggergation would mean
  the
   methods of the sql imp would be apart of the connection class not a 
 member.
  
   Im still not convinced that aggergation is usefull.
 
  Object aggregation in general is a technique where you have some
  functionality in objects you forward calls to, a pretty common
  technique.  You can of course do that in PHP today, but it's slow (lots
  of userland method calls) and high on maintenance (if an aggregated
  class gets a new method, you must make a new wrapper in the forwarding
  class, etc).  In my opinion, providing native support for this in an
  efficient way makes a lot of sense for PHP.

  Ok, Im still not convinced that I personally will ever use aggregation 
 but im
sure someone out there somewhere would want to use it. But my consern is that
people will start using aggregation instead of normal MI. Aggregation should
only be used at certin times not just for MI.

(as i said in another post)

  Basically I don't want aggergation to be the only way that a user can 
 have MI
just because MI isn't implemented. I can see users doing this.

class A;
class B;
class C;

$c = new C;
aggergate($c, A);
aggergate($c, B);

Just because they can. Not be cause it makes sence or its readable. I guess
it would aleviate my conserns if MI was included as well as aggergation.

(as i said in another post)


- Brad

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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


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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread brad lafountain


--- Zeev Suraski [EMAIL PROTECTED] wrote:
 Having both makes very little sense.  Compile-time vs. run-time in PHP 
 doesn't make any real difference as far as functionality goes, because the 
 stages are linked together immediately.
 I don't think MI will make it into PHP, now that aggregation was
 introduced...

Yes it does make sence. How much slower would the code below run, not to
mention how hard it is to read or maintain.

class a;
class b;
class c;

for($i = 0;$i  1;$i++)
{
 $d = new a;
 aggregate($d, b);
 aggregate($d, c);
 $d-method();
}

or this
class a;
class b;
class c;
class d extends a,b,c;

for($i = 0;$i  1;$i++)
{
 $d = new d;
 $d-method();
}

Its all about desiging your objects.. if d always consits of a,b and c then MI
should be used. If some condition arises where d is only a and b or a and c.
then aggregation should be used.

Eg.

$d = new a;
if(condition)
 aggregate($d, 'b');
elseif(codition)
 aggregate($d, 'c');
$d-method();
That makes sence.

But not doign this.
$d = new a;
aggregate($d, 'b');
aggregate($d, 'c');
$d-method();

 I currently am trying to talk my company to use php over java. This is a huge
project. The company i work for has 22000 employees and probally 500-1000
developers across us (mainly). And in desiging our classes i can see where i
could use MI. and im not about to go and tell all 500 developers that evertime
you create an instance of x you need to aggerate y.

If aggregation is included then i see it is absoulty necessary to include MI
too.
- brad

 
 At 18:59 08/04/2002, brad lafountain wrote:
 
 --- Stig S. Bakken [EMAIL PROTECTED] wrote:
   On Mon, 2002-04-08 at 02:50, brad lafountain wrote:
   
--- Stig S. Bakken [EMAIL PROTECTED] wrote:
 On Sun, 2002-04-07 at 20:35, brad lafountain wrote:
 
   What would be wrong with having the *_SQL_* objects be a member 
  of the
  *_Connection* classes?

 What you're describing here is object aggregation.
   
What do you mean... Im saying that the SQL implementation is a member
 or
   the
connection class.. Nothing to do with aggergation. aggergation would
 mean
   the
methods of the sql imp would be apart of the connection class not a 
  member.
   
Im still not convinced that aggergation is usefull.
  
   Object aggregation in general is a technique where you have some
   functionality in objects you forward calls to, a pretty common
   technique.  You can of course do that in PHP today, but it's slow (lots
   of userland method calls) and high on maintenance (if an aggregated
   class gets a new method, you must make a new wrapper in the forwarding
   class, etc).  In my opinion, providing native support for this in an
   efficient way makes a lot of sense for PHP.
 
   Ok, Im still not convinced that I personally will ever use aggregation 
  but im
 sure someone out there somewhere would want to use it. But my consern is
 that
 people will start using aggregation instead of normal MI. Aggregation should
 only be used at certin times not just for MI.
 
 (as i said in another post)
 
   Basically I don't want aggergation to be the only way that a user can 
  have MI
 just because MI isn't implemented. I can see users doing this.
 
 class A;
 class B;
 class C;
 
 $c = new C;
 aggergate($c, A);
 aggergate($c, B);
 
 Just because they can. Not be cause it makes sence or its readable. I
 guess
 it would aleviate my conserns if MI was included as well as aggergation.
 
 (as i said in another post)
 
 
 - Brad
 
 __
 Do You Yahoo!?
 Yahoo! Tax Center - online filing with TurboTax
 http://taxes.yahoo.com/
 
 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Zeev Suraski

At 00:44 09/04/2002, brad lafountain wrote:
If aggregation is included then i see it is absoulty necessary to include MI
too.

In my opinion, only one of them (at most) has room in PHP.  Having both is 
messy.  My personal preference is MI, which is why I prefer tagging 
aggregation as experimental.

Zeev


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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread brad lafountain


--- Zeev Suraski [EMAIL PROTECTED] wrote:
 At 00:44 09/04/2002, brad lafountain wrote:
 If aggregation is included then i see it is absoulty necessary to include MI
 too.
 
 In my opinion, only one of them (at most) has room in PHP.  Having both is 
 messy.  My personal preference is MI, which is why I prefer tagging 
 aggregation as experimental.

 Well i would have totally agreed with you yesterday.. but i have convinced
myself that there is use for aggregation. Me personally i would never use it.
But i can see somepeople using it.

But giving the user a way to MI without having MI support(aggregation) will
create alot of messy code. It wont even give the user a change to write good OO
code.

Can you explain why you can't see room for both of them?


- Brad

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Steve Meyers

If MI can be emulated using aggregation, how hard would it be to add the 
syntax for MI to the language, but have it implement it using aggregation?

Zeev Suraski wrote:

 At 00:44 09/04/2002, brad lafountain wrote:
If aggregation is included then i see it is absoulty necessary to include
MI too.
 
 In my opinion, only one of them (at most) has room in PHP.  Having both is
 messy.  My personal preference is MI, which is why I prefer tagging
 aggregation as experimental.
 
 Zeev



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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread brad lafountain


--- Steve Meyers [EMAIL PROTECTED] wrote:
 If MI can be emulated using aggregation, how hard would it be to add the 
 syntax for MI to the language, but have it implement it using aggregation?

 That would be the biggest hack. MI isn't that hard to implement. It probally
would take a good developer less than a weeks time to do.

 - Brad
 
 Zeev Suraski wrote:
 
  At 00:44 09/04/2002, brad lafountain wrote:
 If aggregation is included then i see it is absoulty necessary to include
 MI too.
  
  In my opinion, only one of them (at most) has room in PHP.  Having both is
  messy.  My personal preference is MI, which is why I prefer tagging
  aggregation as experimental.
  
  Zeev
 
 
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Zeev Suraski

At 00:55 09/04/2002, brad lafountain wrote:
  Well i would have totally agreed with you yesterday.. but i have convinced
myself that there is use for aggregation. Me personally i would never use it.
But i can see somepeople using it.

It doesn't mean it's a good idea to add it.  I used both, and yes, 
aggregation makes sense in some cases, but having them both in the language 
is like a supermarket of everything, and that's never good.

But giving the user a way to MI without having MI support(aggregation) 
will
create alot of messy code. It wont even give the user a change to write 
good OO
code.

Can you explain why you can't see room for both of them?

Aggregation is typically supported in userland, in the rare cases where 
it's really required (through wrapper methods that relay calls to a member 
object). Having them both will confuse people.  Even people with some OO 
experience won't find it trivial to decide which they should use.

Zeev


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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Marcus Börger

Mybe it would make sence to have MI for compile time and aggregation
for run time. So we can have good design with MI and prototyping and
testing and quick hacks with aggregeation. But doing compile times work
with run time methods?

marcus

At 23:58 08.04.2002, you wrote:
If MI can be emulated using aggregation, how hard would it be to add the
syntax for MI to the language, but have it implement it using aggregation?

Zeev Suraski wrote:

  At 00:44 09/04/2002, brad lafountain wrote:
 If aggregation is included then i see it is absoulty necessary to include
 MI too.
 
  In my opinion, only one of them (at most) has room in PHP.  Having both is
  messy.  My personal preference is MI, which is why I prefer tagging
  aggregation as experimental.
 
  Zeev



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


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




Re: [PHP-DEV] Re: cvs: php4 /pear Makefile.frag

2002-04-08 Thread Stig S. Bakken

On Mon, 2002-04-08 at 16:45, Yasuo Ohgaki wrote:
 Yasuo Ohgaki wrote:
  yohgaki Mon Apr  8 10:17:31 2002 EDT
  
Modified files:  
  /php4/pear  Makefile.frag 
Log:
Make pgsql header available for PECL module(s)
 
 It's better to have a way to install PECL module's
 header, so that we can make most modules into PECL.

Yes, I just added install headers to pear/TODO.

 - Stig


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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Stig S. Bakken

But a class is not defined at runtime, it's only compiled into bytecode
that, when executed, declares the class.  That's what Zeev means when he
says that the difference between compile-time and runtime is not that
big.

IMHO there is room for both aggregate and MI.  We have require and
include, not just include? :-)

 - Stig

On Tue, 2002-04-09 at 00:16, Marcus Börger wrote:
 Mybe it would make sence to have MI for compile time and aggregation
 for run time. So we can have good design with MI and prototyping and
 testing and quick hacks with aggregeation. But doing compile times work
 with run time methods?
 
 marcus
 
 At 23:58 08.04.2002, you wrote:
 If MI can be emulated using aggregation, how hard would it be to add the
 syntax for MI to the language, but have it implement it using aggregation?
 
 Zeev Suraski wrote:
 
   At 00:44 09/04/2002, brad lafountain wrote:
  If aggregation is included then i see it is absoulty necessary to include
  MI too.
  
   In my opinion, only one of them (at most) has room in PHP.  Having both is
   messy.  My personal preference is MI, which is why I prefer tagging
   aggregation as experimental.
  
   Zeev
 
 
 
 --
 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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread brad lafountain


--- Zeev Suraski [EMAIL PROTECTED] wrote:
 At 00:55 09/04/2002, brad lafountain wrote:
   Well i would have totally agreed with you yesterday.. but i have convinced
 myself that there is use for aggregation. Me personally i would never use
 it.
 But i can see somepeople using it.
 
 It doesn't mean it's a good idea to add it.  I used both, and yes, 
 aggregation makes sense in some cases, but having them both in the language 
 is like a supermarket of everything, and that's never good.
 
 But giving the user a way to MI without having MI support(aggregation) 
 will
 create alot of messy code. It wont even give the user a change to write 
 good OO
 code.
 
 Can you explain why you can't see room for both of them?
 
 Aggregation is typically supported in userland, in the rare cases where 
 it's really required (through wrapper methods that relay calls to a member 
 object). Having them both will confuse people.  Even people with some OO 
 experience won't find it trivial to decide which they should use.

But do you see my point that having ONLY aggregate means that in 90% of the
case where people will use it its probally a bad idea. They are only using it
becuase of the lack of MI. How does aggregation solve overwriting methods.

class a
{
 function blah()
 {
  echo in a;
 } 
}

class b
{
 function blah()
 {
  echo in b;
 } 
}

class c
{
 function blah()
 {
  echo in c;
 } 
}

class d extends a,b,c
{
 function blah()
 {
   echo a::blah() . b::blah() . c::blah();
 }
}

how do you do that with aggregation? MI really is way different than
aggregation. 

I see aggregation used for adding methods to an existing class. 
class a
{
 function do_a()
 {
 }
}
class b
{
 function do_b()
 {
 }
}

$c = new stdclass;
aggregate($c, a);
aggregate($c, b);
$c-do_a();
$c-do_b();


but i still don't like this... there are cleaner ways around that by using
members and/or MI.

- Brad


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread brad lafountain


--- Stig S. Bakken [EMAIL PROTECTED] wrote:
 But a class is not defined at runtime, it's only compiled into bytecode
 that, when executed, declares the class.  That's what Zeev means when he
 says that the difference between compile-time and runtime is not that
 big.
 
 IMHO there is room for both aggregate and MI.  We have require and
 include, not just include? :-)

 Ok now we are talking :)...
 
 I think if aggregate exists then MI is absoulty necessary. but if MI exists
then aggregate doesn't necessarly need to exists.

 
  - Stig
 
 On Tue, 2002-04-09 at 00:16, Marcus Börger wrote:
  Mybe it would make sence to have MI for compile time and aggregation
  for run time. So we can have good design with MI and prototyping and
  testing and quick hacks with aggregeation. But doing compile times work
  with run time methods?
  
  marcus
  
  At 23:58 08.04.2002, you wrote:
  If MI can be emulated using aggregation, how hard would it be to add the
  syntax for MI to the language, but have it implement it using aggregation?
  
  Zeev Suraski wrote:
  
At 00:44 09/04/2002, brad lafountain wrote:
   If aggregation is included then i see it is absoulty necessary to
 include
   MI too.
   
In my opinion, only one of them (at most) has room in PHP.  Having both
 is
messy.  My personal preference is MI, which is why I prefer tagging
aggregation as experimental.
   
Zeev
  
  
  
  --
  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
 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




RE: [PHP-DEV] php_odbc.c patch

2002-04-08 Thread Jani Taskinen


Patch committed. Also into PHP_4_2_0 branch.

--Jani


On Mon, 8 Apr 2002, Andrew Hill wrote:

Hi Dan,

Yes, the .diff whitespace change is relevant, as preprocessor codes have to
start in the first column.

I've asked the iODBC maintainer (who produced this patch) to look at 4.2.0.

And these weren't Mac files - should be fine on *nix platforms.

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


 -Original Message-
 From: Dan Kalowsky [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 08, 2002 1:17 PM
 To: Andrew Hill
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DEV] php_odbc.c patch


 Hey Andrew,

 Dont mind any bad typing by me, I am not used to German keyboard layouts.

 Your patch .diff file does seem to do anything though except a whitespace
 change.  Is that the proper diff file?

 Derick the message is a .zip btw.

 This message took 20 minutes to write... sorry for brevity.


 On Mon, 8 Apr 2002, Andrew Hill wrote:

  Hi folks,
 
  Attached please find a zip file containing both a diff and a modified
  php_odbc.c file that cleans up some problems with Connection
 in Use errors
  our customers (and others) were having with PHP.
 
  The patch was made against PHP 4.1.2
 
  Can Dan et. al. check it over and commit please?
 
  Best regards,
  Andrew Hill
  Director of Technology Evangelism
  OpenLink Software  http://www.openlinksw.com
  Universal Data Access  Virtuoso Universal Server
 
 

 ---
 Dan Kalowsky The record shows, I took the blows.
 http://www.deadmime.org/~dank And did it my way.
 [EMAIL PROTECTED] - My Way, Frank Sinatra


 --
 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: Assistance Needed (not sure where to ask)

2002-04-08 Thread Stig S. Bakken

Hi,

[EMAIL PROTECTED] is a better place to ask this question.  Cc'ing
there.

 - Stig

On Fri, 2002-03-15 at 00:55, Ozz Nixon wrote:
 Hello,
 
 We are developing a web server (for the past 5 years off and on), and the latest 
version supports ISAPI, and now PHP. I have everything working wonderfully - but have 
a problem, and not sure where/who to ask.
 
 When a PHP script does:
 setcookie($cookiename,$sessid,'',$cookiepath,$cookiedomain,$cookiesecure);
 
 or header(location: $ref);
 
 It appears my server code is not implementing something correclty. Would you mind 
giving me some insight on what exactly I might be missing? We are very interested in 
promoting PHP with our web server, and have already helped some customers move from 
IIS  ASP to our webserver w/ PHP. I have developed all of their PHP using session 
variables. But I have had a couple customers say the above code is not working from 
well known PHP scripts (like phpBB and NukePHP), so I am sure it is not their issue 
it has to be mine.
 
 Basically in a simple test script, tracing my server code during exection I never 
see an ISAPI event for those - which leads me to think, I am not interacting with 
your ISAPI PHP correctly. I have written some test ISAPI's and they are working 
flawlessly, so I must not be calling your code correctly.
 
 Who can help me? As I am extremely excited to announce that our latest version is 
100% compliant w/ ISAPI and can host PHP based sites. (I have successfully 
implemented almost every PHP example using every extension, but these two commands 
have me baffled on what did I not do correctly).
 
 Thanks greatly for your assistance!!
 Ozz Nixon
 www.bpdx.com


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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Marcus Börger

At 00:40 09.04.2002, Stig S. Bakken wrote:
But a class is not defined at runtime, it's only compiled into bytecode
that, when executed, declares the class.  That's what Zeev means when he
says that the difference between compile-time and runtime is not that
big.

What i meant with runtime was that aggregation allows to change the
methods of an object.


IMHO there is room for both aggregate and MI.  We have require and
include, not just include? :-)

  - Stig

On Tue, 2002-04-09 at 00:16, Marcus Börger wrote:
  Mybe it would make sence to have MI for compile time and aggregation
  for run time. So we can have good design with MI and prototyping and
  testing and quick hacks with aggregeation. But doing compile times work
  with run time methods?
 
  marcus
 
  At 23:58 08.04.2002, you wrote:
  If MI can be emulated using aggregation, how hard would it be to add the
  syntax for MI to the language, but have it implement it using aggregation?
  
  Zeev Suraski wrote:
  
At 00:44 09/04/2002, brad lafountain wrote:
   If aggregation is included then i see it is absoulty necessary to 
 include
   MI too.
   
In my opinion, only one of them (at most) has room in PHP.  Having 
 both is
messy.  My personal preference is MI, which is why I prefer tagging
aggregation as experimental.
   
Zeev
  
  
  
  --
  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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Marcus Börger

At 00:53 09.04.2002, you wrote:

--- Stig S. Bakken [EMAIL PROTECTED] wrote:
  But a class is not defined at runtime, it's only compiled into bytecode
  that, when executed, declares the class.  That's what Zeev means when he
  says that the difference between compile-time and runtime is not that
  big.
 
  IMHO there is room for both aggregate and MI.  We have require and
  include, not just include? :-)

  Ok now we are talking :)...

  I think if aggregate exists then MI is absoulty necessary. but if MI exists
then aggregate doesn't necessarly need to exists.

Sure! And keep in mind that when only having MI we only have objects because
we allow or instances to have dynamically added members.

class A {
}

$a = new A;
$a-b = 'new';   // WORKS!

When having aggregation we also have objects because of changing method
tables, too. Then why am i not allowed to do the following:

class A {
}

function add($name, $value) {
 $this-$name = $value;   // WORKS!
}

$a = new A;
$a-add = add;// NOT Allowed
$a-add('b', 'new');

This is not possible now BUT this is object oriented code and not only class
oriented! And we did not use Aggregation. Aggregation is only a technique
to add complete method tables from one class to an object (run-time) whereas
MI adds complete method tables from one class to another class. Therefore
aggregation is only a specialcase of the above scenario.

If the discussion did only came up because someone wanted to have streaming
there are three ways out of it:
1) MI
2) aggregation
3) properties and a superclass that has a stream interface with properties 
(like
Borland's CBuilder).
4) Interfaces

Option 3 has the negative effect that only classes derived from the defined 
superclass
can be streamed. Option 1 allows to add streaming support for any class at 
compile
time whereas aggregation would allow to add streaming at run time to 
instances which
were never considered to be streamed. Again the 4th option allows to do all 
without
MI or aggregation (that does not mean i dislike MI/aggregation - i like 
MI+Interfaces).

In a mail some hours ago brad already unfolded the main difference:
With aggregation you can have d=(a,b) and d=(a,c) while MI only allows 
d=(a,b,c).

marcus


 
   - Stig
 
  On Tue, 2002-04-09 at 00:16, Marcus Börger wrote:
   Mybe it would make sence to have MI for compile time and aggregation
   for run time. So we can have good design with MI and prototyping and
   testing and quick hacks with aggregeation. But doing compile times work
   with run time methods?
  
   marcus
  
   At 23:58 08.04.2002, you wrote:
   If MI can be emulated using aggregation, how hard would it be to add the
   syntax for MI to the language, but have it implement it using 
 aggregation?
   
   Zeev Suraski wrote:
   
 At 00:44 09/04/2002, brad lafountain wrote:
If aggregation is included then i see it is absoulty necessary to
  include
MI too.

 In my opinion, only one of them (at most) has room in 
 PHP.  Having both
  is
 messy.  My personal preference is MI, which is why I prefer tagging
 aggregation as experimental.

 Zeev
   
   
   
   --
   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
 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/


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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Yasuo Ohgaki

Brad Lafountain wrote:
*SNIP*
 But do you see my point that having ONLY aggregate means that in 90% of the
 case where people will use it its probally a bad idea. They are only using it
 becuase of the lack of MI. How does aggregation solve overwriting methods.
 
 class a
 {
  function blah()
  {
   echo in a;
  } 
 }
 
 class b
 {
  function blah()
  {
   echo in b;
  } 
 }
 
 class c
 {
  function blah()
  {
   echo in c;
  } 
 }
 
 class d extends a,b,c
 {
  function blah()
  {
echo a::blah() . b::blah() . c::blah();
  }
 }

With MI, documentation can be generated easily using tools.
*EASIER* to maintain code.

 
 how do you do that with aggregation? MI really is way different than
 aggregation. 
 
 I see aggregation used for adding methods to an existing class. 
 class a
 {
  function do_a()
  {
  }
 }
 class b
 {
  function do_b()
  {
  }
 }
 
 $c = new stdclass;
 aggregate($c, a);
 aggregate($c, b);
 $c-do_a();
 $c-do_b();
 

With aggregate, auto generating documentation hard.
*HARDER* (very hard, if one use it w/o good reason) to maintain code

To me, aggregate is GOTO like feature.
It's useful for sure, Howver
_Never_ use unless there is very good reason.

Therefore, it worth to have both MI and aggregate. IMHO

--
Yasuo Ohgaki

 
 but i still don't like this... there are cleaner ways around that by using
 members and/or MI.
 
 - Brad
 
 
 __
 Do You Yahoo!?
 Yahoo! Tax Center - online filing with TurboTax
 http://taxes.yahoo.com/



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




[PHP-DEV] Aggregation, Multiple Inheritence, pros/cons

2002-04-08 Thread fabwash

Hello all,

check this Thesis about multiple inheritence and aggregation, especially
chapter 9. It gives an excellent source for debate, and will explain the
main differences between both techniques, the pros, cons, etc..

http://www.cs.tut.fi/~pets/pruuden97.pdf

My vote is java like: no MI, no aggregation, single inheritence and use of
interfaces :)

- Original Message -
From: Yasuo Ohgaki [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Brad Lafountain [EMAIL PROTECTED]
Cc: Zeev Suraski [EMAIL PROTECTED]
Sent: Monday, April 08, 2002 8:14 PM
Subject: Re: [PHP-DEV] Re: aggergate vs MI


 Brad Lafountain wrote:
 *SNIP*
  But do you see my point that having ONLY aggregate means that in 90% of
the
  case where people will use it its probally a bad idea. They are only
using it
  becuase of the lack of MI. How does aggregation solve overwriting
methods.
 
  class a
  {
   function blah()
   {
echo in a;
   }
  }
 
  class b
  {
   function blah()
   {
echo in b;
   }
  }
 
  class c
  {
   function blah()
   {
echo in c;
   }
  }
 
  class d extends a,b,c
  {
   function blah()
   {
 echo a::blah() . b::blah() . c::blah();
   }
  }

 With MI, documentation can be generated easily using tools.
 *EASIER* to maintain code.

 
  how do you do that with aggregation? MI really is way different than
  aggregation.
 
  I see aggregation used for adding methods to an existing class.
  class a
  {
   function do_a()
   {
   }
  }
  class b
  {
   function do_b()
   {
   }
  }
 
  $c = new stdclass;
  aggregate($c, a);
  aggregate($c, b);
  $c-do_a();
  $c-do_b();
 

 With aggregate, auto generating documentation hard.
 *HARDER* (very hard, if one use it w/o good reason) to maintain code

 To me, aggregate is GOTO like feature.
 It's useful for sure, Howver
 _Never_ use unless there is very good reason.

 Therefore, it worth to have both MI and aggregate. IMHO

 --
 Yasuo Ohgaki

 
  but i still don't like this... there are cleaner ways around that by
using
  members and/or MI.
 
  - Brad
 
 
  __
  Do You Yahoo!?
  Yahoo! Tax Center - online filing with TurboTax
  http://taxes.yahoo.com/



 --
 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: Assistance Needed (not sure where to ask)

2002-04-08 Thread Ozz Nixon

Thanks Stig,

Since that original post, we have successfully modified our WebServer
software to run PHP 4.0 through 4.1.1 without error. The problem was the PHP
ISAPI changed over time to use the _EX command for the header, and we had to
update our internal code to support newer ISAPI specifications. Now, we are
seriously testing every PHP script we can get our hands on, 1 to learn the
scripting language, and 2 to make sure when we release WWS v1.1 we know it
works with every script we can test again - and we document any modified we
had to do (so far, VERY little has required changes - usually things, like
assumption the script will run on a linux server, as our WWS code is
available for both Windows and Linux).

Thanks again!
Ozz Nixon
CEO Brain Patchwork DX, LLC.

(p.s. who would I talk to about getting our server code PHP Certified?)

- Original Message -
From: Stig S. Bakken [EMAIL PROTECTED]
To: Ozz Nixon [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, April 08, 2002 7:16 PM
Subject: Re: Assistance Needed (not sure where to ask)


 Hi,

 [EMAIL PROTECTED] is a better place to ask this question.  Cc'ing
 there.

  - Stig

 On Fri, 2002-03-15 at 00:55, Ozz Nixon wrote:
  Hello,
 
  We are developing a web server (for the past 5 years off and on),
and the latest version supports ISAPI, and now PHP. I have everything
working wonderfully - but have a problem, and not sure where/who to ask.
 
  When a PHP script does:
 
setcookie($cookiename,$sessid,'',$cookiepath,$cookiedomain,$cookiesecure);
 
  or header(location: $ref);
 
  It appears my server code is not implementing something correclty. Would
you mind giving me some insight on what exactly I might be missing? We are
very interested in promoting PHP with our web server, and have already
helped some customers move from IIS  ASP to our webserver w/ PHP. I have
developed all of their PHP using session variables. But I have had a couple
customers say the above code is not working from well known PHP scripts
(like phpBB and NukePHP), so I am sure it is not their issue it has to be
mine.
 
  Basically in a simple test script, tracing my server code during
exection I never see an ISAPI event for those - which leads me to think, I
am not interacting with your ISAPI PHP correctly. I have written some test
ISAPI's and they are working flawlessly, so I must not be calling your code
correctly.
 
  Who can help me? As I am extremely excited to announce that our latest
version is 100% compliant w/ ISAPI and can host PHP based sites. (I have
successfully implemented almost every PHP example using every extension, but
these two commands have me baffled on what did I not do correctly).
 
  Thanks greatly for your assistance!!
  Ozz Nixon
  www.bpdx.com





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




Re: [PHP-DEV] Crash in Apache2Filter

2002-04-08 Thread Sebastian Bergmann

Sebastian Bergmann wrote:
   Win32, Apache 2.0.36-dev, PHP 4.3.0-dev (both current CVS)

  The crash seems to be gone now.

  However, the following compiler warnings remain:

c:\Apache2\include\apr.h(334): warning C4142:
benign redefinition of type

c:\home\php\php4\sapi\apache2filter\sapi_apache2.c(121): warning C4018:
'': signed/unsigned mismatch

c:\Apache2\include\apr.h(334): warning C4142:
benign redefinition of type

c:\home\php\php4\sapi\apache2filter\php_functions.c(91): warning C4244:
'function': conversion from 'apr_time_t' to 'long',
possible loss of data

c:\home\php\php4\sapi\apache2filter\php_functions.c(92): warning C4244:
'function': conversion from 'apr_off_t' to 'long',
possible loss of data

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

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

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




Re: [PHP-DEV] Re: aggergate vs MI

2002-04-08 Thread Zeev Suraski

At 01:51 09/04/2002, brad lafountain wrote:
But do you see my point that having ONLY aggregate means that in 90% of the
case where people will use it its probally a bad idea. They are only using it
becuase of the lack of MI. How does aggregation solve overwriting methods.

Yes, I see the point...

but i still don't like this... there are cleaner ways around that by using
members and/or MI.

I really don't know - as far as I know, aggregation is really not about 
runtime, but about 'has a', vs. 'is a'.  When you have 'hard' compiling, 
i.e., a phase that turns source code into a binary component, aggregation 
helps keep a loose relationship between objects, but it's still done in 
compile time of the new, 'derived' or constructed class:

class aggregated_class {
 var $inner_object;

 function aggergated_class()
 {
 $this-inner_object = new inner_class();
 }
 function inner_method()
 {
 return $this-inner_object-inner_method();
 }
}

Zeev


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




[PHP-DEV] CVS Account Request: devuser

2002-04-08 Thread devuser

learn

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