Re: [PHP] PHP 5 Question about OO

2005-06-02 Thread Marcus Bointon
On 2 Jun 2005, at 03:00, Richard Lynch wrote: Maybe I'm being dumb, but how can an object's __autoload function get called when the object class definition hasn't been loaded, and that's why you're calling __autoload in the first place... It wouldn't solve everything, but it would help. It

Re: [PHP] PHP 5 Question about OO

2005-06-02 Thread Marcus Bointon
On 2 Jun 2005, at 11:56, Colin Ross wrote: The way I see it, you are gonna be spending quite a bit of time writing all those lines of code for the class, what is bad about another requiring the file each time? Huh? Writing a 1-line function in a base class means that I would never have

Re: [PHP] PHP 5 Question about OO

2005-06-02 Thread Jochem Maas
Richard Lynch wrote: On Wed, June 1, 2005 3:53 am, Marcus Bointon said: On 1 Jun 2005, at 11:38, Jochem Maas wrote: all true, now imagine that you install a couple of 3rdparty php5 'packages' and they all define __autoload() - ain't gonna work! which is why there has been discussion on

Re: [PHP] PHP 5 Question about OO

2005-06-02 Thread Jason Barnett
Jochem Maas wrote: Richard Lynch wrote: On Wed, June 1, 2005 3:53 am, Marcus Bointon said: On 1 Jun 2005, at 11:38, Jochem Maas wrote: all true, now imagine that you install a couple of 3rdparty php5 'packages' and they all define __autoload() - ain't gonna work! which is why there has

Re: [PHP] PHP 5 Question about OO

2005-06-02 Thread Jochem Maas
Jason Barnett wrote: Jochem Maas wrote: Richard Lynch wrote: On Wed, June 1, 2005 3:53 am, Marcus Bointon said: On 1 Jun 2005, at 11:38, Jochem Maas wrote: ... I opened up a feature request for this very topic a while back. The __autoload function should just register

Re: [PHP] PHP 5 Question about OO

2005-06-02 Thread GamblerZG
Maybe it's just me, but the core concept of __autoload() seems to be broken to me. Moreover, every proposed solution I've heard about is totally inside the box. I would do it like this: 1) Define $_AUTOLOAD superglobal. 2) If I need SomeClass to be autoloaded I write this:

Re: [PHP] PHP 5 Question about OO

2005-06-02 Thread Greg Donald
On 6/2/05, GamblerZG [EMAIL PROTECTED] wrote: Maybe it's just me, but the core concept of __autoload() seems to be broken to me. Moreover, every proposed solution I've heard about is totally inside the box. I would do it like this: 1) Define $_AUTOLOAD superglobal. When forced to do OO, I use

[PHP] PHP 5 Question about OO

2005-06-01 Thread janbro
Hi List, I'm using the oo orientation of PHP5 for a while now. All Classes I've got have a require on top them, if I try to reference to other classes. something like require (Class2.php); class Class1{ private function ... { $refClass2 = new Class2; } } Now my

Re: [PHP] PHP 5 Question about OO

2005-06-01 Thread Marcus Bointon
On 1 Jun 2005, at 09:01, janbro wrote: require (Class2.php); class Class1{ private function ... { $refClass2 = new Class2; } } Now my question, is it possible to skip that require/ include part? In Java you don't need that, as class and file names are identical. PHP doesn't

Re: [PHP] PHP 5 Question about OO

2005-06-01 Thread Richard Davey
Hello janbro, Wednesday, June 1, 2005, 9:01:57 AM, you wrote: j Now my question, is it possible to skip that require/ include part? j In Java you don't need that, as class and file names are identical. Personally I'd __autoload them, but this might not be ideal for your file structure. Worth a

Re: [PHP] PHP 5 Question about OO

2005-06-01 Thread eoghan
maybe have a look at extends class Class1 extends Class2 {... janbro wrote: Hi List, I'm using the oo orientation of PHP5 for a while now. All Classes I've got have a require on top them, if I try to reference to other classes. something like require (Class2.php); class Class1{

Re: [PHP] PHP 5 Question about OO

2005-06-01 Thread Jochem Maas
Marcus Bointon wrote: On 1 Jun 2005, at 09:01, janbro wrote: require (Class2.php); I bet you didn't cut'n'paste that from a working file :-) class Class1{ private function ... { $refClass2 = new Class2; } } Now my question, is it possible to skip that require/ include

Re: [PHP] PHP 5 Question about OO

2005-06-01 Thread Jochem Maas
eoghan wrote: maybe have a look at extends class Class1 extends Class2 {... he will still have to make sure that Class2 is loaded. besides wrapping 1 object inside another is perfectly acceptable, if my GOF terminology serves me well then this is usually termed a Delegation pattern (not

Re: [PHP] PHP 5 Question about OO

2005-06-01 Thread Marcus Bointon
On 1 Jun 2005, at 11:38, Jochem Maas wrote: all true, now imagine that you install a couple of 3rdparty php5 'packages' and they all define __autoload() - ain't gonna work! which is why there has been discussion on internals regarding the possibility of use a handler- function stack for

Re: [PHP] PHP 5 Question about OO

2005-06-01 Thread janbro
Okay, I see there is a workaround but nothing realy satisfying, but I'm not hoing to complain, I'm hapy to have oo in PHP at all. I never worked with __autoload so far, but I will give it a try and check it out thx janbro Marcus Bointon schrieb: On 1 Jun 2005, at 09:01, janbro wrote: require

Re: [PHP] PHP 5 Question about OO

2005-06-01 Thread janbro
Alright thanks, I see there is a workaround to cope with that. I've never worked with __autoload, but will sure give it a look. I don't realy feel this satisfying, but hey I'm thankful to have oo at all. janbro Marcus Bointon schrieb: On 1 Jun 2005, at 09:01, janbro wrote: require

Re: [PHP] PHP 5 Question about OO

2005-06-01 Thread Matthew Weier O'Phinney
* janbro [EMAIL PROTECTED] : Okay, I see there is a workaround but nothing realy satisfying, but I'm not hoing to complain, I'm hapy to have oo in PHP at all. I never worked with __autoload so far, but I will give it a try and check it out The best way to use autoload is with the

Re: [PHP] PHP 5 Question about OO

2005-06-01 Thread Richard Lynch
On Wed, June 1, 2005 3:53 am, Marcus Bointon said: On 1 Jun 2005, at 11:38, Jochem Maas wrote: all true, now imagine that you install a couple of 3rdparty php5 'packages' and they all define __autoload() - ain't gonna work! which is why there has been discussion on internals regarding the