Class PHRUTS_ServiceContext

Description

Defines a set of methods that a controller service uses to get initialization parameters and store glogal attributes.

  • author: John WILDENAUER <jwilde@users.sourceforge.net> (PHP4 port of Struts)
  • author: Olivier HENRY <oliv.henry@gmail.com> (PHP5 port of Struts)
  • version: $Id: PHRUTS_ServiceContext.php,v 1.2 2008/05/21 15:14:46 ohenry Exp $
  • copyright: Copyright PHruts 2008

Located in /action/PHRUTS_ServiceContext.php (line 33)


	
			
Variable Summary
Method Summary
PHRUTS_ServiceContext __construct ( $serviceConfig, [string $basePath = null])
object getAttribute (string $name)
string getInitParameter (string $name)
string getRealPath (string $path)
void removeAttribute (string $name)
void setAttribute (string $name, object $object)
void setRequestDispatcher ( $requestDispatcher)
Variables
array $attributes = array() (line 53)

The context attributes.

  • access: protected
string $basePath = null (line 46)

Base path of the web application.

  • access: protected
PHRUTS_RequestDispatcher $requestDispatcher = null (line 60)

The request dispatcher object associated with this context.

  • access: protected
PHRUTS_ServiceConfig $serviceConfig = null (line 39)

The service configuration object associated with this context.

  • access: protected
Methods
Constructor __construct (line 66)
  • access: public
PHRUTS_ServiceContext __construct ( $serviceConfig, [string $basePath = null])
getAttribute (line 114)

Returns the attribute with the given name, or null if there is no attribute by that name.

  • access: public
object getAttribute (string $name)
  • string $name: The attribute name
getAttributeNames (line 127)

Returns an array containing the attribute names available within this context.

  • access: public
array getAttributeNames ()
getInitParameter (line 93)

Returns a string containing the value of the named initialization parameter, or null if the parameter does not exist.

  • access: public
string getInitParameter (string $name)
  • string $name: The name of the initialization parameter
getInitParameterNames (line 103)

Returns the names of the service's initialization parameters.

  • return: Returns an array of string, or an empty array if the service has no initialization parameters
  • access: public
array getInitParameterNames ()
getRealPath (line 158)

Returns the real path for a given virtual path.

  • access: public
string getRealPath (string $path)
  • string $path
getRequestDispatcher (line 181)

Returns a PHRUTS_RequestDispatcher object that acts as a wrapper for the resource located at the given path.

A PHRUTS_RequestDispatcher object can be used to forward a request to the resource or to include the resource in a response. The resource can be dynamic or static.

The pathname must begin with a "/" and is interpreted as relative to the current context root.

  • access: public
PHRUTS_RequestDispatcher getRequestDispatcher (string $path)
  • string $path: A string specifying the pathname to the resource.
getServiceConfig (line 82)

Get the service configuration object associated with this context.

  • access: public
PHRUTS_ServiceConfig getServiceConfig ()
removeAttribute (line 147)

Removes the attribute with the given name from the context.

  • access: public
void removeAttribute (string $name)
  • string $name: The attribute name
setAttribute (line 137)

Binds an object to a given attribute name in this context.

  • access: public
void setAttribute (string $name, object $object)
  • string $name: The attribute name
  • object $object: The object to bind to the specified attribute
setRequestDispatcher (line 195)

Set the request dispatcher object associated with this context.

  • access: public
void setRequestDispatcher ( $requestDispatcher)

Documentation generated on Sat, 31 May 2008 15:46:33 +0200 by phpDocumentor 1.4.1