Project

General

Profile

Actions

Bug #53295

closed

Fatal error: Class '\t3lib_cache_backend_NullBackend' not found

Added by Franz Holzinger about 11 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-11-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The TYPO3 Backend list module shows occasionally a fatal error message under TYPO3 6.2 beta1.

ExtDirect Exception

Fatal error: Class '\t3lib_cache_backend_NullBackend' not found in /home/path/typo3/sysext/core/Classes/Cache/CacheFactory.php on line 85

Actions #1

Updated by Mathias Brodala about 11 years ago

I think more info is necessary here.

Is this a fresh install or an upgrade from an older version?

What extensions are installed?

How does $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] look like?

Actions #2

Updated by Franz Holzinger about 11 years ago

This is an upgrade install from TYPO3 6.1 where this error message did never shop up.

The extensions tt_products and party have been installed. In the EM for tt_products the [cache.cache.backend] is empty.
The file ext_localconf.php of tt_products sets the Caching Framework.
Sometimes it happens that the class t3lib_cache_backend_NullBackend is not found.



$typoVersion = tx_div2007_core::getTypoVersion();

// support for new Caching Framework

$optionsArray = array();
$backendCache = 't3lib_cache_backend_NullBackend';

// Register cache 'tt_products_cache'
if (
    isset($_EXTCONF['cache.']) &&
    $_EXTCONF['cache.']['backend'] &&
    !is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tt_products_cache'])
) {
    if (
        isset($_EXTCONF['cache.']['options.']) &&
        $_EXTCONF['cache.']['options.']['servers'] != ''
    ) {
        $optionsArray['servers'] = array($_EXTCONF['cache.']['options.']['servers']);
    }

    if (
        extension_loaded('memcache') &&
        isset($optionsArray['servers']) &&
        is_array($optionsArray['servers'])
    ) {
        $backendCache = 't3lib_cache_backend_MemcachedBackend';
    } else if (extension_loaded('apc') || extension_loaded('apcu')) {
        $backendCache = 't3lib_cache_backend_ApcBackend';
    } else if (extension_loaded('redis')) {
        $backendCache = 't3lib_cache_backend_RedisBackend';
    }
}

if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tt_products_cache'])) {
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tt_products_cache'] = array();
}

// Define string frontend as default frontend, this must be set with TYPO3 4.5 and below
// and overrides the default variable frontend of 4.6
if (!isset($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['tt_products_cache']['frontend'])) {
    $TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['tt_products_cache']['frontend'] = 't3lib_cache_frontend_StringFrontend';
}

if ($typoVersion >= '4006000') {

    if (!isset($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['tt_products_cache']['backend'])) {
        $TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['tt_products_cache']['backend'] = $backendCache;
    }

    if (!isset($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['tt_products_cache']['options'])) {
        $TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['tt_products_cache']['options'] = $optionsArray;
    }
}

if ($typoVersion < '4006000') {
    // Define database backend as backend for 4.5 and below (default in 4.6)
    if (!isset($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['tt_products_cache']['backend'])) {
        $TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['tt_products_cache']['backend'] = 't3lib_cache_backend_DbBackend';
    }
    // Define data and tags table for 4.5 and below (obsolete in 4.6)
    if (!isset($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['tt_products_cache']['options'])) {
        $TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['tt_products_cache']['options'] = array();
    }
    if (!isset($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['tt_products_cache']['options']['cacheTable'])) {
        $TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['tt_products_cache']['options']['cacheTable'] = 'tt_products_cache';
    }
    if (!isset($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['tt_products_cache']['options']['tagsTable'])) {
        $TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['tt_products_cache']['options']['tagsTable'] = 'tt_products_cache_tags';
    }

    t3lib_cache::initializeCachingFramework();
} else {
    // add missing setup for the tt_content "list_type = 5" which is used by tt_products
    $addLine = 'tt_content.list.20.5 = < plugin.tt_products';
    t3lib_extMgm::addTypoScript(TT_PRODUCTS_EXT, 'setup', '
    # Setting ' . TT_PRODUCTS_EXT . ' plugin TypoScript
    ' . $addLine . '
    ', 43);
}

if (
    isset($GLOBALS['typo3CacheFactory']) &&
    is_object($GLOBALS['typo3CacheFactory']) &&
    ($typoVersion >= '4006000' || TYPO3_UseCachingFramework)
) {
    // register the cache in BE so it will be cleared with "clear all caches" 
    try {
        $GLOBALS['typo3CacheFactory']->create(
            'tt_products_cache',
            $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tt_products_cache']['frontend'],
            $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tt_products_cache']['backend'],
            $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tt_products_cache']['options']);
    } catch (t3lib_cache_exception_DuplicateIdentifier $e) {
        // do nothing, a tt_products_cache cache already exists
    }
}
Actions #3

Updated by Wouter Wolters almost 10 years ago

  • Status changed from New to Needs Feedback

Hi, is this still reproducable?

Actions #4

Updated by Christian Kuhn almost 10 years ago

  • Status changed from Needs Feedback to Resolved

NullBackend is now part of static class map in not yet released 6.2 branch that will become 6.2.10. This issue will ot pop up again, even if i'm not sure on why and when it appeared in the first place.

Actions #5

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF