Re: Re: Pear Pager, Pager constructor is deprecated. You must use the "Pager::factory($params)" method instead of "new Pager($params)"

From: Date: Thu, 05 Jan 2006 23:41:07 +0000
Subject: Re: Re: Pear Pager, Pager constructor is deprecated. You must use the "Pager::factory($params)" method instead of "new Pager($params)"
References: 1 2 3 4  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-22450@lists.php.net to get a copy of this message
On 1/5/06, Colin Ross <colinross@gmail.com> wrote: > On a sidenote, don't you think its a bit extreme to throw a fatal error for > using a depreciated format? WHat about older, not maintained projects? > Should they fail becuase the package's author decided to use a factory > method instead? > Why not redirect the old way to the new? > > i.e. > class pager{ > function *__construct($params)*{ > return $this->factory($params); > } > function pager($params){ > return $this->factory($params); > } > function factory($params){ > .... > } > } > Because constructors can't return values. It doesn't work that way. You have to use the factory. > -c > > On 1/5/06, Louie Miranda <lmiranda@gmail.com> wrote: > > > > Oh my, i had been gone for a very long time. > > > > Thanks sir. > > > > On 1/5/06, Haydar Ciftci <haydar.ciftci@gmail.com> wrote: > > > > > > Instead using > > > $pager = &new Pager($params); > > > try > > > $pager = Pager::factory($params); > > > > > > See the doc at > > > > > > http://pear.php.net/manual/en/package.html.pager.factory.php > > > > > > -- > > > PEAR General Mailing List (http://pear.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > -- > > Louie Miranda > > http://www.axishift.com -- under development > > > > -- Justin Patrin

« previous php.pear.general (#22450) next »