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.
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. |
DirectoryMapper::DirectoryMapper | ( | request_rec * | r, | |
DirConfig * | config | |||
) | [inline] |
r
or config
.
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.
SystemException | An error occured while examening the filesystem. |
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.
SystemException | An error occured while examening the filesystem. |
ApplicationType DirectoryMapper::getApplicationType | ( | ) | [inline] |
Returns the application type that's associated with the HTTP request.
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.
SystemException | An error occured while examening the filesystem. |