Apache2-WebApp-Toolkit
view release on metacpan or search on metacpan
lib/Apache2/WebApp/Helper/Project.pm view on Meta::CPAN
mkpath("$doc_root/bin", $verbose, 0755);
mkpath("$doc_root/conf", $verbose, 0755);
mkpath("$doc_root/htdocs", $verbose, 0755);
mkpath("$doc_root/logs", $verbose);
mkpath("$doc_root/templates", $verbose);
mkpath("$doc_root/tmp", $verbose);
mkpath("$doc_root/tmp/cache", $verbose);
mkpath("$doc_root/tmp/cache/templates", $verbose);
mkpath("$doc_root/tmp/uploads", $verbose);
# File::Path ignores default 0777, use chmod instead
chmod 0777, "$doc_root/logs";
chmod 0777, "$doc_root/tmp";
chmod 0777, "$doc_root/tmp/cache";
chmod 0777, "$doc_root/tmp/cache/templates";
chmod 0777, "$doc_root/tmp/uploads";
open (FILE1, ">$doc_root/logs/access_log" ) or $self->error("Cannot open file: $!"); close(FILE1);
open (FILE2, ">$doc_root/logs/error_log" ) or $self->error("Cannot open file: $!"); close(FILE2);
open (FILE3, ">$doc_root/htdocs/favicon.ico") or $self->error("Cannot open file: $!"); close(FILE3);
print "created $doc_root/logs/access_log\n" if ($verbose);
print "created $doc_root/logs/error_log\n" if ($verbose);
print "created $doc_root/htdocs/favicon.ico\n" if ($verbose);
$self->set_vars({
lib/Apache2/WebApp/Helper/Project.pm view on Meta::CPAN
$self->write_file("$source/base_pm.tt", "$doc_root/app/$project/Base.pm" );
$self->write_file("$source/startup_pl.tt", "$doc_root/bin/startup.pl" );
$self->write_file("$source/htpasswd.tt", "$doc_root/conf/htpasswd" );
$self->write_file("$source/webapp_conf.tt", "$doc_root/conf/webapp.conf" );
$self->write_file("$source/httpd_conf.tt", "$doc_root/conf/httpd.conf" );
$self->write_file("$source/index_html.tt", "$doc_root/htdocs/index.html" );
$self->write_file("$source/projrc.tt", "$doc_root/.projrc" );
$self->write_file("$source/template.tt", "$doc_root/templates/example.tt" );
$self->write_file("$source/error.tt", "$doc_root/templates/error.tt" );
chmod 0666, "$doc_root/conf/htpasswd";
print "\033[33mProject '$project' created successfully\033[0m\n";
exit;
}
#----------------------------------------------------------------------------+
# help()
#
# Command-line argument help menu.
( run in 0.535 second using v1.01-cache-2.11-cpan-496ff517765 )