[TYPO3-dev] manually clear cache of my extension

Cyrill Helg phlogsmailinglists at gmail.com
Sat Sep 13 00:01:24 CEST 2008


Am Thursday 11 September 2008 schrieb Oliver Klee:
> Hi Cyrill,
>
> Cyrill Helg schrieb:
> > How can I manually clear the cache of my extension? So that the cHash
> > becomes outdated and the page is recreated? I need this because the
> > content of the extension is updated by an import function which can be
> > run as a cronjob.
>

You solution is not enough as I read here: http://www.sk-typo3.de/Cache-
loeschen-aus-der-Extension.213.0.html

This code I use now is a little better way:

		$dbResult = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
		'pid', 'tt_content', 'list_type="visualizexml_pi1"'
		);
		
		if (!$dbResult) {
			return;
		}

		$pageIds = array();
		while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbResult)) {
			$pageIds[] = $row['pid'];
		}
		$tce = t3lib_div::makeInstance('t3lib_TCEmain'); 
		 foreach (array_unique($pageIds) as $pid) {
				$tce->clear_cacheCmd($pid);
		 } 

Thanks
Cyrill

> I do it like this for the "realty" extension:
>
> public static function clearFrontEndCacheForRealtyPages() {
> 	$dbResult = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
> 		'pid', 'tt_content', 'list_type="realty_pi1"'
> 	);
> 	if (!$dbResult) {
> 		throw new Exception(DATABASE_QUERY_ERROR);
> 	}
>
> 	$pageIds = array();
> 	while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbResult)) {
> 		$pageIds[] = $row['pid'];
> 	}
>
> 	tslib_fe::clearPageCacheContent_pidList(implode(',', $pageIds));
> }
>
>
> Oliver
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev






More information about the TYPO3-dev mailing list