From 1211f0d0a547b1edfa11f21abad2a03d9ae976c6 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 7 Aug 2015 01:54:41 +0100 Subject: [PATCH] Skip the first row, fill in the destination parameter --- scripts/redirects.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/redirects.php b/scripts/redirects.php index 735350bd..540b7323 100644 --- a/scripts/redirects.php +++ b/scripts/redirects.php @@ -17,14 +17,18 @@ $row = 1; if (($handle = fopen($filename, 'r')) !== FALSE) { while (($data = fgetcsv($handle, filesize($filename))) !== FALSE) { -var_dump($data[0]); + if ($row === 1) { + continue; + } + $templateData = [ - '%DESTINATION%' => $destination, + '%DESTINATION%' => $data[1], ]; $output = strtr($template, $templateData); file_put_contents("source/{$data[0]}.html", $output); + echo "Written to {$data[0]}.html\n"; $row++; } }