Terry's Blog Engine Version 3.1.0
functions.php File Reference

Miscellaneous functions. More...


 __autoload ($className)
 Autoload Handler.
 getTranslation ($phrase)
 Handle National Language lookup.
 debugMsg ($msg)
 Simple debug message logger.
 debugVar ($title, $var)
 Debug var_export to file.
 pageTimer ($eventName)
 Simple debug transaction timer.

Detailed Description

This file contains the few miscellaneous functions that don't sensibly or can't fit into the class framework.

Function Documentation

__autoload ( className)

All material functionality is implemented though classes in this implementation. Unless explicitly preloaded, classes are loaded by this autoloader.

  • By default classes are loaded from a _cache directory, if they exist in this directory. If a cache fault occurs — that is the class isn't in the _cache directory — not then the autoloader uses a builder class to create this cached copy.
  • These builder classes are an exception to the _cache directory location as they are directly loaded from the _include directory. The builder name is based on a simple convention for the class name: if the class name is multiple words (separated by underscore) then the first word in the name is used for the builder class otherwise the "<i>default</i>" builder class is used.

See AbstractBuilder for further detailed discussion of the builder strategy.

$classNameThe name of the class to be autoloaded.
getTranslation ( phrase)

This application and the templating system (described in the class TemplateBuilder) is designed to be National Language (NL) capable. All text resources are accessed through this getTranslation function. This current implementation is more of a hook since the current version is implemented in English. However each phrase to be translated is written to the language table in the D/B. This hook enables the blog engine to implement another NL by:

  • Translating (and adding) the entries in the language table to the target NL.
  • Decoding the NL context to the set the AppContext property languageCode. This rotine will then return the text content for the target NL.
$phraseThe phrase to be translated
The translation of the phrase.

The flexibilty of autoloader system has a consequence that the execution path to the initial invocation of getTranslation can vary and therefore it must self-initialise its context. A couple of static variables are used and the context is initialise once if they aren't set, rather than once per call.

debugMsg ( msg)
$msgMessage to be output to debug log
debugVar ( title,
$titleTitle to prefix variable dump
$varVariable to be dumped to debug log
pageTimer ( eventName)
$eventNameTimer event being displayed
 All Classes Files Functions Variables