[jifty-devel] ClassLoader rewrite has landed

John Peacock jpeacock at rowman.com
Wed Jun 28 14:29:14 EDT 2006


I just committed my rewrite of Jifty::ClassLoader for better support of plugins
to the repository.  I've attached a working Jifty::Plugin::Login (that still
isn't feature complete, which is why it isn't in the repository too).

A couple of random notes:

1) To add the Login features to an application, you need a User class; a simple
wrapper of the provide class works fine:

> package MyWeblog::Model::User;
> use base qw/Jifty::Plugin::Login::Model::User/;
> 
> 1;

I didn't think it would normally be a good idea for the plugin to provide an
autogenerated model (though I'd be happy to be convinced otherwise).  Other than
that, just add

>   Plugins:
>     - Login: {}

to your config.yml and you should be good to go!

2) The nature of way that the various bits fit together, every Model is mapped
to every "class" (application and plugin), so the code still throws warnings for
the "missing classes" that aren't really missing after all.  I changed the line
in Jifty::Util->require to be a warning instead of an error.  If anyone else can
see a way to prevent the crossproduct, this can be changed back.

3) Moving forward, I need to adjust the POD in ClassLoader to reflect the
changes and the new methods: register() and preregister() (names subject to
change).  The former method pushes new autogeneration hooks and the latter
unshifts them to the internal array that ClassLoader::INC uses to do its magic.

4) Next step is to hack Wifty to use the Login class instead of the hardcoded
methods it has now (as more proof of concept).

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Blvd
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Jifty-Plugin-Login-0.01.tar.gz
Type: application/x-gzip
Size: 16223 bytes
Desc: not available
Url : http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20060628/bc8b4827/Jifty-Plugin-Login-0.01.tar.bin


More information about the jifty-devel mailing list