Overview

Namespaces

  • Budabot
    • Core
      • Modules
    • User
      • Modules
  • None
  • Tyrence
    • Modules

Classes

  • AccessManager
  • AdminManager
  • AOChat
  • AOChatPacket
  • AOChatQueue
  • AOExtMsg
  • AsyncHttp
  • AutoInject
  • BotRunner
  • Budabot
  • BuddylistManager
  • CacheManager
  • CacheResult
  • ClassLoader
  • ColorSettingHandler
  • CommandAlias
  • CommandManager
  • ConfigFile
  • DB
  • DBRow
  • EventLoop
  • EventManager
  • GuildChannelCommandReply
  • GuildManager
  • HelpManager
  • Http
  • HttpRequest
  • LegacyLogger
  • LimitsController
  • LoggerWrapper
  • MMDBParser
  • NumberSettingHandler
  • OptionsSettingHandler
  • PlayerHistory
  • PlayerHistoryManager
  • PlayerManager
  • Preferences
  • PrivateChannelCommandReply
  • PrivateMessageCommandReply
  • Registry
  • SettingHandler
  • SettingManager
  • SettingObject
  • SocketManager
  • SocketNotifier
  • SubcommandManager
  • Text
  • TextSettingHandler
  • Timer
  • TimerEvent
  • TimeSettingHandler
  • Util
  • xml

Interfaces

  • CommandReply

Exceptions

  • InvalidHttpRequest
  • SQLException
  • StopExecutionException

Functions

  • isWindows
  • Overview
  • Namespace
  • Class

Class SettingManager

Namespace: Budabot\Core
Instance
Located at SettingManager.class.php
Methods summary
public
# add( $module, $name, $description, $mode, $type, $value, $options = '', $intoptions = '', $accessLevel = 'mod', $help = '' )

Description:

Adds a new setting

Name:

add

Param:

$module - the module name
$name - the name of the setting
$description - a description for the setting (will appear in the config)
$mode - 'edit', 'noedit'
$type - 'color', 'number', 'text', 'options', or 'time'
$options - a list of values that the setting can be, semi-colon delimited (optional)
$intoptions - int values corresponding to $options; if empty, the values from $options will be what is stored in the database (optional)
$admin - the permission level needed to change this setting (default: mod) (optional)
$help - a help file for this setting; if blank, will use a help topic with the same name as this setting if it exists (optional)
public
# exists( $name )

Description:

Determine if a setting with a given name exists

Name:

exists

Return:

true if the setting exists, false otherwise
public
# get( $name )

Description:

Gets the value of a setting

Name:

get

Return:

the value of the setting, or false if a setting with that name does not exist
public
# save( $name, $value )

Description:

Saves a new value for a setting

Name:

save

Param:

$name - the name of the setting
@value - the new value to set the setting to

Return:

false if the setting with that name does not exist, true otherwise
public
# upload( )
public
# registerChangeListener( string $settingName, callable $callback, $data = null )

Adds listener callback which will be called if given $settingName changes.

Adds listener callback which will be called if given $settingName changes.

The callback has following signature:

function callback($value, $data)

$value: new value of the setting $data: optional data variable given on register

Example usage:

registerChangeListener("some_setting_name", function($settingName, $oldValue, $newValue, $data) {
    // ...
} );

Parameters

$settingName
changed setting's name
$callback

the callback function to call $param mixed $data any data which will be passed to to the callback (optional)

In the event of an invalid setting value, throw an exception with a message indicating why the value is invalid.

$data
public
# getSettingHandler( $row )
Properties summary
public $db

Inject

#
public $chatBot

Inject

#
public $util

Inject

#
public $helpManager

Inject

#
public $accessManager

Inject

#
public $logger

Logger

#
public array $settings
# array()
private array $changeListeners
# array()
Budabot 4 Docs API documentation generated by ApiGen