[TYPO3-dev] makeInstance caches multiple entries

Manuel Kammermann manuel.kammermann at unibas.ch
Mon Feb 11 13:09:41 CET 2013


Hi List,

I try to achieve the following:

from my extension, i want two different outputs of the same different extension. I use t3lib_div::makeInstance() and change the conf for the second init()-call  (TYPO3 is 4.5.5):

code:

require_once(PATH_typo3conf.'ext/foreignextkey/pi1/class.tx_foreignextkey_pi1.php');
                $publ = t3lib_div::makeInstance('tx_foreignextkey_pi1');
                $publ->pi_checkCHash = TRUE;
                $publ->pi_USER_INT_obj = TRUE;
                $publ->cObj = $this->cObj;
                $conf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_foreignextkey_pi1.'];

                if($pubView == 'two'){
                    $conf['category_sub'] = $bookCats;
                }

                $publ->init('',$conf);
                $publ->piVars['showAll'] = 1;

                $mArr['###marker###'] = $publ->listAll();
                if($pubView == 'two'){
                    $conf['category_sub'] = $otherCats;
                    $publ->init('',$conf);
                    $publ->piVars['showAll'] = 1;
                    $mArr['###publications###'] .= $publ->listAll();
                }
                unset($conf);


Not sure how to clear the cache between the two calls (you see some tried effort in the code). Any hints?

Thanks for your help, and have a good day.

------------

MANUEL KAMMERMANN, M. Sc.
Web Developer
Research IT Technology Platform<http://www.biozentrum.unibas.ch/researchit>

Biozentrum der Universität Basel
The Center of Molecular Life Sciences

Klingelbergstrasse 50, CH-4056 Basel
+41 (0)61 267 21 83



More information about the TYPO3-dev mailing list