1CGI::Application::PlugiUns:e:rViCeownCtordieb(u3t)ed PerClGID:o:cAupmpelnitcaattiioonn::Plugin::ViewCode(3)
2
3
4
6 CGI::Application::Plugin::ViewCode - View the source of the running
7 application
8
10 In your CGI::Application based class
11
12 use CGI::Application::Plugin::ViewCode;
13
14 Then you can view your module's source (or pod) as it's running by
15 changing the url
16
17 ?rm=view_code
18 ?rm=view_code#215
19 ?rm=view_code&pod=0&line_no=0
20 ?rm=view_code&module=CGI-Application
21
22 ?rm=view_pod
23 ?rm=view_pod&module=CGI-Application
24
26 This plugin works by adding extra run modes (named "view_code" and "
27 view_pod ") to the application. By calling this run mode you can see
28 the source or POD of the running module (by default) or you can specify
29 which module you would like to view (see SECURITY).
30
31 view_code
32 This extra run mode will accept the following arguments in the query
33 string:
34
35 module
36 The name of the module to view. By default it is the module
37 currently being run. Also, since colons (':') aren't simply typed
38 into URL's, you can just substitute '-' for '::'.
39
40 ?rm=view_code?module=My-Base-Class
41
42 highlight
43 Boolean indicates whether syntax highlighting (using
44 Syntax::Highlight::Perl::Improved) is "on" or "off". By default it
45 is "on".
46
47 line_no
48 Boolean indicates whether the viewing of line numbers is "on" or
49 "off". By default it is "on". It "line_no" is on, you can also
50 specify which line number you want to see by adding an anchor to
51 the link:
52
53 ?rm=view_code#215
54
55 This will take you immediately to line 215 of the current
56 application module.
57
58 pod Boolean indicates whether POD is seen or not. By default it is
59 seen>.
60
61 view_pod
62 This extra run mode will accept the following arguments in the query
63 string:
64
65 module
66 The name of the module to view. By default it is the module
67 currently being run. Also, since colons (':') aren't simply typed
68 into URL's, you can just substitute '-' for '::'.
69
70 ?rm=view_pod?module=My-Base-Class
71
73 This plugin can be used in conjunction with
74 CGI::Application::Plugin::DevPopup. If we detect that
75 CGI::Application::Plugin::DevPopup is running and turned on, we will
76 create a sub-report that includes the highlighted source code.
77
78 So you can simply do the following:
79
80 BEGIN { $ENV{CAP_DEVPOPUP_EXEC} = 1; } # turn it on for real
81 use CGI::Application::Plugin::DevPopup;
82 use CGI::Application::Plugin::ViewCode;
83
84 Befault, this report will be the same thing produced by "view_code". If
85 you want this report to include the "view_pod" report, simply set the
86 the $ENV{CAP_VIEWCODE_POPUP_POD} to true. You can also turn off the
87 "view_code" report but setting $ENV{CAP_VIEWCODE_POPUP_CODE} to false.
88
89 # have the POD report, but not the code in the dev popup window
90 BEGIN {
91 $ENV{CAP_DEVPOPUP_EXEC} = 1; # turn it on for real
92 $ENV{CAP_VIEWCODE_POPUP_POD} = 1; # turn on POD report
93 $ENV{CAP_VIEWCODE_POPUP_CODE} = 0; # turn off code report
94 }
95 use CGI::Application::Plugin::DevPopup;
96 use CGI::Application::Plugin::ViewCode;
97
99 This plugin is designed to be used for development only. Please do not
100 use it in a production system as it will allow anyone to see the source
101 code for any loaded module. Consider yourself warned.
102
104 Michael Peters, "<mpeters@plusthree.com>"
105
107 Please report any bugs or feature requests to
108 "bug-cgi-application-plugin-viewsource@rt.cpan.org", or through the web
109 interface at
110 http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Application-Plugin-ViewCode
111 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Application-Plugin-
112 ViewCode>. I will be notified, and then you'll automatically be
113 notified of progress on your bug as I make changes.
114
117 Copyright 2005 Michael Peters, All Rights Reserved.
118
119 This program is free software; you can redistribute it and/or modify it
120 under the same terms as Perl itself.
121
122
123
124perl v5.12.0 2010-04-C3G0I::Application::Plugin::ViewCode(3)