Closed GoogleCodeExporter closed 9 years ago
Sorry, "$app" has to be replaces with "$this" in the code above if this code is
move
to TApplication::onLoadState(), so the correct code is:
const CONFIG_TIMESTAMP_KEY = 'Prado:Application:ConfigTimeStamp';
// ^ put this in class header
$ts = intval($this->getGlobalState(self::CONFIG_TIMESTAMP_KEY, 0));
$cts = intval(@filemtime($this->getConfigurationFile()));
if ($ts!==$cts)
{
$this->setGlobalState(self::CONFIG_TIMESTAMP_KEY, $cts);
$this->saveGlobals();
// ^ save changes quick so we don't get redundant cache purge attempts while
this is running
foreach($this->getModules() as $module)
if ($module instanceof TCache)
$module->flush();
}
Original comment by google...@pcforum.hu
on 3 Jan 2010 at 1:16
Why don't you use Application::Mode as "Normal"? Because this is feature of the
Performance mode do not check the changed files.
Here is from documentation (
http://www.pradosoft.com/docs/manual/System/TApplication.html ):
TApplication has four modes that can be changed by setting Mode property (in
the
application configuration file).
=====================
Off mode will prevent the application from serving user requests.
Debug mode is mainly used during application development. It ensures the cache
is
always up-to-date if caching is enabled. It also allows exceptions are
displayed with
rich context information if they occur.
Normal mode is mainly used during production stage. Exception information will
only
be recorded in system error logs. The cache is ensured to be up-to-date if it
is
enabled.
Performance mode is similar to Normal mode except that it does not ensure the
cache
is up-to-date.
===============
Original comment by alex.fomenko
on 7 Jan 2010 at 8:16
"Why don't you use Application::Mode as "Normal"?"
Probably because I don't want the performance penalty that comes with "Normal",
but
still might want to upgrade my app from time to time?
The point is, there's no standard way in Prado to invalidate all your cached
templates when you do an upgrade. Or if there's one, I missed it.
Original comment by google...@pcforum.hu
on 7 Jan 2010 at 8:28
Original comment by Christophe.Boulain@gmail.com
on 11 Jan 2010 at 12:23
Original comment by ctrlal...@gmail.com
on 25 Jun 2012 at 1:56
Original comment by ctrlal...@gmail.com
on 21 Jan 2013 at 7:03
Original comment by ctrlal...@gmail.com
on 24 Jul 2013 at 1:46
Moved to github: https://github.com/pradosoft/prado/issues
Original comment by ctrlal...@gmail.com
on 1 Oct 2013 at 10:14
Original issue reported on code.google.com by
google...@pcforum.hu
on 3 Jan 2010 at 1:13