aboutsummaryrefslogtreecommitdiff
path: root/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output
diff options
context:
space:
mode:
Diffstat (limited to 'srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output')
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Download.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Hex.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Inline.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Link.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_PNG_Inline.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Binarytoip.php97
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Bool2Text.php45
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Dateformat.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_External.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Formatted.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Imagelink.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php101
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php60
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php101
15 files changed, 834 insertions, 0 deletions
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Download.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Download.php
new file mode 100644
index 0000000..2c0795f
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Download.php
@@ -0,0 +1,43 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Application OctetStream Download Transformations plugin for phpMyAdmin
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage Download
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\Transformations\Abs\DownloadTransformationsPlugin;
+
+/**
+ * Handles the download transformation for application octetstream
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage Download
+ */
+// @codingStandardsIgnoreLine
+class Application_Octetstream_Download extends DownloadTransformationsPlugin
+{
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Application";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "OctetStream";
+ }
+}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Hex.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Hex.php
new file mode 100644
index 0000000..4ab62eb
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Hex.php
@@ -0,0 +1,43 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Application OctetStream Hex Transformations plugin for phpMyAdmin
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage Hex
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\Transformations\Abs\HexTransformationsPlugin;
+
+/**
+ * Handles the hex transformation for application octetstream
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage Hex
+ */
+// @codingStandardsIgnoreLine
+class Application_Octetstream_Hex extends HexTransformationsPlugin
+{
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Application";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "OctetStream";
+ }
+}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Inline.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Inline.php
new file mode 100644
index 0000000..7c69405
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Inline.php
@@ -0,0 +1,43 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Image JPEG Inline Transformations plugin for phpMyAdmin
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage Inline
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\Transformations\Abs\InlineTransformationsPlugin;
+
+/**
+ * Handles the inline transformation for image jpeg
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage Inline
+ */
+// @codingStandardsIgnoreLine
+class Image_JPEG_Inline extends InlineTransformationsPlugin
+{
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Image";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "JPEG";
+ }
+}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Link.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Link.php
new file mode 100644
index 0000000..f338d57
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Link.php
@@ -0,0 +1,43 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Image JPEG Link Transformations plugin for phpMyAdmin
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage Link
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\Transformations\Abs\ImageLinkTransformationsPlugin;
+
+/**
+ * Handles the link transformation for image jpeg
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage Link
+ */
+// @codingStandardsIgnoreLine
+class Image_JPEG_Link extends ImageLinkTransformationsPlugin
+{
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Image";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "JPEG";
+ }
+}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_PNG_Inline.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_PNG_Inline.php
new file mode 100644
index 0000000..5c8e5e5
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_PNG_Inline.php
@@ -0,0 +1,43 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Image PNG Inline Transformations plugin for phpMyAdmin
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage Inline
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\Transformations\Abs\InlineTransformationsPlugin;
+
+/**
+ * Handles the inline transformation for image png
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage Inline
+ */
+// @codingStandardsIgnoreLine
+class Image_PNG_Inline extends InlineTransformationsPlugin
+{
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Image";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "PNG";
+ }
+}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php
new file mode 100644
index 0000000..e6132f0
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php
@@ -0,0 +1,43 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Blob SQL Transformations plugin for phpMyAdmin
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage SQL
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\Transformations\Abs\SQLTransformationsPlugin;
+
+/**
+ * Handles the sql transformation for blob data
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage SQL
+ */
+// @codingStandardsIgnoreLine
+class Text_Octetstream_Sql extends SQLTransformationsPlugin
+{
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Text";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "Octetstream";
+ }
+}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Binarytoip.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Binarytoip.php
new file mode 100644
index 0000000..ea08c78
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Binarytoip.php
@@ -0,0 +1,97 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Handles the binary to IPv4/IPv6 transformation for text plain
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage BinaryToIP
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\TransformationsPlugin;
+use stdClass;
+
+/**
+ * Handles the binary to IPv4/IPv6 transformation for text plain
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage BinaryToIP
+ */
+// @codingStandardsIgnoreLine
+class Text_Plain_Binarytoip extends TransformationsPlugin
+{
+ /**
+ * Gets the transformation description of the plugin
+ *
+ * @return string
+ */
+ public static function getInfo()
+ {
+ return __(
+ 'Converts an Internet network address stored as a binary string'
+ . ' into a string in Internet standard (IPv4/IPv6) format.'
+ );
+ }
+
+ /**
+ * Does the actual work of each specific transformations plugin.
+ *
+ * @param string $buffer text to be transformed. a binary string containing
+ * an IP address, as returned from MySQL's INET6_ATON
+ * function
+ * @param array $options transformation options
+ * @param stdClass|null $meta meta information
+ *
+ * @return string IP address
+ */
+ public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
+ {
+ if (0 !== strpos($buffer, '0x')) {
+ return $buffer;
+ }
+
+ $ipHex = substr($buffer, 2);
+ $ipBin = hex2bin($ipHex);
+
+ if (false === $ipBin) {
+ return $buffer;
+ }
+
+ return @inet_ntop($ipBin);
+ }
+
+
+ /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
+
+ /**
+ * Gets the transformation name of the plugin
+ *
+ * @return string
+ */
+ public static function getName()
+ {
+ return "Binary To IPv4/IPv6";
+ }
+
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Text";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "Plain";
+ }
+}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Bool2Text.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Bool2Text.php
new file mode 100644
index 0000000..fcb65a6
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Bool2Text.php
@@ -0,0 +1,45 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Text Plain Bool2Text Transformations plugin for phpMyAdmin
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage Bool2Text
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\Transformations\Abs\Bool2TextTransformationsPlugin;
+
+/**
+ * Handles the Boolean to Text transformation for text plain.
+ * Has one option: the output format (default 'T/F')
+ * or 'Y/N'
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage Bool2Text
+ */
+// @codingStandardsIgnoreLine
+class Text_Plain_Bool2Text extends Bool2TextTransformationsPlugin
+{
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Text";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "Plain";
+ }
+}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Dateformat.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Dateformat.php
new file mode 100644
index 0000000..1d0ae78
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Dateformat.php
@@ -0,0 +1,43 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Text Plain Date Format Transformations plugin for phpMyAdmin
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage DateFormat
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\Transformations\Abs\DateFormatTransformationsPlugin;
+
+/**
+ * Handles the date format transformation for text plain
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage DateFormat
+ */
+// @codingStandardsIgnoreLine
+class Text_Plain_Dateformat extends DateFormatTransformationsPlugin
+{
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Text";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "Plain";
+ }
+}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_External.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_External.php
new file mode 100644
index 0000000..8e5a36d
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_External.php
@@ -0,0 +1,43 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Text Plain External Transformations plugin for phpMyAdmin
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage External
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\Transformations\Abs\ExternalTransformationsPlugin;
+
+/**
+ * Handles the external transformation for text plain
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage External
+ */
+// @codingStandardsIgnoreLine
+class Text_Plain_External extends ExternalTransformationsPlugin
+{
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Text";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "Plain";
+ }
+}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Formatted.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Formatted.php
new file mode 100644
index 0000000..6eeffba
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Formatted.php
@@ -0,0 +1,43 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Text Plain Formatted Transformations plugin for phpMyAdmin
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage Formatted
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\Transformations\Abs\FormattedTransformationsPlugin;
+
+/**
+ * Handles the formatted transformation for text plain
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage Formatted
+ */
+// @codingStandardsIgnoreLine
+class Text_Plain_Formatted extends FormattedTransformationsPlugin
+{
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Text";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "Plain";
+ }
+}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Imagelink.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Imagelink.php
new file mode 100644
index 0000000..fcad39b
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Imagelink.php
@@ -0,0 +1,43 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Text Plain Image Link Transformations plugin for phpMyAdmin
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage ImageLink
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\Transformations\Abs\TextImageLinkTransformationsPlugin;
+
+/**
+ * Handles the image link transformation for text plain
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage ImageLink
+ */
+// @codingStandardsIgnoreLine
+class Text_Plain_Imagelink extends TextImageLinkTransformationsPlugin
+{
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Text";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "Plain";
+ }
+}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php
new file mode 100644
index 0000000..ce06610
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php
@@ -0,0 +1,101 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Text Plain JSON Transformations plugin for phpMyAdmin
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage SQL
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\TransformationsPlugin;
+use PhpMyAdmin\Response;
+use stdClass;
+
+/**
+ * Handles the json transformation for text plain
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage JSON
+ */
+// @codingStandardsIgnoreLine
+class Text_Plain_Json extends TransformationsPlugin
+{
+ /**
+ * No-arg constructor
+ */
+ public function __construct()
+ {
+ if (! empty($GLOBALS['cfg']['CodemirrorEnable'])) {
+ $response = Response::getInstance();
+ $scripts = $response->getHeader()
+ ->getScripts();
+ $scripts->addFile('vendor/codemirror/lib/codemirror.js');
+ $scripts->addFile('vendor/codemirror/mode/javascript/javascript.js');
+ $scripts->addFile('vendor/codemirror/addon/runmode/runmode.js');
+ $scripts->addFile('transformations/json.js');
+ }
+ }
+
+ /**
+ * Gets the transformation description of the specific plugin
+ *
+ * @return string
+ */
+ public static function getInfo()
+ {
+ return __(
+ 'Formats text as JSON with syntax highlighting.'
+ );
+ }
+
+ /**
+ * Does the actual work of each specific transformations plugin.
+ *
+ * @param string $buffer text to be transformed
+ * @param array $options transformation options
+ * @param stdClass|null $meta meta information
+ *
+ * @return string
+ */
+ public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
+ {
+ return '<code class="json"><pre>' . "\n"
+ . htmlspecialchars($buffer) . "\n"
+ . '</pre></code>';
+ }
+
+ /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
+
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Text";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "Plain";
+ }
+
+ /**
+ * Gets the transformation name of the specific plugin
+ *
+ * @return string
+ */
+ public static function getName()
+ {
+ return "JSON";
+ }
+}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php
new file mode 100644
index 0000000..2c39e03
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php
@@ -0,0 +1,60 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Text Plain SQL Transformations plugin for phpMyAdmin
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage SQL
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\Transformations\Abs\SQLTransformationsPlugin;
+use PhpMyAdmin\Response;
+
+/**
+ * Handles the sql transformation for text plain
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage SQL
+ */
+// @codingStandardsIgnoreLine
+class Text_Plain_Sql extends SQLTransformationsPlugin
+{
+ /**
+ * No-arg constructor
+ */
+ public function __construct()
+ {
+ if (! empty($GLOBALS['cfg']['CodemirrorEnable'])) {
+ $response = Response::getInstance();
+ $scripts = $response->getHeader()
+ ->getScripts();
+ $scripts->addFile('vendor/codemirror/lib/codemirror.js');
+ $scripts->addFile('vendor/codemirror/mode/sql/sql.js');
+ $scripts->addFile('vendor/codemirror/addon/runmode/runmode.js');
+ $scripts->addFile('functions.js');
+ }
+ }
+
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Text";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "Plain";
+ }
+}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php
new file mode 100644
index 0000000..fc06744
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php
@@ -0,0 +1,101 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Text Plain XML Transformations plugin for phpMyAdmin
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage SQL
+ */
+declare(strict_types=1);
+
+namespace PhpMyAdmin\Plugins\Transformations\Output;
+
+use PhpMyAdmin\Plugins\TransformationsPlugin;
+use PhpMyAdmin\Response;
+use stdClass;
+
+/**
+ * Handles the XML transformation for text plain
+ *
+ * @package PhpMyAdmin-Transformations
+ * @subpackage XML
+ */
+// @codingStandardsIgnoreLine
+class Text_Plain_Xml extends TransformationsPlugin
+{
+ /**
+ * No-arg constructor
+ */
+ public function __construct()
+ {
+ if (! empty($GLOBALS['cfg']['CodemirrorEnable'])) {
+ $response = Response::getInstance();
+ $scripts = $response->getHeader()
+ ->getScripts();
+ $scripts->addFile('vendor/codemirror/lib/codemirror.js');
+ $scripts->addFile('vendor/codemirror/mode/xml/xml.js');
+ $scripts->addFile('vendor/codemirror/addon/runmode/runmode.js');
+ $scripts->addFile('transformations/xml.js');
+ }
+ }
+
+ /**
+ * Gets the transformation description of the specific plugin
+ *
+ * @return string
+ */
+ public static function getInfo()
+ {
+ return __(
+ 'Formats text as XML with syntax highlighting.'
+ );
+ }
+
+ /**
+ * Does the actual work of each specific transformations plugin.
+ *
+ * @param string $buffer text to be transformed
+ * @param array $options transformation options
+ * @param stdClass|null $meta meta information
+ *
+ * @return string
+ */
+ public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
+ {
+ return '<code class="xml"><pre>' . "\n"
+ . htmlspecialchars($buffer) . "\n"
+ . '</pre></code>';
+ }
+
+ /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
+
+ /**
+ * Gets the plugin`s MIME type
+ *
+ * @return string
+ */
+ public static function getMIMEType()
+ {
+ return "Text";
+ }
+
+ /**
+ * Gets the plugin`s MIME subtype
+ *
+ * @return string
+ */
+ public static function getMIMESubtype()
+ {
+ return "Plain";
+ }
+
+ /**
+ * Gets the transformation name of the specific plugin
+ *
+ * @return string
+ */
+ public static function getName()
+ {
+ return "XML";
+ }
+}