DeBot Framework


DeBot\Modules
core/Modules.php at line 18

Class Modules

Modules

public class Modules

DeBot Core - Modules Created by dab ??? ?? 2009 Last Edited: Jul 29 2010 Last Edited: Aug 2 2010 Last Edited: Aug 15 2010 This file maintains all the extensions to the DeBot Framework. It is actually quite simple. Loads in the Module class into an array and calls callbacks based on what the Bot class receives.

Author:
David (dab)
Version:
v1.0

Field Summary
IDs[]

$moduleIPC

This variable stores all of our Inter Process Communcation information.

Array An array of [string] index to integer values /

$moduleIPCLength

This stores the string length of our objects in our Inter Process Communication.

Method Summary
null

__construct(String sNick)

Our construction function.

Module[]

getModules()

This returns all of the modules loaded by the bot.

Boolean

load(String sModule)

Load a module to this bot.

void

offsetExists(mixed sKey)

void

offsetGet(mixed sKey)

void

offsetSet(mixed sKey, mixed mValue)

void

offsetUnset(mixed sKey)

Boolean

reload(String sModule)

This method reloads a module from the disk.

Boolean

unload(string sModule)

We can unload a module so none of the callbacks are called.

Field Detail

core/Modules.php at line 40

moduleIPC

public IDs[] $moduleIPC

This variable stores all of our Inter Process Communcation information. It stores the ID (sum of ord characters) and gets the module's string name so we can assign to the proper objects


core/Modules.php at line 48

moduleIPCLength

public Array An array of [string] index to integer values / $moduleIPCLength

This stores the string length of our objects in our Inter Process Communication.


Method Detail

core/Modules.php at line 58

__construct

public null __construct(String sNick)

Our construction function. Loads the bot modules to load, and loads them.

Parameters:
sNick - The nickname of the bot we are loading for
Returns:
Nothing to return.

core/Modules.php at line 183

getModules

public Module[] getModules()

This returns all of the modules loaded by the bot.

Returns:
A module class in an array

core/Modules.php at line 79

load

public Boolean load(String sModule)

Load a module to this bot. Only takes the name, without the .php. So lets say teh Module is in /Modules/dabRules.php. You would pass dabRules to the function.

Parameters:
sModule - The name of the module to load
Returns:
(Loaded or not)

core/Modules.php at line 189

offsetExists

public void offsetExists(mixed sKey)

core/Modules.php at line 197

offsetGet

public void offsetGet(mixed sKey)

core/Modules.php at line 206

offsetSet

public void offsetSet(mixed sKey, mixed mValue)

core/Modules.php at line 211

offsetUnset

public void offsetUnset(mixed sKey)

core/Modules.php at line 133

reload

public Boolean reload(String sModule)

This method reloads a module from the disk. Assuming ou have runkit installed (Required!)

Parameters:
sModule - The name of the module you want to reload
Returns:
True on success false on failure /

core/Modules.php at line 115

unload

public Boolean unload(string sModule)

We can unload a module so none of the callbacks are called. MAKE SURE TO ADD TIMER REMOVAL IN YOUR DESTRUCTS. Timer still makes calls to the modules if they made a timer callback.

Parameters:
sModule - The module name to unload
Returns:
True on success, false on failure. /

DeBot Framework