# Zugriff auf Controller über CLI

**URL:** <https://forum.shopware.com/t/zugriff-auf-controller-uber-cli/28441>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [25. Juni 2015 um 10:13 UTC](https://forum.shopware.com/t/zugriff-auf-controller-uber-cli/28441 "2015-06-25T10:13:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kamik](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@kamik](https://forum.shopware.com/u/kamik)\
**Post date:** [25. Juni 2015 um 10:13 UTC](https://forum.shopware.com/t/zugriff-auf-controller-uber-cli/28441/1 "2015-06-25T10:13:07Z")

</div>

Hallo All, kann mir jemand helfen Controller Funktionen über CLI aufrufen? z.B. engine\Shopware\Plugins\Community\Frontend\TestController\TestController.php `class Shopware\_Controllers\_Frontend\_TestController extends Enlight\_Controller\_Action { ..... public function getArticlesCountAction(){ .... } }` in Bootstrap.php `class Shopware\_Plugins\_Frontend\_TestController\_Bootstrap extends Shopware\_Components\_Plugin\_Bootstrap { ..... public function onAddConsoleCommand(Enlight\_Event\_EventArgs $args) { Shopware()-\>Pluginlogger()-\>info('onAddConsoleCommand'); require\_once \_\_DIR\_\_ . '/Commands/getArticlesCount.php'; return new Doctrine\Common\Collections\ArrayCollection(array( new \Shopware\Commands\getArticlesCount() )); } }` in engine\Shopware\Plugins\Community\Frontend\TestController\Commands\getArticlesCount.php [code]namespace Shopware\Commands; use Shopware\Components\Model\ModelManager; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class getArticlesCount extends ShopwareCommand { protected function configure() { $this -\>setName(‚TestController:getArticlesCount‘) -\>setDescription(‚getArticlesCount Command.‘) -\>setHelp(\<\<%command.name% is just a test.  
EOF  
);  
;  
}

```
/**
 * {@inheritdoc}
 */
protected function execute(InputInterface $input, OutputInterface $output)
{
    //getArticlesCount();
}

```

}[/code]

Wie kann ich getArticlesCount() in function execute aufrufen?
