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

2002-04-07 Thread brad lafountain


--- "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.

- Brad


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

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




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

2002-04-07 Thread Stig S. Bakken

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.

 - Stig


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




RE: [PHP-DEV] 4.1.3?

2002-04-07 Thread derick

On Sun, 7 Apr 2002, Lukas Smith wrote:

> > i did not really follow the discussion, but: what about just releasing
> an
> > apache2 patch for 4.1.2 (for the people that cannot wait). I don't
> think
> > that Apache 2 is worth to hurry a new release. I think the people that
> > install it now are only the "freaks" that always want the newest
> version.
> 
> Then they should QA 4.2.0 :-)
> If people just want to play with apache then they can use 4.2.0 rc2?
> For production it makes more sense to wait for a properly QA'ed 4.2.0
> release.

RC2 doesn't work with apache 2. RC3 will.

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




RE: [PHP-DEV] 4.1.3?

2002-04-07 Thread Lukas Smith

> i did not really follow the discussion, but: what about just releasing
an
> apache2 patch for 4.1.2 (for the people that cannot wait). I don't
think
> that Apache 2 is worth to hurry a new release. I think the people that
> install it now are only the "freaks" that always want the newest
version.

Then they should QA 4.2.0 :-)
If people just want to play with apache then they can use 4.2.0 rc2?
For production it makes more sense to wait for a properly QA'ed 4.2.0
release.

Best regards,
Lukas Smith
[EMAIL PROTECTED]
___
 DybNet Internet Solutions GbR
 Reuchlinstr. 10-11
 Gebäude 4 1.OG Raum 6 (4.1.6)
 10553 Berlin
 Germany
 Tel. : +49 30 83 22 50 00
 Fax : +49 30 83 22 50 07
 www.dybnet.de [EMAIL PROTECTED]
___



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




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

2002-04-07 Thread brad lafountain


--- "Stig S. Bakken" <[EMAIL PROTECTED]> wrote:
> On Sat, 2002-04-06 at 23:40, brad lafountain wrote:
> > 
> > --- "Stig S. Bakken" <[EMAIL PROTECTED]> wrote:
> > > MI is compile-time, aggregate is runtime.  That's a big enough reason
> > > for me.
> > 
> >  I know the difference but how does this benifit you?
> > 
> > > 
> > > > Class definition is defined at design time not run time!
> > > 
> > > Aggregate is not really about class definition.  The shortcut in the
> > > current implementation modifies the class definition, but in its basic
> > > form, aggregation is about forwarding calls, not about changing class
> > > definitions.  Thus my suggestion to change aggregate as in my first
> > > reply to Kristian.
> > 
> >  Ok... Can you give me a good example that aggergate would be used over MI.
> > That makes sence and isn't garbage code!
> 
> Okay, a good example could be a database abstraction layer supporting
> ODBC with special handling of each database behind ODBC.
> 
> For example, if you use ODBC to talk with MySQL, Oracle or Solid, you
> have three ways of dealing with sequences (mysql only has auto_increment
> fields, Oracle has real sequences, but for Solid 2.x you need to define
> and use a procedure to get sequence values).  If you use iODBC to do all
> this, you won't know which one you're talking to until after connecting.
> 
> 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.

 Are you saying the connect function aggergates the specfic connectio class and
the specfic sql class? or the Connection class connect method aggerates the sql
class?


 You don't even need aggergate or MI for this.

 What would be wrong with having the *_SQL_* objects be a member of the
*_Connection* classes? It makes sence that a connection you can't have a
connection without having a SQL implementation. Then you could make a generic
one for most cases. Then you could ither have a get_sql() mehtod. This would
make more sence.

class DB_Connection_Factory
{
 function get_connection($type)
 {
   switch($type)
   {
   case 'oracle':
 return new DB_Connection_oracle($type);
   break;
   case 'odbc':
 return new DB_Connection_odbc($type);
   break;
   ...
   }
 }
}

class DB_Connection
{
 var $sql;
 function DB_Connection($type)
 {
   switch($type)
   {
   case 'oracle':
$this->sql = new DB_SQL_oracle();
   break;
   case 'mysql':
$this->sql = new DB_SQL_mysql();
   break;
   default:
$this->sql = new DB_SQL();
   break;
   }
 }
 function connect($server, $u, $p)
 { 
 }
 function set_sql($sql)
 {
   $this->sql = $sql;
 }

}
class DB_Connection_odbc extends DB_Connection
class DB_Connection_oracle extends DB_Connection
class DB_Connection_mysql extends DB_Connection
class DB_SQL
class DB_SQL_oracle extends DB_SQL
class DB_SQL_mysql extends DB_SQL

$connection = DB_Connection_Factory::get_connection(oracle);
$connection->connect(server, l, p);
$sql = $connection->get_sql_handler();
$ret = $sql->query($query);
 or
$connection = new DB_Connection();
$ret = $conection->sql->query($query);

They way that you describe first will be slower than the above code and they
way it hides the sql class from the connection class theres now way to mix and
match sql classes with connection class. 

$connect->set_sql(new DB_SQL_mysql());
this works way nicer cause theres no way to "unaggergate" classes methods.

IMHO as far as pure OO design goes this way is way bettter than the way that
you described.

__BRAD__


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

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




Re: [PHP-DEV] new port

2002-04-07 Thread Andi Gutmans

This isn't really an error because the argument count can't overflow in 
this situation. In any case, I'll see if we can't clean up these warnings a 
bit by making the l-values ulong.

Andi

At 13:48 07/04/2002 -0400, fabwash wrote:
>Hello,
>
>I achieved the first step of victory last night I got a php object created
>at 5am :) It's only the first step and it will take a long time to get
>something I can really run, I have a bunch of unresolved references and the
>first thing it did when I ran it was to signal.
>
>I will go through every source file with a warnings and implicit
>declarations so it will take some time. The most annoying one for now is one
>that is being included all the time: zend_language_parser.c:
>
>/bin/sh ../libtool --silent --mode=compile
>c89 -D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED -WIEEE_float -DHAVE_CONFIG_H -
>I. -I. -I../main-I../TSRM  -prefer-non-pic -static -c
>zend_language_parser.c
> int delete_count = (ulong)  *p;
>"/usr/people/fab/php-4.1.2/Zend/zend_execute.h", line 110: warning(1506):
>implicit conversion from "unsigned long" to "int": rounding, sign extension,
>or loss of accuracy may result
>
>  Same thing on line 122: int arg_count = (ulong) *p;
>
>I have some work to do on the ./configure first. Unfortunately the system
>i'm working on will not fail when a test is done to check the existence of a
>procedure by compiling it like cc does. That makes ./configure think that I
>have procedures that I really don't, hence the unresolved references when
>the link is done.
>
>Once I fix this and make ./configure understand my system better, i'll see
>how I can log the implicit castings and send the log to a place where you
>can take a look and correct if necessary.
>
>Later,
>
>Fab.
>- Original Message -
>From: "Stanislav Malyshev" <[EMAIL PROTECTED]>
>To: "fab wash" <[EMAIL PROTECTED]>
>Cc: <[EMAIL PROTECTED]>
>Sent: Sunday, April 07, 2002 5:01 AM
>Subject: Re: [PHP-DEV] new port
>
>
> > fw>> it to compile (which is not a simple task!), and notice an enormous
>amount
> > fw>> of bad casting in the code. For example:
> > fw>>
> > fw>> int joe = (ulong) *p;
> >
> > Things like this should be fixed, I think - that's a bug, plain and
> > simple, since ulong and int can have different size, and you get data loss
> > here (unless you are 100% sure *p is fitting int, in which case it should
> > be commented in the code).
> >
> > Can you point out some of the examples where this happens?
> > --
> > Stanislav Malyshev, Zend Products Engineer
> > [EMAIL PROTECTED]  http://www.zend.com/ +972-3-6139665 ext.115
> >
> >
> >
>
>--
>PHP Development Mailing List 
>To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP-DEV] new port

2002-04-07 Thread fabwash

Hello,

I achieved the first step of victory last night I got a php object created
at 5am :) It's only the first step and it will take a long time to get
something I can really run, I have a bunch of unresolved references and the
first thing it did when I ran it was to signal.

I will go through every source file with a warnings and implicit
declarations so it will take some time. The most annoying one for now is one
that is being included all the time: zend_language_parser.c:

/bin/sh ../libtool --silent --mode=compile
c89 -D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED -WIEEE_float -DHAVE_CONFIG_H -
I. -I. -I../main-I../TSRM  -prefer-non-pic -static -c
zend_language_parser.c
int delete_count = (ulong)  *p;
"/usr/people/fab/php-4.1.2/Zend/zend_execute.h", line 110: warning(1506):
implicit conversion from "unsigned long" to "int": rounding, sign extension,
or loss of accuracy may result

 Same thing on line 122: int arg_count = (ulong) *p;

I have some work to do on the ./configure first. Unfortunately the system
i'm working on will not fail when a test is done to check the existence of a
procedure by compiling it like cc does. That makes ./configure think that I
have procedures that I really don't, hence the unresolved references when
the link is done.

Once I fix this and make ./configure understand my system better, i'll see
how I can log the implicit castings and send the log to a place where you
can take a look and correct if necessary.

Later,

Fab.
- Original Message -
From: "Stanislav Malyshev" <[EMAIL PROTECTED]>
To: "fab wash" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, April 07, 2002 5:01 AM
Subject: Re: [PHP-DEV] new port


