From 4861c88cc69075a84c32e0e94a484ffc30d441a1 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 18 Mar 2025 13:10:45 +0100 Subject: [PATCH] IMAP: Create, drop, truncate --- plugins/drivers/imap.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/plugins/drivers/imap.php b/plugins/drivers/imap.php index d61f37b8..6fe22214 100644 --- a/plugins/drivers/imap.php +++ b/plugins/drivers/imap.php @@ -1,6 +1,7 @@ $return->unseen, ); } + + function create($name) { + return imap_createmailbox($this->imap, $this->mailbox . $name); + } + + function drop($name) { + return imap_deletemailbox($this->imap, $this->mailbox . $name); + } + + function expunge($name) { + return imap_expunge($this->imap); + } } class Result { @@ -235,6 +248,33 @@ if (isset($_GET["imap"])) { return $table_status["Rows"]; } + function fk_support($table_status) { + } + + function engines() { + return array(); + } + + function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) { + return connection()->create($name); + } + + function drop_tables($tables) { + $return = true; + foreach ($tables as $name) { + $return = $return && connection()->drop($name); + } + return $return; + } + + function truncate_tables($tables) { + $return = true; + foreach ($tables as $name) { + $return = $return && connection()->expunge($name); + } + return $return; + } + function connect($credentials) { $connection = new Db; if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {