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

时间:2015-07-09 09:06:25

标签: typo3 extbase typo3-6.2.x

我创建了一个空的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';

类/命令/ 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';

        }
      }
?>

任何想法都丢失了?

2 个答案:

答案 0 :(得分:1)

正如Jost已经提到的,你需要正确的注释:

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

答案 1 :(得分:0)

选择&#34; Extbase-CommandController-Task&#34;在下拉列表中 您将在底部找到另一个选择字段,您可以在其中找到您的&#34; ImportCommand&#34;选择并保存