static private function init($type)
{
- if (S::has('__DE_' . $type)) {
+ if (Platal::globals()->cacheEnabled() && S::has('__DE_' . $type)) {
self::$enumerations[$type] = S::v('__DE_' . $type);
} else {
$cls = "DE_" . ucfirst($type);
$obj = new $cls();
self::$enumerations[$type] = $obj;
- if ($obj->capabilities & DirEnumeration::SAVE_IN_SESSION) {
+ if (Platal::globals()->cacheEnabled()
+ && $obj->capabilities & DirEnumeration::SAVE_IN_SESSION) {
S::set('__DE_' . $type, $obj);
}
}
class PlatalGlobals extends PlGlobals
{
+ const DEBUG_NOCACHE = DEBUG_USERBASE;
+
/** The x.org version */
public $version = '@VERSION@';
FROM requests");
$this->changeDynamicConfig(array('NbValid' => $res->fetchOneCell()));
}
-}
+ public function cacheEnabled()
+ {
+ return ($this->debug & self::DEBUG_NOCACHE) == 0;
+ }
+}
/******************************************************************************
* Dynamic configuration update/edition stuff