Apache2::ASP::ConfigNode::Web - The $Config->web object.
Given the following configuration...
<?xml version="1.0"?> <config> ... <web> <application_name>MyApp</application_name> <application_root>@ServerRoot@</application_root> <handler_root>@ServerRoot@/handlers</handler_root> <media_manager_upload_root>@ServerRoot@/MEDIA</media_manager_upload_root> <www_root>@ServerRoot@/htdocs</www_root> <page_cache_root>/tmp/PAGE_CACHE</page_cache_root> <request_filters> <filter> <uri_match>/members/.*</uri_match> <class>My::MemberFilter</class> </filter> <filter> <uri_match>/checkout/.*</uri_match> <class>My::HasOrderFilter</class> </filter> </request_filters> </web> ... </config>
You would access it like this:
$Config->web->application_name; # 'MyApp' $Config->web->application_root; # '/usr/local/projects/mysite.com' $Config->web->handler_root; # '/usr/local/projects/mysite.com/handlers' $Config->web->media_manager_upload_root; # '/usr/local/projects/mysite.com/MEDIA' $Config->web->www_root; # '/usr/local/projects/mysite.com/htdocs' $Config->web->page_cache_root; # '/tmp/PAGE_CACHE' You will never need to do this: foreach my $filter ( $Config->web->request_filters ) { my $regexp = $filter->uri_match; my $class = $filter->class; }# end foreach()
Apache2::ASP::ConfigNode::Web provides access to the web portion of the configuration.
web
Returns the name of the application.
Returns the absolute path to the root of the application, i.e. /usr/local/projects/mysite.com
/usr/local/projects/mysite.com
Returns the absolute path to where the 'handlers' are installed, i.e. /usr/local/projects/mysite.com/handlers
/usr/local/projects/mysite.com/handlers
Returns the absolute path to where uploaded files will be stored, i.e. /usr/local/projects/mysite.com/MEDIA
/usr/local/projects/mysite.com/MEDIA
Returns the absolute path to where the normal website files (ASP, images, css, javascripts, etc) are located, i.e. /usr/local/projects/mysite.com/htdocs
/usr/local/projects/mysite.com/htdocs
Returns the absolute path to where 'compiled' ASP scripts are stored, i.e. /tmp/PAGE_CACHE
/tmp/PAGE_CACHE
Since the 'compiled' ASP scripts are overwritten whenever the source ASP script has been changed on disk, the webserver process must have read/write access to this location.
It is recommended that a temporary path is used - '/tmp' on most Linux distributions.
Returns a list of ConfigNodes that represent individual filter elements in the configuration.
filter
Apache2::ASP::RequestFilter
It's possible that some bugs have found their way into this release.
Use RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=Apache2-ASP to submit bug reports.
Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.
John Drago <jdrago_999@yahoo.com>
Copyright 2007 John Drago, All rights reserved.
This software is free software. It may be used and distributed under the same terms as Perl itself.
To install Apache2::ASP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Apache2::ASP
CPAN shell
perl -MCPAN -e shell install Apache2::ASP
For more information on module installation, please visit the detailed CPAN module installation guide.