[TYPO3-core] USER_CINT again

Bernhard Kraft kraftb at kraftb.at
Sat Mar 4 13:25:08 CET 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Kutschker wrote:
> Dmitry Dulepov <dima at spamcop.net> writes on 
> Tue, 28 Feb 2006 17:12:51 +0100 (MET):
> 
> 
>>What happens if in half-year we invent USER_DINT and need to
>>cache/not cache/crash the server/whatever depending on its state?
> 
> 
> 
> I thought about returning an array instead of a boolean ;-)

I think I have the solution for you problem.

Just define some kind of API which says: If there is some "global" variable set by the
USER func it doesn't get cached.

So I would do something like:

+			case 'CINT':
+				$conf['__cacheKey'] = md5(random(1, 0x7fffffff).time());
+				$c=$this->callUserFunction($conf['userFunc'],$conf,'');
+					// plugin asks for caching of the content?
+				if (intval($GLOBALS['TSFE']->CINTcachingArray[$conf['__cacheKey']]))      {
+					$content.=$c;
+					break;
+				}


So the USER function should do something like:

$GLOBALS['TSFE']->CINTcachingArray[$this->conf['__cacheKey']] = 1;

if it want's to get cached.


no changes in the core required elsewhere except that you should add the CINTcachingArray or whatever
it will get called to the tslib_fe class as an empty array.


Here my resume:
Very nice feature. We should call it MINT not CINT so it stands for MostlyINT (what stand CINT for)
and also for "MartinINT" :) :)
it would also sound somehow more refreshing !

And another proposal would be to let the CINTcacingArray be either an integer == do fully cache with site.

Or "trara" .. an array like:
array(
	'expires' => 3600*24,	// expire time in seconds from now
	'until' => time()+(3600*24),	// expire time in absoulte time
	//	both of them and whichever is first.
);

Then make some possiblity to set this return values from a "traditional" cObj like "TEXT" and you
have a solution to output for example the date of the current day on a heavy loaded server without
clearing the complete cache each day at 0:00


Even if you not have this feature it would also bring us nearer to it.
So just post the latest version with the change Wolfgang made manually included and I
will test it.




greets,
Bernhard
- --
- ----------------------------------------------------------------------
"Freiheit ist immer auch die Freiheit des Andersdenkenden"
Rosa Luxemburg, 1871 - 1919
- ----------------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFECYbuIl4dkVkDMFkRAqhVAJ0fb5PB+4eDiWaVLKaut1xCqHaZBwCgutfA
IKjgy/usXE23AKiDwDT7hdA=
=B0Gl
-----END PGP SIGNATURE-----



More information about the TYPO3-team-core mailing list