/**
  * @param string $queueName
  * @return QueueInterface
  * @throws JobQueueException
  */
 public function getQueue($queueName)
 {
     if (!isset($this->queues[$queueName])) {
         $settings = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['jobqueue'];
         $className = $this->extensionConfiguration->get('defaultQueue');
         $options = [];
         if (isset($settings[$queueName])) {
             $className = isset($settings[$queueName]['className']) ? $settings[$queueName]['className'] : null;
             $options = isset($settings[$queueName]['options']) ? (array) $settings[$queueName]['options'] : [];
         }
         if (empty($options)) {
             $options = isset($settings[$className]['options']) ? (array) $settings[$className]['options'] : [];
         }
         if (!isset($options['timeout'])) {
             $defaultTimeout = (int) $this->extensionConfiguration->get('defaultTimeout');
             $options['timeout'] = $defaultTimeout > 0 ? $defaultTimeout : null;
         }
         if (empty($className)) {
             throw new JobQueueException('No jobqueue class name configuration found.', 1448488276);
         }
         $classNameParts = ClassNamingUtility::explode($className);
         ExtensionManagementUtility::isLoaded(GeneralUtility::camelCaseToLowerCaseUnderscored($classNameParts['extensionName']), true);
         $queue = $this->objectManager->get($className, $queueName, $options);
         if (!$queue instanceof QueueInterface) {
             throw new JobQueueException("Queue '{$queueName}' is not a queue.", 1446318455);
         }
         $this->queues[$queueName] = $queue;
     }
     return $this->queues[$queueName];
 }
Beispiel #2
0
 /**
  * Constructor.
  *
  * @param string $extension EXT key
  */
 public function __construct($extension)
 {
     $this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $this->installUtility = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Utility\\InstallUtility');
     $this->extension = $this->installUtility->enrichExtensionWithDetails($extension);
     $this->updateStatements = null;
 }
Beispiel #3
0
 /**
  * @constuctor
  *
  * @param	string $identifier form identifier
  */
 public function __construct($identifier)
 {
     $this->elements = [];
     $this->identifier = $identifier;
     $this->enableCsrftoken = TYPO3_MODE == 'FE' ? true : false;
     $this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $this->stringUtility = $this->objectManager->get('Ameos\\AmeosForm\\Utility\\StringUtility', $this);
     $this->errorManager = $this->objectManager->get('Ameos\\AmeosForm\\Utility\\ErrorManager', $this);
 }
 /**
  * Get a provider
  *
  * @param string $name
  * @param string $path
  *
  * @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentValueException
  * @return object
  */
 public static function getProvider($name, $path = NULL)
 {
     if ($path != NULL) {
         self::addProvider($path, $name);
         return self::getProvider($name);
     }
     if (!isset(self::$provider[$name])) {
         throw new \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentValueException($name . ' not exists');
     }
     require_once self::$provider[$name];
     $obj = new \TYPO3\CMS\Extbase\Object\ObjectManager();
     return $obj->get($name);
 }
 /**
  * Returns the HTML content for a checkbox group field
  *
  * @param string $formName Name of the form
  * @param string $fieldName Name of the field
  * @return string HTML content
  */
 protected function renderCheckboxGroupField($formName, $fieldName)
 {
     if (empty($this->arguments['options'])) {
         return '';
     }
     $options = $this->getOptions();
     if (empty($options)) {
         $options = array('' => '');
     }
     $icon = !empty($this->arguments['optionIcon']) ? $this->arguments['optionIcon'] : '';
     $items = array();
     $checkedItems = array();
     foreach ($options as $value => $label) {
         $items[] = array($label, $value, $icon);
         if ($this->isChecked($value)) {
             $checkedItems[] = $value;
         }
         // Register the field name for each option for the token generation
         $this->registerFieldNameForFormTokenGeneration($fieldName . '[]');
     }
     $setup = array('itemFormElValue' => implode(',', $checkedItems), 'itemFormElName' => $this->getName(), 'fieldChangeFunc' => array());
     // Render field with default form engine
     $formEngine = $this->objectManager->create('TYPO3\\CMS\\Backend\\Form\\FormEngine');
     $formEngine->formName = $formName;
     $content = $formEngine->getSingleField_typeSelect_checkbox('', '', array(), $setup, array(), $items, '%s');
     unset($formEngine);
     return $content;
 }
 public function import($data, Configuration $configuration)
 {
     $offset = 0;
     $dataProvider = $this->objectManager->get(ExcelDataProvider::class, $data, $offset);
     $importService = $this->objectManager->get($configuration->getImportServiceClass(), $configuration);
     //$this->signalSlotDispatcher->connect(get_class($reader), 'readDataset', $writer, 'writeDataset');
     $dataProvider->initializeObject();
     $failures = 0;
     while ($dataProvider->hasNextDataset()) {
         try {
             $dataset = $dataProvider->getNextDataset();
             $importService->importDataset($dataset);
         } catch (ImportServiceException $exception) {
             $failures++;
         }
     }
 }
 public function setUp()
 {
     \Aimeos\Aimeos\Base::getAimeos();
     // initialize autoloader
     $this->object = $this->getAccessibleMock('Aimeos\\Aimeos\\Controller\\AccountController', array('dummy'));
     $objManager = new \TYPO3\CMS\Extbase\Object\ObjectManager();
     $uriBuilder = $objManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
     $response = $objManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
     $request = $objManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
     $uriBuilder->setRequest($request);
     if (method_exists($response, 'setRequest')) {
         $response->setRequest($request);
     }
     $this->object->_set('uriBuilder', $uriBuilder);
     $this->object->_set('response', $response);
     $this->object->_set('request', $request);
     $this->object->_call('initializeAction');
 }
 public function setUp()
 {
     \Aimeos\Aimeos\Base::getAimeos();
     // initialize autoloader
     $this->object = $this->getAccessibleMock('Aimeos\\Aimeos\\Controller\\JsonadmController', array('dummy'));
     $this->request = $this->getMockBuilder('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request')->setMethods(array('hasArgument', 'getArgument', 'getMethod', 'getBaseUri'))->disableOriginalConstructor()->getMock();
     $this->response = $this->getMockBuilder('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response')->setMethods(array('setStatus'))->disableOriginalConstructor()->getMock();
     $objManager = new \TYPO3\CMS\Extbase\Object\ObjectManager();
     $uriBuilder = $objManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
     $uriBuilder->setRequest($this->request);
     if (method_exists($response, 'setRequest')) {
         $response->setRequest($this->request);
     }
     $this->object->_set('uriBuilder', $uriBuilder);
     $this->object->_set('response', $this->response);
     $this->object->_set('request', $this->request);
     $this->object->_call('initializeAction');
 }