diff options
author | louise <louise> | 2009-09-15 13:57:01 +0000 |
---|---|---|
committer | louise <louise> | 2009-09-15 13:57:01 +0000 |
commit | 2c8db0fa557b1722ab8f79422bd3986bcf67997b (patch) | |
tree | ca0858f58a06ae3cf4d4c2ff70efbab570ab6112 | |
parent | 8b80abe4f02c175e7c548a361504ed6112206680 (diff) |
Making conf file location relative to files in perllib, not relative to wherever execution was started from
-rw-r--r-- | perllib/Page.pm | 5 | ||||
-rw-r--r-- | perllib/Standard.pm | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm index bdee4ec25..21771eab3 100644 --- a/perllib/Page.pm +++ b/perllib/Page.pm @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: Page.pm,v 1.176 2009-09-10 12:04:19 louise Exp $ +# $Id: Page.pm,v 1.177 2009-09-15 13:57:01 louise Exp $ # package Page; @@ -42,7 +42,8 @@ use mySociety::WatchUpdate; use mySociety::Web qw(ent NewURL); BEGIN { - mySociety::Config::set_file("$FindBin::Bin/../conf/general"); + (my $dir = __FILE__) =~ s{/[^/]*?$}{}; + mySociety::Config::set_file("$dir/../conf/general"); } my $lastmodified; diff --git a/perllib/Standard.pm b/perllib/Standard.pm index 000b16169..2a776e8c3 100644 --- a/perllib/Standard.pm +++ b/perllib/Standard.pm @@ -7,7 +7,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: Standard.pm,v 1.2 2008-10-09 14:20:54 matthew Exp $ +# $Id: Standard.pm,v 1.3 2009-09-15 13:57:01 louise Exp $ use strict; use warnings; @@ -29,7 +29,8 @@ sub import { unless ($db && $db eq '-db') { use mySociety::Config; use mySociety::DBHandle qw(dbh); - mySociety::Config::set_file("$FindBin::Bin/../conf/general"); + (my $file = __FILE__) =~ s{/[^/]*?$}{}; + mySociety::Config::set_file("$file/../conf/general"); mySociety::DBHandle::configure( Name => mySociety::Config::get('BCI_DB_NAME'), User => mySociety::Config::get('BCI_DB_USER'), |