/** * @test * @expectedException \AppZap\PHPFramework\Mvc\ApplicationPartMissingException * @expectedExceptionCode 1410537933 */ public function cacheFolderNotWritable() { Configuration::reset(); Configuration::set('phpframework', 'cache.enable', TRUE); Configuration::set('phpframework', 'cache.folder', '/'); $cache = CacheFactory::getCache(); $this->assertTrue($cache->getStorage() instanceof FileStorage); }
/** * @throws ApplicationPartMissingException */ public function __construct() { SignalSlotDispatcher::emitSignal(self::SIGNAL_CONSTRUCT); $this->cache = CacheFactory::getCache(); $this->determineRequestMethod(); }
/** * @param string $output * @param string $uri * @param string $requestMethod * @throws \AppZap\PHPFramework\Mvc\ApplicationPartMissingException */ public static function writeOutputToCache($output, $uri, $requestMethod) { if (Configuration::get('phpframework', 'cache.full_output', FALSE) && $requestMethod === 'get') { CacheFactory::getCache()->save('output_' . $uri, $output, [Cache::EXPIRE => Configuration::get('phpframework', 'cache.full_output_expiration', '20 Minutes')]); } }