Update redirects.php

This commit is contained in:
Oliver Davies 2015-08-07 20:07:36 +01:00
parent d881875827
commit 3ae0912a3a

View file

@ -2,6 +2,8 @@
<?php <?php
$csv = 'redirects.csv';
$template = <<<EOS $template = <<<EOS
--- ---
layout: redirect layout: redirect
@ -10,12 +12,9 @@ destination: %DESTINATION%
EOS; EOS;
$filename = dirname(__FILE__) . '/redirects.csv';
$row = 0; $row = 0;
if (($handle = fopen($csv, 'r')) !== FALSE) {
if (($handle = fopen($filename, 'r')) !== FALSE) { while (($data = fgetcsv($handle, filesize($csv))) !== FALSE) {
while (($data = fgetcsv($handle, filesize($filename))) !== FALSE) {
$row++; $row++;
if ($row > 1) { if ($row > 1) {