modifs.mineures sans commentaires

This commit is contained in:
Jephté Clain 2025-05-06 17:01:54 +04:00
parent fea5cb8b87
commit 3754ed7454
2 changed files with 16 additions and 21 deletions

9
.idea/php.xml generated
View File

@ -60,9 +60,16 @@
<path value="$PROJECT_DIR$/vendor/composer" /> <path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/nulib/spout" /> <path value="$PROJECT_DIR$/vendor/nulib/spout" />
<path value="$PROJECT_DIR$/vendor/nulib/spout" /> <path value="$PROJECT_DIR$/vendor/nulib/spout" />
<path value="$PROJECT_DIR$/vendor/nulib/php" />
<path value="$PROJECT_DIR$/vendor/nulib/spout" /> <path value="$PROJECT_DIR$/vendor/nulib/spout" />
<path value="$PROJECT_DIR$/vendor/nulib/spout" /> <path value="$PROJECT_DIR$/vendor/nulib/spout" />
<path value="$PROJECT_DIR$/vendor/doctrine/instantiator" />
<path value="$PROJECT_DIR$/vendor/ezyang/htmlpurifier" />
<path value="$PROJECT_DIR$/vendor/myclabs/php-enum" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/vendor/sebastian/resource-operations" />
<path value="$PROJECT_DIR$/vendor/nulib/spout" />
<path value="$PROJECT_DIR$/vendor/nulib/php" />
<path value="$PROJECT_DIR$/vendor/nulib/spout" />
</include_path> </include_path>
</component> </component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.4" /> <component name="PhpProjectSharedConfiguration" php_language_level="7.4" />

View File

@ -63,21 +63,14 @@ Application::run(new class extends Application {
$storage = new SqliteStorage($dbfile); $storage = new SqliteStorage($dbfile);
$db = $storage->db(); $db = $storage->db();
$haveChannels = $storage->tableExists("_channels");
$name = $this->name; $name = $this->name;
$channelClass = $this->channelClass; $channelClass = $this->channelClass;
$tableName = $this->tableName; $tableName = $this->tableName;
if ($name !== null) { if ($name !== null) {
$row = null; if (!$storage->channelExists($name, $row)) {
if ($haveChannels) { self::die("$name: nom de canal de données introuvable");
$row = $db->one([
"select from _channels",
"where" => ["name" => $name],
]);
} }
if ($row === null) self::die("$name: nom de canal de données introuvable"); if ($row["class_name"] !== "class@anonymous") $channelClass = $row["class_name"];
if ($row["class"] !== "class@anonymous") $channelClass = $row["class"];
else $tableName = $row["table_name"]; else $tableName = $row["table_name"];
} }
if ($channelClass !== null) { if ($channelClass !== null) {
@ -92,17 +85,12 @@ Application::run(new class extends Application {
}; };
} else { } else {
$found = false; $found = false;
if ($haveChannels) { foreach ($storage->getChannels() as $row) {
$rows = $db->all([ msg::print($row["name"]);
"select from _channels", $found = true;
]);
foreach ($rows as $row) {
msg::print($row["name"]);
$found = true;
}
} }
if (!$found) self::die("Vous devez spécifier le canal de données"); if ($found) self::exit();
else self::exit(); self::die("Vous devez spécifier le canal de données");
} }
$capacitor = new Capacitor($storage, $channel); $capacitor = new Capacitor($storage, $channel);