This repository has been archived on 2026-09-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
2017-07-05 20:40:20 +01:00
|
|
|
#!/usr/bin/env php
|
|
|
|
|
<?php
|
|
|
|
|
$here = __DIR__;
|
|
|
|
|
|
|
|
|
|
array_map("unlink", glob("$here/samples/*"));
|
|
|
|
|
|
|
|
|
|
$csv = fopen("$here/samples.csv", "r");
|
|
|
|
|
$headings = fgetcsv($csv);
|
|
|
|
|
|
|
|
|
|
while ($data = fgetcsv($csv)) {
|
|
|
|
|
$row = array_combine($headings, $data);
|
2017-07-05 21:00:13 +01:00
|
|
|
$from = $row["Project Path"] . "/samples/" . $row["Original Bank"];
|
|
|
|
|
$from = str_replace("~", $_SERVER["HOME"], $from);
|
2017-07-05 20:40:20 +01:00
|
|
|
$to = "$here/samples/" . $row["New Bank"];
|
|
|
|
|
if (is_link($to)) {
|
|
|
|
|
throw new Exception("$to exists");
|
|
|
|
|
}
|
|
|
|
|
symlink($from, $to);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fclose($csv);
|