com.lokorin.lokorin.lib
[ class tree: com.lokorin.lokorin.lib ] [ index: com.lokorin.lokorin.lib ] [ all elements ]

Procedural File: lib_redirects.php

Source Location: /_includes/lib_redirects.php



Page Details:

A library that contains everything related to the site's url redirect system. The system maps incoming urls to actual files on the server. It allows the site to show one structure to the outside while in reality using a completly different structure on the server.



Tags:

filesource:  Source Code for this file
license:  GNU Lesser General Public License
version:  $Revision: 1.20 $
author:  Andreas Launila


Includes:

require_once('common.php') [line 21]
For access to common functions and variables.







buildUrlAliases [line 149]

void buildUrlAliases( )

Rebuilds the url aliases master table. It composes all necessary aliases and resets the aliases master table with that info.



Tags:

access:  public


[ Top ]



buildUrlRedirects [line 394]

void buildUrlRedirects( )

Rebuilds the url redirects master table. It composes all necessary redirects and resets the redirects master table with that info.



Tags:

access:  public


[ Top ]



doDelayedRedirect [line 513]

void doDelayedRedirect( string $url, [integer $delay = 2])

Performs a delayed redirection to the specified url with the speicified delay. The page will be redirected after the specified number of seconds have elapsed.



Tags:

access:  public


Parameters

string   $url   The url to the site that the user should be taken to.
integer   $delay   The number of seconds that the redirection should be delayed.
[ Top ]



doPermanentRedirect [line 526]

void doPermanentRedirect( string $destinationUrl)

Redirects the request to a specified page with a permanent redirect, i.e.

with a status code 301. The redirects is performed immedientally without delay and is done via the header sent in response to the request.




Parameters

string   $destinationUrl   The url to which the user should be redirected. The url should be relative to the page root, relative to the web root or be absolute, starting with http://.
[ Top ]



doRedirect [line 538]

void doRedirect( string $destinationUrl)

Redirects the url to the specified page with a temporary redirect, i.e.

a redirect that should not be considered to be permanent by the client.




Parameters

string   $destinationUrl   The url to which the user should be redirected. The url should be relative to the page root, relative to the web root or be absolute, starting with http://.
[ Top ]



getRealUrl [line 122]

string getRealUrl( string $requestedUrl)

Gets the url that a specified url really leads to. For instance a user might request one url while the request is actually transferred to an centralised module behind the scenes.



Tags:

return:  The actual url, relative to the site's root, that the call should be directed to.
access:  private


Parameters

string   $requestedUrl   The url, relative to the site's root, which has been requested by the user (no query string).
[ Top ]



getRedirect [line 97]

string getRedirect( string $requestedUrl)

Gets any redirects that apply to a specified url.



Tags:

return:  The url that the specified url should be redirected to, or an empty string if none was found.
access:  private


Parameters

string   $requestedUrl   The url, relative to the site's root, which has been requested by the user (no query string).
[ Top ]



getSimilarUrls [line 480]

array getSimilarUrls( string $url)

Gets all urls that are similar to a specified url. I.e. all urls that exist and are subsets of the specified url.



Tags:

return:  An array of string with each string representing a similar url relative to the page root.
access:  public


Parameters

string   $url   The url, relative to the page root, for which all similar urls should be found. No query string is allowed.
[ Top ]



getUrlPath [line 46]

string getUrlPath( string $url, [boolean $jump = true])

Attempts to get a url path to an existing file by starting from a specified url and then translating the related redirects.



Tags:

return:  The url to the file, relative to the page root and with query string, that the url is resolved to. An empty string is returned if no file could be found.
access:  public


Parameters

string   $url   The url, relative to the page root, that the search should start from.
boolean   $jump   Whether or not redirects should be followed. I.e. whether or not jumps should be executed. True if jumps should be executed, false otherwise.
[ Top ]



stripQueryString [line 29]

string stripQueryString( string $url)

Strips an url of any query string (if one exists).



Tags:

return:  The url without its query string.
access:  public


Parameters

string   $url   The url which's query string should be removed.
[ Top ]



stripRootPath [line 553]

string stripRootPath( string $url)

Strips the root path from a specified url.



Tags:

return:  The url but without the first occurance of the root path.


Parameters

string   $url   The url from which the root path should be stripped.
[ Top ]



Documentation generated on Sun, 16 Apr 2006 21:03:50 +0200 by phpDocumentor 1.3.0RC4