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

Generic Cache

Discussion in 'XenForo Development Discussions' started by digitalpoint, Feb 6, 2011.

  1. digitalpoint

    digitalpoint Well-Known Member

    There's something I want to do that really should be cached...

    Is there some sort of generic caching mechanism in XenForo that I can't find (basically the equivalent of vBulletin's datastore)?

    I suppose I could drop it into a hidden option or something, but that seems terribly inelegant.
  2. ragtek

    ragtek Guest

    1. You can use the Zend Cache. (Like vB_Cache)

    Check XenForo_Dependencies_Public

    class XenForo_Dependencies_Public extends XenForo_Dependencies_Abstract
         * List of data to pre-load from the data registry. You must process this data
         * via {@link _handleCustomPreLoadedData()}.
         * @var array
    protected $_dataPreLoadFromRegistry = array(
         * Handles the custom data that needs to be preloaded.
         * @param array $data Data that was loaded. Unsuccessfully loaded items will have a value of null
    protected function _handleCustomPreloadedData(array &$data)
    I've never used it, but here http://xenforo.com/community/threads/xenmoods.5885/ you can see how dismounted is using it in his add-on^^
    Fuhrmann, Walter and digitalpoint like this.
  3. digitalpoint

    digitalpoint Well-Known Member

    Ah... "data_registry". I was looking through the tables trying to figure out where such a cache would be stored and couldn't find it. Knowing you would need to fallback to a database storage if the user didn't have any memory cache mechanisms installed, I figured it would be the best place to look and I missed that table. :)

    Exactly what I was looking for... thanks. :)

Share This Page