spunQ_html Class Reference

Global configurations/functions for the spunQ.html module. More...

List of all members.

Static Public Member Functions

static setSessionManager (spunQ_ISessionManager $sessionManager)
static getSessionManager ()
static handleCurrentRequest ()
 Will take care of the current request.
static handleFatalError ($output)
 Callback for the error-handling output buffer.
static extractPhpErrorMessage ($output)
 Extracts the error message presented by PHP in captured buffer output.
static setPageCache ($cache)
 Sets a page cache to use.
static setTemplateCache ($cache)
 Sets a template cache to use.
static loadPageFromCache (spunQ_HttpEntryPoint $entryPoint, array $variables, array $cacheOptions)
 Tries to load a page's contents from cache.
static storePageContent (spunQ_HttpEntryPoint $entryPoint, array $variables, array $cacheOptions, $content)
static loadTemplateFromCache (spunQ_Template $template, array $variables, array $cacheOptions)
 Tries to load a template's contents from cache.
static storeTemplateContent (spunQ_Template $template, array $variables, array $cacheOptions, $content)
static setHeaderAndFootermanager ($headerAndFooterManager)
 Sets the headers/footers manager for response objects.
static getHeaderAndFootermanager ()
 Provides the headers/footers manager for response objects.
static setCssCollector ($cssCollector)
static setJsCollector ($jsCollector)
static getCssCollector ()
static getJsCollector ()
static setCssPostProcessors (array $postProcessors)
static addCssPostProcessor (spunQ_ICssPostProcessor $postProcessor)
static getCssPostProcessors ()
static setJsPostProcessors (array $postProcessors)
static addJsPostProcessor (spunQ_IJsPostProcessor $postProcessor)
static getJsPostProcessors ()
static setHtmlPostProcessors (array $postProcessors)
static addHtmlPostProcessor (spunQ_IHtmlPostProcessor $postProcessor)
static getHtmlPostProcessors ()

Static Private Attributes

static $pageCache = NULL
 Page caching mechanism to use.
static $templateCache = NULL
 Template caching mechanism to use.
static $headerAndFooterManager = NULL
 The headers/footers manager to provide to response objects.
static $cssCollector = NULL
 The css collector to use for responses.
static $jsCollector = NULL
 The js collector to use for responses.
static $cssPostProcessors = array()
static $jsPostProcessors = array()
static $htmlPostProcessors = array()
static $sessionManager = NULL
static $fatalError = true
 Whether a fatal error has occured.


Detailed Description

Global configurations/functions for the spunQ.html module.

The term alias is used frequently in this package. Every file type known to spunQ in the html module has an alias describing that file independent of its actual path in the file system. This gives the flexibility to move the files to another path, requiring only an update on the configuration files. The configuration should contain multiple values mapping folders to root module names. Example:

   /var/www/spunQ3 => spunQ
An alias is the path from this directory starting with the module name, up to the file name, omitting the file extension, separated by dots, just like in spunQ. Example:
   /var/www/spunQ3/error/500.tpl => spunQ.error.500

Definition at line 57 of file html.class.php.


Member Function Documentation

static spunQ_html::extractPhpErrorMessage ( output  )  [static]

Extracts the error message presented by PHP in captured buffer output.

Assumes that the error message was appended to the output (as is the case if the php.ini directive display_errors is set.)

Parameters:
$output Captured output buffer content.
Returns:
string Extracted error message. Might be NULL if nothing was found (maybe display_errors was off?)

Definition at line 195 of file html.class.php.

static spunQ_html::getHeaderAndFootermanager (  )  [static]

Provides the headers/footers manager for response objects.

Returns:
spunQ_IHeaderAndFooterManager

Definition at line 287 of file html.class.php.

static spunQ_html::handleCurrentRequest (  )  [static]

Will take care of the current request.

This is the only function required to handle a Http request. The script is expected not to print anything else after this function has finished.

Returns:
spunQ_Response The response that was sent.
Todo:
session_start might generate a warning if headers are already sent. Handle that case.

Definition at line 137 of file html.class.php.

static spunQ_html::handleFatalError ( output  )  [static]

Callback for the error-handling output buffer.

See also:
html::$fatalError
Parameters:
$output The output generated so far.
Returns:
string

Definition at line 176 of file html.class.php.

static spunQ_html::loadPageFromCache ( spunQ_HttpEntryPoint entryPoint,
array $  variables,
array $  cacheOptions 
) [static]

Tries to load a page's contents from cache.

Parameters:
$entryPoint The entry point to load from cache.
$variables Parameters to the template.
Returns:
boolean Whether loading from cache succeeded.

Definition at line 239 of file html.class.php.

static spunQ_html::loadTemplateFromCache ( spunQ_Template template,
array $  variables,
array $  cacheOptions 
) [static]

Tries to load a template's contents from cache.

Parameters:
$template Template to load from cache.
$variables Parameters to the template.
Returns:
boolean Whether loading from cache succeeded.

Definition at line 259 of file html.class.php.

static spunQ_html::setHeaderAndFootermanager ( headerAndFooterManager  )  [static]

Sets the headers/footers manager for response objects.

Parameters:
$headerAndFooterManager The spunQ_IHeaderAndFooterManager implementation. Can be NULL to fall back to default behaviour.

Definition at line 278 of file html.class.php.

static spunQ_html::setPageCache ( cache  )  [static]

Sets a page cache to use.

Parameters:
$cache The new spunQ_IPageCache. Can be NULL to disable caching.
Returns:
void

Definition at line 217 of file html.class.php.

static spunQ_html::setTemplateCache ( cache  )  [static]

Sets a template cache to use.

Parameters:
$cache The new spunQ_ITemplateCache. Can be NULL to disable caching.
Returns:
void

Definition at line 228 of file html.class.php.


Member Data Documentation

spunQ_html::$cssCollector = NULL [static, private]

The css collector to use for responses.

Defaults to spunQ_WormHoleCssCollector if NULL.

Type:
spunQ_ICssCollector

Definition at line 85 of file html.class.php.

spunQ_html::$fatalError = true [static, private]

Whether a fatal error has occured.

There is only way of reacting to fatal errors in PHP: creating an output buffer with a callback and checking a flag in the callback, whether it was set to false at the end of the script. This is the mentioned flag.

Type:
boolean

Definition at line 110 of file html.class.php.

spunQ_html::$headerAndFooterManager = NULL [static, private]

The headers/footers manager to provide to response objects.

Defaults to spunQ_BufferingHeaderAndFooterManager if NULL.

Type:
spunQ_IHeaderAndFooterManager

Definition at line 78 of file html.class.php.

spunQ_html::$jsCollector = NULL [static, private]

The js collector to use for responses.

Defaults to spunQ_WormHoleJsCollector if NULL.

Type:
spunQ_IJsCollector

Definition at line 92 of file html.class.php.

spunQ_html::$pageCache = NULL [static, private]

Page caching mechanism to use.

Will not cache anything if omitted.

Definition at line 64 of file html.class.php.

spunQ_html::$templateCache = NULL [static, private]

Template caching mechanism to use.

Will not cache anything if omitted.

Definition at line 71 of file html.class.php.


The documentation for this class was generated from the following file:

Generated on Fri Jul 1 11:12:40 2011 for spunQ3 by  doxygen 1.5.9