/** * Triggers the shutdown by closing the output buffer * * @static * @return void */ public static function shutdown() { // This will flush the buffer if (ob_get_level()) { while (@ob_end_flush()) { } } // close caching if (self::$caching && !defined('NOCACHE')) { X4Cache_core::End(self::$output); } }
/** * Starts caching off. Returns true if cached, and dumps * the output. False if not cached and start output buffering. * * @static * @param string $id Unique ID of this data * @param int $ttl How long to cache for (in seconds) * @return bool True if cached, false if not */ public static function Start($id, $ttl) { if (self::isCached($id)) { echo self::read($id); return true; } else { self::$id = $id; self::$ttl = $ttl; return false; } }