Quantcast
Channel: Programmierung - Shopware Community Forum
Viewing all articles
Browse latest Browse all 2871

Suhopware Commands

$
0
0

Hallo, 

ich möchte in meinem Console Command ein anderes Console Command am aufrufen. 
Habe in der Symfony Dokumentation folgendes gefunden: 
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:  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
 

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

Hat jemand eine Idee?


Viewing all articles
Browse latest Browse all 2871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>