# Suhopware Commands

**URL:** <https://forum.shopware.com/t/suhopware-commands/40805>\
**Category:** Programmierung\
**Created:** [25. Oktober 2016 um 08:29 UTC](https://forum.shopware.com/t/suhopware-commands/40805 "2016-10-25T08:29:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_Geloschter\_Benutze7](https://avatars.discourse-cdn.com/v4/letter/_/cdc98d/32.png) [@\_Geloschter\_Benutze7](https://forum.shopware.com/u/_Geloschter_Benutze7)\
**Post date:** [25. Oktober 2016 um 08:29 UTC](https://forum.shopware.com/t/suhopware-commands/40805/1 "2016-10-25T08:29:23Z")

</div>

Hallo,&nbsp;

ich möchte in meinem Console Command ein anderes Console Command am aufrufen.&nbsp;  
Habe in der Symfony Dokumentation folgendes gefunden:&nbsp;  
[http://symfony.com/doc/current/console/command\_in\_controller.html](http://symfony.com/doc/current/console/command_in_controller.html)

Smyfony Code:

```
 $kernel = $this-\>get('kernel'); $application = new Application($kernel); $application-\>setAutoExit(false); $input = new ArrayInput(array( 'command' =\> 'swiftmailer:spool:send', '--message-limit' =\> $messages, )); // You can use NullOutput() if you don't need the output $output = new BufferedOutput(); $application-\>run($input, $output);

```

Mein Code (Beispiel Command):

```
 $command = new RebuildCategoryTreeCommand(); $command-\>run(new ArrayInput(array()), new BufferedOutput());

```

In der Console bekomme ich folgenden Fehler:

PHP Fatal error: &nbsp;Call to a member function get() on a non-object in /…/vendor/symfony/console/Command/Command.php on line 615  
Fatal error: Call to a member function get() on a non-object in /…/vendor/symfony/console/Command/Command.php on line 615  
&nbsp;

Der Fehler kommt zustande, weil das HelperSet nicht definiert ist.&nbsp;

Hat jemand eine Idee?

---

<div class="post-metadata">

**Author:** ![ahmadsaad](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@ahmadsaad](https://forum.shopware.com/u/ahmadsaad)\
**Post date:** [25. Oktober 2016 um 16:00 UTC](https://forum.shopware.com/t/suhopware-commands/40805/2 "2016-10-25T16:00:32Z")

</div>

Hallo,

Ich weiß nicht was ist Ihre Aktule Code.

aber in jeden fall in Shopware , Sie können get Kernel mit:

> $this-\>container-\>get(‚kernel‘);

Ich hoffe, dass diese Sie helfen Können.

und Sie können auch diese Link schauen:&nbsp;[Shopware 5 CLI commands](https://developers.shopware.com/developers-guide/shopware-5-cli-commands/)

Viele Grüße,

Ahmad&nbsp;

---

<div class="post-metadata">

**Author:** ![\_Geloschter\_Benutze7](https://avatars.discourse-cdn.com/v4/letter/_/cdc98d/32.png) [@\_Geloschter\_Benutze7](https://forum.shopware.com/u/_Geloschter_Benutze7)\
**Post date:** [10. November 2016 um 08:52 UTC](https://forum.shopware.com/t/suhopware-commands/40805/3 "2016-11-10T08:52:55Z")

</div>

Hallo,&nbsp;

vielen Dank, das war der fehlende Bestandteil den ich benötigt habe.&nbsp;

Viele Grüße,&nbsp;  
Brian
