Exemple #1
0
 /**
  * @param string $commandControllerClass
  * @param string $actionName
  * @return CommandTask
  */
 public static function registerForCommand($commandControllerClass, $actionName)
 {
     $cutoff = strrpos($commandControllerClass, '\\') + 1;
     $controllerName = substr($commandControllerClass, $cutoff, strlen($commandControllerClass) - $cutoff - 17);
     $task = new CommandTask($commandControllerClass . '->' . $actionName);
     $task->getTaskConfiguration()->setId($commandControllerClass . '->' . $actionName)->setLabel('Command')->setDescription($controllerName . '->' . $actionName);
     TaskManager::getInstance()->addTask($task);
     return $task;
 }
<?php

if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\BackendCommandController::class, 'lock');
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\BackendCommandController::class, 'unlock');
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\CacheCommandController::class, 'warmup');
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\CacheCommandController::class, 'listGroups');
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\CacheCommandController::class, 'flush')->getTaskConfiguration()->setAvailable(FALSE);
// Disabled due to unsupported use of runlevel requesting via Bootstrap->requestRunLevel
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\CacheCommandController::class, 'flushGroups')->setFieldTypeForArgument(\NamelessCoder\RpcConsole\CacheGroupsField::class, 'groups');
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\CacheCommandController::class, 'flushTags');
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\CleanupCommandController::class, 'updateReferenceIndex');
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\CleanupCommandController::class, 'updateReferenceIndex');
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\ConfigurationCommandController::class, 'removeByPath');
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\DatabaseCommandController::class, 'updateSchema')->setFieldTypeForArgument(\NamelessCoder\RpcConsole\SchemaTypesField::class, 'schemaUpdateTypes');
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\DocumentationCommandController::class, 'generateXsd');
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\FrontendCommandController::class, 'request')->getTaskConfiguration()->setAvailable(FALSE);
// Disabled due to use of testing framework classes that may not be available on production
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\InstallCommandController::class, 'generatePackageStates');
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\InstallCommandController::class, 'environmentAndFolders');
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\InstallCommandController::class, 'defaultConfiguration')->getTaskConfiguration()->setAvailable(FALSE);
// Explicitly disabled but can be re-enabled by choice. Is potentially VERY destructive - is definitely an opt-in!
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\Helhum\Typo3Console\Command\SchedulerCommandController::class, 'run')->getTaskConfiguration()->setAvailable(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('scheduler'));
// Available only when `scheduler` extension is loaded
Exemple #3
0
if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL)) {
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup('
		rpc = PAGE
		rpc {
			typeNum = 991
			config {
				no_cache = 1
				disableAllHeaderCode = 1
				additionalHeaders = Content-type:application/json
    			xhtml_cleaning = 0
    			admPanel = 0
    			debug = 0
			}
			headerData >
			10 = USER_INT
			10.userFunc = NamelessCoder\\Rpc\\RequestDispatcher->handleIncomingRequest
		}
	');
}
\NamelessCoder\Rpc\Manager\TaskManager::setInstance(new \NamelessCoder\Rpc\Implementation\TaskManagerImplementation());
\NamelessCoder\Rpc\Manager\ClientManager::setInstance(new \NamelessCoder\Rpc\Implementation\ClientManagerImplementation());
\NamelessCoder\Rpc\Manager\TaskManager::getInstance()->addTask(new \NamelessCoder\Rpc\Implementation\Task\HelpTask('help'));
\NamelessCoder\Rpc\Manager\TaskManager::getInstance()->addTask(new \NamelessCoder\Rpc\Implementation\Task\ListTask('list'));
\NamelessCoder\Rpc\Manager\TaskManager::getInstance()->addTask(new \NamelessCoder\Rpc\Implementation\Task\DemoTask('demo'));
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\TYPO3\CMS\Extensionmanager\Command\ExtensionCommandController::class, 'install')->setFieldTypeForArgument(\NamelessCoder\Rpc\Implementation\Field\AvailableExtensionsField::class, 'extensionKey');
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand(\TYPO3\CMS\Extensionmanager\Command\ExtensionCommandController::class, 'uninstall')->setFieldTypeForArgument(\NamelessCoder\Rpc\Implementation\Field\InstalledExtensionsField::class, 'extensionKey');
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \NamelessCoder\Rpc\Backend\DataHandlerHook::class;