Updated redirects.php
This commit is contained in:
parent
ff41091b95
commit
f6b6f16a3d
|
@ -12,24 +12,22 @@ EOS;
|
|||
|
||||
$filename = dirname(__FILE__) . '/redirects.csv';
|
||||
|
||||
$row = 1;
|
||||
$row = 0;
|
||||
|
||||
if (($handle = fopen($filename, 'r')) !== FALSE) {
|
||||
while (($data = fgetcsv($handle, filesize($filename))) !== FALSE) {
|
||||
# if ($row == 1) {
|
||||
# continue;
|
||||
# }
|
||||
|
||||
$templateData = [
|
||||
'%DESTINATION%' => $data[1],
|
||||
];
|
||||
|
||||
$output = strtr($template, $templateData);
|
||||
file_put_contents("source/{$data[0]}.html", $output);
|
||||
|
||||
echo "Written to {$data[0]}.html\n";
|
||||
|
||||
$row++;
|
||||
|
||||
if ($row > 1) {
|
||||
$templateData = [
|
||||
'%DESTINATION%' => $data[1],
|
||||
];
|
||||
|
||||
$output = strtr($template, $templateData);
|
||||
file_put_contents("source/{$data[0]}.html", $output);
|
||||
|
||||
echo "Written to {$data[0]}.html\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue