Coding standards part and bad empty Disallow

- Unsure PHP_EOL is the best here : PHP_EOL are not the same on *nux and win, it's not for server , but for browser
- _content vs _init : seems not really a web content ?
This commit is contained in:
Denis Chenu 2017-04-26 17:07:24 +02:00
parent 4942c97785
commit 6ef8d18297
1 changed files with 15 additions and 17 deletions

View File

@ -1,29 +1,27 @@
<?php <?php
/** /**
* return the default robots.txt * return the default robots.txt
* @version 0.1.0 * @version 0.1.1
*/ */
/** /**
* Simple robots.txt * Simple robots.txt
* @inheritdoc (?) * @param App $a
* @return void
*/ */
function robots_txt_init(App $a) { function robots_txt_init(App $a) {
/** @var string[] globally disallowed url */ /** @var string[] globally disallowed url */
$allDisalloweds=array( $allDisalloweds = array(
'/settings/', "/settings/",
'/admin/', "/admin/",
'/message/', "/message/",
); );
header("Content-Type: text/plain"); header("Content-Type: text/plain");
echo "User-agent: *\n"; echo "User-agent: *\n";
echo "Disallow:\n"; foreach($allDisalloweds as $disallowed) {
echo "\n"; echo "Disallow: {$disallowed}\n";
echo "User-agent: *\n"; }
foreach($allDisalloweds as $disallowed) { killme();
echo "Disallow: {$disallowed}\n";
}
killme();
} }