Ejemplo n.º 1
0
 /**
  * Get cron driver
  * @return SugarCronJobs
  */
 protected function getCronDriver()
 {
     $cronDriver = $this->config->get('cron_class', 'SugarCronJobs');
     $this->logger->debug("Using {$cronDriver} as CRON driver");
     \SugarAutoLoader::requireWithCustom("include/SugarQueue/{$cronDriver}.php");
     return new $cronDriver();
 }
Ejemplo n.º 2
0
 /**
  * Constructor
  *
  * Reads the config file for logger settings
  *
  * @param string $loggerName
  */
 public function __construct($loggerName)
 {
     $this->config = SugarConfig::getInstance();
     $this->ext = $this->config->get('logger.file.ext', $this->ext);
     $this->logfile = $this->config->get('logger.file.name', $this->logfile);
     $this->dateFormat = $this->config->get('logger.file.dateFormat', $this->dateFormat);
     $this->logSize = $this->config->get('logger.file.maxSize', $this->logSize);
     $this->maxLogs = $this->config->get('logger.file.maxLogs', $this->maxLogs);
     $this->filesuffix = $this->config->get('logger.file.suffix', $this->filesuffix);
     $log_dir = $this->config->get('log_dir', $this->log_dir);
     $this->log_dir = $log_dir . (empty($log_dir) ? '' : '/');
     $this->full_log_file = $this->log_dir . $this->logfile . $this->ext;
     if (!empty($level)) {
         $this->defaultLevel = isset($this->levels[$level]) ? $this->levels[$level] : $this->defaultLevel;
     }
     $this->logger = new Logger($loggerName);
     $this->logger->pushHandler(new StreamHandler($this->full_log_file, $this->defaultLevel));
 }
Ejemplo n.º 3
0
 /**
  * Ctor
  * @param CsrfTokenManagerInterface $manager
  * @param LoggerInterface $logger
  * @param \SugarConfig $config
  */
 public function __construct(CsrfTokenManagerInterface $manager, LoggerInterface $logger, \SugarConfig $config)
 {
     $this->manager = $manager;
     $this->logger = $logger;
     // set config options
     $this->softFailForm = (bool) $config->get('csrf.soft_fail_form', false);
     // to be removed after beta
     $this->beta = (bool) $config->get('csrf.opt_in', false);
 }