DirectoryMapper Class Reference
[Core Apache-related classes and functions]

List of all members.


Detailed Description

Utility class for determining URI-to-Rails/Rack directory mappings.

Given a URI, it will determine whether that URI belongs to a Rails/Rack application, what the base URI of that application is, and what the associated 'public' directory is.

Note:
This class is not thread-safe, but is reentrant.

Public Member Functions

 DirectoryMapper (request_rec *r, DirConfig *config)
const char * getBaseURI ()
 Determine whether the given HTTP request falls under one of the specified RailsBaseURIs or RackBaseURIs.
string getPublicDirectory ()
 Returns the filename of the 'public' directory of the Rails/Rack application that's associated with the HTTP request.
ApplicationType getApplicationType ()
 Returns the application type that's associated with the HTTP request.
const char * getApplicationTypeString ()
 Returns the application type (as a string) that's associated with the HTTP request.

Constructor & Destructor Documentation

DirectoryMapper::DirectoryMapper ( request_rec *  r,
DirConfig *  config 
) [inline]

Warning:
Do not use this object after the destruction of r or config.


Member Function Documentation

const char* DirectoryMapper::getBaseURI (  )  [inline]

Determine whether the given HTTP request falls under one of the specified RailsBaseURIs or RackBaseURIs.

If yes, then the first matching base URI will be returned.

If Rails/Rack autodetection was enabled in the configuration, and the document root seems to be a valid Rails/Rack 'public' folder, then this method will return "/".

Otherwise, NULL will be returned.

Exceptions:
SystemException An error occured while examening the filesystem.
Warning:
The return value may only be used as long as config hasn't been destroyed.

string DirectoryMapper::getPublicDirectory (  )  [inline]

Returns the filename of the 'public' directory of the Rails/Rack application that's associated with the HTTP request.

Returns an empty string if the document root of the HTTP request cannot be determined, or if it isn't a valid folder.

Exceptions:
SystemException An error occured while examening the filesystem.

ApplicationType DirectoryMapper::getApplicationType (  )  [inline]

Returns the application type that's associated with the HTTP request.

Exceptions:
SystemException An error occured while examening the filesystem.

const char* DirectoryMapper::getApplicationTypeString (  )  [inline]

Returns the application type (as a string) that's associated with the HTTP request.

Exceptions:
SystemException An error occured while examening the filesystem.


The documentation for this class was generated from the following file:

Generated on Tue Jun 24 14:03:42 2008 for Passenger by  doxygen 1.5.5