/**
  * Add resources from the stash and cache them
  *
  * @param boolean $cacheResources cache resources after retrieving them from the stasher
  */
 public function addResourcesFromDatabaseAndCacheThem($cacheResources = true)
 {
     $resources = $this->translationRepository->getAllDomainsByLocale();
     $this->addResources($resources);
     if ($cacheResources === true) {
         $this->resourceCacher->cacheResources($resources);
     }
 }
Exemplo n.º 2
0
 /**
  * Add resources from the stash and cache them
  *
  * @param boolean $cacheResources cache resources after retrieving them from the stasher
  */
 public function addResourcesFromDatabaseAndCacheThem($cacheResources = true)
 {
     try {
         $resources = $this->translationRepository->getAllDomainsByLocale();
         $this->addResources($resources);
         if ($cacheResources === true) {
             $this->resourceCacher->cacheResources($resources);
         }
     } catch (\Exception $ex) {
         // don't load if the database doesn't work
     }
 }