Updated redirects.php

This commit is contained in:
Oliver Davies 2015-08-07 07:19:43 +01:00
parent ff41091b95
commit f6b6f16a3d

View file

@ -12,14 +12,13 @@ EOS;
$filename = dirname(__FILE__) . '/redirects.csv'; $filename = dirname(__FILE__) . '/redirects.csv';
$row = 1; $row = 0;
if (($handle = fopen($filename, 'r')) !== FALSE) { if (($handle = fopen($filename, 'r')) !== FALSE) {
while (($data = fgetcsv($handle, filesize($filename))) !== FALSE) { while (($data = fgetcsv($handle, filesize($filename))) !== FALSE) {
# if ($row == 1) { $row++;
# continue;
# }
if ($row > 1) {
$templateData = [ $templateData = [
'%DESTINATION%' => $data[1], '%DESTINATION%' => $data[1],
]; ];
@ -28,8 +27,7 @@ if (($handle = fopen($filename, 'r')) !== FALSE) {
file_put_contents("source/{$data[0]}.html", $output); file_put_contents("source/{$data[0]}.html", $output);
echo "Written to {$data[0]}.html\n"; echo "Written to {$data[0]}.html\n";
}
$row++;
} }
} }