> fw>> it to compile (which is not a simple task!), and notice an enormous
amount
> fw>> of bad casting in the code. For example:
> fw>>
> fw>> int joe = (ulong) *p;
>
> Things like this should be fixed, I think - that's a bug, plain and
> simple, since ulong and int can have different size, and you get data loss
> here (unless you are 100% sure *p is fitting int, in which case it should
> be commented in the code).
>
> Can you point out some of the examples where this happens?
> --
> Stanislav Malyshev, Zend Products Engineer
> [EMAIL PROTECTED]  http://www.zend.com/ +972-3-6139665 ext.115
>
>
>

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




[PHP-DEV] ext/exif broken in HEAD.

2002-04-07 Thread Jani Taskinen


/usr/src/web/php/php4/ext/exif/exif.c: In function `add_assoc_image_info':
/usr/src/web/php/php4/ext/exif/exif.c:1346: warning: `array' might be used 
uninitialized in this function
/usr/src/web/php/php4/ext/exif/exif.c: In function `exif_process_user_comment':
/usr/src/web/php/php4/ext/exif/exif.c:2056: warning: implicit declaration of function 
`exif_process_string_raw'
/usr/src/web/php/php4/ext/exif/exif.c: In function `exif_process_IFD_TAG':
/usr/src/web/php/php4/ext/exif/exif.c:2238: too few arguments to function 
`exif_process_user_comment'
/usr/src/web/php/php4/ext/exif/exif.c:2306: warning: `sub_section_index' might be used 
uninitialized in this function
/usr/src/web/php/php4/ext/exif/exif.c: In function `exif_scan_JPEG_header':
/usr/src/web/php/php4/ext/exif/exif.c:2492: warning: `comment_correction' might be 
used uninitialized in this function
/usr/src/web/php/php4/ext/exif/exif.c: In function `exif_process_IFD_in_TIFF':
/usr/src/web/php/php4/ext/exif/exif.c:2732: warning: `sub_section_index' might be used 
uninitialized in this function
/usr/src/web/php/php4/ext/exif/exif.c:2734: warning: `entry_value' might be used 
uninitialized in this function
/usr/src/web/php/php4/ext/exif/exif.c: At top level:
/usr/src/web/php/php4/ext/exif/exif.c:125: warning: `exif_encoding_unicode' defined 
but not used
/usr/src/web/php/php4/ext/exif/exif.c:126: warning: `exif_encoding_jis' defined but 
not used
/usr/src/web/php/php4/ext/exif/exif.c:546: warning: `exif_char_dump' defined but not 
used
make: *** [ext/exif/exif.lo] Error 1

Also, the ext/exif.c does not follow the coding standards.
Marcus, please read: CODING_STANDARDS.

--Jani



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




[PHP-DEV] apache2 on FreeBSD

2002-04-07 Thread Jan Lehnardt

Hi,
in order to run apache2 on FreeBSD, you need to add --with-tsrm-pth to
your ./configure line.
I attached a patch to configure.in that throws a WARNING. I hope I
cought all possibilities, but I am sure Jani will find a gotcha; thats
why I have not comitted it directly ;)

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


Index: configure.in
===
RCS file: /repository/php4/configure.in,v
retrieving revision 1.334
diff -u -r1.334 configure.in
--- configure.in6 Apr 2002 13:42:39 -   1.334
+++ configure.in7 Apr 2002 13:59:19 -
@@ -1170,6 +1170,15 @@
 dnl  rm -f main/internal_functions.c.old
 dnl  fi
 
+  if test $UNAME = "FreeBSD" && test $PHP_SAPI = "apache2filter" && test $TSRM_PTH != 
+"pth-config" ; then
+echo "++"
+echo "|*** WARNING *** |"
+echo "||"
+echo "| In order to build PHP as a Apache2 module on FreeBSD, you have to  |"
+echo "| add  --with-tsrm-pth to your ./configure line. Therefore you need  |"
+echo "| to install gnu-pth from /usr/ports/devel/pth.  |"
+  fi
+
   if test -n "$PHP_APXS_BROKEN"; then
 echo "++"
 echo "| WARNING: Your $APXS script is most likely broken."


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


Re: [PHP-DEV] pear script doesn't work with current CVS

2002-04-07 Thread Wez Furlong

> On 07/04/02, "Sebastian Bergmann" <[EMAIL PROTECTED]> wrote:
> > I think this has something to do with the patch to the error system
> >   yesterday.
> >   Win32, PHP 4.3.0-dev, HEAD
> > c:\home>php c:\pear
> > Warning: fopen("php://stderr") - Invalid argument in c:\pear on line 136

Hmm, fopen("php://stderr", "w") works just find for me under Linux.

--Wez.


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




Re: [PHP-DEV] pear script doesn't work with current CVS

2002-04-07 Thread Wez Furlong

Hi Sebastian,

It might also be related to the BC fix for the zlib wrapper I committed
yesterday.
Could you try reverting to streams.c from the day before yesterday?
(I've got local changes in my local streams.c that aren't ready
for commiting yet).

If that fixes it, I'll revise my code.
Please don't make any changes to streams.c in HEAD today; I plan
to commit a little later on.

--Wez.

On 07/04/02, "Sebastian Bergmann" <[EMAIL PROTECTED]> wrote:
> I think this has something to do with the patch to the error system
>   yesterday.
> 
>   Win32, PHP 4.3.0-dev, HEAD
> 
> c:\home>php c:\pear
> 
> Warning: fopen("php://stderr") - Invalid argument in c:\pear on line 136
> 
> Warning: fputs(): supplied argument is not a valid File-Handle resource in
> c:\pe
> ar on line 137
> 
> Warning: fputs(): supplied argument is not a valid File-Handle resource in
> c:\pe
> ar on line 152
> 
> Warning: fclose(): supplied argument is not a valid File-Handle resource
> in c:\p
> ear on line 153
> 
>   Win32, PHP 4.3.0-dev, -D 2002-05-06
> 
> c:\home>php c:\pear
> 
> Usage: pear [options] command [command-options] 
> Type "pear help options" to list all options.
> Type "pear help " to get the help for the specified command.
> Commands:
>login
>logout
>config-show
>config-get
>config-set
>install
>uninstall
>upgrade
>package
>package-list
>package-info
>list-installed
>shell-test
>remote-package-info
>list-upgrades
>list-remote-packages
> 
> -- 
>   Sebastian Bergmann
>   http://sebastian-bergmann.de/ http://phpOpenTracker.de/
> 
>   Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php




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




[PHP-DEV] pear script doesn't work with current CVS

2002-04-07 Thread Sebastian Bergmann

  I think this has something to do with the patch to the error system
  yesterday.

  Win32, PHP 4.3.0-dev, HEAD

c:\home>php c:\pear

Warning: fopen("php://stderr") - Invalid argument in c:\pear on line 136

Warning: fputs(): supplied argument is not a valid File-Handle resource in
c:\pe
ar on line 137

Warning: fputs(): supplied argument is not a valid File-Handle resource in
c:\pe
ar on line 152

Warning: fclose(): supplied argument is not a valid File-Handle resource
in c:\p
ear on line 153

  Win32, PHP 4.3.0-dev, -D 2002-05-06

c:\home>php c:\pear

Usage: pear [options] command [command-options] 
Type "pear help options" to list all options.
Type "pear help " to get the help for the specified command.
Commands:
   login
   logout
   config-show
   config-get
   config-set
   install
   uninstall
   upgrade
   package
   package-list
   package-info
   list-installed
   shell-test
   remote-package-info
   list-upgrades
   list-remote-packages

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

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

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




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

2002-04-07 Thread Stig S. Bakken

On Sat, 2002-04-06 at 23:40, brad lafountain wrote:
> 
> --- "Stig S. Bakken" <[EMAIL PROTECTED]> wrote:
> > MI is compile-time, aggregate is runtime.  That's a big enough reason
> > for me.
> 
>  I know the difference but how does this benifit you?
> 
> > 
> > > Class definition is defined at design time not run time!
> > 
> > Aggregate is not really about class definition.  The shortcut in the
> > current implementation modifies the class definition, but in its basic
> > form, aggregation is about forwarding calls, not about changing class
> > definitions.  Thus my suggestion to change aggregate as in my first
> > reply to Kristian.
> 
>  Ok... Can you give me a good example that aggergate would be used over MI.
> That makes sence and isn't garbage code!

Okay, a good example could be a database abstraction layer supporting
ODBC with special handling of each database behind ODBC.

For example, if you use ODBC to talk with MySQL, Oracle or Solid, you
have three ways of dealing with sequences (mysql only has auto_increment
fields, Oracle has real sequences, but for Solid 2.x you need to define
and use a procedure to get sequence values).  If you use iODBC to do all
this, you won't know which one you're talking to until after connecting.

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.

 - Stig


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




Re: [PHP-DEV] new port

2002-04-07 Thread Stanislav Malyshev

fw>> it to compile (which is not a simple task!), and notice an enormous amount 
fw>> of bad casting in the code. For example:
fw>> 
fw>> int joe = (ulong) *p;

Things like this should be fixed, I think - that's a bug, plain and 
simple, since ulong and int can have different size, and you get data loss 
here (unless you are 100% sure *p is fitting int, in which case it should 
be commented in the code).

Can you point out some of the examples where this happens?
-- 
Stanislav Malyshev, Zend Products Engineer   
[EMAIL PROTECTED]  http://www.zend.com/ +972-3-6139665 ext.115



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