> wrote:
> >
> > Hi Chanaka,
> >
> > I stumbled upon this piece of code (random pick) :
> >
> > PMA_CommonFunctions::getInstance()->backquote($_REQUEST['view']['name'])
> >
> > and it made me wonder if using a singleton for PMA_CommonFunctions is
> > necessary, because basicaly PMA_Commonfunctions is a collection of
> > methods, not really a 'living' object.
> > So then I had a look at the class, and I discovered that the class has
> > no class variables (apart from the _instance variable) and an empty
> > constructor.
> > So basicly this should be a static class, with static methods, because
> > no instance is needed for it to work.
> >
> > And the above piece of code will become :
> >
> > PMA_CommonFunctions::backquote($_REQUEST['view']['name'])
> >
> > BTW: If you convert it to a static class, don't forget to replace the
> > $this->method() calls by the static equivalent self::method().
> > BTW2 : you forgot to add the if (! defined('PHPMYADMIN')), check in
> > the beginning of the file, see [0].
> >
> > [0]
http://wiki.phpmyadmin.net/pma/File_template
> > --
> > Kind regards,
> >
> > Dieter Adriaenssens
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Phpmyadmin-devel mailing list
Phpmyadmin-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel