phpBB

Code Changes

File: phpbb/textformatter/s9e/factory.php

  Unmodified   Added   Modified   Removed
Line 130Line 130
	* @var \phpbb\event\dispatcher_interface
*/
protected $dispatcher;

	* @var \phpbb\event\dispatcher_interface
*/
protected $dispatcher;

 

/**
* @var \phpbb\log\log_interface
*/
protected $log;


/**
* Constructor


/**
* Constructor

Line 139Line 144
	* @param \phpbb\event\dispatcher_interface $dispatcher
* @param \phpbb\config\config $config
* @param \phpbb\textformatter\s9e\link_helper $link_helper

	* @param \phpbb\event\dispatcher_interface $dispatcher
* @param \phpbb\config\config $config
* @param \phpbb\textformatter\s9e\link_helper $link_helper

 
	* @param \phpbb\log\log_interface $log

	* @param string $cache_dir          Path to the cache dir
* @param string $cache_key_parser Cache key used for the parser
* @param string $cache_key_renderer Cache key used for the renderer
*/

	* @param string $cache_dir          Path to the cache dir
* @param string $cache_key_parser Cache key used for the parser
* @param string $cache_key_renderer Cache key used for the renderer
*/

	public function __construct(\phpbb\textformatter\data_access $data_access, \phpbb\cache\driver\driver_interface $cache, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\config\config $config, \phpbb\textformatter\s9e\link_helper $link_helper, $cache_dir, $cache_key_parser, $cache_key_renderer)

	public function __construct(\phpbb\textformatter\data_access $data_access, \phpbb\cache\driver\driver_interface $cache, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\config\config $config, \phpbb\textformatter\s9e\link_helper $link_helper, \phpbb\log\log_interface $log, $cache_dir, $cache_key_parser, $cache_key_renderer)

	{
$this->link_helper = $link_helper;
$this->cache = $cache;

	{
$this->link_helper = $link_helper;
$this->cache = $cache;

Line 153Line 159
		$this->config = $config;
$this->data_access = $data_access;
$this->dispatcher = $dispatcher;

		$this->config = $config;
$this->data_access = $data_access;
$this->dispatcher = $dispatcher;

 
		$this->log = $log;

	}

/**

	}

/**

Line 272Line 279
		// Add default BBCodes
foreach ($this->get_default_bbcodes($configurator) as $bbcode)
{

		// Add default BBCodes
foreach ($this->get_default_bbcodes($configurator) as $bbcode)
{

			$configurator->BBCodes->addCustom($bbcode['usage'], new UnsafeTemplate($bbcode['template']));

			$this->add_bbcode($configurator, $bbcode['usage'], $bbcode['template']);

		}
if (isset($configurator->tags['QUOTE']))
{

		}
if (isset($configurator->tags['QUOTE']))
{

Line 299Line 306
				},
$row['bbcode_tpl']
);

				},
$row['bbcode_tpl']
);


try
{
$configurator->BBCodes->addCustom($row['bbcode_match'], new UnsafeTemplate($tpl));
}
catch (\Exception $e)
{
/**
* @todo log an error?
*/
}

			$this->add_bbcode($configurator, $row['bbcode_match'], $tpl);











		}

// Load smilies

		}

// Load smilies

Line 416Line 413
		$this->cache->put($this->cache_key_renderer, $renderer_data);

return array('parser' => $parser, 'renderer' => $renderer);

		$this->cache->put($this->cache_key_renderer, $renderer_data);

return array('parser' => $parser, 'renderer' => $renderer);

 
	}

/**
* Add a BBCode to given configurator
*
* @param Configurator $configurator
* @param string $usage
* @param string $template
* @return void
*/
protected function add_bbcode(Configurator $configurator, $usage, $template)
{
try
{
$configurator->BBCodes->addCustom($usage, new UnsafeTemplate($template));
}
catch (\Exception $e)
{
$this->log->add('critical', null, null, 'LOG_BBCODE_CONFIGURATION_ERROR', false, [$usage, $e->getMessage()]);
}

	}

/**

	}

/**