예제 #1
0
파일: Picture.php 프로젝트: acp3/core
 /**
  * @param \Symfony\Component\HttpFoundation\Response $response
  * @param \ACP3\Core\Environment\ApplicationPath     $appPath
  * @param string                                     $environment
  */
 public function __construct(Response $response, ApplicationPath $appPath, $environment)
 {
     $this->response = $response;
     $this->appPath = $appPath;
     $this->environment = $environment;
     $this->cacheDir = $this->appPath->getCacheDir() . 'images/';
 }
예제 #2
0
파일: Smarty.php 프로젝트: acp3/core
 /**
  * @param array $params
  *
  * @throws \SmartyException
  */
 public function configure(array $params = [])
 {
     $this->smarty->setErrorReporting($this->isDevOrInstall() ? E_ALL : 0);
     $this->smarty->setCompileId(!empty($params['compile_id']) ? $params['compile_id'] : $this->environment);
     $this->smarty->setCompileCheck($this->isDevOrInstall());
     $this->smarty->setCompileDir($this->appPath->getCacheDir() . 'tpl_compiled/');
     $this->smarty->setCacheDir($this->appPath->getCacheDir() . 'tpl_cached/');
 }
예제 #3
0
파일: Logger.php 프로젝트: acp3/core
 /**
  * @param string $channel
  * @param string $level
  */
 private function createChannel($channel, $level)
 {
     $fileName = $this->appPath->getCacheDir() . 'logs/' . $channel . '.log';
     $logLevelConst = constant(\Monolog\Logger::class . '::' . strtoupper($level));
     $stream = new StreamHandler($fileName, $logLevelConst);
     $stream->setFormatter(new LineFormatter(null, null, true));
     $this->channels[$channel] = new \Monolog\Logger($channel, [$stream]);
 }
 public function invalidatePageCache()
 {
     if ($this->canUsePageCache->canUsePageCache()) {
         if ($this->settings->getSettings(Schema::MODULE_NAME)['page_cache_purge_mode'] == 1) {
             Purge::doPurge($this->applicationPath->getCacheDir() . 'http');
         } else {
             $this->settings->saveSettings(['page_cache_is_valid' => false], Schema::MODULE_NAME);
         }
     }
 }
예제 #5
0
 /**
  * @param string $driverName
  * @param string $driverNameFqn
  *
  * @return \Doctrine\Common\Cache\CacheProvider
  */
 protected function initializeCacheDriver($driverName, $driverNameFqn)
 {
     /** @var \Doctrine\Common\Cache\CacheProvider $driver */
     switch (strtolower($driverName)) {
         case 'phpfile':
             $cacheDir = $this->appPath->getCacheDir() . 'sql/';
             return new $driverNameFqn($cacheDir);
         default:
             return new $driverNameFqn();
     }
 }
 public function invalidatePageCache()
 {
     if ($this->canUsePageCache->canUsePageCache()) {
         if ($this->settings->getSettings(Schema::MODULE_NAME)['page_cache_purge_mode'] == 1) {
             Purge::doPurge($this->applicationPath->getCacheDir() . 'http');
         } else {
             $systemModuleId = $this->modules->getModuleId(Schema::MODULE_NAME);
             $this->settingsRepository->update(['value' => false], ['module_id' => $systemModuleId, 'name' => 'page_cache_is_valid']);
         }
     }
 }