Re: [PHP-DEV] buildconf

2004-01-23 Thread Jani Taskinen
On Thu, 22 Jan 2004, Patrick Welche wrote:

>On Thu, Jan 22, 2004 at 04:51:43PM +0200, Jani Taskinen wrote:
>> 
>> There's nothing wrong in this. If your autoconf/aclocal/etc.
>> tools are installed correctly, buildconf works fine.
>> 
>> Please use the snapshots if you don't know what you're doing.
>
>:-) I have to smile otherwise I would be offended.

   =)

>> >Why does build/buildcheck.sh do the dance of copying the contents of
>> >libtool.m4 (whose location it guesses - wrongly in my case) into
>> >aclocal.m4, instead of letting libtoolize copy libtool.m4 over and
>> >automake pop it into aclocal.m4? This presumably would happen during
>> >make -f build/build2.mk if buildcheck gave it a chance..
>
>The above still stands. I would call your use of the autotools
>unorthodox.

I hope you mean "PHP uses" since I have nothing do to with
the way they're used. :)

And I'm sure Sascha will gladly explain you WHY we use them
like we do. (mainly because they suck in so many ways.. :)

>libtoolize would pop libtool.m4 either into . or the directory
>specified in AC_CONFIG_AUX_DIR. OK, you may wish to carry on using
>a really outdated autoconf which doesn't understand that, but at
>least letting libtoolize, which knows where to find the libtool.m4,
>copy it, and then look for it in . is not a bad thing. However, as
>you then just copy libtool.m4 into aclocal.m4, I don't see why you
>don't let the autotools just do if for you. It isn't as if you are
>altering libtool.m4's contents. 

Actually we should be altering, the snapshots are generated
using patched libtool.m4..and I think we should bundle it 
and append THAT one..Sascha, what's your opinion?

--Jani

p.s. # cvs log -r1.29 build/build2.mk


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



Re: [PHP-DEV] buildconf

2004-01-23 Thread Sascha Schumann
> The above still stands. I would call your use of the autotools
> unorthodox.

The problem with a number of autotools is that they are
unsuitable for large projects which contain a huge number of
independent modules.  We initially kicked out automake
because of that reason and furthermore don't recommend using
autoconf 2.50+ (slow, buggy and incomplete, albeit some nice
portability work has gone into it).

libtool.m4 is copied manually due to removing aclocal
(automake tool) from the build chain.  I'm not aware of a
command to copy libtool.m4 itself.

If you want to propose modifications to the current build
chain, feel free to post a patch.

- Sascha

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



Re: [PHP-DEV] PHP 4.3.5RC1 and dba(db4)

2004-01-23 Thread Martin Kraemer
On Thu, Jan 15, 2004 at 10:33:38PM +0100, Marcus Boerger wrote:
> 
> > I'll report when I found anything.
> 
> Could you please update your php to current cvs version (PHP4.3.5RC1-dev and
> PHP5-dev). Also if that doesn't help you could update db4 to db4>=4.1.25 and
> test with db3 or db2 version. And what is the output of
> "php run-tests.php ext/dba"?

I have upgraded to db4.1.25 and now the locking problems have vanished.
The output of php run-tests.php ext/dba follows:
env TEST_PHP_EXECUTABLE=$cwd/sapi/cli/php sapi/cli/php run-tests.php ext/dba

