Hi,
ich versuche nun das ganze Wochenende die Settings einer Extension in den Scheduler/CommandController einzulesen.
Egal was ich im Internet gefunden habe, es funktioniert einfach nicht.
Ob
#112042
oder
http://forge.typo3.org/projects/typo3v4-mvc/wiki/CommandControllerInSchedulerTask
oder
http://www.derhansen.de/2012/06/zugriff-auf-extbase-extension.html
Was habe ich gemacht:
In der
ext_localconf.php
/**
* Scheduler
* Setting up scripts that can be run from the cli_dispatch.phpsh script.
*/
if (TYPO3_MODE === 'BE') {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = 'sh\Sh\Command\ShDivCommandController';
}
in der ext_table.php
if (TYPO3_MODE === 'BE') {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript($_EXTKEY, 'constants', '<INCLUDE_TYPOSCRIPT: source=FILE:EXT:sh/Configuration/TypoScript/constants.txt>');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript($_EXTKEY, 'setup', '<INCLUDE_TYPOSCRIPT: source=FILE:EXT:sh/Configuration/TypoScript/setup.txt>');
}
In der setup.txt steht
module.tx_sh{
settings < plugin.tx_sh.settings
persistence < plugin.tx_sh.persistence
view < plugin.tx_sh.view
view {
templateRootPath = {$module.tx_sh.view.templateRootPath}
partialRootPath = {$module.tx_sh.view.partialRootPath}
layoutRootPath = {$module.tx_sh.view.layoutRootPath}
}
}
Der CommandContoller
<?php
namespace sh\Sh\Command;
class ShDivCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandController {
/**
* @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
* @inject
*/
protected $configurationManager;
/**
* Create once a day the static conf file
*
* @param none
* @return void
*/
public function testCommand() {
echo 'settings...';
$this->settings = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, 'sh', 'Sh');
}
}
?>
Ich bin für jede Hilfe dankbar.
Grüße
metan