ASP4
view release on metacpan or search on metacpan
sbin/asphelper view on Meta::CPAN
like \$res->content, qr(visited this page \$_ time), "Simple session counter: \$_ visits recorded.";
\$res = \$api->ua->get("/");
}# end for()
TEST
}# end if()
print $ofh <<"TEST";
# More tests can go here or in other files.
TEST
close($ofh);
}# end unless()
warn "="x60, "\n";
warn " Running Initial Test Suite...\n";
warn "="x60, "\n";
chdir("www");
`asp4 /` =~ m{You have visited this page}
or die "Warning: ASP script contents (/index.asp) not what we expected!";
system("prove -rv t");
# Talk about the config now:
warn <<"END";
!!!!!!!!!!!!!!!!!!!!!! CONGRATULATIONS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*** Update your Apache Config ***
Include $cwd/www/conf/httpd.conf
*** Add This to your /etc/hosts File ***
127.0.0.1 $domain
*** Restart Apache ***
Maybe: sudo /etc/init.d/httpd restart
Or: sudo /etc/init.d/apache2 restart
Or: service apache2 restart
*** To Test it in Your Browser ***
Navigate to http://$domain
*** To Run the Unit Tests ***
cd $cwd/www
prove -rv t
*** To Run an ASP Script From the Command Line ***
cd $cwd/www
asp4 /index.asp
END
sub generic_config
{
my ($has_db) = @_;
my $str = <<'EOF';
{
"system": {
"post_processors": [
],
"libs": [
"@ServerRoot@/lib",
"@ProjectRoot@/common/lib"
],
"load_modules": [
],
"env_vars": {
},
"settings": {
}
},
"errors": {
"error_handler": "ASP4::ErrorHandler",
"mail_errors_to": "%email%",
"mail_errors_from": "root@localhost",
"smtp_server": "localhost"
},
"web": {
"application_name": "%appName%",
"application_root": "@ServerRoot@",
"www_root": "@ServerRoot@/htdocs",
"handler_root": "@ServerRoot@/handlers",
"page_cache_root": "/tmp/PAGE_CACHE",
"handler_resolver": "ASP4::HandlerResolver",
"handler_runner": "ASP4::HandlerRunner",
"filter_resolver": "ASP4::FilterResolver",
"request_filters": [
],
"routes": [
],
"disable_persistence": [
]
},
"data_connections": {
EOF
if( $has_db )
{
$str .= <<'EOF';
"session": {
"manager": "ASP4::SessionStateManager",
"cookie_name": "session-id",
"cookie_domain": "*",
"session_timeout": "*",
"dsn": "DBI:mysql:%dbName%:%dbHost%",
"username": "%dbUser%",
"password": "%dbPass%"
},
"main": {
"dsn": "DBI:mysql:%dbName%:%dbHost%",
"username": "%dbUser%",
"password": "%dbPass%"
}
EOF
}
else
{
$str .= <<'EOF';
"session": {
( run in 0.985 second using v1.01-cache-2.11-cpan-5837b0d9d2c )