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/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/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>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.4" />

View File

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