Typo3 - 用于调度程序任务的 Extbase CommandController

Typo3 - Extbase CommandController for scheduler task

我创建了一个空的 extbase/fluid 扩展并为调度程序任务添加了一个 ImportCommandController。出于某种原因,我无法在我的调度程序中加载该任务。请注意,我想通过 CommandController (http://wiki.typo3.org/CommandController_In_Scheduler_Task) 和 NOT 通过 \TYPO3\CMS\Scheduler\Task\AbstractTask.

实现我的任务

ext_localconf.php

<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = 'VENDORx\Sched\Command\ImportCommandController';

Classes/Command/ImportCommandController.php

<?php
    namespace VENDORx\Sched\Command;


    /**
     *
     *
     * @package Sched
     * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
     *
     */

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

        public function importCommand($commandIdentifier= NULL) {

        echo 'command run';

        }
      }
?>

知道缺少什么吗??

正如 Jost 已经提到的,您需要适当的注释:

/**
 * @param integer $commandIdentifier 
 */
public function importCommand($commandIdentifier = NULL) {
    $this->outputLine('command run');
}

Select "Extbase-CommandController-Task" 在下拉列表中 您会在底部看到另一个 select 字段,您可以在其中找到您的 "ImportCommand" select 并保存