1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Closed Suggestions' started by xf_phantom, Aug 20, 2013.

  1. xf_phantom

    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)
      {
      
    $additionalDataXenForo_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: Aug 20, 2013

Share This Page