Skip Menu |

This queue is for tickets about the CGI-Wiki CPAN distribution.

Report information
The Basics
Id: 2462
Status: resolved
Priority: 0/
Queue: CGI-Wiki

People
Owner: KAKE [...] cpan.org
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: CGI::Wiki::Setup::*::setup should take the same arguments as CGI::Wiki::Store::*::new
ok, maybe not identical (i'm talking about my $self = shift; due to ->), but my %destination = ( dbname => "test", dbuser => "test", dbpass => "", dbhost => "localhost", ); CGI::Wiki::Setup::MySQL::setup(%destination); my $destination = CGI::Wiki::Store::MySQL->new( %destination ); should work. That way, CGI::Wiki:::Setup::SQLite is not limited to a single argument (which is a bug), because DBD::SQLite also takes a user/pass argument.
[PODMASTER - Wed Apr 30 10:06:59 2003]: Show quoted text
> my %destination = ( > dbname => "test", > dbuser => "test", > dbpass => "", > dbhost => "localhost", > ); > CGI::Wiki::Setup::MySQL::setup(%destination); > my $destination = CGI::Wiki::Store::MySQL->new( %destination ); > > should work.
This one's tricky because if I just assume that the arguments to ::setup are a hash like that, then it breaks backwards compatibility and there's quite a lot of code built on top of this now - not by any means all of it mine! So I really want to stay backwards compatible. I *could* check the number of arguments and assume we have a hash if there are more than four - but then I can never add any more arguments to the list style of calling, and I don't want to assume that I never will want to. You're right that I should have done it with a hash to start with, but oh well, that's hindsight for you :) How about if I make it accept a hash *reference* as well as the existing way of calling it with a list? That's a lot easier to check for robustly. Would that suit your needs? Kake
Show quoted text
> How about if I make it accept a hash *reference* as well as the > existing > way of calling it with a list? That's a lot easier to check for > robustly. Would that suit your needs?
Sure, that'd work well. I'd have also been satisfied with an alternate constructor. BTW, at some point you simply have to break backwards compatibility ;)
[guest - Sun May 4 06:20:10 2003]: Show quoted text
>> How about if I make it accept a hash *reference* as well as the >> existing way of calling it with a list? That's a lot easier to >> check for robustly. Would that suit your needs?
> > Sure, that'd work well.
OK, added to 0.34, which I've just uploaded. Kake