line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catalyst::Controller::AllowDisable; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
26216
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
50
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
60
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.08'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use base qw/Catalyst::Controller/; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2305
|
|
9
|
1
|
|
|
1
|
|
11
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
10
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
192
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
14
|
0
|
|
|
|
|
|
my ($app) = @_; |
15
|
0
|
|
|
|
|
|
my $self = $class->next::method(@_); |
16
|
|
|
|
|
|
|
|
17
|
0
|
0
|
|
|
|
|
if ( $app->config->{on_controller_disable} ) { |
18
|
0
|
|
|
|
|
|
return bless {}, 'Catalyst::Controller::AllowDisable::Disabled'; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
return $self; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 NAME |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Catalyst::Controller::AllowDisable - DEPRECATED. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 WARNINGS |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
this module is DEPRECATED. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
because equivalent mechanism is supported on Catalyst. |
35
|
|
|
|
|
|
|
http://lumberjaph.net/blog/index.php/2009/06/25/how-to-prevent-some-components-to-be-loaded-by-catalyst/ |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 SYNOPSIS |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Package App::Web::Controller::Devel; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
use base qw/Catalyst::Controller::AllowDisable/; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub make_10000_users : Local { |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
myapp.yml |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
on_controller_disable:1 |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 DESCRIPTION |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
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. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 METHOD |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 new |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 AUTHOR |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Tomohiro Teranishi, C<< <tomohiro.teranishi at gmail.com> >> |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Copyright 2008 Tomohiro Teranishi, all rights reserved. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
72
|
|
|
|
|
|
|
under the same terms as Perl itself. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|