From f6b6f16a3d489e5cba38803caada0c312dc8e515 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 7 Aug 2015 07:19:43 +0100 Subject: [PATCH] Updated redirects.php --- scripts/redirects.php | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/scripts/redirects.php b/scripts/redirects.php index a2e3c760..cdc11110 100644 --- a/scripts/redirects.php +++ b/scripts/redirects.php @@ -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"; + } } }