[Catalyst-commits] r7818 - in trunk/Catalyst-Controller-BindLex: . lib/Catalyst lib/Catalyst/Controller

matthewt at dev.catalyst.perl.org matthewt at dev.catalyst.perl.org
Tue May 27 13:33:56 BST 2008


Author: matthewt
Date: 2008-05-27 13:33:54 +0100 (Tue, 27 May 2008)
New Revision: 7818

Removed:
   trunk/Catalyst-Controller-BindLex/lib/Catalyst/Helper/
Modified:
   trunk/Catalyst-Controller-BindLex/Changes
   trunk/Catalyst-Controller-BindLex/lib/Catalyst/Controller/BindLex.pm
Log:
mark bindlex as dangerous and unmaintained as prep for final release

Modified: trunk/Catalyst-Controller-BindLex/Changes
===================================================================
--- trunk/Catalyst-Controller-BindLex/Changes	2008-05-27 12:01:28 UTC (rev 7817)
+++ trunk/Catalyst-Controller-BindLex/Changes	2008-05-27 12:33:54 UTC (rev 7818)
@@ -1,5 +1,5 @@
-0.05 2007-xx-xx
-    - Add Helper component
+0.05 2008-05-27
+    - Add danger stickers and unmaintainedness warning
 
 0.04 2007-04-026
     - switch to Module::Install

Modified: trunk/Catalyst-Controller-BindLex/lib/Catalyst/Controller/BindLex.pm
===================================================================
--- trunk/Catalyst-Controller-BindLex/lib/Catalyst/Controller/BindLex.pm	2008-05-27 12:01:28 UTC (rev 7817)
+++ trunk/Catalyst-Controller-BindLex/lib/Catalyst/Controller/BindLex.pm	2008-05-27 12:33:54 UTC (rev 7818)
@@ -16,7 +16,7 @@
 use Scalar::Util    ();
 use Carp            ();
 
-our $VERSION = '0.04';
+our $VERSION = '0.05';
 
 sub bindlex_default_config {
     map { ucfirst() . 'ed' => $_, ucfirst() => $_} qw/stash session flash/;
@@ -153,6 +153,19 @@
     @remain;
 }
 
+sub COMPONENT {
+    my $class = shift;
+    $class->_bindlex_setup_warning(@_);
+    return $class->NEXT::COMPONENT(@_);
+}
+
+sub _bindlex_setup_warning {
+    my ($class, $app) = @_;
+    return if $class->config->{unsafe_bindlex_ok};
+    $app->log->warn("Controller class $class using Catalyst::Controller::BindLex; this module is unmaintained and considered -dangerous-");
+    $app->log->warn("Please see the documentation for an explanation and how to disable this warning if you want to take the risk");
+}
+
 1;
 
 __END__
@@ -161,7 +174,7 @@
 
 =head1 NAME
 
-Catalyst::Controller::BindLex - Stash your lexical goodness.
+Catalyst::Controller::BindLex - Unmaintained, dangerous proof of concept
 
 =head1 SYNOPSIS
 
@@ -194,6 +207,24 @@
         $c->res->body( "request number " . ++$count );
     }
 
+=head1 WARNING
+
+Catalyst::Controller::BindLex does some fairly nasty magic - the attribute
+wrapping tricks are complex and will break if you declare the same lexical
+name twice in the same method, and the approach to get $c out of the call
+stack is hacky and fragile.
+
+It was designed as a PROOF OF CONCEPT ONLY and should not be considered for
+use in production. The authors no longer consider it a viable implementation
+plan and THIS MODULE IS NOT SUPPORTED AND WILL NOT BE MAINTAINED.
+
+If you really want to use it, please read the source code and be sure you
+understand it well enough to fix anything that goes wrong, then set
+
+    __PACKAGE__->config->{unsafe_bindlex_ok} = 1;
+
+in your controller class to suppress the startup warning.
+
 =head1 DESCRIPTION
 
 This plugin lets you put your lexicals on the stash and elsewhere very easily.




More information about the Catalyst-commits mailing list