Skip to content

Instantly share code, notes, and snippets.

@koernchen02
Last active August 26, 2015 11:47
Show Gist options
  • Select an option

  • Save koernchen02/01cfb7eb1eb5ce0fc4c9 to your computer and use it in GitHub Desktop.

Select an option

Save koernchen02/01cfb7eb1eb5ce0fc4c9 to your computer and use it in GitHub Desktop.
Creating a CommandController to be used with TYPO3 Scheduler Extension, based on https://wiki.typo3.org/CommandController_In_Scheduler_Task
/** located in ...ext/flappl/Classes/Command
<?php
namespace Portachtzig\Flappl\Command;
class DeleteCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandController {
/**
* @var \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository
* @inject
*/
protected $frontendUserRepository = NULL;
/**
* The settings.
* @var array
*/
protected $settings = array();
/**
* @return bool
*/
// very nice: parameters will be fields in the scheduler!
public function deleteCommand() {
$configurationManager = $this->objectManager->get( '\TYPO3\CMS\Extbase\Configuration\ConfigurationManager' );
/* @var $configurationManager \TYPO3\CMS\Extbase\Configuration\ConfigurationManager */
$this->settings = array_merge( $this->settings, $configurationManager->getConfiguration( \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, 'flappl', 'application') );
return TRUE;
}
}
?>
<?php
// ...
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = 'Portachtzig\\Flappl\\Command\\DeleteCommandController';
// ...
...
module.tx_flappl < plugin.tx_flappl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment