quell warning about C4::Context::DIR being used only once
authorGalen Charlton <galen.charlton@liblime.com>
Mon, 22 Oct 2007 19:43:18 +0000 (14:43 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Mon, 22 Oct 2007 20:42:43 +0000 (15:42 -0500)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Context.pm

index 94f436f..876a3f4 100644 (file)
@@ -145,9 +145,16 @@ $context = undef;        # Initially, no context is set
 
 sub KOHAVERSION {
     my $cgidir = C4::Context->intranetdir ."/cgi-bin";
+
+    # 2 cases here : on CVS install, $cgidir does not need a /cgi-bin
+    # on a standard install, /cgi-bin need to be added.
+    # test one, then the other
+    # FIXME - is this all really necessary?
     unless (opendir(DIR, "$cgidir/cataloguing/value_builder")) {
-            $cgidir = C4::Context->intranetdir;
+        $cgidir = C4::Context->intranetdir;
+        closedir(DIR);
     }
+
     do $cgidir."/kohaversion.pl" || die "NO $cgidir/kohaversion.pl";
     return kohaversion();
 }