Packageindex Classtrees Modulegroups Elementlist Report XML Files

pxdb_tools

pxdb_tools

private class pxdb_tools

 

Public Method Summary

void xlate(string $text)
Translates a string (using gettext).
void get_search_terms(string $search_data, [ string $prefix, string $suffix ])
Gets a list of search terms based on a passed search string.
array array_thread(string $key, array $data)
Takes a two-dimensional array and converts it to a one-dim array of values for given key.
void get_plugins(string $type)
Looks at the filesystem to find all the plugins (PHP files) for specified type.
string get_time_quarters()
Gets the time in 15 minute increments, to take advantage of MySQL's query caching
string encode_section_link(string $value)
Encodes the URL_ID of a section so that URLs can be included in encoded
mixed decode_section_link(string $value)
Decodes a URL that has been encoded using the encode_section_link()

Private Method Summary

string populate(string $text, array $replace_map, [ string $tag_open, string $tag_close ])
Replaces in passed text with values in $replace_map.
void db_signature( &$db)
Generates a signature of ADOConnection.

Public Method Details

xlate

public void xlate(string $text)

  -- I think that this could probably be replaced with sprintf() and variable swapping, but there might be some reason to keep this method... If only for the fact that it's more elegant. Takes a variable number of arguments, the first is the string to translate, subsequent ones are values to replace {*} tags with. This funtion preserves order relationship between tags & arguments so that if tags are re-organized in translated text (very possible), it will still replace the correct values.

Parameter
string $text
The text to be translated.
Returns void


get_search_terms

public void get_search_terms(string $search_data, [ string $prefix, string $suffix ])

 

Parameter
string $search_data
the string of keywords
string $prefix = >>null<<
add to beginning of each term (e.g. '%')
string $suffix = >>null<<
add to end of each term (e.g. '%')
Returns void


array_thread

public array array_thread(string $key, array $data)

 

Parameter
string $key
The key we want to extract.
array $data
The input array.
Returns array

A 1-dim array with same number of elements of input array.


get_plugins

public void get_plugins(string $type)

  OAM: is this only used in dbasis?

Parameter
string $type
The plugin type we are looking for -- corresponds to filesystem directory.
Returns void


get_time_quarters

public string get_time_quarters()

 

Returns string

ISO -formatted date to the previous 15 minute increment


encode_section_link

public string encode_section_link(string $value)

  form in the URL_PATH of a section. Note that this involves a three step encoding: Step 1: base64 encodes the entire string Step 2: replaces the base64 '/' character with hash/pound sign '#' Step 3: prepends an identifying label '*64' To decode an encoded link we use the decode_section_link() function

Parameter
string $value
URL to be encoded. Can be absolute or relative
Returns string

encoded version of input using modified base64 encoding


decode_section_link

public mixed decode_section_link(string $value)

  function. This essentially reverses the effect of running the encoding function. It will return the decoded version of the input string or false if the input string is not marked as an encoded URL (eg. has the *64_ prefix

Parameter
string $value
version of the string
Returns mixed

decoded version of input string or false if input is not encoded


Private Method Details

populate

private string populate(string $text, array $replace_map, [ string $tag_open, string $tag_close ])

 

Parameter
string $text
The text containing the tags we need to replace.
array $replace_map
A hash where key is the tag in text and value is the value with which to replace that tag.
string $tag_open = >>'{'<<
The character(s) that open(s) tags.
string $tag_close = >>'}'<<
The character(s) that close(s) tags.
Returns string

The text that results after the find/replace.


db_signature

private void db_signature( &$db)

  Used for singleton instantiator functions.

Parameter
&$db
Warning: documentation is missing.
Returns void



Packageindex Classtrees Modulegroups Elementlist Report XML Files
Generated on Fri, 28 Apr 2006 19:07:22 -0400 by PHPDoc v1.5 www.phpdoc.de