package cPanel::Ecommerce::AgoraCart;

use strict;
use warnings;

our $VERSION = 0.1;
my $pkg = __PACKAGE__;

our $meta_info = {
    require_suexec    => 1,
    adminuser_pass    => 1, 
    admin_email       => 1, 
    installdir        => 'agora',
    description       => 'Perl/MySQL based shopping system', # required
    security          => 'Requires SuExec for security. Nothing is world writable and no data is available to any users but the user herself and anyone she happens to create a login for. Also Perl does not suffer from common PHP security issues.',
    version           => '4.0K-4b', # required
    security_rank     => 8, 
    website           => 'http://www.agoracart.com/', 
    documentation_url => 'http://www.agoracart.com/help/storemanager.html',
    config_files      => [qw(protected/misc/mgr_pass.pl admin_files/agora_user_lib.pl)],
    adminarea_name     => 'Agora Cart Store Admin',
    adminarea_path     => 'protected',
    # mysql           => ['agora'],
    # table_prefix    => 'agora', 
};

#### action functions ##
sub install { 
    my $cpa = shift; # shift it because @_ is used later

    # set to no in case we don't have pgp
    $cpa->{'use_pgp'}  = 'no';
    $cpa->{'pgp_path'} = '';

    # look for pgp and use it if found
    for(qw(/bin  /usr/bin  /usr/local/bin 
           /sbin /usr/sbin /usr/local/sbin)) {
        if(-e "$_/pgp" && -x "$_/pgp") {
            $cpa->{'use_pgp'}  = 'yes';
            $cpa->{'pgp_path'} = "$_/pgp";
        }
    }
    $cpa->stdinstall(@_); 
}
sub upgrade { shift->stdupgrade(@_) }
sub uninstall { shift->stduninstall(@_) }

#### non action functions ##
sub installform { print shift->{installform} }
sub upgradeform { print shift->{upgradeform} }
sub uninstallform { print shift->{uninstallform} }

1;
