本文整理汇总了PHP中factory::regenerate方法的典型用法代码示例。如果您正苦于以下问题:PHP factory::regenerate方法的具体用法?PHP factory::regenerate怎么用?PHP factory::regenerate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类factory
的用法示例。
在下文中一共展示了factory::regenerate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* @param \phpbb\cache\driver\driver_interface $cache
* @param string $cache_dir Path to the cache dir
* @param string $key Cache key
* @param factory $factory
* @param \phpbb\event\dispatcher_interface $dispatcher
*/
public function __construct(\phpbb\cache\driver\driver_interface $cache, $cache_dir, $key, factory $factory, \phpbb\event\dispatcher_interface $dispatcher)
{
$renderer_data = $cache->get($key);
if ($renderer_data) {
$class = $renderer_data['class'];
if (!class_exists($class, false)) {
// Try to load the renderer class from its cache file
$cache_file = $cache_dir . $class . '.php';
if (file_exists($cache_file)) {
include $cache_file;
}
}
if (class_exists($class, false)) {
$renderer = new $class();
}
if (isset($renderer_data['censor'])) {
$censor = $renderer_data['censor'];
}
}
if (!isset($renderer)) {
$objects = $factory->regenerate();
$renderer = $objects['renderer'];
}
if (isset($censor)) {
$this->censor = $censor;
}
$this->dispatcher = $dispatcher;
$this->renderer = $renderer;
$renderer = $this;
/**
* Configure the renderer service
*
* @event core.text_formatter_s9e_renderer_setup
* @var \phpbb\textformatter\s9e\renderer renderer This renderer service
* @since 3.2.0-a1
*/
$vars = array('renderer');
extract($dispatcher->trigger_event('core.text_formatter_s9e_renderer_setup', compact($vars)));
}