=
CWD : /home/openis/cache/tmp/php-4.3.5RC1
PHP : /home/martin/SRC/plusCD/work/php-4.3.5RC1/sapi/cli/php 
PHP_SAPI: cli
PHP_VERSION : 4.3.5RC1
ZEND_VERSION: 1.3.0
PHP_OS  : POSIX-BC - POSIX-BC S130he12.mch.fsc.net 04.0A A35 BS2000
INI actual  : 
More .INIs  : 
Extra dirs  : 
=
Running selected tests.
PASS DBA CDB handler test [ext/dba/tests/dba_cdb.phpt] (info: CDB does not support 
replace or delete)
FAIL DBA CDB_MAKE handler test [ext/dba/tests/dba_cdb_make.phpt] (info: CDB_MAKE does 
not support reading)
FAIL DBA CDB handler test (read only) [ext/dba/tests/dba_cdb_read.phpt]
SKIP DBA DBM handler test [ext/dba/tests/dba_dbm.phpt] (reason: DBM handler not 
available)
SKIP DBA DB2 handler test [ext/dba/tests/dba_db2.phpt] (reason: DB2 handler not 
available)
SKIP DBA DB3 handler test [ext/dba/tests/dba_db3.phpt] (reason: DB3 handler not 
available)
PASS DBA DB4 handler test [ext/dba/tests/dba_db4.phpt]
PASS DBA FlatFile handler test [ext/dba/tests/dba_flatfile.phpt]
PASS DBA GDBM handler test [ext/dba/tests/dba_gdbm.phpt]
PASS DBA INIFILE handler test [ext/dba/tests/dba_inifile.phpt]
SKIP DBA NDBM handler test [ext/dba/tests/dba_ndbm.phpt] (reason: NDBM handler not 
available)
PASS DBA File Creation Test [ext/dba/tests/dba001.phpt] (info: FLATFILE handler used)
PASS DBA Insert/Fetch Test [ext/dba/tests/dba002.phpt] (info: FLATFILE handler used)
PASS DBA Insert/Replace/Fetch Test [ext/dba/tests/dba003.phpt] (info: FLATFILE handler 
used)
PASS DBA Multiple Insert/Fetch Test [ext/dba/tests/dba004.phpt] (info: FLATFILE 
handler used)
PASS DBA FirstKey/NextKey Loop Test With 5 Items [ext/dba/tests/dba005.phpt] (info: 
FLATFILE handler used)
PASS DBA FirstKey/NextKey with 2 deletes [ext/dba/tests/dba006.phpt] (info: FLATFILE 
handler used)
PASS DBA Multiple File Creation Test [ext/dba/tests/dba007.phpt] (info: FLATFILE 
handler used)
PASS DBA magic_quotes_runtime Test [ext/dba/tests/dba008.phpt] (info: FLATFILE handler 
used)
PASS DBA dba_popen Test [ext/dba/tests/dba009.phpt] (info: FLATFILE handler used)

So, as I understand it, the problem went away by replacing db-4.0.14
by db-4.1.25. But isn't it going to bite other db4 users?

Strange however that php-4.3.3 did not experience these problems.

   Martin
-- 
<[EMAIL PROTECTED]> | Fujitsu Siemens
Fon: +49-89-636-46021, FAX: +49-89-636-47655 | 81730  Munich,  Germany

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



[PHP-DEV] CVS Account Request: satish3t

2004-01-23 Thread satish tripathi
for PHP development

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



Re: [PHP-DEV] Exception / trace member

2004-01-23 Thread Stephane Drouard
Hello Marcus,

Hum... you fixed the issue but not really in the way I expected it. Now my code does 
not work...

My message was not only to report a bug, but to ask *not* to fix it as expected. 
Particularly to put the "trace" member as protected, (or "getTrace()" as virtual and 
not final).

Remember my code:

trace, 0, 1);
$this->file = $this->trace[0]['file'];
$this->line = $this->trace[0]['line'];
  }

  static function handler($code, $message) {
throw new SystemException($message, $code);
  }
}

set_error_handler(array('SystemException', 'handler'));
?>

Indeed, I'm no more able to modify the trace, so if I want to report the real file and 
line (I mean the interresting ones, so those in trace[1]), they won't be coherent with 
the back trace.

Why could you accept a derived class to modify "file" and "line" members, and not the 
"trace" one?

My original message was also to limit the use of private and final modifiers, as they 
go against inheritance.

Regards,
Stephane

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



Re: [PHP-DEV] base class

2004-01-23 Thread Stephane Drouard
Marcus,

The idea behind this kind of request is to speed up development time. And the way a 
language and its base classes are implemented could really help to reach this goal.

When you write "a change is a change", you're right. But the way you have written your 
code could really reduce the risk of bugs. And systematically calling parent::... is 
one of it.

I also understand when you consider as a non sense calling an empty method which slows 
down execution for nothing.
Except that personally I really favour develop time rather than execution speed. 
Upgrading a computer is less expensive than spending hours to fix bugs.

Implementing a common base class with empty methods (or Chris' proposal, just do not 
report error) does not impact performance (just don't call them), but allows people 
having a different view on programming to do it.

Finally my request to implement it within PHP would limit the number of class trees, 
all world wide classes would have the same base class. Nice OOP vision, isn't it ;-)

Regards,
Stephane

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



Re: [PHP-DEV] __clone() implementation

2004-01-23 Thread Stephane Drouard
Marcus,

> you're right $that must be available in the derived __clone().

You will solve one problem: being able to call parent::__clone(), but it won't remove 
the constraint on derived classes (declaring members) to implement __clone() when one 
of its parents implements it.
This is just to limit risk of bugs, especially when you change a class implementation 
(not its interface) that now requires __clone() in a class that is the parent of 
others.

Regards,
Stephane

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



[PHP-DEV] win32 build fails on VC6

2004-01-23 Thread Ard Biesheuvel
Hi guys,

When building HEAD on VC6 with the new build system, the linker fails 
because the symbols _pctype and ___mb_cur_max are not defined. These are 
defined in libcmt, which is excluded explicitly from the link stage.

If I remove the /nodefaultlib:libcmt directive, the build succeeds with 
a warning, but the resulting php5ts_debug.dll works like a charm. Has 
anyone else experienced this problem?

Another question: are we going to ditch the old build system right away?
The new build system works a lot better for the interbase extension, 
because the different flavours of interbase/firebird use different 
combinations of client libraries with different names.

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


[PHP-DEV] SimpleXML Docs

2004-01-23 Thread Ken Tossell
Hi Internals,

 I've just committed a new documentation module for SimpleXML, which 
should show up on php.net sometime. It's available at 
http://php.kennyt.com/newdocs/?q=ref.simplexml -- if you see any major 
errors (and there are some, I'm sure), please point them out.

Ken

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



Re: [PHP-DEV] SimpleXML Docs

2004-01-23 Thread Jan Schneider
Zitat von Ken Tossell <[EMAIL PROTECTED]>:

Hi Internals,

 I've just committed a new documentation module for SimpleXML, which
should show up on php.net sometime. It's available at
http://php.kennyt.com/newdocs/?q=ref.simplexml -- if you see any major
errors (and there are some, I'm sure), please point them out.
The 2nd example uses the undefined $movies variable, should probably be
$xml->movie.
Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - Neue Wege des Lernens
http://www.tip4all.de - Deine private Tippgemeinschaft
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DEV] SimpleXML Docs

2004-01-23 Thread Ferdinand Beyer
On 23 Jan 2004 at 11:24, Ken Tossell wrote:

> Hi Internals,
> 
>  I've just committed a new documentation module for SimpleXML, 
which 
> should show up on php.net sometime. It's available at 
> http://php.kennyt.com/newdocs/?q=ref.simplexml -- if you see any 
major 
> errors (and there are some, I'm sure), please point them out.
> 
> Ken

- In the syntax line for simplexml_load_file() the function is mixed up
with simplexml_load_string(): object simplexml_element
simplexml_load_string(string $filename)

- In simplexml_load_dom() there is a still the notice: "This function is
currently not documented; only the argument list is available", 
although a
documentation exists.

-- 
Ferdinand Beyer
<[EMAIL PROTECTED]>

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



Re: [PHP-DEV] Exception / trace member

2004-01-23 Thread Marcus Boerger
Hello Stephane,

i had reasons to make that property private. You may use getTrace() to
read the contents and if you must overwrite it because you want to misuse
the whole thing then you can overwrite the read access method, too. This
should be enough, right?

Friday, January 23, 2004, 10:54:53 AM, you wrote:

> Hello Marcus,

> Hum... you fixed the issue but not really in the way I expected it. Now my code does 
> not work...

> My message was not only to report a bug, but to ask *not* to fix it as
> expected. Particularly to put the "trace" member as protected, (or
> "getTrace()" as virtual and not final).

> Remember my code:

>  class SystemException extends Exception {
>   function __construct($message, $code) {
> parent::__construct($message, $code);
> // Hide trace of handler() call.
> array_splice($this->trace, 0, 1);
> $this->file = $this->trace[0]['file'];
> $this->line = $this->trace[0]['line'];
>   }

>   static function handler($code, $message) {
> throw new SystemException($message, $code);
>   }
> }

> set_error_handler(array('SystemException', 'handler'));
?>>

> Indeed, I'm no more able to modify the trace, so if I want to report
> the real file and line (I mean the interresting ones, so those in
> trace[1]), they won't be coherent with the back trace.

> Why could you accept a derived class to modify "file" and "line" members, and not 
> the "trace" one?

> My original message was also to limit the use of private and final
> modifiers, as they go against inheritance.

> Regards,
> Stephane




-- 
Best regards,
 Marcusmailto:[EMAIL PROTECTED]

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



Re: [PHP-DEV] base class

2004-01-23 Thread Marcus Boerger
Hello Stephane,

your right with comparing development time to computer performance (total
cost of ownership model). So feel free to remember me as soon as we start
developing php 5.1. Maybe we can add somthing that lets you call non present
magical methods (__construct/__destruct/__clone) even if they are not
present without a huge waste of time in execution.

marcus

Friday, January 23, 2004, 11:53:02 AM, you wrote:

> Marcus,

> The idea behind this kind of request is to speed up development time.
> And the way a language and its base classes are implemented could really
> help to reach this goal.

> When you write "a change is a change", you're right. But the way you
> have written your code could really reduce the risk of bugs. And
> systematically calling parent::... is one of it.

> I also understand when you consider as a non sense calling an empty
> method which slows down execution for nothing.
> Except that personally I really favour develop time rather than
> execution speed. Upgrading a computer is less expensive than spending
> hours to fix bugs.

> Implementing a common base class with empty methods (or Chris'
> proposal, just do not report error) does not impact performance (just
> don't call them), but allows people having a different view on programming
> to do it.

> Finally my request to implement it within PHP would limit the number of
> class trees, all world wide classes would have the same base class. Nice
> OOP vision, isn't it ;-)

> Regards,
> Stephane




-- 
Best regards,
 Marcusmailto:[EMAIL PROTECTED]

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



Re: [PHP-DEV] SimpleXML Docs

2004-01-23 Thread Marcus Boerger
Hello Ken,

thank you very musch for the docs!

perhaps you could add something from the extension's README file.

regards
marcus

Friday, January 23, 2004, 5:24:27 PM, you wrote:

> Hi Internals,

>  I've just committed a new documentation module for SimpleXML, which 
> should show up on php.net sometime. It's available at 
> http://php.kennyt.com/newdocs/?q=ref.simplexml -- if you see any major 
> errors (and there are some, I'm sure), please point them out.

> Ken

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



Re: [PHP-DEV] PHP 4.3.5RC1 and dba(db4)

2004-01-23 Thread Marcus Boerger
Hello Martin,

thanks for prooving my thoughts. What should i say other than the module is
far too complex and allows far too many combinations so that as a
consequence a lot of them don't work. Most of the non working combinations
are inherent problems we cannot solve. The most common is the problem of
name clashes in the external libs. And i don't want to search for all
failing combinations that would be an endless story. Does this make you feel
more comfortable in any way?

marcus

Friday, January 23, 2004, 10:16:37 AM, you wrote:

> On Thu, Jan 15, 2004 at 10:33:38PM +0100, Marcus Boerger wrote:
>> 
>> > I'll report when I found anything.
>> 
>> Could you please update your php to current cvs version (PHP4.3.5RC1-dev and
>> PHP5-dev). Also if that doesn't help you could update db4 to db4>=4.1.25 and
>> test with db3 or db2 version. And what is the output of
>> "php run-tests.php ext/dba"?

> I have upgraded to db4.1.25 and now the locking problems have vanished.
> The output of php run-tests.php ext/dba follows:
> env TEST_PHP_EXECUTABLE=$cwd/sapi/cli/php sapi/cli/php run-tests.php ext/dba

> =
> CWD : /home/openis/cache/tmp/php-4.3.5RC1
> PHP : /home/martin/SRC/plusCD/work/php-4.3.5RC1/sapi/cli/php 
> PHP_SAPI: cli
> PHP_VERSION : 4.3.5RC1
> ZEND_VERSION: 1.3.0
> PHP_OS  : POSIX-BC - POSIX-BC S130he12.mch.fsc.net 04.0A A35 BS2000
> INI actual  : 
> More .INIs  : 
> Extra dirs  : 
> =
> Running selected tests.
> PASS DBA CDB handler test [ext/dba/tests/dba_cdb.phpt] (info: CDB does not support 
> replace or delete)
> FAIL DBA CDB_MAKE handler test [ext/dba/tests/dba_cdb_make.phpt] (info: CDB_MAKE 
> does not support reading)
> FAIL DBA CDB handler test (read only) [ext/dba/tests/dba_cdb_read.phpt]
> SKIP DBA DBM handler test [ext/dba/tests/dba_dbm.phpt] (reason: DBM handler not 
> available)
> SKIP DBA DB2 handler test [ext/dba/tests/dba_db2.phpt] (reason: DB2 handler not 
> available)
> SKIP DBA DB3 handler test [ext/dba/tests/dba_db3.phpt] (reason: DB3 handler not 
> available)
> PASS DBA DB4 handler test [ext/dba/tests/dba_db4.phpt]
> PASS DBA FlatFile handler test [ext/dba/tests/dba_flatfile.phpt]
> PASS DBA GDBM handler test [ext/dba/tests/dba_gdbm.phpt]
> PASS DBA INIFILE handler test [ext/dba/tests/dba_inifile.phpt]
> SKIP DBA NDBM handler test [ext/dba/tests/dba_ndbm.phpt] (reason: NDBM handler not 
> available)
> PASS DBA File Creation Test [ext/dba/tests/dba001.phpt] (info: FLATFILE handler used)
> PASS DBA Insert/Fetch Test [ext/dba/tests/dba002.phpt] (info: FLATFILE handler used)
> PASS DBA Insert/Replace/Fetch Test [ext/dba/tests/dba003.phpt] (info: FLATFILE 
> handler used)
> PASS DBA Multiple Insert/Fetch Test [ext/dba/tests/dba004.phpt] (info: FLATFILE 
> handler used)
> PASS DBA FirstKey/NextKey Loop Test With 5 Items
> [ext/dba/tests/dba005.phpt] (info: FLATFILE handler used)
> PASS DBA FirstKey/NextKey with 2 deletes [ext/dba/tests/dba006.phpt] (info: FLATFILE 
> handler used)
> PASS DBA Multiple File Creation Test [ext/dba/tests/dba007.phpt] (info: FLATFILE 
> handler used)
> PASS DBA magic_quotes_runtime Test [ext/dba/tests/dba008.phpt] (info: FLATFILE 
> handler used)
> PASS DBA dba_popen Test [ext/dba/tests/dba009.phpt] (info: FLATFILE handler used)

> So, as I understand it, the problem went away by replacing db-4.0.14
> by db-4.1.25. But isn't it going to bite other db4 users?

> Strange however that php-4.3.3 did not experience these problems.

>Martin



-- 
Best regards,
 Marcusmailto:[EMAIL PROTECTED]

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



[PHP-DEV] SPL Examples Broken?

2004-01-23 Thread Adam Maccabee Trachtenberg
I'm trying to run the SPL examples and running into some
problems. Some of these I was able to work around, but I eventually
end up generating a 192 Mb core dump with a 1000+ line gdb
backtrace. It's actually quite an impressive crash. :)

First of all, I'm running under PHP 5 Beta 3 since the current CVS no
longer allows an Interface to implement an Interface. (Maybe this is
the biggest problem? I thought I rememebered Andi claim that Zeev will
be fixing this RSN?)

Second, there is a small typo in recursiveiteratoriterator.inc. Line
67 has one extra closing ')'. I fixed this.

Next, I get an error that recursivedirectoryiterator.inc cannot be
found. Based on some guess work, I created this file and placed the
following PHP code inside:

class RecursiveDirectoryIterator extends DirectoryTreeIterator { }

I'm not sure if this is correct, but it allowed me to run the
following without any warnings:

~/Documents/php/php-5.0.0b3/sapi/cli/php -d include_path=.
-d auto_prepend_file=autoload.inc tree.php ../../dba

Unfortunately, this gives a big core dump. :(

If anyone has some suggestions I'm happy to try them. In the meantime
I will start with a more basic example and see what pushes PHP over
the edge. Maybe that will give a more reasonable backtrace. (Marcus: I
will send you my current backtrace if you think it will be helpful.)

-adam

-- 
[EMAIL PROTECTED]
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!

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



Re: [PHP-DEV] SPL Examples Broken?

2004-01-23 Thread Marcus Boerger
Hello Adam,

Friday, January 23, 2004, 9:48:42 PM, you wrote:

> I'm trying to run the SPL examples and running into some
> problems. Some of these I was able to work around, but I eventually
> end up generating a 192 Mb core dump with a 1000+ line gdb
> backtrace. It's actually quite an impressive crash. :)

> First of all, I'm running under PHP 5 Beta 3 since the current CVS no
> longer allows an Interface to implement an Interface. (Maybe this is
> the biggest problem? I thought I rememebered Andi claim that Zeev will
> be fixing this RSN?)

> Second, there is a small typo in recursiveiteratoriterator.inc. Line
> 67 has one extra closing ')'. I fixed this.

> Next, I get an error that recursivedirectoryiterator.inc cannot be
> found. Based on some guess work, I created this file and placed the
> following PHP code inside:

> class RecursiveDirectoryIterator extends DirectoryTreeIterator { }

> I'm not sure if this is correct, but it allowed me to run the
> following without any warnings:

> ~/Documents/php/php-5.0.0b3/sapi/cli/php -d include_path=.
> -d auto_prepend_file=autoload.inc tree.php ../../dba

> Unfortunately, this gives a big core dump. :(

> If anyone has some suggestions I'm happy to try them. In the meantime
> I will start with a more basic example and see what pushes PHP over
> the edge. Maybe that will give a more reasonable backtrace. (Marcus: I
> will send you my current backtrace if you think it will be helpful.)

The way you created RecursiveDirectoryIterator should be the problem.
At least i hope so. The class is suppoed to implement interface
RecursiveIterator which you are obviously missing. Apart from that the class
is a built in class (or are you trying the code without ext/spl?).
You can verify the existence of the class by the following line:

$ php -r 'Reflection_Class::export("RecursiveDirectoryIterator");'

You should then see an outut like this:
Class [   class RecursiveDirectoryIterator extends 
DirectoryIterator implements Traversable, Iterator, RecursiveIterator ] {

  - Constants [0] {
  }

  [...]

Where two things are important. First the fact that the class is an internal
class and second that it implements interface RecursiveIterator.

You may also send me the bt. But i know those funny bitches. Such lengthy
bts occur when the error happens very deep inrecursion.

And thanks for noticing the error in the example (i shouldn't rewrite test
files when no longer using them).

Best regards,
 Marcusmailto:[EMAIL PROTECTED]

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



Re: [PHP-DEV] SPL Examples Broken?

2004-01-23 Thread Adam Maccabee Trachtenberg
On Fri, 23 Jan 2004, Marcus Boerger wrote:

> The way you created RecursiveDirectoryIterator should be the problem.
> At least i hope so. The class is suppoed to implement interface
> RecursiveIterator which you are obviously missing. Apart from that the class
> is a built in class (or are you trying the code without ext/spl?).
> You can verify the existence of the class by the following line:

I am an idiot. I forgot that I did not build PHP Beta 3 with SPL, so
when I switched from my "current CVS" build to work around the
"implements" bug, I eliminated SPL from my copy of PHP. :)

I will try rebuilding things and take a second look.

Thanks.

-adam

-- 
[EMAIL PROTECTED]
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!

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



Re: [PHP-DEV] base class

2004-01-23 Thread Timm Friebe
On Thu, 2004-01-22 at 15:48, Stephane Drouard wrote:
[...]
> I think all classes should be derived from a common base class 
> (stdClass or a new dedicated one), even if it's not explicitly
>  written.

This can be done in userland and should take a more or less skilled
programmer 5 to 10 minutes.

- Timm

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



Re: [PHP-DEV] SPL Examples Broken?

2004-01-23 Thread Adam Maccabee Trachtenberg
On Fri, 23 Jan 2004, Adam Maccabee Trachtenberg wrote:

> I will try rebuilding things and take a second look.

The tree.php example now works, but I am getting errors with
findfile.php:

[EMAIL PROTECTED]:~/CVS/php/php-src/ext/spl/examples] $
../../../sapi/cli/php -d auto_prepend_file=autoload.inc findfile.php
. findfile.php
PHP Notice:  Undefined property:  FindFile::$it in
/usr/local/cvs/php/php-src/ext/spl/examples/findfile.php on line 36
PHP Fatal error:  Call to a member function current() on a non-object
in /usr/local/cvs/php/php-src/ext/spl/examples/findfile.php on line 36
/Users/adam/CVS/php/php-src/main/streams/streams.c(371) : Stream of
type 'dir' 0xac0e80 (path:(null)) was not closed

-adam

-- 
[EMAIL PROTECTED]
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!

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



Re: [PHP-DEV] SPL Examples Broken?

2004-01-23 Thread Marcus Boerger
Hello Adam,

Friday, January 23, 2004, 11:18:09 PM, you wrote:

> On Fri, 23 Jan 2004, Adam Maccabee Trachtenberg wrote:

>> I will try rebuilding things and take a second look.

> The tree.php example now works, but I am getting errors with
> findfile.php:

> [EMAIL PROTECTED]:~/CVS/php/php-src/ext/spl/examples] $
> ../../../sapi/cli/php -d auto_prepend_file=autoload.inc findfile.php
> . findfile.php
> PHP Notice:  Undefined property:  FindFile::$it in
> /usr/local/cvs/php/php-src/ext/spl/examples/findfile.php on line 36
> PHP Fatal error:  Call to a member function current() on a non-object
> in /usr/local/cvs/php/php-src/ext/spl/examples/findfile.php on line 36
> /Users/adam/CVS/php/php-src/main/streams/streams.c(371) : Stream of
> type 'dir' 0xac0e80 (path:(null)) was not closed

Fixed too. Hey if you find some cool & easy examples please tell me.
Lukas already mentioned some random iterator. That would require an
interface that add a count() method to the Seekable interface. And
an iterator class that randomly seeks and reads from such interfaces.
Of course the class would need to build up an array of available indices
and only return elements not read so far by dropping any read index from
the available list when read.


Best regards,
 Marcusmailto:[EMAIL PROTECTED]

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



Re: [PHP-DEV] __clone() implementation

2004-01-23 Thread lingwitt
I was told earlier that this is the correct way to do it:

public function __clone()
{
$this = parent::__clone();

$this->... = $that->...;
...
}
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DEV] base class

2004-01-23 Thread lingwitt
So why must we all keep implementing it?

On 23 Jan 2004, at 4:21 PM, Timm Friebe wrote:

This can be done in userland and should take a more or less skilled
programmer 5 to 10 minutes.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DEV] base class

2004-01-23 Thread Timm Friebe
On Sat, 2004-01-24 at 03:06, [EMAIL PROTECTED] wrote:
> So why must we all keep implementing it?

Well, because you'd probably not like it the way I'd like to see it (or
the other way around), someone else probably prefers PEAR's, Horde's,
$random_other_php_framework's solution, and so on.

Plus, as was already said, and to which I agree, not every class should
have a constructor. If it did, you'd have a noticeable and unnecessary
memory overhead, especially when you're creating big amounts of objects.

There are more reasons which do not necessarily have to do with
performance or memory consumption but rather with how one thinks a base
class should be designed - see what I mean by personal preferences?

All in all, I don't think it would be a good idea if PHP forced this on
you. What would be basically OK if you had the _option_ of having such a
base class. But then again, why not simply write one for yourself? It's
not like any programmer utilizing OOP *doesn't* use any sort of
include(s) in where his/her classes reside. Add it there and you're all
set up.

It's basically the same with the built-in exception class. I can't have
my own (at least not with the sexy-most name "Exception"). Then, in my
(very personal) view I want it designed differently, and want to have it
extend _my_ base class (which, incidentally, is called "Object" and does
_not_ have constructor:)) - again, this is _my_ very personal feeling
about how it should be - so I'll just have my own exception, which is
perfectly OK and dealt with very well by the Zend Engine.

I'm not the only PHP user out there with his or her own understanding of
subtleties in class design (new Reflection_Class("xxx") vs.
Reflection_Class::forName("xxx"). As for base classes, whip up Google,
search for object.php and see for yourself.

- Timm

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