@@ -16,7 +16,6 @@ |
||
| 16 | 16 | use yii\web\Controller; |
| 17 | 17 | use yii\web\NotFoundHttpException; |
| 18 | 18 | use yii\web\Response; |
| 19 | -use assayerpro\sitemap\RobotsTxt; |
|
| 20 | 19 | |
| 21 | 20 | /** |
| 22 | 21 | * DefaultController for sitemap module |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $xml->writeAttribute('xmlns', $this->schemas['xmlns']); |
| 85 | 85 | for ($i = 1; $i <= $parts; $i++) { |
| 86 | 86 | $xml->startElement('sitemap'); |
| 87 | - $xml->writeElement('loc', Url::to(['/' . $this->moduleId . '/web/index', 'id' =>$i], true)); |
|
| 87 | + $xml->writeElement('loc', Url::to(['/'.$this->moduleId.'/web/index', 'id' =>$i], true)); |
|
| 88 | 88 | $xml->writeElement('lastmod', static::dateToW3C(time())); |
| 89 | 89 | $xml->endElement(); |
| 90 | 90 | } |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | protected function sortUrlsByPriority(&$urls) |
| 230 | 230 | { |
| 231 | - usort($urls, function ($urlA, $urlB) { |
|
| 231 | + usort($urls, function($urlA, $urlB) { |
|
| 232 | 232 | if (!isset($urlA['priority'])) { |
| 233 | 233 | return 1; |
| 234 | 234 | } |
@@ -46,10 +46,10 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function actionIndex() |
| 48 | 48 | { |
| 49 | - $route = '/' . $this->module->id . '/web/index'; |
|
| 49 | + $route = '/'.$this->module->id.'/web/index'; |
|
| 50 | 50 | |
| 51 | - $rootDir = Yii::getAlias('/' . trim($this->rootDir, '/')); |
|
| 52 | - $file = $rootDir . Url::to([$route], false); |
|
| 51 | + $rootDir = Yii::getAlias('/'.trim($this->rootDir, '/')); |
|
| 52 | + $file = $rootDir.Url::to([$route], false); |
|
| 53 | 53 | |
| 54 | 54 | $this->stdout("Generate sitemap file.\n", Console::FG_GREEN); |
| 55 | 55 | $this->stdout("Rendering sitemap...\n", Console::FG_GREEN); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $sitemap_count = count($sitemap); |
| 62 | 62 | |
| 63 | 63 | for ($i = 0; $i < $sitemap_count - 1; $i++) { |
| 64 | - $file = $rootDir . Url::to([$route, 'id' => $i], false); |
|
| 64 | + $file = $rootDir.Url::to([$route, 'id' => $i], false); |
|
| 65 | 65 | $this->stdout("Writing sitemap to $file\n", Console::FG_GREEN); |
| 66 | 66 | file_put_contents($file, $sitemap[$i + 1]['xml']); |
| 67 | 67 | } |