From 0d47b2a7578e89c8df27556a40283101919ed9d6 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Thu, 5 Jun 2025 15:38:06 +0400 Subject: [PATCH] modifs.mineures sans commentaires --- php/src/db/CapacitorStorage.php | 16 ++++++++++++++++ php/src/db/sqlite/SqliteStorage.php | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/php/src/db/CapacitorStorage.php b/php/src/db/CapacitorStorage.php index 542673e..df39422 100644 --- a/php/src/db/CapacitorStorage.php +++ b/php/src/db/CapacitorStorage.php @@ -227,6 +227,22 @@ abstract class CapacitorStorage { "class_name" => "varchar", ]; + function channelExists(string $name, ?array &$row=null): bool { + $row = $this->db()->one([ + "select", + "from" => static::CHANNELS_TABLE, + "where" => ["name" => $name], + ]); + return $row !== null; + } + + function getChannels(): iterable { + return $this->db()->all([ + "select", + "from" => static::CHANNELS_TABLE, + ]); + } + protected function _createChannelsSql(): array { return [ "create table if not exists", diff --git a/php/src/db/sqlite/SqliteStorage.php b/php/src/db/sqlite/SqliteStorage.php index d37b9d1..e9423b9 100644 --- a/php/src/db/sqlite/SqliteStorage.php +++ b/php/src/db/sqlite/SqliteStorage.php @@ -38,22 +38,6 @@ class SqliteStorage extends CapacitorStorage { return new _sqliteMigration($migrations, $channel->getName()); } - function channelExists(string $name, ?array &$row=null): bool { - $row = $this->db->one([ - "select", - "from" => static::CHANNELS_TABLE, - "where" => ["name" => $name], - ]); - return $row !== null; - } - - function getChannels(): iterable { - return $this->db->all([ - "select", - "from" => static::CHANNELS_TABLE, - ]); - } - protected function _addToChannelsSql(CapacitorChannel $channel): array { $sql = parent::_addToChannelsSql($channel); $sql[0] = "insert or ignore";