Re: Re: [Call for Votes] HTTP_Download

From: Date: Wed, 01 Oct 2003 22:35:23 +0000
Subject: Re: Re: [Call for Votes] HTTP_Download
References: 1 2 3 4 5 6  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-22292@lists.php.net to get a copy of this message
Wednesday, October 1, 2003, 9:15:52 PM, Roman Neuhauser wrote: > # m.wallner@iworks.at / 2003-10-01 20:39:42 +0200: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Hi Roman Neuhauser, you wrote: >> >> > >> > http://pear.php.net/manual/en/core.pear.pear.raiseerror.php >> >> That way? >> http://dev.iworks.at/.src?f=HTTP_Download/Download > I was thinking of > if (...) { > $this = PEAR::raiseError(...); > return; > } Oh, that's just ugly. If you need to return an error in the constructor just use a static factory like method. Instead of: $a = new HTTP_Download(); do: $a = HTTP_Download::factory() or instance() or whatever. Inside that class you return a new HTTP_Download object, error or what you want. -- Tomas V.V.Cox mailto:cox@idecnet.com

« previous php.pear.dev (#22292) next »