* @var string
*/
public const LOG_CHANNEL = LogChannel::CONSOLE;
+
+ /**
+ * Checks, if the Console command was executed outside of`bin/console.php` and prints the correct execution
+ *
+ * @param string $command the current command
+ */
+ protected function checkDeprecated(string $command): void
+ {
+ if (substr($this->executable, -strlen('bin/console.php')) !== 'bin/console.php') {
+ $this->out(sprintf("'%s' is deprecated and will removed. Please use 'bin/console.php %s' instead", $this->executable, $command));
+ }
+ }
}
protected function doExecute()
{
- if (substr($this->executable, -strlen('bin/console.php')) !== 'bin/console.php') {
- $this->out(sprintf("'%s' is deprecated and will removed. Please use 'bin/console.php daemon' instead", $this->executable));
- }
+ $this->checkDeprecated('daemon');
if ($this->mode->isInstall()) {
throw new RuntimeException("Friendica isn't properly installed yet");
protected function doExecute()
{
- if ($this->executable !== 'bin/console.php') {
- $this->out(sprintf("'%s' is deprecated and will removed. Please use 'bin/console.php jetstream' instead", $this->executable));
- }
+ $this->checkDeprecated('jetstream');
if ($this->mode->isInstall()) {
throw new RuntimeException("Friendica isn't properly installed yet");
protected function doExecute()
{
- if ($this->executable !== 'bin/console.php') {
- $this->out(sprintf("'%s' is deprecated and will removed. Please use 'bin/console.php worker' instead", $this->executable));
- }
+ $this->checkDeprecated('worker');
$this->mode->setExecutor(Mode::WORKER);