Exemplo n.º 1
0
 /**
  * This creates another stand-alone instance of the Fluid StandaloneView
  * to render an e-mail template
  *
  * @param string $templatePath
  * @param string $templateFileName
  * @param string $format
  *
  * @return \TYPO3\CMS\Fluid\View\StandaloneView Fluid instance
  */
 protected function getEmailStandaloneView($templatePath = '/Mail/', $templateFileName = 'Default', $format = 'html')
 {
     $templatePathAndFileName = $templatePath . $templateFileName . '.' . $format;
     /** @var \TYPO3\CMS\Fluid\View\StandaloneView $view */
     $view = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
     $view->setFormat($format);
     if ($this->pluginSettings['view']) {
         $view->setLayoutRootPaths($this->resolveRootPaths('layoutRootPaths'));
         $view->setPartialRootPaths($this->resolveRootPaths('partialRootPaths'));
         if ($this->pluginSettings['view']['templateRootPaths']) {
             foreach ($this->pluginSettings['view']['templateRootPaths'] as $pathNameKey => $pathNameValue) {
                 $templateRootPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($pathNameValue);
                 $completePath = $templateRootPath . $templatePathAndFileName;
                 if (file_exists($completePath)) {
                     $view->setTemplatePathAndFilename($completePath);
                 }
             }
         }
     }
     if (!$view->getTemplatePathAndFilename()) {
         $logger = $this->logManager->getLogger(__CLASS__);
         $logger->error('Cannot find Template for MailHandler', ['templateRootPaths' => $this->pluginSettings['view']['templateRootPaths'], 'templatePathAndFileName' => $templatePathAndFileName]);
     }
     // set controller extension name for translation
     $view->getRequest()->setControllerExtensionName('Cart');
     return $view;
 }
Exemplo n.º 2
0
 /**
  * @test
  */
 public function configuresLoggerWithConfiguredProcessor()
 {
     $component = 'test';
     $processor = 'TYPO3\\CMS\\Core\\Log\\Processor\\NullProcessor';
     $level = \TYPO3\CMS\Core\Log\LogLevel::DEBUG;
     $GLOBALS['TYPO3_CONF_VARS']['LOG'][$component]['processorConfiguration'] = array($level => array($processor => array()));
     /** @var $logger \TYPO3\CMS\Core\Log\Logger */
     $logger = $this->logManagerInstance->getLogger($component);
     $processors = $logger->getProcessors();
     $this->assertInstanceOf($processor, $processors[$level][0]);
 }
Exemplo n.º 3
0
 /**
  * @return LoggerManager
  */
 public function __construct()
 {
     parent::__construct();
     $this->loggerConfiguration =& $GLOBALS['TYPO3_CONF_VARS']['LOG'];
 }
Exemplo n.º 4
0
 /**
  * @param  \TYPO3\CMS\Core\Log\LogManager  $logManager
  * @return  void
  */
 public function injectLogManager(LogManager $logManager)
 {
     $this->logger = $logManager->getLogger(__CLASS__);
 }
 /**
  * @param \TYPO3\CMS\Core\Log\LogManager $logManager
  * @return void
  */
 public function injectLogManager(\TYPO3\CMS\Core\Log\LogManager $logManager)
 {
     $this->logger = $logManager->getLogger(__CLASS__);
 }
Exemplo n.º 6
0
 /**
  * @param  \TYPO3\CMS\Core\Log\LogManager $logManager
  * @return void
  */
 public function injectLogManager(LogManager $logManager)
 {
     $this->logger = $logManager->getLogger('tevmail');
 }
Exemplo n.º 7
0
 /**
  * Constructor
  *
  * @param Log\LogManager $logManager Application log manager
  */
 public function __construct(Log\LogManager $logManager)
 {
     $this->logger = $logManager->getLogger(__CLASS__);
 }