To enable transformations, you have to setup the column_info table and the proper directives. Please see the Configuration on how to do so.
You can apply different transformations to the contents of each column. The transformation will take the content of each column and transform it with certain rules defined in the selected transformation.
Say you have a column ‘filename’ which contains a filename. Normally you would see in phpMyAdmin only this filename. Using transformations you can transform that filename into a HTML link, so you can click inside of the phpMyAdmin structure on the column’s link and will see the file displayed in a new browser window. Using transformation options you can also specify strings to append/prepend to a string or the format you want the output stored in.
For a general overview of all available transformations and their options, you can consult your <www.your-host.com>/<your-install- dir>/transformation_overview.php installation.
For a tutorial on how to effectively use transformations, see our Link section on the official phpMyAdmin homepage.
Go to your tbl_structure.php page (i.e. reached through clicking on the ‘Structure’ link for a table). There click on “Change” (or change icon) and there you will see three new fields at the end of the line. They are called ‘MIME-type’, ‘Browser transformation’ and ‘Transformation options’.
All specific transformations for mimetypes are defined through class files in the directory ‘libraries/plugins/transformations/’. Each of them extends a certain transformation abstract class declared in libraries/plugins/transformations/abstract.
They are stored in files to ease up customization and easy adding of new transformations.
Because the user cannot enter own mimetypes, it is kept sure that transformations always work. It makes no sense to apply a transformation to a mimetype the transform-function doesn’t know to handle.
There is a file called ‘transformations.lib.php‘ that provides some basic functions which can be included by any other transform function.
The file name convention is [Mimetype]_[Subtype]_[Transformation Name].class.php, while the abtract class that it extends has the name [Transformation Name]TransformationsPlugin. All of the methods that have to be implemented by a transformations plug-in are:
The getMIMEType(), getMIMESubtype() and getName() methods return the name of the MIME type, MIME Subtype and transformation accordingly. getInfo() returns the transformation’s description and possible options it may receive and applyTransformation() is the method that does the actual work of the transformation plug-in.
Please see the libraries/plugins/transformations/TEMPLATE and libraries/plugins/transformations/TEMPLATE_ABSTRACT files for adding your own transformation plug-in. You can also generate a new transformation plug-in (with or without the abstract transformation class), by using libraries/plugins/transformations/generator_plugin.sh or libraries/plugins/transformations/generator_main_class.sh.
The applyTransformation() method always gets passed three variables: