/**
  * @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);
 }
Example #2
0
 /**
  * @throws ApplicationPartMissingException
  */
 public function __construct()
 {
     SignalSlotDispatcher::emitSignal(self::SIGNAL_CONSTRUCT);
     $this->cache = CacheFactory::getCache();
     $this->determineRequestMethod();
 }
Example #3
0
 /**
  * @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')]);
     }
 }