[Koha-patches] (no subject)

Joe Atzberger joe.atzberger at liblime.com
Fri Jan 9 16:03:16 CET 2009


Can you give some indication why you think enabling warnings in Context.pm
is safe to do at this point, i.e. why it won't flood the logs with potential
warnings?  Context is used by almost every Koha page, so one wrinkle that
triggers a warn could conceivably overwhelm production systems with repeated
log messages.

--Joe

On Thu, Jan 1, 2009 at 12:39 PM, stan <stan at brinkerhoff.org> wrote:

> From 74de1bb0b2f0ad21fab01a35f5c0cb3582f6c1db Mon Sep 17 00:00:00 2001
> From: stan <stan at brinkerhoff.org>
> Date: Thu, 1 Jan 2009 12:36:57 -0500
> Subject: [PATCH] Enable use warnings;, clean up complainy functions, fix a
> few tab/space formatting issues.
>
> Refactoring KOHAVERSION to be less crufty, enabling use warnings, change
> formatting slightly in places.
>
> ---
>  C4/Context.pm |   32 +++++++++++++++-----------------
>  1 files changed, 15 insertions(+), 17 deletions(-)
>
> diff --git a/C4/Context.pm b/C4/Context.pm
> index 78b9dd7..9c7e0b8 100644
> --- a/C4/Context.pm
> +++ b/C4/Context.pm
> @@ -16,6 +16,7 @@ package C4::Context;
>  # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple
> Place,
>  # Suite 330, Boston, MA  02111-1307 USA
>
> +use warnings;
>  use strict;
>  use vars qw($VERSION $AUTOLOAD $context @context_stack);
>
> @@ -190,17 +191,14 @@ $context = undef;        # Initially, no context is
> set
>  =cut
>
>  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;
> -        closedir(DIR);
> -    }
> +    my $cgidir = C4::Context->intranetdir;
>
> +    # Apparently the GIT code does not run out of a CGI-BIN subdirectory
> +    # but distribution code does?  (Stan, 1jan08)
> +    if(-d $cgidir . "/cgi-bin"){
> +        my $cgidir .= "/cgi-bin";
> +    }
> +
>     do $cgidir."/kohaversion.pl" || die "NO $cgidir/kohaversion.pl";
>     return kohaversion();
>  }
> @@ -649,13 +647,13 @@ sub _new_Zconn {
>  sub _new_dbh
>  {
>
> -### $context
> -    ##correct name for db_schme
> +    ## $context
> +    ## correct name for db_schme
>     my $db_driver;
>     if ($context->config("db_scheme")){
> -    $db_driver=db_scheme2dbi($context->config("db_scheme"));
> +        $db_driver=db_scheme2dbi($context->config("db_scheme"));
>     }else{
> -    $db_driver="mysql";
> +        $db_driver="mysql";
>     }
>
>     my $db_name   = $context->config("database");
> @@ -931,12 +929,12 @@ sub set_userenv{
>         "cardnumber" => $usercnum,
>         "firstname"  => $userfirstname,
>         "surname"    => $usersurname,
> -#possibly a law problem
> +        #possibly a law problem
>         "branch"     => $userbranch,
>         "branchname" => $branchname,
>         "flags"      => $userflags,
> -        "emailaddress"    => $emailaddress,
> -               "branchprinter"    => $branchprinter
> +        "emailaddress"     => $emailaddress,
> +        "branchprinter"    => $branchprinter
>     };
>     $context->{userenv}->{$var} = $cell;
>     return $cell;
> --
> 1.5.6.3
>
> _______________________________________________
> Koha-patches mailing list
> Koha-patches at lists.koha.org
> http://lists.koha.org/mailman/listinfo/koha-patches
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-patches/attachments/20090109/cf516a7d/attachment-0002.htm>


More information about the Koha-patches mailing list