2 // vim: expandtab sw=4 ts=4 sts=4:
4 * This file contains the basic structure for an abstract class defining a
6 * For instructions, read the documentation
8 * @package PhpMyAdmin-Transformations
9 * @subpackage [TransformationName]
11 if (! defined('PHPMYADMIN')) {
15 /* Get the transformations interface */
16 require_once 'libraries/plugins/TransformationsPlugin.class.php';
19 * Provides common methods for all of the [TransformationName] transformations plugins.
23 abstract class [TransformationName]TransformationsPlugin
24 extends TransformationsPlugin
27 * Gets the transformation description of the specific plugin
31 public static function getInfo()
34 'Description of the transformation.'
39 * Does the actual work of each specific transformations plugin.
41 * @param string $buffer text to be transformed
42 * @param array $options transformation options
43 * @param string $meta meta information
47 public function applyTransformation($buffer, $options = array(), $meta = '')
49 // possibly use a global transform and feed it with special options
51 // further operations on $buffer using the $options[] array.
53 // You can evaluate the propagated $meta Object. It's contained fields are described in http://www.php.net/mysql_fetch_field.
54 // This stored information can be used to get the field information about the transformed field.
55 // $meta->mimetype contains the original MimeType of the field (i.e. 'text/plain', 'image/jpeg' etc.)
61 * This method is called when any PluginManager to which the observer
62 * is attached calls PluginManager::notify()
64 * @param SplSubject $subject The PluginManager notifying the observer
70 public function update (SplSubject $subject)
76 /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
80 * Gets the TransformationName of the specific plugin
84 public static function getName()
86 return "[TransformationName]";