Exemplo n.º 1
0
 /**
  * Create new option / Update option value
  *
  * @param array $data Option data in the following format
  *
  * @return void
  */
 public function createOption($data)
 {
     parent::createOption($data);
     if ('CDev\\XMLSitemap' == $data['category']) {
         \XLite\Module\CDev\XMLSitemap\Logic\SitemapGenerator::getInstance()->clear();
     }
 }
Exemplo n.º 2
0
 /**
  * Clear sitemaps 
  * 
  * @return void
  *
  * @PrePersist
  * @PreUpdate
  * @PreRemove
  */
 public function clearSitemaps()
 {
     \XLite\Module\CDev\XMLSitemap\Logic\SitemapGenerator::getInstance()->clear();
 }
Exemplo n.º 3
0
 public function testgenerate()
 {
     foreach (glob(LC_DIR_DATA . 'xmlsitemap.*') as $path) {
         unlink($path);
     }
     $this->assertFalse(\XLite\Module\CDev\XMLSitemap\Logic\SitemapGenerator::getInstance()->isGenerated(), '#1');
     \XLite\Module\CDev\XMLSitemap\Logic\SitemapGenerator::getInstance()->generate();
     $this->assertTrue(\XLite\Module\CDev\XMLSitemap\Logic\SitemapGenerator::getInstance()->isGenerated(), '#2');
     $list = \XLite\Core\Database::getRepo('XLite\\Model\\Product')->findFrame(0, 1);
     $product = $list[0];
     $product->setPrice(10);
     \XLite\Core\Database::getEM()->flush();
     $this->assertFalse(\XLite\Module\CDev\XMLSitemap\Logic\SitemapGenerator::getInstance()->isGenerated(), '#3');
 }
Exemplo n.º 4
0
 /**
  * Check if current page is accessible
  *
  * @return boolean
  */
 protected function checkAccess()
 {
     return parent::checkAccess() && !\XLite\Module\CDev\XMLSitemap\Logic\SitemapGenerator::getInstance()->isEmpty();
 }
Exemplo n.º 5
0
 /**
  * Run step
  *
  * @return void
  */
 protected function runStep()
 {
     $generator = \XLite\Module\CDev\XMLSitemap\Logic\SitemapGenerator::getInstance();
     $generator->generate();
 }
Exemplo n.º 6
0
 /**
  * Manually generate sitemap.xml
  *
  * @return void
  */
 protected function doActionGenerate()
 {
     $generator = \XLite\Module\CDev\XMLSitemap\Logic\SitemapGenerator::getInstance();
     $generator->generate();
     \XLite\Core\TopMessage::addInfo('XML-Sitemap generated');
 }