From: Tomas Doran Date: Sun, 4 Jan 2009 21:59:02 +0000 (+0000) Subject: Warnings about deprecated runtime plugins X-Git-Tag: 5.8000_05~47 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=6b2a933b5b3820e494f9b5804c7c2eb6083bcf09;hp=64d969197ee915ca489db95a9ceac4b91a9078ea Warnings about deprecated runtime plugins --- diff --git a/Makefile.PL b/Makefile.PL index 4ea6d0d..de27fe1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -155,7 +155,7 @@ EOF return unless $found; # More or less copied from Module::Build - return if $ENV{PERL_MM_USE_DEFAULT}; + return if $ENV{PERL_MM_USE_DEFAULT}; return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)); sleep 4; diff --git a/TODO b/TODO index 01c3873..e925394 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,3 @@ -Pending patches: - - meta test for MX::Emulate::CAF needed by Catalyst::Plugin::Cache::Curried - Back-compat investigation / known issues: - Get engines tested: @@ -39,9 +36,6 @@ Back-compat investigation / known issues: an exception. Needs a test case (Caelum) - Catalyst::Plugin::Authentication new release. - - - Deprecation/Upgrade notice in Catalyst Makefile.PL for known broken - versions of plugins. - Issues with TWMC not being loaded when it used to be in 5.70 (Bill Moseley) @@ -54,7 +48,10 @@ Back-compat investigation / known issues: This obviously needs better tests :/ Cleanups: - + + - Allow turning deprecated warnings off with use Catalyst + qw/-NoDeprecationWarnings/ + - Update Test suite to not assume MyApp ISA Controller - After that set up attr handlers that will output helpful error messages when you do it as well as how to fix it. @@ -66,8 +63,6 @@ Cleanups: - Find whatever in the test suite craps a file called GLOB(0xfoo) onto my disk and fix it. (Believed to be in the optional TEST_HTTP tests?) (t0m) - - Deprecate runtime plugins with warning. - Documentation: - extends in components with attributes must be inside a BEGIN block. @@ -91,3 +86,6 @@ Tests: - Moosified test application? - Test warning from back-compat methods in Catalyst::Dispatcher + + - Test warnings from plugin method on Catalyst + diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index cef7ac7..3471a6c 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -862,11 +862,19 @@ loads and instantiates the given class. MyApp->plugin( 'prototype', 'HTML::Prototype' ); $c->prototype->define_javascript_functions; + +B This method of adding plugins is deprecated. The ability +to add plugins like this B in a Catalyst 5.9. +Please do not use this functionality in new code. =cut sub plugin { my ( $class, $name, $plugin, @args ) = @_; + + # See block comment in t/unit_core_plugin.t + $class->log->debug(qq/Adding plugin using the ->plugin method is deprecated, and will be removed in Catalyst 5.9/); + $class->_register_plugin( $plugin, 1 ); eval { $plugin->import }; diff --git a/t/unit_core_plugin.t b/t/unit_core_plugin.t index 58ebe1e..97f8d7b 100644 --- a/t/unit_core_plugin.t +++ b/t/unit_core_plugin.t @@ -19,6 +19,8 @@ use lib 't/lib'; use Catalyst::Test qw/PluginTestApp/; ok( get("/compile_time_plugins"), "get ok" ); +# FIXME - Run time plugin support is insane, and should be removed +# for Catalyst 5.9 ok( get("/run_time_plugins"), "get ok" ); use_ok 'TestApp';