Skip to content
Snippets Groups Projects
Select Git revision
  • 2409764e452aa95d8ec4c6f2ef7b0895d4c1f89a
  • master default protected
  • devel
  • hruska-feature-clients-api
  • malostik-#5066-deduplicate-idea-ids
  • warden-postgresql-port
  • hruska-feature-#6799-filter-keys
  • hruska-feature-5066-duplicateIdeaID
  • warden-client-3.0-beta3
  • warden-server-3.0-beta3
  • warden-client-2.2-final
  • warden-server-2.2-final
  • warden-client-3.0-beta2
  • warden-server-3.0-beta2
  • warden-client-2.2
  • warden-server-2.2-patch3
  • warden-client-3.0-beta1
  • warden-server-3.0-beta1
  • warden-server-2.2-patch1
  • warden-client-3.0-beta0
  • warden-server-3.0-beta0
  • warden-server-2.2
  • warden-server-2.1-patch1
  • warden-client-2.1
  • warden-server-2.1
  • warden-server-2.1-beta6
  • warden-server-2.1-beta5
  • warden-server-2.1-beta4
28 results

updateCommon.pm

Blame
  • updateCommon.pm 1.61 KiB
    # updateCommon.pm
    #
    # Copyright (C) 2011-2014 Cesnet z.s.p.o
    #
    # Use of this source is governed by a BSD-style license, see LICENSE file.
    
    package updateCommon;
    
    use warnings;
    use strict;
    
    ################################################################################
    #                               VARIABLES
    ################################################################################
    our $VERSION = "2.2";
    
    ################################################################################
    #                               FUNCTIONS
    ################################################################################
    sub getConfHash {
      my $arg = shift;
      my $hash;
      our %VALID_STRINGS;
      require $arg;
      while (my ($key, $value_ref) = each %VALID_STRINGS) {
        $hash .= "  \"$key\" => [\"$value_ref->[0]\"";
        shift($value_ref);
        foreach my $element (@$value_ref) {
          $hash .= ", \"$element\"";
        }
        $hash .= "],\n";
      }
      print $hash;
    }
    
    sub getConfArrayPre {
      my $arg = shift;
      my $array;
      our @SQL_PRECONDITION;
      require $arg;
      foreach my $element (@SQL_PRECONDITION) {
        $array .= "'$element', ";
      }
      print $array;
    }
    
    sub getConfArrayPost {
      my $arg = shift;
      my $array;
      our @SQL_POSTCONDITION;
      require $arg;
      foreach my $element (@SQL_POSTCONDITION) {
        $array .= "'$element', ";
      }
      print $array;
    }
    
    sub getConfArrayQueries {
      my $arg = shift;
      my $array;
      our @SQL_QUERIES;
      require $arg;
      foreach my $hash_ref (@SQL_QUERIES) {
        $array .= "{";
        while (my ($key, $value_ref) = each $hash_ref) {
          $array .= "$key => \"$value_ref\", ";
        }
        $array .= "},\n";
      }
      print $array;