Class Toolbox

Description

Toolbox is a Registry for Utility Singletons

Tools are loosely coupled collections of utility-functions which can be called statically. The Toolbox is a Registry for these tools.

To use a tool function you have to register the Tool class first, using the register method of the toolbox. Then simply call Toolbox::employ( ) with the name of the tool function and its parameters to use the utility whenever you need it.

If you register two Tool classes with identical method names, the second Tool will override the first on register.

Located in /toolbox.php (line 26)

PHOOL
   |
   --Toolbox
Variable Summary
static array $registry
static array $signatures
Method Summary
static mixed employ (string $toolfunc)
static boolean has (string $toolname)
static void register (string $toolname)
void __clone ()
Variables
static array $registry = array( ) (line 33)

Static container for Tool objects

  • access: private
static array $signatures = array( ) (line 40)

Static container for tool signatures

  • access: private

Inherited Variables

Inherited from PHOOL

PHOOL::$debug
PHOOL::$errorlabels
PHOOL::$errorlevels
PHOOL::$errors
PHOOL::$exists
PHOOL::$logdir
PHOOL::$loglevel
PHOOL::$objname
Methods
static employ (line 72)

Use a tool from toolbox and call tool function

You may pass parameters into this functions as you like.

  • return: result of tool function
static mixed employ (string $toolfunc)
  • string $toolfunc: name of registered toolfunction
static has (line 99)

Check if a tool exists

static boolean has (string $toolname)
  • string $toolname: toolname
static register (line 47)

Create and register a Tool object instance.

static void register (string $toolname)
  • string $toolname: the tool-classname to register
__clone (line 108)

Deny cloning of Toolbox

void __clone ()

Inherited Methods

Inherited From PHOOL

PHOOL::PHOOL()
PHOOL::debug()
PHOOL::error()
PHOOL::get_errors()
PHOOL::handle_error()
PHOOL::has_error()
PHOOL::log_error()
PHOOL::set_debug()
PHOOL::set_logdir()
PHOOL::set_loglevel()
Class Constants

Inherited Constants

Inherited from PHOOL

PHOOL::ERROR
PHOOL::UNKNOWN
PHOOL::USER
PHOOL::WARNING

Documentation generated on Tue, 12 May 2009 23:09:43 +0200 by phpDocumentor 1.4.1