當前位置: 首頁>>代碼示例>>PHP>>正文


PHP factory::regenerate方法代碼示例

本文整理匯總了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)));
 }
開發者ID:bruninoit,項目名稱:phpbb,代碼行數:48,代碼來源:renderer.php


注:本文中的factory::regenerate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。