Further change this so that it properly sets the include path so we can 
always find the module, or die if it can't.  (Helps some scripts like 
ljmaint.pl which don't setup include paths.)

        Patch by mark. 

diffs (36 lines):

diff -r c22b4bb13976 -r a85caf951e7e cgi-bin/ljlib.pl
--- a/cgi-bin/ljlib.pl  Mon Jan 11 04:46:12 2010 +0000
+++ b/cgi-bin/ljlib.pl  Mon Jan 11 04:53:56 2010 +0000
@@ -16,8 +16,6 @@ use strict;
 use strict;
 no warnings 'uninitialized';
 
-use LJ::Config;
-
 BEGIN {
     # ugly hack to shutup dependent libraries which sometimes want to bring in
     # ljlib.pl (via require, ick!).  so this lets them know if it's recursive.
@@ -28,7 +26,14 @@ BEGIN {
     $LJ::HOME ||= $ENV{LJHOME};
     die "No \$LJ::HOME set, or not a directory!\n"
         unless $LJ::HOME && -d $LJ::HOME;
+}
 
+# now that the library is setup, we can start pulling things in.  start with
+# the configuration library we need.
+use lib "$LJ::HOME/cgi-bin";
+use LJ::Config;
+
+BEGIN {
     # mod_perl does this early too, make sure we do as well
     LJ::Config->load;
 
@@ -44,8 +49,6 @@ BEGIN {
         $LJ::PUBLICBIT = 2 ** 63;
     }
 }
-
-use lib "$LJ::HOME/cgi-bin";
 
 use Apache2::Connection ();
 use Carp;
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to