[TYPO3-english] Re: Command Controller: I can't execute a command that uses class repositories of my extension

christian ewigfrost christian-kulozik at gmx.net
Tue Nov 7 15:08:18 CET 2017


OK, i tried to do what you told me:

I registered the task in the ext_localconf.php:

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\Cjk\Icingaconfgen\Tasks\TestTask::class] = array(
'extension' => $_EXTKEY,
'title' => 'Foobar Test'
);

I created a TestTask.php file in Classes/Command/ directory:

<?php

namespace Cjk\Icingaconfgen\Tasks;

class TestTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask
{

public function execute() {
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');

$apprep = $objectManager->get(\Cjk\Icingaconfgen\Domain\Repository\HostRepository::class)

DebuggerUtility::var_dump($apprep->findByUid(1));

}

}

But when i want to save the task Foobar Test i get an error:

Oops, an error occurred!
syntax error, unexpected 'DebuggerUtility' (T_STRING)


More information about the TYPO3-english mailing list