Le 2012-06-27 22:04, Chanaka Dharmarathna a écrit :
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 belows.
$class_name = 'TestClass'; $ob = new $class_name($params);
It is very helpful for me if you can share your suggestions.
Regards !
Hi Chanaka, maybe others, especially Alex Marin, would have an idea to share with you. I have not yet studied his new plugin system for transformations.