Databases Reference
In-Depth Information
MIME-Based Transformations
In this chapter, we cover a powerful phpMyAdmin feature: its ability to transform a
column's contents according to specific rules called the transformations. This chapter
describes how we can transform the contents that we see in the Browse mode for a
table. Normally, the exact contents of each row are displayed, except that:
TEXT and CHARACTER fields might be truncated, according to
$cfg['LimitChars'] and whether we have clicked on the Full Text icon.
BLOB fields might be replaced by a message like [BLOB - 1.5 KB] .
We will use the term cell to indicate a specific column of a specific row. The cell
containing the cover photograph for the 'Future souvenirs' book (a BLOB column) is
currently displayed as cryptic data like ‰PNG\r\n\Z\n\0\0\0\rIHDR\0 or as a
message stating the BLOB field's size. It would be interesting to see a thumbnail of
the picture directly in phpMyAdmin, and possibly the picture itself.
We define a transformation as a mechanism by which all the cells relating to a
column are transformed at browse time, using the metadata defined for this column.
Only the cells visible on the results page are transformed. The transformation logic
itself is coded in PHP scripts, stored in libraries/transformations , and called
using a plug-in architecture.
To enable this feature, we must set $cfg['BrowseMIME'] to TRUE in config.inc.
php . The relational system must be in place (see Chapter 11), because the metadata
necessary for the transformations is not available in the official MySQL table
structure; it is an addition made especially for phpMyAdmin.
In the documentation section on phpMyAdmin's home
site, there is a link pointing to additional information for
developers who would like to learn the internal structure
of the plug-ins in order to code their own transformations.
Search WWH ::




Custom Search