Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Vend 0.3.5
  • Loading branch information
Andrew M. Wilcox authored and jonjensen committed Jan 2, 2009
1 parent 537db7e commit 6b61bf8
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 30 deletions.
15 changes: 15 additions & 0 deletions ChangeLog
@@ -1,3 +1,18 @@
Thu Feb 1 23:09:53 1996 Andrew Wilcox <awilcox@maine.com>

* Vend/Startup.pm, setup: Version 0.3.5.

* Vend/Shopcart.pm
(create_table_placeholders): default $na argument to "NA".

* Vend/Session.pm: Don't export removed expire_sessions function.

* Vend/Startup.pm:
Remove unused -expire option.
Update option help.
(startup): No longer display traceback on errors. Initialize the
session before calling dump_sessions().

Tue Jan 30 23:34:55 1996 Andrew Wilcox <awilcox@maine.com>

* Vend/Startup.pm, setup: Version 0.3.4.
Expand Down
5 changes: 2 additions & 3 deletions Vend/Session.pm
@@ -1,6 +1,6 @@
# Session.pm: tracks session information between requests
#
# $Id: Session.pm,v 1.8 1995/10/31 14:14:40 amw Exp $
# $Id: Session.pm,v 1.9 1996/02/01 23:08:07 amw Exp $
#
package Vend::Session;

Expand All @@ -24,9 +24,8 @@ require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(Session Value
initialize_Session session_id
open_session new_session close_session expire_sessions
open_session new_session close_session
dump_sessions);
# Lists

use Carp;
use strict;
Expand Down
3 changes: 2 additions & 1 deletion Vend/Shopcart.pm
@@ -1,6 +1,6 @@
# Shopcart.pm: utility functions for the shopping cart
#
# $Id: Shopcart.pm,v 1.1 1996/01/30 23:09:24 amw Exp $
# $Id: Shopcart.pm,v 1.2 1996/02/01 23:08:51 amw Exp $
#
package Vend::Shopcart;

Expand Down Expand Up @@ -82,6 +82,7 @@ to return if the key is not present.

sub create_table_placeholders {
my ($name, $table, $na) = @_;
$na = "NA" unless defined $na;

my $column;
foreach $column ($table->columns()) {
Expand Down
49 changes: 25 additions & 24 deletions Vend/Startup.pm
@@ -1,6 +1,6 @@
# Startup.pm: startup Vend program and process command line arguments
#
# $Id: Startup.pm,v 1.23 1996/01/30 23:34:55 amw Exp $
# $Id: Startup.pm,v 1.25 1996/02/01 23:09:53 amw Exp $
#
package Vend::Startup;

Expand Down Expand Up @@ -34,12 +34,11 @@ require Vend::Http;
use Vend::lock;
use Vend::Log;
use Vend::Page;
use Vend::Require;
use Vend::Server;
use Vend::Session;
use Vend::Uneval;

my $Vend_version = "0.3.4";
my $Vend_version = "0.3.5";

my $Running_as_cgi_bin;
my $Mode;
Expand All @@ -55,7 +54,6 @@ sub parse_options {
"version",
"help",
"test",
"expire",
"dump-sessions",
"server",
"debug")
Expand All @@ -73,8 +71,6 @@ sub parse_options {
exit 0;
} elsif ($Vend::Startup::opt_test) {
$Mode = 'test';
} elsif ($Vend::Startup::opt_expire) {
$Mode = 'expire';
} elsif ($Vend::Startup::opt_dump_sessions) {
$Mode = 'dump-sessions';
} elsif ($Vend::Startup::opt_server) {
Expand All @@ -97,9 +93,11 @@ absolutely no warranty for Vend; see the file COPYING for details.
Command line options:
-test report problems
-debug used with -server, stay in foreground
-dump-sessions display session information for debugging purposes
-server run in the background as a server
-test load catalog pages and report problems
-version display program version
-expire expire old sessions
END
}

Expand Down Expand Up @@ -147,8 +145,6 @@ my @Modules;
sub startup {
my ($initialize) = @_;

local $SIG{'__DIE__'} = \&expound_error;

# Were we called from an HTTPD server as a cgi-bin program?
$Running_as_cgi_bin = defined($ENV{'GATEWAY_INTERFACE'});

Expand All @@ -175,14 +171,12 @@ sub startup {
or die "Could not chdir to '".App_directory()."': $!\n";
umask $Umask;

# my $vdb_class = "Vdb_" . Database;
# require "$vdb_class.pm";

@Modules = split(/\s+/, Modules);
foreach (@Modules) {
s!::!/!g;
print "Loading $_\n" if ($Mode eq 'test');
Require("$_.pm");
my $module;
foreach $module (@Modules) {
$module =~ s!::!/!g;
print "Loading $module\n" if ($Mode eq 'test');
require "$module.pm";
}

# read_config_file($config_file);
Expand All @@ -203,9 +197,13 @@ sub startup {
$http->populate(\%ENV);
dispatch($http);
}
elsif ($Mode eq 'server') { run_server($Vend::Startup::opt_debug) }
elsif ($Mode eq 'expire') { expire_sessions() }
elsif ($Mode eq 'dump-sessions') { dump_sessions() }
elsif ($Mode eq 'server') {
run_server($Vend::Startup::opt_debug);
}
elsif ($Mode eq 'dump-sessions') {
initialize_session();
dump_sessions();
}
else {
die "Unknown mode: $Mode\n";
}
Expand Down Expand Up @@ -312,6 +310,12 @@ sub become_daemon {
setsid();
}

sub initialize_session {
initialize_Session(Database,
Data_directory,
Session_expire,
$File_creation_mask);
}

sub run_server {
my ($debug) = @_;
Expand All @@ -325,10 +329,7 @@ sub run_server {
run_daemon_server();
}

initialize_Session(Database,
Data_directory,
Session_expire,
$File_creation_mask);
initialize_session();
run_module_init_functions();

my $next = server(Data_directory . "/socket", $debug);
Expand Down
4 changes: 2 additions & 2 deletions setup
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# setup: read configuration file and install application
#
# $Id: setup,v 1.22 1996/01/30 23:34:53 amw Exp $
# $Id: setup,v 1.23 1996/02/01 23:09:52 amw Exp $

# Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
#
Expand All @@ -19,7 +19,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

my $Version = "0.3.4";
my $Version = "0.3.5";

use Getopt::Long;
# use strict;
Expand Down

0 comments on commit 6b61bf8

Please sign in to comment.