public function setCache() { if ($this->ignore_cache || !PHPWS_Template::allowSigmaCache()) { return; } static $root_dir = null; if (empty($root_dir) && defined('CACHE_LIFETIME')) { if (CACHE_TPL_LOCALLY) { $root_dir = PHPWS_SOURCE_DIR . 'templates/cache/'; } elseif (defined('CACHE_DIRECTORY')) { $root_dir = CACHE_DIRECTORY; } else { $root_dir = 'unusable'; return; } if (!is_writable($root_dir)) { $root_dir = 'unusable'; return; } } elseif ($root_dir == 'unusable') { return; } $this->setCacheRoot($root_dir); }