本文整理匯總了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)));
}