Apache-independent support classes and function


Classes

class  Passenger::Application
 Represents a single Ruby on Rails or Rack application instance. More...
class  Passenger::ApplicationPool
 A persistent pool of Applications. More...
class  Passenger::ApplicationPoolServer
 Multi-process usage support for ApplicationPool. More...
class  Passenger::DummySpawnManager
 A dummy SpawnManager replacement for testing/debugging purposes. More...
class  Passenger::MessageChannel
 Convenience class for I/O operations on file descriptors. More...
class  Passenger::SpawnManager
 Spawning of Ruby on Rails/Rack application instances. More...
class  Passenger::StandardApplicationPool
 A standard implementation of ApplicationPool for single-process environments. More...
class  Passenger::TempFile
 Represents a temporary file. More...

Functions

template<typename T>
shared_ptr< T > Passenger::ptr (T *pointer)
 Convenience shortcut for creating a shared_ptr.
template<typename T>
string Passenger::toString (T something)
 Convert anything to a string.
int Passenger::atoi (const string &s)
 Converts the given string to an integer.
long Passenger::atol (const string &s)
 Converts the given string to a long integer.
void Passenger::split (const string &str, char sep, vector< string > &output)
 Split the given string using the given separator.
bool Passenger::fileExists (const char *filename, CachedMultiFileStat *mstat=0, unsigned int throttleRate=0)
 Check whether the specified file exists.
FileType Passenger::getFileType (const char *filename, CachedMultiFileStat *mstat=0, unsigned int throttleRate=0)
 Check whether 'filename' exists and what kind of file it is.
string Passenger::findSpawnServer (const char *passengerRoot=NULL)
 Find the location of the Passenger spawn server script.
string Passenger::findApplicationPoolServer (const char *passengerRoot)
 Find the location of the Passenger ApplicationPool server executable.
string Passenger::canonicalizePath (const string &path)
 Returns a canonical version of the specified path.
string Passenger::escapeForXml (const string &input)
 Escape the given raw string into an XML value.
const char * Passenger::getTempDir ()
 Return the path name for the directory in which temporary files are to be stored.
string Passenger::getPassengerTempDir (bool bypassCache=false)
 Return the path name for the directory in which Phusion Passenger-specific temporary files are to be stored.
bool Passenger::verifyRailsDir (const string &dir, CachedMultiFileStat *mstat=0, unsigned int throttleRate=0)
 Check whether the specified directory is a valid Ruby on Rails application root directory.
bool Passenger::verifyRackDir (const string &dir, CachedMultiFileStat *mstat=0, unsigned int throttleRate=0)
 Check whether the specified directory is a valid Rack application root directory.
bool Passenger::verifyWSGIDir (const string &dir, CachedMultiFileStat *mstat=0, unsigned int throttleRate=0)
 Check whether the specified directory is a valid WSGI application root directory.


Function Documentation

string Passenger::canonicalizePath ( const string &  path  ) 

Returns a canonical version of the specified path.

All symbolic links and relative path elements are resolved.

Exceptions:
FileSystemException Something went wrong.

string Passenger::escapeForXml ( const string &  input  ) 

Escape the given raw string into an XML value.

Exceptions:
std::bad_alloc Something went wrong.

bool Passenger::fileExists ( const char *  filename,
CachedMultiFileStat *  mstat = 0,
unsigned int  throttleRate = 0 
)

Check whether the specified file exists.

Parameters:
filename The filename to check.
mstat A CachedMultiFileStat object, if you want to use cached statting.
throttleRate A throttle rate for mstat. Only applicable if mstat is not NULL.
Returns:
Whether the file exists.
Exceptions:
FileSystemException Unable to check because of a filesystem error.

string Passenger::findApplicationPoolServer ( const char *  passengerRoot  ) 

Find the location of the Passenger ApplicationPool server executable.

Parameters:
passengerRoot The Passenger root folder.
Returns:
An absolute path to the executable.
Exceptions:
FileSystemException Unable to access parts of the filesystem.
Precondition:
passengerRoot != NULL

string Passenger::findSpawnServer ( const char *  passengerRoot = NULL  ) 

Find the location of the Passenger spawn server script.

If passengerRoot is given, t T

Parameters:
passengerRoot The Passenger root folder. If NULL is given, then the spawn server is found by scanning $PATH. For security reasons, only absolute paths are scanned.
Returns:
An absolute path to the spawn server script, or an empty string on error.
Exceptions:
FileSystemException Unable to access parts of the filesystem.

FileType Passenger::getFileType ( const char *  filename,
CachedMultiFileStat *  mstat = 0,
unsigned int  throttleRate = 0 
)

Check whether 'filename' exists and what kind of file it is.

Parameters:
filename The filename to check.
mstat A CachedMultiFileStat object, if you want to use cached statting.
throttleRate A throttle rate for mstat. Only applicable if mstat is not NULL.
Returns:
The file type.
Exceptions:
FileSystemException Unable to check because of a filesystem error.

string Passenger::getPassengerTempDir ( bool  bypassCache = false  ) 

Return the path name for the directory in which Phusion Passenger-specific temporary files are to be stored.

This directory is unique for this instance of the web server in which Phusion Passenger is running.

The result will be cached into the PHUSION_PASSENGER_TMP environment variable, which will be used for future calls to this function. To bypass this cache, set 'bypassCache' to true.

!result.empty()

const char * Passenger::getTempDir (  ) 

Return the path name for the directory in which temporary files are to be stored.

result != NULL

template<typename T>
shared_ptr<T> Passenger::ptr ( T *  pointer  )  [inline]

Convenience shortcut for creating a shared_ptr.

Instead of:

    shared_ptr<Foo> foo;
    ...
    foo = shared_ptr<Foo>(new Foo());
one can write:
    shared_ptr<Foo> foo;
    ...
    foo = ptr(new Foo());

Parameters:
pointer The item to put in the shared_ptr object.

void Passenger::split ( const string &  str,
char  sep,
vector< string > &  output 
)

Split the given string using the given separator.

Parameters:
str The string to split.
sep The separator to use.
output The vector to write the output to.

template<typename T>
string Passenger::toString ( something  )  [inline]

Convert anything to a string.

Parameters:
something The thing to convert.

bool Passenger::verifyRackDir ( const string &  dir,
CachedMultiFileStat *  mstat = 0,
unsigned int  throttleRate = 0 
)

Check whether the specified directory is a valid Rack application root directory.

Parameters:
mstat A CachedMultiFileStat object, if you want to use cached statting.
throttleRate A throttle rate for mstat. Only applicable if mstat is not NULL.
Exceptions:
FileSystemException Unable to check because of a filesystem error.

bool Passenger::verifyRailsDir ( const string &  dir,
CachedMultiFileStat *  mstat = 0,
unsigned int  throttleRate = 0 
)

Check whether the specified directory is a valid Ruby on Rails application root directory.

Parameters:
mstat A CachedMultiFileStat object, if you want to use cached statting.
throttleRate A throttle rate for mstat. Only applicable if mstat is not NULL.
Exceptions:
FileSystemException Unable to check because of a system error.

bool Passenger::verifyWSGIDir ( const string &  dir,
CachedMultiFileStat *  mstat = 0,
unsigned int  throttleRate = 0 
)

Check whether the specified directory is a valid WSGI application root directory.

Parameters:
mstat A CachedMultiFileStat object, if you want to use cached statting.
throttleRate A throttle rate for mstat. Only applicable if mstat is not NULL.
Exceptions:
FileSystemException Unable to check because of a filesystem error.


Generated on Fri Mar 13 19:24:33 2009 for Passenger by  doxygen 1.5.5