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

Procedural File: lib_util.php

Source Location: /_includes/lib_util.php



Page Details:

A library that contains varius functions that do not belong anywhere else and that do not constitute a sufficiently large cohesion group for a library of their own.



Tags:

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


Includes:

require_once('common.php') [line 20]
For access to common constants and functions.







addQueryParams [line 75]

string addQueryParams( array $paramsToAdd)

Adds specified parameters to the current query string. If a parameter is already specified then the existing value is overwritten by the new one.



Tags:

return:  The resulting query string. It has the form 'foo1=bar1&foo2=bar2'.
access:  public


Parameters

array   $paramsToAdd   The parameters that should be added. The key should be the parameter name, while the value should be the parameter value.
[ Top ]



getCurrentDirectory [line 142]

string getCurrentDirectory( )

Gets the relative path to the current requested directory from the root path.



Tags:

return:  A path from the root path to the current directory.
access:  public


[ Top ]



getCurrentEncodedUrl [line 36]

string getCurrentEncodedUrl( )

Gets the current encoded url, complete with the query string.



Tags:

return:  An encoded url.
access:  public


[ Top ]



getCurrentUrl [line 27]

string getCurrentUrl( )

Gets the current url, complete with the query string.



Tags:

return:  An url.
access:  public


[ Top ]



removeDirectoryContents [line 163]

boolean removeDirectoryContents( string $dirName)

Removes all files and directories contained in the specified directory.



Tags:

return:  True if the contants was successfully removed, false otherwise.
access:  public


Parameters

string   $dirName   The name of the directory that should be removed relative to the current directory.
[ Top ]



removeDirectoryRecursive [line 190]

boolean removeDirectoryRecursive( string $dirName)

Recursivly removes a directory and all of its contents.



Tags:

return:  True if the directory was successfully removed, false otherwise.
access:  public


Parameters

string   $dirName   The name of the directory that should be removed relative to the current directory.
[ Top ]



renameQueryParams [line 54]

string renameQueryParams( array $replacements, [string $queryString = ''])

Renames parameters in a url query string, the values remain unchanged. It can for instance turn "foo=0&bar=hi" into "a=0&b=hi".



Tags:

return:  The query string with the specified name changes performed on it.
access:  public


Parameters

array   $replacements   An array specifying what and how parameters should be renamed. The name of the parameter that should be renamed should be the key and the new name for the parameter should be the value.
string   $queryString   An optional way to specify the query string that should be renamed. The default is that the query string in $_SERVER['QUERY_STRING'] is used.
[ Top ]



sendEmail [line 111]

void sendEmail( string $title, string $message, [string $sender = ''], [string $receiver = 'lokorin'])

Sends an email with specified contents. Optionally the receiver of the email can be specififed along with the sender.



Tags:

access:  public


Parameters

string   $title   The title that the email message should have.
string   $message   The actual message contents for the email.
string   $sender   An optional email address that should be given as the sender of the email (and hence the return path).
string   $receiver   An optional specification of the receing email address. It should be given without a domain, i.e. if the mail should be sent to foo@dfcrafter.com then 'foo' should be specified.
[ Top ]



urlEncodeReadable [line 210]

string urlEncodeReadable( string $input)

Encodes the string to be encoded for url use, but first alters some characters to get a more readable string. For instance spaces are replaced with underscores instead of %20. This function is not one to one.



Tags:

return:  An encoded string.
access:  public


Parameters

string   $input   The input that should be encoded.
[ Top ]



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