Class WFWebApplication

Description

The WFWebApplication object is a singleton object that manages the running of the any Phocoa request, be it CLI or HTTP.

Right now it doesn't do a whole lot besides manage the shared application object and provide access to a few application defaults via the delegate. Eventually it can be used to manage application-wide settings and state.

Located in /framework/WFWebApplication.php (line 31)

WFObject
   |
   --WFWebApplication
Class Constant Summary
Variable Summary
object The $delegate
array $modulePaths
Method Summary
static string appDirPath (string $appDirName)
static boolean isHTTPRequest ()
static string serializeURL (string $url)
static object The sharedWebApplication ()
static string unserializeURL (string $data)
static string webDirPath (string $webDirPath)
WFWebApplication __construct ()
void addModulePath (string $modulePath, string $moduleDir)
boolean autoload (string $className)
object Object defaultSkinDelegate ()
object WFObject delegate ()
void initialize ()
array modulePaths ()
void sessionDidStart ()
Variables
object The $delegate (line 46)
  • var: delegate object for the application.
  • access: protected
array $modulePaths (line 50)
  • var: An array containing module location information for modules not in APP_ROOT/modules. Format modulePath => moduleDir [absolute fs path]
  • access: protected
Methods
static method appDirPath (line 168)

Get the absolute path of one of the application directories.

NOTE: this function should only return things inside of APP_ROOT.. presently DIR_SMARTY is an exception b/c we haven't yet implemented userland smarty templates...

  • return: The absolute path of the passed directory type. NO TRAILING SLASH!! ADD IT YOURSELF.
static string appDirPath (string $appDirName)
  • string $appDirName: One of the DIR_* constants.
static method isHTTPRequest (line 330)

Determine if the current execution environment is the result of a WEB request (as oppopsed to a CLI script).

  • access: public
static boolean isHTTPRequest ()
static method serializeURL (line 309)

Helper function for encoding URL's in a fashion suitable for passing around as an invocationPath parameter.

This is just base64 modified for URL.

static string serializeURL (string $url)
  • string $url: raw data
static method sharedWebApplication (line 148)

Get a reference to the shared application object.

  • return: WFWebApplication object.
static object The sharedWebApplication ()
static method unserializeURL (line 320)

Decode data encoded with serializeURL.

  • return: raw data
  • access: public
static string unserializeURL (string $data)
  • string $data: serialized data string
static method webDirPath (line 197)

Get the www-absolute path of one of the application's public www directories.

  • return: The absolute path to the passed directory type.
  • throws:
static string webDirPath (string $webDirPath)
  • string $webDirPath: One of the WWW_DIR_* constants.
Constructor __construct (line 55)

Constructor

WFWebApplication __construct ()

Redefinition of:
WFObject::__construct()
addModulePath (line 106)

If you have installed modules outside of your project's modules directory, you can tell PHOCOA where to look for them with this function.

Examples:

  1.   WFWebApplication::sharedWebApplication()->addModulePath('login'FRAMEWORK_DIR '/modules/login');

void addModulePath (string $modulePath, string $moduleDir)
  • string $modulePath: The modulePath that must be matched to use the given module.
  • string $moduleDir: The absoulte filesystem path of the location of the module.
autoload (line 219)

Autoload callback for WFWebApplication.

Will allow the app delegate to autoload classes if autoload() is declared in the app delegate.

  • return: TRUE if the class loading request was handled, FALSE otherwise.
boolean autoload (string $className)
  • string $className: The class name needing loading.
defaultInvocationPath (line 237)

Get the default invocationPath for this web application. The default module is the module that will be run if the web root is accessed.

The default module is provided by the WFWebApplicationDelegate::defaultInvocationPath().

  • return: The default invocationPath for this web application.
string defaultInvocationPath ()
defaultSkinDelegate (line 258)

Get the default Skin delegate for the application.

The default skin delegate is provided by the WFWebApplicationDelegate.

  • return: implementing the WFSkinDelegate delegate protocol, or NULL if there is no default delegate.
object Object defaultSkinDelegate ()
delegate (line 127)

Get the delegate for the WFWebApplication.

object WFObject delegate ()
initialize (line 292)

Hook to call the initialize method fo the web application.

Applications will typically initialize DB stuff here.

void initialize ()
modulePaths (line 117)

Get the list of extra modules activates for this webapp.

array modulePaths ()
runWebApplication (line 137)

Bootstrap control of the application to the RequestController.

The web framework's normal cycle is to instantiate the WFWebApplication then pass control to the WFRequestController to handle the request.

void runWebApplication ()
sessionDidStart (line 280)

Hook to provide opportunity for the web application to munge the session data after php's session_start() is called.

void sessionDidStart ()
sessionWillStart (line 270)

Hook to provide opportunity for the web application to munge the session config before php's session_start() is called.

void sessionWillStart ()

Inherited Methods

Inherited From WFObject

WFObject::__construct()
WFObject::exposedProperties()
WFObject::getClass()
WFObject::keyPathToTargetAndKey()
WFObject::setValueForKey()
WFObject::setValueForKeyPath()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForUndefinedKey()
WFObject::__toString()
Class Constants
DIR_CLASSES = 3 (line 35)
DIR_LOG = 1 (line 33)
DIR_MODULES = 5 (line 37)
DIR_RUNTIME = 2 (line 34)
DIR_SKINS = 7 (line 39)
DIR_SMARTY = 4 (line 36)
DIR_WWW = 6 (line 38)
WWW_DIR_BASE = 100 (line 40)
WWW_DIR_FRAMEWORK = 101 (line 41)

Documentation generated on Thu, 07 Aug 2008 10:37:07 -0400 by phpDocumentor 1.4.1