Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / libraries / plugins / transformations / abstract / SQLTransformationsPlugin.class.php
blob2123cdb3d348257365426fbaa1812f21d6fc9d18
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Abstract class for the SQL transformations plugins
6 * @package PhpMyAdmin-Transformations
7 * @subpackage SQL
8 */
9 if (! defined('PHPMYADMIN')) {
10 exit;
13 /* Get the transformations interface */
14 require_once 'libraries/plugins/TransformationsPlugin.class.php';
16 /**
17 * Provides common methods for all of the SQL transformations plugins.
19 * @package PhpMyAdmin
21 abstract class SQLTransformationsPlugin extends TransformationsPlugin
23 /**
24 * Gets the transformation description of the specific plugin
26 * @return string
28 public static function getInfo()
30 return __(
31 'Formats text as SQL query with syntax highlighting.'
35 /**
36 * Does the actual work of each specific transformations plugin.
38 * @param string $buffer text to be transformed
39 * @param array $options transformation options
40 * @param string $meta meta information
42 * @return void
44 public function applyTransformation($buffer, $options = array(), $meta = '')
46 $result = PMA_SQP_formatHtml(PMA_SQP_parse($buffer));
47 // Need to clear error state not to break subsequent queries display.
48 PMA_SQP_resetError();
49 return $result;
52 /**
53 * This method is called when any PluginManager to which the observer
54 * is attached calls PluginManager::notify()
56 * @param SplSubject $subject The PluginManager notifying the observer
57 * of an update.
59 * @todo implement
60 * @return void
62 public function update (SplSubject $subject)
68 /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
71 /**
72 * Gets the transformation name of the specific plugin
74 * @return string
76 public static function getName()
78 return "SQL";