head	1.2;
access;
symbols
	TIGRIS_1_1_0RC2:1.1
	TIGRIS_1_1_0RC1:1.1
	TIGRIS_1_1:1.1.0.14
	TIGRIS_1_0_8:1.1
	TIGRIS_1_0_8RC3:1.1
	TIGRIS_1_0_8RC2:1.1
	TIGRIS_1_0_8RC1:1.1
	TIGRIS_1_0_7:1.1
	TIGRIS_1_0_7RC3:1.1
	TIGRIS_1_0_7RC2:1.1
	TIGRIS_1_0_7RC1:1.1
	TIGRIS_1_0_6:1.1
	TIGRIS_1_0_6RC5:1.1
	TIGRIS_1_0_6RC4:1.1
	TIGRIS_1_0_6RC3:1.1
	TIGRIS_1_0_6RC2:1.1
	TIGRIS_1_0_6RC1:1.1
	TIGRIS_1_0_5:1.1
	TIGRIS_1_0_5RC6:1.1
	TIGRIS_1_0_5RC5:1.1
	TIGRIS_1_0_5RC4:1.1
	TIGRIS_1_0_5RC3:1.1
	TIGRIS_1_0_5RC2:1.1
	TIGRIS_1_0_5RC1:1.1
	TIGRIS_1_0_4:1.1
	TIGRIS_1_0_3:1.1
	TIGRIS_1_0_2:1.1
	TIGRIS_1_0_1:1.1
	TIGRIS_1_0:1.1.0.16
	TIGRIS_1_0_0:1.1
	TIGRIS_1_0_0_RC1:1.1.0.12
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.1
	TIGRIS_0_9_2_3:1.1
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.1
	TIGRIS_0_9_2_1:1.1
	TIGRIS_0_9_2:1.1.0.10
	TIGRIS_0_9_0:1.1.0.8
	TIGRIS_0_8_4:1.1.0.6
	NEWHELM:1.1.1.1
	TIGRIS_NOV_12_2000:1.1.1
	OLDHELM:1.1.0.4
	TIGRIS_NOV_11_2000:1.1
	TIGRIS_SEP_13_2000:1.1.0.2
	TIGRIS_BASELINE:1.1;
locks; strict;
comment	@# @;


1.2
date	2001.08.14.21.57.24;	author edk;	state dead;
branches;
next	1.1;

1.1
date	2000.06.22.00.09.54;	author jrobbins;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2000.11.12.21.17.04;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.2
log
@remove obsolete/non-functional scripts
@
text
@# ================================================================
# Copyright (c) 2000 Collab.Net.  All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 
# 3. The end-user documentation included with the redistribution, if
# any, must include the following acknowlegement: "This product includes
# software developed by Collab.Net (http://www.Collab.Net/)."
# Alternately, this acknowlegement may appear in the software itself, if
# and wherever such third-party acknowlegements normally appear.
# 
# 4. The hosted project names must not be used to endorse or promote
# products derived from this software without prior written
# permission. For written permission, please contact info@@collab.net.
# 
# 5. Products derived from this software may not use the "Tigris" name
# nor may "Tigris" appear in their names without prior written
# permission of Collab.Net.
# 
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ====================================================================
# 
# This software consists of voluntary contributions made by many
# individuals on behalf of Collab.Net.
#


# Helm/Config.pm
# ----------------
# How we configure Helm. For now, we make this simple. Later, we'll
# make it complicated.
#
# Note that configuration done here should be only one-off domain-level
# stuff that is host-specific. Anything that involves lists of things, 
# is configurable via the admin interface, or is about projects, etc...
# should be in the database (see Helm::Database).
#
# Well, we've made this complicated. We now pull everything except the 
# database configuration out of the database. We should probably pull
# that out of the environment - after all, that's how Perl seems to like
# it.

package Helm::Config;

require Exporter;
@@ISA = qw(Exporter);

use strict;

my $configdb = {
# CONFIG - set for database name, username and password
    db_name => '__DATABASE_NAME__',
    db_user => '__DATABASE_USER__',
    db_pass => '__DATABASE_PASSWORD__',
};

# $value = Helm::Config::param($db, $param);
sub param {
    my ($db, $param) = @@_;
    
    return $configdb->{$param} if ($configdb->{$param});

    _initconfig($db) unless $db->{domain_config};
    return $db->{domain_config}->{$param};
}

# On the theory that there will be a small number of configurable options,
# we load them all in at startup.
sub _initconfig {
    my $db = shift;
    $db->{domain_config} = {};

    my $sth = $db->dbh->prepare("SELECT param,value FROM domain_config");
    $sth->execute();

    my $row;
    while ($row = $sth->fetchrow_arrayref) {
	$db->{domain_config}->{$row->[0]} = $row->[1];
    }
}

# Alternate version of param that accesses the database each time.
# One might be faster than the other. Right now we use config().
sub dbparam {
    my ($db, $param) = @@_;

    return $configdb->{$param} if ($configdb->{$param});

    my $sth = $db->dbh->prepare("SELECT value FROM domain_config WHERE param = '$param'");
    $sth->execute();

    my ($result, $row);
    while ($row = $sth->fetchrow_arrayref) {
	$result = $row->[0];
    }

    return $result;
}


@


1.1
log
@new .in file to make perl cgis use specified database, useful or per-developer sandboxes
@
text
@@


1.1.1.1
log
@Merging newhelm tree into helm, as per IZ issue #557.  Previous major version of helm is tagged TIGRIS_NOV_11_2000.
@
text
@@

