diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-08-10 17:08:41 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-08-10 17:08:41 +0100 |
commit | 4faf6b08b07bf450d87db10df786f2b7ff8a802c (patch) | |
tree | a3c0f7de00a73c5fce730461c3faac477a26327e /perllib/FixMyStreet/Geocode/Zurich.pm | |
parent | 5d2426e0ca4dfee5f85fd5857f0db3276ed6d6c8 (diff) | |
parent | 6f6fc8b2d15b253bd455661a38d41ece11a547c0 (diff) |
Merge branch '1474-absolutely-fabulous'
Diffstat (limited to 'perllib/FixMyStreet/Geocode/Zurich.pm')
-rw-r--r-- | perllib/FixMyStreet/Geocode/Zurich.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Geocode/Zurich.pm b/perllib/FixMyStreet/Geocode/Zurich.pm index 671da9722..c7bd9e9d9 100644 --- a/perllib/FixMyStreet/Geocode/Zurich.pm +++ b/perllib/FixMyStreet/Geocode/Zurich.pm @@ -12,8 +12,8 @@ package FixMyStreet::Geocode::Zurich; use strict; use Digest::MD5 qw(md5_hex); -use File::Path (); use Geo::Coordinates::CH1903Plus; +use Path::Tiny; use Storable; use Utils; @@ -64,8 +64,8 @@ sub string { setup_soap(); - my $cache_dir = FixMyStreet->config('GEO_CACHE') . 'zurich/'; - my $cache_file = $cache_dir . md5_hex($s); + my $cache_dir = path(FixMyStreet->config('GEO_CACHE'), 'zurich')->absolute(FixMyStreet->path_to()); + my $cache_file = $cache_dir->child(md5_hex($s)); my $result; if (-s $cache_file && -M $cache_file <= 7 && !FixMyStreet->config('STAGING_SITE')) { $result = retrieve($cache_file); @@ -80,7 +80,7 @@ sub string { return { error => 'The geocoder appears to be down.' }; } $result = $result->result; - File::Path::mkpath($cache_dir); + $cache_dir->mkpath; store $result, $cache_file if $result && !FixMyStreet->config('STAGING_SITE'); } |