Class SGL

Description

Provides a set of static utility methods used by most modules.

Located in /SGL.php (line 47)


	
			
Method Summary
 static string getCurrentCharset ()
 static string getCurrentLang ()
 static boolean isMinimalInstall ()
 static mixed loadRegionList (string $regionType)
 static boolean logMessage (mixed $message, [string $file = null], [integer $line = null], [integer $priority = PEAR_LOG_INFO])
 static boolean moduleIsEnabled (string $moduleName)
 static object raiseError (string $msg, [int $type = null], [int $behaviour = null], [ $getTranslation = false])
 static void _toCurrentCharset ( &$v, string $v)
 void displayErrorPage ( &$output, SGL_Output $output)
 void displayMaintenancePage ( &$output)
 void displayStaticPage ( $msg)
 void import (string $resource)
 void isPhp5 ()
 void objectCopy ( $src,  &$target)
 boolean objectHasState (object $obj)
 void raiseMsg ( $messageKey, [ $getTranslation = true], [ $messageType = SGL_MESSAGE_ERROR])
 boolean runningFromCLI ()
 void setNoticeBehaviour ([ $mode = SGL_NOTICES_ENABLED])
Methods
static getCurrentCharset (line 75)

Returns current encoding, ie, utf-8.

  • return: charset codepage
  • access: public
string getCurrentCharset ()
static getCurrentLang (line 58)

Returns the 2 letter language code, ie, de for German

  • return: langCode, ie zh-TW
  • access: public
string getCurrentLang ()
static isMinimalInstall (line 477)

Returns true if a minimal version of Seagull has been installed.

boolean isMinimalInstall ()
static loadRegionList (line 324)

Loads region list for current language. If not found, loads region list for default language (English). Put found data into $GLOBALS.

All region lists should be UTF-8 encoded.

  • todo: remove presence of $GLOBALS
mixed loadRegionList (string $regionType)
  • string $regionType
static logMessage (line 100)

Log a message to the global Seagull log backend.

Note that the method can be safely called by simply omitting the deprecated parameters (but doesn't have to be).

boolean logMessage (mixed $message, [string $file = null], [integer $line = null], [integer $priority = PEAR_LOG_INFO])
  • mixed $message: Either a string or a PEAR_Error object.
  • string $file: Deprecated.
  • integer $line: Deprecated.
  • integer $priority: The priority of the message. One of: PEAR_LOG_EMERG, PEAR_LOG_ALERT, PEAR_LOG_CRIT PEAR_LOG_ERR, PEAR_LOG_WARNING, PEAR_LOG_NOTICE PEAR_LOG_INFO, PEAR_LOG_DEBUG
static moduleIsEnabled (line 489)

Returns true if a module is installed, ie has a record in the module table.

boolean moduleIsEnabled (string $moduleName)
  • string $moduleName
static raiseError (line 184)

A static method to invoke errors.

  • return: PEAR error
  • access: public
object raiseError (string $msg, [int $type = null], [int $behaviour = null], [ $getTranslation = false])
  • string $msg: the error message
  • int $type: custom message code
  • int $behaviour: behaviour (die or continue!);
  • $getTranslation
static _toCurrentCharset (line 377)

Convert string to current charset from utf-8.

void _toCurrentCharset ( &$v, string $v)
  • string $v
  • &$v
displayErrorPage (line 430)

Display Seagull error page.

void displayErrorPage ( &$output, SGL_Output $output)
displayMaintenancePage (line 400)
void displayMaintenancePage ( &$output)
  • &$output
displayStaticPage (line 384)
void displayStaticPage ( $msg)
  • $msg
import (line 305)

Returns true on success, false if resource was not found.

void import (string $resource)
  • string $resource: File or lib name
isPhp5 (line 234)
void isPhp5 ()
objectCopy (line 267)
void objectCopy ( $src,  &$target)
  • $src
  • &$target
objectHasState (line 249)

Returns false if no properties are set.

Simplistic if ($prop) test is intentional, method will return false for props such as 0, "0", "", null, array(), etc.

boolean objectHasState (object $obj)
  • object $obj
raiseMsg (line 213)
void raiseMsg ( $messageKey, [ $getTranslation = true], [ $messageType = SGL_MESSAGE_ERROR])
  • $messageKey
  • $getTranslation
  • $messageType
runningFromCLI (line 280)

Determines current server API, ie, are we running from commandline or webserver.

boolean runningFromCLI ()
setNoticeBehaviour (line 295)
void setNoticeBehaviour ([ $mode = SGL_NOTICES_ENABLED])
  • $mode

Documentation generated on Tue, 23 Feb 2010 18:14:33 +0000 by phpDocumentor 1.4.3