예제 #1
0
파일: Cache.php 프로젝트: acp3/module-seo
 /**
  * Setzt den Cache für die URI-Aliase
  *
  * @return boolean
  */
 public function saveCache()
 {
     $aliases = $this->seoRepository->getAllMetaTags();
     $cAliases = count($aliases);
     $data = [];
     for ($i = 0; $i < $cAliases; ++$i) {
         $data[$aliases[$i]['uri']] = ['alias' => $aliases[$i]['alias'], 'keywords' => $aliases[$i]['keywords'], 'description' => $aliases[$i]['description'], 'robots' => $aliases[$i]['robots']];
     }
     return $this->cache->save('seo', $data);
 }
예제 #2
0
 /**
  * Inserts/Updates a given URL alias
  *
  * @param string $path
  * @param string $alias
  * @param string $keywords
  * @param string $description
  * @param int    $robots
  *
  * @return boolean
  */
 public function insertUriAlias($path, $alias, $keywords = '', $description = '', $robots = 0)
 {
     $path .= $this->preparePath($path);
     $data = ['alias' => $alias, 'seo_keywords' => $keywords, 'seo_description' => $description, 'seo_robots' => (int) $robots];
     $seo = $this->seoRepository->getOneByUri($path);
     if (!empty($seo)) {
         $data['uri'] = $seo['uri'];
         $bool = $this->seoModel->save($data, $seo['id']);
     } else {
         $data['uri'] = $path;
         $bool = $this->seoModel->save($data);
     }
     return $bool !== false;
 }