本文整理汇总了PHP中SugarConfig::get方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarConfig::get方法的具体用法?PHP SugarConfig::get怎么用?PHP SugarConfig::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarConfig
的用法示例。
在下文中一共展示了SugarConfig::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCronDriver
/**
* 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();
}
示例2: __construct
/**
* 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));
}
示例3: __construct
/**
* 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);
}