/** * Sets a file cache instance to a class property * * @return void */ public static function setCache() { $home = getenv('HOME'); if (!$home) { //Sometimes in Windows, $HOME is not defined. $home = getenv('HOMEDRIVE') . '/' . getenv('HOMEPATH'); } $dir = getenv('TERMINUS_CACHE_DIR'); if (!$dir) { $dir = "{$home}/.terminus/cache"; } // 6 months, 300mb $cache = new FileCache($dir, 86400, 314572800); $cache->clean(); self::$cache = $cache; }