Exemplo n.º 1
0
 /**
  * Первый запуск модуля
  */
 protected static function first_run()
 {
     // (1) IndexerSecretKey
     self::save_setting('IndexerSecretKey', sha1(mt_rand() . time()));
     // (2) robots.txt sitemap link
     $robots = new nc_search_robots();
     $path = self::get_module_url();
     foreach (array_keys(nc_Core::get_object()->catalogue->get_all()) as $site_id) {
         $robots->add_directive($site_id, "Sitemap: {$path}/sitemap.php");
         $robots->save_robots_txt($site_id);
     }
     // (3) инициализация поисковой службы
     self::get_provider()->first_run();
 }