Lack of interest Fetching of Global Required Data in the dependency object

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

xf_phantom

Well-known member
There's no way to preload the data, before init_dependencies, because the data are preloaded BEFORE the event system is inizialited.

It would be nice if we wouldn't need to fetch everything on event init_dependencies or put everything into simpleCache.
This way we would just need to add the entries to the config array and it would need only 1 query, instead of probably X queries.



What about something like my current implemention:
PHP:
//config.php:

$config['preloadData'] = array('systemMailCount','lastStats');


//XenForo_Dependencies_Abstract



   /**
    * Pre-loads globally required data for the system.
    */
   public function preLoadData()
   {
  $additionalData = array();
  if (XenForo_Application::get('config')->enableListeners)
  {
  $additionalData= XenForo_Application::getConfig()->preloadData->toArray();
  }

     $required = array_merge(
       array('options', 'languages', 'contentTypes', 'codeEventListeners', 'deferredRun', 'simpleCache', 'addOns', 'defaultStyleProperties'),
       $this->_dataPreLoadFromRegistry,
  $additionalData
     );


This could even be split up into additionalPublicData and additionalAdminData
 
Last edited:
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
Back
Top Bottom