aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--notes/INSTALL3
-rw-r--r--perllib/FixMyStreet/Geocode.pm2
2 files changed, 4 insertions, 1 deletions
diff --git a/notes/INSTALL b/notes/INSTALL
index 5e79a49a6..5254a6982 100644
--- a/notes/INSTALL
+++ b/notes/INSTALL
@@ -39,7 +39,7 @@ sudo apt-get install `cat conf/packages`
# also install these that are available by default on mySoc boxes:
sudo apt-get install \
- libregexp-common-perl php5-cli perl-doc
+ libregexp-common-perl php5-cli perl-doc libtest-exception-perl
# SETTING UP APACHE
@@ -88,6 +88,7 @@ nano conf/general
# * the OPTION_EVEL_URL to '' - this will cause some emails not to be sent but warned to STDERR instead - proper email handling is being worked on
# * the OPTION_SMTP_SMARTHOST to '' if routing mail via ssmtp as described above - otherwise your SMTP server
# * set OPTION_EMAIL_VHOST to the same as OPTION_BASE_URL minus the 'http://' - eg 'localhost'
+# * set OPTION_UPLOAD_CACHE and OPTION_GEO_CACHE to your preferred values
# SETTING UP THE DATABASES
diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm
index 9e89b4f7b..4854411cf 100644
--- a/perllib/FixMyStreet/Geocode.pm
+++ b/perllib/FixMyStreet/Geocode.pm
@@ -11,6 +11,7 @@ package FixMyStreet::Geocode;
use strict;
use Error qw(:try);
use File::Slurp;
+use File::Path ();
use LWP::Simple;
use Digest::MD5 qw(md5_hex);
use URI::Escape;
@@ -96,6 +97,7 @@ sub string {
$url .= ',+UK' unless $url =~ /united\++kingdom$/ || $url =~ /uk$/i;
$url .= '&sensor=false&gl=uk&key=' . mySociety::Config::get('GOOGLE_MAPS_API_KEY');
$js = LWP::Simple::get($url);
+ File::Path::mkpath($cache_dir);
File::Slurp::write_file($cache_file, $js) if $js && $js !~ /"code":6[12]0/;
}
if (!$js) {