From dave@riverside-cms.co.uk Mon May 23 00:15:00 2005 From: dave@riverside-cms.co.uk (David Baird) Date: Mon, 23 May 2005 00:15:00 +0100 Subject: [Maypole] Generating apps on the fly Message-ID: <200505230015.00706.dave@riverside-cms.co.uk> Following on from recent discussions about building apps for multiple vhosts, I've written a module that sets up Maypole apps 'on the fly'. I'd like to solicit suggestions for a name for the thing. At the moment, I'm provisionally calling it Maypole::Virtual::Application. =head1 SYNOPSIS package BeerDB; use strict; use warnings; use Class::DBI::Loader::Relationship; use Maypole::Virtual::Application; Maypole::Virtual::Application->install_packages( qw( -Debug AutoUntaint ) ); # beer for everyone! sub virtual_packages { map { __PACKAGE__ . "::Site$_" } 1 .. 100 } sub initialize_package { my ( $self, $package ) = @_; $package =~ /(Site\d+)$/; my $site = $1; my $username = My::Config::System->get_beerdb_username_for( $site ); my $password = My::Config::System->get_beerdb_password_for( $site ); $package->setup( "dbi:mysql:BeerDB$site", $username, $password, ); $package->config->{template_root} = '/usr/local/www/beerdb/htdocs'; $package->config->{uri_base} = '/'; $package->config->{rows_per_page} = 10; $package->config->{display_tables} = [ $package->config->loader->tables ]; $package->config->{application_name} = "The Beer Database for $site"; $package->auto_untaint; $package->config->loader->relationship( $_ ) for ( 'a brewery produces beers', 'a style defines beers', 'a pub has beers on handpumps', ); # this would get called anyway during the first request, but # putting it here is useful under mod_perl to get all initialisation # done before forking off child servers $package->init; } From dave@riverside-cms.co.uk Tue May 24 15:39:58 2005 From: dave@riverside-cms.co.uk (David Baird) Date: Tue, 24 May 2005 15:39:58 +0100 Subject: [Maypole] [ANNOUNCE] Maypole::Virtual::Application Message-ID: <200505241539.59051.dave@riverside-cms.co.uk> I've just uploaded this to CPAN. I stayed with the singular name, because I couldn't resist the symmetry with Mp::App. Note that to get this to work, you need to fix Maypole::Application first. The bugs are described in rt.cpan.org, and you can download a fixed version from beerdb.riverside-cms.co.uk. Does anyone have any idea of when a new release is likely? MasonX::Maypole also needs some fixes to Mp::App (which are also in the beerdb.riverside-cms.co.uk version). d. From Danijel.MIlicevic@rawmode.org Tue May 24 16:26:10 2005 From: Danijel.MIlicevic@rawmode.org (Danijel Milicevic) Date: Tue, 24 May 2005 17:26:10 +0200 Subject: [Maypole] [ANNOUNCE] Maypole::Virtual::Application In-Reply-To: <200505241539.59051.dave@riverside-cms.co.uk> References: <200505241539.59051.dave@riverside-cms.co.uk> Message-ID: <1116948370.8103.2.camel@localhost.localdomain> Hi David, Am Dienstag, den 24.05.2005, 15:39 +0100 schrieb David Baird: > I've just uploaded this to CPAN. I stayed with the singular name, because I > couldn't resist the symmetry with Mp::App. > > Note that to get this to work, you need to fix Maypole::Application first. The > bugs are described in rt.cpan.org, and you can download a fixed version from > beerdb.riverside-cms.co.uk. > > Does anyone have any idea of when a new release is likely? MasonX::Maypole > also needs some fixes to Mp::App (which are also in the > beerdb.riverside-cms.co.uk version). this list is somewhat of obsolete since the current maintainer Simon Flack decided to use Sourceforge for the mailing lists. You can find them here: http://sourceforge.net/projects/maypole Also maybe it's time to maintain maypole a bit more again? Ever since I used it last time (that was last year) not much has changed. Anyone know if the maintainer is still interested in maintaining maypole? Regards, Danijel