[Phpmyadmin-devel] Refactoring: Displaying query results

Chanaka Dharmarathna pe.chanaka.ck at gmail.com
Thu Jun 28 04:04:14 CEST 2012

> > Hi All,
> >
> > I have already create a class for display_tbl.lib.php
> > andPMA_getDataCellForBlobField() in master used the
> > PMA_mimeDefaultFunction() function as a global function.
> > EX :
> > $str = 'PMA_mimeDefaultFunction';
> > $str($parameters);
> >
> > I have moved the PMA_mimeDefaultFunction() from display_tbl.lib.php (in
> > master) to common.lib.php file due to the way it has used inside
> > display_tbl.lib.php.
> >
> > Now I'm implementing class behavior in common.lib.php file.
> > So can anyone tell me a file, which contain global function, to where I
> > should again move this PMA_mimeDefaultFunction().
> >
> > Regards !
> Chanaka,
> I believe that this function should not be global, as it's only called
> from other functions in libraries/DisplayResults.class.php, right?
Hi Marc,

I'm going to look into getting PMA_mimeDefaultFunction() function inside
PMA_DisplayResults class. (currently it is under core.lib.php)
I think it is possible to use this function inside that class, and call
directly ($this->_mimeDefaultFunction()) instead of using additional string
to store method name. (current way)

Then the default function for the mime transformation is inside a class.
But the other existing transformations functions are still global functions.
If that is not good (feels not good), those also should convert to classes.

And if other transformations converted to classes, in which way I can
create objects of those classes.
Should I need to use string to store the class name and then use it as

$class_name = 'TestClass';
$ob = new $class_name($params);

It is very helpful for me if you can share your suggestions.

Regards !

Chanaka Indrajith
Bsc.Computer Engineering Undergraduate
Faculty of Engineering
University of Peradeniya
Sri Lanka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20120628/a70ada23/attachment.html>

More information about the Developers mailing list