Class CMS3_MainClass

Description

The CMS3 main class, this class hostes all plugins and initiate everything.

Located in /default.php (line 35)


	
			
Variable Summary
Method Summary
 static void Main ( $Args)
 CMS3_MainClass __construct ()
 void __destruct ()
 array &CallImplementations (string $Interface, string $Method, [array $Arguments = array()])
 void FatalError ( $PluginID, [ $msg = "Fatal Error, closing the application."])
 string GetCMS3Path ()
 string GetCMS3URL ()
 Returns &GetDatabaseHandle ()
 string GetEmbedment (string $Identifier)
 array &GetImplementations (string $Interface)
 string GetNamespace (string $PluginID)
 object The &GetPlugin (string $Plugin)
 string GetUserName ()
 true/false IsAdmin ()
 object Returns &LoadPlugin (string $Plugin)
 void Log (string $PluginID, string $msg)
 bool Login (string $Username, string $Password)
 void LogMySQL (string $PluginID, string $msg, resource &$res)
 bool RegisterNamespace (string $Namespace, string $PluginID)
 bool ResolveIdentifier (string $Identifier)
 bool UnregisterNamespace (string $Namespace)
Variables
mixed $LogFileHandle (line 312)

Handle for the logfile, not always loaded

  • access: protected
mixed $Plugins = array() (line 37)
  • access: protected
mixed $SystemDatabaseHandle (line 412)

Handle for the system database, not always initialized

  • access: private
mixed $UserSpaceDatabaseHandle (line 361)

Handle for the userspace database, not always initialized

  • access: protected
Methods
static Main (line 88)

Main functions start the application

void Main ( $Args)
  • $Args
Constructor __construct (line 42)

Constructor, loads all plugins

CMS3_MainClass __construct ()
Destructor __destruct (line 72)

Destructor, closes Database connections

void __destruct ()
CallImplementations (line 237)

Call a method on all plugins that implements an interface

  • return: Returns an array of return values from the different methods
  • access: public
array &CallImplementations (string $Interface, string $Method, [array $Arguments = array()])
  • string $Interface: Interface Interface the plugins must implement to get this call
  • string $Method: Method Method to be called
  • array $Arguments: Arguments Array of arguments to be passed to the method.
FatalError (line 396)

Closes the application, with an FatalError log, and print the log messsage to user.

  • access: public
void FatalError ( $PluginID, [ $msg = "Fatal Error, closing the application."])
  • $PluginID
  • $msg
GetCMS3Path (line 163)

Gets the server path of the CMS3 installation.

  • access: public
string GetCMS3Path ()
GetCMS3URL (line 174)

Gets the URL of the CMS3 toplevel namespace.

  • access: public
string GetCMS3URL ()
GetDatabaseHandle (line 369)

Gets a handle for the userspace database

  • return: a MySQL database connection.
  • access: public
Returns &GetDatabaseHandle ()
GetEmbedment (line 505)

Gets an embedment from it unique identifier, returns embedable HTML.

  • access: public
string GetEmbedment (string $Identifier)
  • string $Identifier: Identifier Unique identifier.
GetImplementations (line 219)

Gets all plugins that implements an interface

  • return: Array of objects that implements the interface
  • access: public
array &GetImplementations (string $Interface)
  • string $Interface: Interface Interface the plugins must implement
GetNamespace (line 292)

Get namespace from owner

  • return: Namespace of the plugin or false if nothing was registered.
  • access: public
string GetNamespace (string $PluginID)
  • string $PluginID: PluginID PluginID of the owner plugin
GetPlugin (line 203)

Gets an instance of a plugin, this returns the one loaded at initialization

  • return: plugin you requested, or false if not there.
  • access: public
object The &GetPlugin (string $Plugin)
  • string $Plugin: Plugin PluginID of the plugin you wish to load
GetSystemDatabaseHandle (line 420)

Gets a handle for the system database

  • return: a MySQL database connection.
  • access: protected
Returns &GetSystemDatabaseHandle ()
GetUserName (line 99)

Gets the username of the current user, resturns null if user not loggedin.

  • access: public
string GetUserName ()
IsAdmin (line 135)

Returns true if current user is administrator.

  • access: public
true/false IsAdmin ()
LoadPlugin (line 185)

Load a plugin

  • return: the plugin you requested
  • access: public
object Returns &LoadPlugin (string $Plugin)
  • string $Plugin: Plugin PluginID of the plugin you wish to load
Log (line 323)

Print a message to the logfile, useful for debuggin information.

Message are both printed to custom logfile in ./data/System/System.log and send to syslogd local0 savedin /var/log/CMS3.log according to installation notes.

  • access: public
void Log (string $PluginID, string $msg)
  • string $PluginID: PluginID PluginID of the plugin that wrote this log message.
  • string $msg: msg Message to print to the log. Note: Date and time is printed automaticly.
Login (line 114)

Log the user in

  • return: true if login was successfull
  • access: public
bool Login (string $Username, string $Password)
  • string $Username: Username Username of the user
  • string $Password: Password The users password
LogMySQL (line 352)

Print a message of an mysql error to the logfile, useful for debuggin information.

  • access: public
void LogMySQL (string $PluginID, string $msg, resource &$res)
  • string $PluginID: PluginID PluginID of the plugin that wrote this log message.
  • string $msg: msg Message to print to the log. Note: Date and time is printed automaticly.
  • resource &$res: mysql resource that the error accoured on.
RegisterNamespace (line 263)

Registers a namespace, the plugin that owns this MUST implement IProvidesContent

  • return: Returns true if registration was successfull.
  • access: public
bool RegisterNamespace (string $Namespace, string $PluginID)
  • string $Namespace: Namespace String representation of the namespace, max 255 characters.
  • string $PluginID: PluginID PluginID of the owner plugin, this must implement IProvidesContent
ResolveIdentifier (line 449)

Resoles an print the content of an identifier.

  • return: True/false depending on success of failure
  • access: public
bool ResolveIdentifier (string $Identifier)
  • string $Identifier: Identifier Identifier, including namespace etc.
UnregisterNamespace (line 280)

Unregisters a namespace

  • return: Returns true if unregistration was successfull.
  • access: public
bool UnregisterNamespace (string $Namespace)
  • string $Namespace: Namespace String representation of the namespace.

Documentation generated on Mon, 30 Apr 2007 01:59:13 +0200 by phpDocumentor 1.3.1