Main functions start the application
void
Main
( $Args)
Constructor, loads all plugins
CMS3_MainClass
__construct
()
Destructor, closes Database connections
void
__destruct
()
Call a method on all plugins that implements an interface
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.
Closes the application, with an FatalError log, and print the log messsage to user.
void
FatalError
( $PluginID, [ $msg = "Fatal Error, closing the application."])
Gets the server path of the CMS3 installation.
string
GetCMS3Path
()
Gets the URL of the CMS3 toplevel namespace.
string
GetCMS3URL
()
Gets a handle for the userspace database
Returns
&GetDatabaseHandle
()
Gets an embedment from it unique identifier, returns embedable HTML.
string
GetEmbedment
(string $Identifier)
-
string
$Identifier: Identifier Unique identifier.
Gets all plugins that implements an interface
array
&GetImplementations
(string $Interface)
-
string
$Interface: Interface Interface the plugins must implement
Get namespace from owner
string
GetNamespace
(string $PluginID)
-
string
$PluginID: PluginID PluginID of the owner plugin
Gets an instance of a plugin, this returns the one loaded at initialization
object The
&GetPlugin
(string $Plugin)
-
string
$Plugin: Plugin PluginID of the plugin you wish to load
Gets a handle for the system database
Returns
&GetSystemDatabaseHandle
()
Gets the username of the current user, resturns null if user not loggedin.
string
GetUserName
()
Returns true if current user is administrator.
true/false
IsAdmin
()
Load a plugin
object Returns
&LoadPlugin
(string $Plugin)
-
string
$Plugin: Plugin PluginID of the plugin you wish to load
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.
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.
Log the user in
bool
Login
(string $Username, string $Password)
-
string
$Username: Username Username of the user
-
string
$Password: Password The users password
Print a message of an mysql error to the logfile, useful for debuggin information.
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.
Registers a namespace, the plugin that owns this MUST implement IProvidesContent
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
Resoles an print the content of an identifier.
bool
ResolveIdentifier
(string $Identifier)
-
string
$Identifier: Identifier Identifier, including namespace etc.
Unregisters a namespace
bool
UnregisterNamespace
(string $Namespace)
-
string
$Namespace: Namespace String representation of the namespace.