Common
[ class tree: Common ] [ index: Common ] [ all elements ]

Class: ResourceHandler

Source Location: /common/ResourceHandler.php

Class Overview


Class to manage resource accesses


Variables

Methods



Class Details

[line 196]
Class to manage resource accesses

It handles the registration of Url provider objects.




[ Top ]


Class Variables

$cartoclientBaseUrl =

[line 213]

The URL to the cartoclient base



Tags:

access:  private

Type:   string


[ Top ]

$cartoserverBaseUrl =

[line 219]

The URL to the cartoserver base.



Tags:

access:  private

Type:   string


[ Top ]

$directAccess =

[line 207]

True if the client is in direct access mode.



Tags:

access:  private

Type:   boolean


[ Top ]

$urlProvider =

[line 201]

The current URL provider to use for generating URL's



Tags:

access:  private

Type:   UrlProvider


[ Top ]



Class Methods


constructor __construct [line 227]

ResourceHandler __construct( Config $config, ProjectHandler $projectHandler)

Constructor



Tags:

access:  public


Parameters:

Config   $config   the current configuration object
ProjectHandler   $projectHandler   the current project handler.

[ Top ]

method convertXhtml [line 258]

string convertXhtml( string $url, [boolean $back = false])

Replaces some URL characters by XHTML-proof ones.



Tags:

return:  filtered URL
static:  
access:  public


Parameters:

string   $url   URL to filter
boolean   $back   switch conversion direction

[ Top ]

method getFinalUrl [line 280]

A getFinalUrl( string $relativeUrl, boolean $client, [boolean $forceAbsolute = false])

Processes a relative URL to a resource, and convert it so that it is accessible on the client templates.

The relative url may be relative to the client or the server base Url. Whenever possible, the returned URL will be relative to the cartoclient. The relative URL is possible if the $forceAbsolute parameter is false and the resource is on the client or directAccess is enabled.




Tags:

return:  relative URL to the resource if possible, or an absolute one
access:  public


Parameters:

string   $relativeUrl   The relative URL to a resource to convert
boolean   $client   True for resources on the client, false for server
boolean   $forceAbsolute   True to obtain an absolute URL in any case

[ Top ]

method getPathOrAbsoluteUrl [line 304]

string getPathOrAbsoluteUrl( string $relativeUrl, [boolean $client = false])

From a relative resource URL, returns either a path to the corresponding file on the file system, if accessible (only for client resources, or server in direct access mode). Otherwise, it will return the absolute URL to the resource.



Tags:

return:  The path to the resource file on the filesystem, if accessible, or the absolute URL to the resource
access:  public


Parameters:

string   $relativeUrl   The relative URL to a resource
boolean   $client   True for resources on the client, false for server

[ Top ]

method getUrlProvider [line 248]

UrlProvider getUrlProvider( )



Tags:

return:  the current URL provider to use for getting url's.
access:  public


[ Top ]


Documentation generated on Wed, 6 Apr 2005 12:06:54 +0200 by phpDocumentor 1.3.0RC3