NAME
Apache2::ASP::GlobalConfig - Config manager for Apache2::ASP web applications
SYNOPSIS
my $global = Apache2::ASP::GlobalConfig->new();
# Find config based on $ENV{HTTP_HOST} or `domain`:
my $current = $global->find_current_config();
# Find config for a specific domain:
my $domain_config = $global->domain_config( 'whatever.com' );
# Get a list of all web application configs:
my @configs = $global->web_applications;
DESCRIPTION
Apache2::ASP::GlobalConfig
attempts to keep all of your web applications' configuration data in one place:
Your /conf/apache2-asp-config.xml file.
It should look like this:
<?xml version="1.0" ?>
<config>
<web_application>
<domain_re>.*</domain_re>
<do_reload_on_script_change>1</do_reload_on_script_change>
<application_name>DefaultApp</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>@ServerRoot@/PAGE_CACHE</page_cache_root>
<application_state>
<manager>Apache2::ASP::ApplicationStateManager::MySQL</manager>
<dsn>DBI:mysql:dstack_dev:localhost</dsn>
<password>j@p@n</password>
<username>root</username>
</application_state>
<session_state>
<manager>Apache2::ASP::SessionStateManager::SQLite</manager>
<cookie_domain>apache2-asp.no-ip.org</cookie_domain>
<cookie_name>session-id</cookie_name>
<dsn>DBI:mysql:dstack_dev:localhost</dsn>
<password>j@p@n</password>
<username>root</username>
<session_timeout>30</session_timeout>
</session_state>
</web_application>
</config>
If it doesn't look like that, an exception will be thrown.
Those little @ServerRoot@
tags are replaced with the value of $ENV{APACHE2_ASP_APPLICATION_ROOT}
when the XML file is loaded up and parsed.
METHODS
BUGS
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.
HOMEPAGE
Please visit the Apache2::ASP homepage at http://apache2-asp.no-ip.org/ to see examples of Apache2::ASP in action.
AUTHOR
John Drago mailto:jdrago_999@yahoo.com
COPYRIGHT AND LICENSE
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.