|
NAMECGI::Application::Plugin::ViewCode - View the source of the running applicationSYNOPSISIn your CGI::Application based classuse CGI::Application::Plugin::ViewCode; Then you can view your module's source (or pod) as it's running by changing the url ?rm=view_code ?rm=view_code#215 ?rm=view_code&pod=0&line_no=0 ?rm=view_code&module=CGI-Application ?rm=view_pod ?rm=view_pod&module=CGI-Application INTERFACEThis plugin works by adding extra run modes (named "view_code" and " view_pod ") to the application. By calling this run mode you can see the source or POD of the running module (by default) or you can specify which module you would like to view (see SECURITY).view_codeThis extra run mode will accept the following arguments in the query string:
view_podThis extra run mode will accept the following arguments in the query string:
AS A POPUP WINDOWThis plugin can be used in conjunction with CGI::Application::Plugin::DevPopup. If we detect that CGI::Application::Plugin::DevPopup is running and turned on, we will create a sub-report that includes the highlighted source code.So you can simply do the following: BEGIN { $ENV{CAP_DEVPOPUP_EXEC} = 1; } # turn it on for real use CGI::Application::Plugin::DevPopup; use CGI::Application::Plugin::ViewCode; Befault, this report will be the same thing produced by "view_code". If you want this report to include the "view_pod" report, simply set the the $ENV{CAP_VIEWCODE_POPUP_POD} to true. You can also turn off the "view_code" report but setting $ENV{CAP_VIEWCODE_POPUP_CODE} to false. # have the POD report, but not the code in the dev popup window BEGIN { $ENV{CAP_DEVPOPUP_EXEC} = 1; # turn it on for real $ENV{CAP_VIEWCODE_POPUP_POD} = 1; # turn on POD report $ENV{CAP_VIEWCODE_POPUP_CODE} = 0; # turn off code report } use CGI::Application::Plugin::DevPopup; use CGI::Application::Plugin::ViewCode; SECURITYThis plugin is designed to be used for development only. Please do not use it in a production system as it will allow anyone to see the source code for any loaded module. Consider yourself warned.AUTHORMichael Peters, "<mpeters@plusthree.com>"BUGSPlease report any bugs or feature requests to "bug-cgi-application-plugin-viewsource@rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Application-Plugin-ViewCode>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.ACKNOWLEDGEMENTSCOPYRIGHT & LICENSECopyright 2005 Michael Peters, All Rights Reserved.This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |