|
|
|
@ -728,37 +728,6 @@ class common {
|
|
|
|
|
return ($folder); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Génère un fichier robots.txt à l'installation |
|
|
|
|
* Si le fichier existe déjà les commandes sont ajoutées |
|
|
|
|
*/ |
|
|
|
|
public function createRobots() { |
|
|
|
|
|
|
|
|
|
$robotValue = |
|
|
|
|
PHP_EOL . |
|
|
|
|
'# ZWII CONFIG ---------' . PHP_EOL . |
|
|
|
|
'User-agent: *' . PHP_EOL . |
|
|
|
|
'Allow: /site/file/' .PHP_EOL . |
|
|
|
|
'Disallow: /site/' .PHP_EOL . |
|
|
|
|
'Sitemap: ' . helper::baseUrl(false) . 'sitemap.xml' . PHP_EOL . |
|
|
|
|
'Sitemap: ' . helper::baseUrl(false) . 'sitemap.xml.gz' . PHP_EOL . |
|
|
|
|
'# ZWII CONFIG ---------' . PHP_EOL ; |
|
|
|
|
|
|
|
|
|
if (file_exists('robots.txt')) { |
|
|
|
|
return(file_put_contents( |
|
|
|
|
'robots.txt', |
|
|
|
|
$robotValue, |
|
|
|
|
FILE_APPEND |
|
|
|
|
)); |
|
|
|
|
} else { |
|
|
|
|
// Sinon on crée un fichier |
|
|
|
|
return(file_put_contents( |
|
|
|
|
'robots.txt', |
|
|
|
|
$robotValue |
|
|
|
|
)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Génère un fichier un fichier sitemap.xml |
|
|
|
@ -773,9 +742,7 @@ class common {
|
|
|
|
|
//require_once "core/vendor/sitemap/SitemapGenerator.php"; |
|
|
|
|
|
|
|
|
|
$timezone = $this->getData(['config','timezone']); |
|
|
|
|
|
|
|
|
|
$outputDir = getcwd(); |
|
|
|
|
|
|
|
|
|
$sitemap = new \Icamys\SitemapGenerator\SitemapGenerator(helper::baseurl(false),$outputDir); |
|
|
|
|
|
|
|
|
|
// will create also compressed (gzipped) sitemap |
|
|
|
@ -786,10 +753,11 @@ class common {
|
|
|
|
|
$sitemap->setMaxUrlsPerSitemap(50000); |
|
|
|
|
|
|
|
|
|
// sitemap file name |
|
|
|
|
$sitemap->setSitemapFileName("sitemap.xml"); |
|
|
|
|
$sitemap->setSitemapFileName( 'sitemap.xml') ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set the sitemap index file name |
|
|
|
|
$sitemap->setSitemapIndexFileName("sitemap-index.xml"); |
|
|
|
|
$sitemap->setSitemapIndexFileName( 'sitemap-index.xml'); |
|
|
|
|
|
|
|
|
|
$datetime = new DateTime(date('c')); |
|
|
|
|
$datetime->format(DateTime::ATOM); // Updated ISO8601 |
|
|
|
@ -845,9 +813,11 @@ class common {
|
|
|
|
|
$sitemap->updateRobots(); |
|
|
|
|
|
|
|
|
|
// Submit your sitemaps to Google, Yahoo, Bing and Ask.com |
|
|
|
|
$sitemap->submitSitemap(); |
|
|
|
|
if (empty ($this->getData(['config','proxyType']) . $this->getData(['config','proxyUrl']) . ':' . $this->getData(['config','proxyPort'])) ) { |
|
|
|
|
$sitemap->submitSitemap(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return(file_exists('sitemap.xml')); |
|
|
|
|
return(file_exists('sitemap.xml') && file_exists('robots.txt')); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|