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


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:

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


    * 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 could even be split up into additionalPublicData and additionalAdminData
Last edited: