mirror of
https://github.com/friendica/friendica-directory
synced 2024-11-11 23:11:34 +01:00
Improve DirectoryAdd console output
This commit is contained in:
parent
bbff23caa5
commit
641dc9b8eb
|
@ -54,17 +54,17 @@ HELP;
|
||||||
|
|
||||||
$directory_url = $this->getArgument(0);
|
$directory_url = $this->getArgument(0);
|
||||||
|
|
||||||
$result = $this->atlas->perform('INSERT IGNORE INTO `directory_poll_queue` SET
|
$affected = $this->atlas->fetchAffected('INSERT IGNORE INTO `directory_poll_queue` SET
|
||||||
`directory_url` = :directory_url',
|
`directory_url` = :directory_url',
|
||||||
['directory_url' => $directory_url]
|
['directory_url' => $directory_url]
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$result) {
|
if (!$affected) {
|
||||||
throw new \RuntimeException('Unable to add repository with URL: ' . $directory_url);
|
$this->out('Directory already exists in the queue.');
|
||||||
|
} else {
|
||||||
|
$this->out('Successfully added the directory to the queue.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->out('Successfully added the repository to the queue.');
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue