The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Modwheel::Session - Easily create Modwheel sessions.

VERSION

v0.2.3

SYNOPSIS

    use strict;
    use warnings;
    use Modwheel::Session;

    my $modwheel_config = {
        prefix          => '/opt/modwheel',
        configfile      => 'config/modwheelconfig.yml',
        site            => 'mySite',
        logmode         => 'stderr',
        locale          => 'en_EN',
    };
    
    my ($modwheel, $user, $db, $object, $repository, $template) =
        modwheel_session($modwheel_config, qw(db user object template repository));
    $modwheel->set_debug(1);
    $db->connect();

    my $args = { };
    $template->init({
        input => './myfile.html'
    });
    print $template->process($args)

    $db->disconnect() if $db->connected();

DESCRIPTION

Modwheel::Session is a shortcut for creating Modwheel sessions in a terminal or CGI-program.

It imports all modules required for the standard Modwheel components into the main namespace, including a handy function for allocating objects from all of them in the right way(tm)*.

* Not that it's the right way, it's actually a horrid hack. But it's still handy :-)

SUBROUTINES/METHODS

CLASS METHODS

modwheel_session($modwheel_config, qw(db user object template repository))

Create a new modwheel session with the given config. Returns an array with the objects you've asked for.

DIAGNOSTICS

None.

CONFIGURATION AND ENVIRONMENT

None.

DEPENDENCIES

Modwheel
Modwheel::DB
Modwheel::User
Modwheel::Object
Modwheel::Repository
Modwheel::Template
Perl6::Export::Attrs
version

INCOMPATIBILITIES

None known.

BUGS AND LIMITATIONS

None known.

SEE ALSO

AUTHOR

Ask Solem, ask@0x61736b.net.

LICENSE AND COPYRIGHT

Copyright (C) 2007 by Ask Solem ask@0x61736b.net.

All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.