From 561e01b9b51b62e2566d80cd63d308f9a4f82822 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Wed, 26 Sep 2018 16:37:40 +0100 Subject: Factor out photo storage backend init checks --- perllib/FixMyStreet/App/Model/PhotoSet.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'perllib/FixMyStreet/App/Model/PhotoSet.pm') diff --git a/perllib/FixMyStreet/App/Model/PhotoSet.pm b/perllib/FixMyStreet/App/Model/PhotoSet.pm index 58e1a135d..21bde52d8 100644 --- a/perllib/FixMyStreet/App/Model/PhotoSet.pm +++ b/perllib/FixMyStreet/App/Model/PhotoSet.pm @@ -16,6 +16,8 @@ use IPC::Cmd qw(can_run); use IPC::Open3; use MIME::Base64; +use FixMyStreet::PhotoStorage; + has c => ( is => 'ro', ); @@ -65,10 +67,7 @@ has storage => ( is => 'ro', lazy => 1, default => sub { - my $class = 'FixMyStreet::PhotoStorage::'; - $class .= FixMyStreet->config('PHOTO_STORAGE_BACKEND') || 'FileSystem'; - eval "use $class"; - return $class->new(); + return FixMyStreet::PhotoStorage::backend; } ); -- cgit v1.2.3