[TYPO3-german] Extbase Command Controller und Settings/Repositories in 6.1

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Mon Nov 25 13:56:55 CET 2013


Hallo allerseits

Ich versuche schon seit mehreren Stunden, ein Command für den Scheduler
in T3 6.1 zum laufen zu kriegen - leider erfolglos.

Ich kriege es nicht hin, die Settings zu lesen. Auch liefert findAll()
beim Repository nichts zurück.

Im Netz gibt es dazu einige Angaben, die meisten jedoch zu 4.7... gilt
das für 6.1 auch noch?

Meine Klasse sieht so aus:

class WorkerCommandController extends 
\TYPO3\CMS\Extbase\Mvc\Controller\CommandController {

        /**
         * @var
\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
         * @inject
         */
        protected $configurationManager;

        /**
         * subscriberRepository
         *
         * @var \GK\Stdapp\Domain\Repository\SubscriberRepository
         * @inject
         */
        protected $subscriberRepository;

        public function initializeCommand() {
                echo "init...";
                $this->configurationManager =
$this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
                $extbaseFrameworkConfiguration =
$this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK,'stdapp','frontend');
                $this->settings =
$this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS,'stdapp','frontend');
                print_r($this->settings);
               
$this->configurationManager->setConfiguration($extbaseFrameworkConfiguration);
        }

        /**
         * worker command
         *
         * @param string $commandIdentifier
         * @return void
         */
        public function workerCommand($commandIdentifier = NULL) {
                $this->initializeCommand();

                foreach ($this->subscriberRepository->findAll() as
$subscriber)
                        echo $subscriber->getUid() . "\n";
        }
}
Die Injection des Configuration Managers scheint nicht zu funktionieren,
daher mache ich das von Hand in einer initializ-Funktion.
Ausser "init..." liefert das Command aber nichts zurück, d.h. die
Settings sind leer, das Repository auch. storagePid sind für plugin und
modul im setup.txt gesetzt.
Was mache ich falsch? Ich bin am Ende meiens Lateins :(

Grüße,
Till



More information about the TYPO3-german mailing list