MySQL::Admin::Session - store the sessions for MySQL::Admin


MySQL-Admin documentation Contained in the MySQL-Admin distribution.

Index


Code Index:

NAME

Top

MySQL::Admin::Session - store the sessions for MySQL::Admin

SYNOPSIS

Top

see l<MySQL::Admin>

DESCRIPTION

Top

session for MySQL::Admin.

EXPORT

loadConfig() saveSession() $session

Public

Top

new

loadConfig

saveSession

Private

Top

getSelf

AUTHOR

Top

Dirk Lindner <lze@cpan.org>

LICENSE

Top

Copyright (C) 2005-2009 by Hr. Dirk Lindner

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.


MySQL-Admin documentation Contained in the MySQL-Admin distribution.
package MySQL::Admin::Session;
use strict;
use warnings;
require Exporter;
use vars qw( $session $DefaultClass @EXPORT  @ISA $defaultconfig);
@MySQL::Admin::Session::EXPORT = qw(loadSession saveSession $session);
use MySQL::Admin::Config;
@MySQL::Admin::Session::ISA     = qw(Exporter MySQL::Admin::Config);
$MySQL::Admin::Session::VERSION = '0.62';
$DefaultClass                   = 'MySQL::Admin::Session' unless defined $MySQL::Admin::Session::DefaultClass;
$defaultconfig                  = '%CONFIG%';

sub new
{
    my ($class, @initializer) = @_;
    my $self = {};
    bless $self, ref $class || $class || $DefaultClass;
    return $self;
}

sub loadSession
{
    my ($self, @p) = getSelf(@_);
    my $do = (defined $p[0]) ? $p[0] : $defaultconfig;
    if (-e $do) {do $do;}
}

sub saveSession
{
    my ($self, @p) = getSelf(@_);
    my $l = defined $p[0] ? $p[0] : $defaultconfig;
    $self->SUPER::saveConfig($l, $session, 'session');
}

sub getSelf
{
    return @_ if defined($_[0]) && (!ref($_[0])) && ($_[0] eq 'MySQL::Admin::Session');
    return (defined($_[0]) && (ref($_[0]) eq 'MySQL::Admin::Session' || UNIVERSAL::isa($_[0], 'MySQL::Admin::Session')))
      ? @_
      : ($MySQL::Admin::Session::DefaultClass->new, @_);
}

1;