Module-Dependency
view release on metacpan or search on metacpan
examples/pmd_cgidepend.plx view on Meta::CPAN
### EDIT THIS - set it to the URL of the stylesheet you want to use
use constant STYLESHEET_LOC => '/depend.css';
### EDIT THIS OPTIONALLY - this value will be prepended to the incoming 'datafile' parameter, allowing you to restrict it to a single directory
use constant DATADIR => '';
### EDIT THIS OPTIONALLY - if true then we'll print a clientside imagemap/make SVGs clickable. if false, no imagemap
use constant DOES_IMAGEMAP => 1;
### EDIT THIS OPTIONALLY - set to 'object' or 'embed'. the default way of embedding an SVG image into the page. Apparently we _should_ use object but many browsers can't handle that
use constant HOW_EMBED => 'object';
use CGI;
use Module::Dependency::Info;
use Module::Dependency::Grapher;
use vars qw/$VERSION $cgi %MIMELUT/;
($VERSION) = ('$Revision: 6570 $' =~ /([\d\.]+)/ );
$cgi = new CGI;
%MIMELUT = (
examples/pmd_cgidepend.plx view on Meta::CPAN
my $xre = $cgi->param('xre');
my $seed;
unless ( $allscripts) {
$seed = $cgi->param('seed') || die("There must be a 'seed' specified");
}
my $kind = $cgi->param('kind') || 'both';
my $embed = $cgi->param('embed');
my $format = $cgi->param('format') || DEFAULT_FORMAT;
$format =~ s/\W//g;
$format = uc($format);
my $howembed = lc($cgi->param('howembed')) || HOW_EMBED;
if ($datafile) {
die("Unlikely characters in filename") if ($datafile =~ m/[^\w\/\:\.-]/);
die("Unlikely looking filename") if ($datafile =~ m/\.\./);
Module::Dependency::Grapher::setIndex( DATADIR . $datafile );
}
# what modules/scripts will be included
my @objlist;
my $objliststr;
( run in 0.814 second using v1.01-cache-2.11-cpan-71847e10f99 )