Catalyst::Controller::AllowDisable - DEPRECATED.


Catalyst-Controller-AllowDisable documentation Contained in the Catalyst-Controller-AllowDisable distribution.

Index


Code Index:

NAME

Top

Catalyst::Controller::AllowDisable - DEPRECATED.

WARNINGS

Top

this module is DEPRECATED.

because equivalent mechanism is supported on Catalyst. http://lumberjaph.net/blog/index.php/2009/06/25/how-to-prevent-some-components-to-be-loaded-by-catalyst/

SYNOPSIS

Top

    Package App::Web::Controller::Devel;

    use base qw/Catalyst::Controller::AllowDisable/;

    sub make_10000_users : Local {

    }

    1;




myapp.yml

 on_controller_disable:1




DESCRIPTION

Top

I sometime create controller only for developers which I do not want to ship it to production but I do not want to remove it also. So I create this controller module. You can disable controller which using this module using on_controller_disable=1 at config.

METHOD

Top

new

AUTHOR

Top

Tomohiro Teranishi, <tomohiro.teranishi at gmail.com>

COPYRIGHT & LICENSE

Top


Catalyst-Controller-AllowDisable documentation Contained in the Catalyst-Controller-AllowDisable distribution.

package Catalyst::Controller::AllowDisable;

use warnings;
use strict;

our $VERSION = '0.08';

use base qw/Catalyst::Controller/;
use strict;
use warnings;

sub new {
    my $class = shift;
    my ($app) = @_;
    my $self = $class->next::method(@_);

    if ( $app->config->{on_controller_disable} ) {
        return bless {}, 'Catalyst::Controller::AllowDisable::Disabled';
    }

    return $self;
}

1;