Error when rebuilding templates

Discussion in 'XC Wiki Tools' started by Scharesoft, Sep 6, 2013.

  1. Scharesoft

    Scharesoft Verified Customer

    There is a problem when rebuilding templates:

    Code:
    Fatal error: Class 'XenForo_CacheRebuilder_Template' not found in /var/www/dev/forum.dev.scharesoft.de/library/XenForo/CacheRebuilder/Abstract.php on line 114
    Cheers

    Daniel
     
  2. Harutyun

    Harutyun Active Member

    The error does not seem to be connected with our products. Please make sure you have correctly uploaded all XenForo files and try again.

    Thank you!
     
  3. Scharesoft

    Scharesoft Verified Customer

    Everything else is possible to rebuilt, but not the rebuilt templates of your framework.
     
  4. Harutyun

    Harutyun Active Member

    The link you see in our framework menu is just to trigger the rebuild. I am almost sure you will get the same error if you import an addon and wait for the phase when it rebuilds the template. The file mentioned is part of XenForo distribution, and the error says it does not exist. Just make sure to re-upload that file, and if the problem still exists we will take another look (though we are unable to reproduce the problem locally and on demo boards).
    Thank you!
     
  5. Scharesoft

    Scharesoft Verified Customer

    Please look here. This was the same error, but it's now working.

    The Abstract.php is the one which you can find in the XenForo files. I didn't change it.

    PHP:
    <?php

    /**
    * Base class for cache/data rebuilders.
    *
    * @package XenForo_CacheRebuilder
    */
    abstract class XenForo_CacheRebuilder_Abstract
    {
        
    /**
        * List of cache builders.
        *
        * @var array [key name] => class name
        */
        
    public static $builders = array(
            
    'AdminTemplate' => 'XenForo_CacheRebuilder_AdminTemplate',
            
    'DailyStats' => 'XenForo_CacheRebuilder_DailyStats',
            
    'EmailTemplate' => 'XenForo_CacheRebuilder_EmailTemplate',
            
    'Forum' => 'XenForo_CacheRebuilder_Forum',
            
    'ImportAdminTemplate' => 'XenForo_CacheRebuilder_ImportAdminTemplate',
            
    'ImportEmailTemplate' => 'XenForo_CacheRebuilder_ImportEmailTemplate',
            
    'ImportMasterData' => 'XenForo_CacheRebuilder_ImportMasterData',
            
    'ImportPhrase' => 'XenForo_CacheRebuilder_ImportPhrase',
            
    'ImportTemplate' => 'XenForo_CacheRebuilder_ImportTemplate',
            
    'Phrase' => 'XenForo_CacheRebuilder_Phrase',
            
    'Permission' => 'XenForo_CacheRebuilder_Permission',
            
    'Poll' => 'XenForo_CacheRebuilder_Poll',
            
    'SearchIndex' => 'XenForo_CacheRebuilder_SearchIndex',
            
    'Template' => 'XenForo_CacheRebuilder_Template',
            
    'Thread' => 'XenForo_CacheRebuilder_Thread',
            
    'User' => 'XenForo_CacheRebuilder_User'
        
    );

        
    /**
        * Key name used for this object.
        *
        * @var string
        */
        
    protected $_keyName '';

        
    /**
        * Gets a message about the type of content being rebuilt.
        * Likely depends on phrases existing.
        *
        * @return string|XenForo_Phrase
        */
        
    abstract public function getRebuildMessage();

        
    /**
        * Rebuilds the data as requested. If there is a large amount of data, it should
        * only be partially rebuilt in each invocation.
        *
        * If true is returned, then the rebuild is done. Otherwise, an integer should be returned.
        * This will be passed to the next call as the position.
        *
        * @param integer $position Position to start building from.
        * @param array $options List of options. Can be modified and updated value will be passed to next call.
        * @param string $detailedMessage A detailed message about the progress to return.
        *
        * @return integer|true
        */
        
    abstract public function rebuild($position 0, array &$options = array(), &$detailedMessage '');

        
    /**
        * Constructor.
        *
        * @param string$keyName
        */
        
    public function __construct($keyName)
        {
            
    $this->_keyName $keyName;

            @
    set_time_limit(0);
            
    ignore_user_abort(true);
            
    XenForo_Application::getDb()->setProfiler(false); // this can use a lot of memory
        
    }

        
    /**
        * Whether or not an exit link should be shown. Only show this if the rebuild can be interrupted
        * without doing bad things.
        *
        * @return boolean
        */
        
    public function showExitLink()
        {
            return 
    false;
        }

        
    /**
        * Gets the key name.
        *
        * @return string
        */
        
    public function getKeyName()
        {
            return 
    $this->_keyName;
        }

        
    /**
        * Gets the specified cache rebuilder.
        *
        * @param string $keyName
        *
        * @return XenForo_CacheRebuilder_Abstract
        */
        
    public static function getCacheRebuilder($keyName)
        {
            if (!isset(
    self::$builders[$keyName]))
            {
                throw new 
    XenForo_Exception('Invalid cache builder ' $keyName ' specified.');
            }

            
    $class self::$builders[$keyName];
            return new 
    $class($keyName);
        }

        
    /**
        * Gets a controller response that reroutes to start rebuilding the caches.
        * Admin CP only.
        *
        * @param XenForo_ControllerAdmin_Abstract $controller
        * @param array $caches List of caches to build. Either array of strings, or array of pairs: [cache name, options]
        * @param string|null $redirect URL to redirect to; null to use referrer
        *
        * @return XenForo_ControllerResponse_Reroute
        */
        
    public static function getRebuilderResponse(XenForo_ControllerAdmin_Abstract $controller$caches$redirect null)
        {
            
    $controller->getRequest()->setParam('caches'$caches);
            if (
    $redirect !== null)
            {
                
    $controller->getRequest()->setParam('redirect'$redirect);
            }

            return 
    $controller->responseReroute('XenForo_ControllerAdmin_Tools''cacheRebuild');
        }
    }
     
  6. Harutyun

    Harutyun Active Member

    Hello, @Scharesoft
    The link in our framework product was meant to rebuild templates in some special cases, especially during development, so anyways, you will not need that functionality and should not use that link. The links works on boards that were updated from XenForo 1.1.x version but does not work with clean installed 1.2.x versions. We will remove this link in the next release of the product.
    Let us know if you have any other problem.
    Thank you!
     
    Scharesoft likes this.

Share This Page