#include <DirectoryMapper.h>
Public Member Functions | |
DirectoryMapper (request_rec *r, DirConfig *config, CachedMultiFileStat *mstat, unsigned int throttleRate) | |
Create a new DirectoryMapper object. | |
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. | |
const char * | getEnvironment () |
Returns the environment under which the application should be spawned. |
Given a URI, it will determine whether that URI belongs to a Phusion Passenger-handled application, what the base URI of that application is, and what the associated 'public' directory is.
Passenger::DirectoryMapper::DirectoryMapper | ( | request_rec * | r, | |
DirConfig * | config, | |||
CachedMultiFileStat * | mstat, | |||
unsigned int | throttleRate | |||
) | [inline] |
Create a new DirectoryMapper object.
mstat | A CachedMultiFileStat object used for statting files. | |
throttleRate | A throttling rate for mstat. |
r
, config
or mstat
.
ApplicationType Passenger::DirectoryMapper::getApplicationType | ( | ) | [inline] |
Returns the application type that's associated with the HTTP request.
FileSystemException | An error occured while examening the filesystem. |
const char* Passenger::DirectoryMapper::getApplicationTypeString | ( | ) | [inline] |
Returns the application type (as a string) that's associated with the HTTP request.
FileSystemException | An error occured while examening the filesystem. |
const char* Passenger::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.
FileSystemException | This method might also examine the filesystem in order to detect the application's type. During that process, a FileSystemException might be thrown. |
config
hasn't been destroyed. const char* Passenger::DirectoryMapper::getEnvironment | ( | ) | [inline] |
Returns the environment under which the application should be spawned.
FileSystemException | An error occured while examening the filesystem. |
string Passenger::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.
FileSystemException | An error occured while examening the filesystem. |