System_Daemon
[ class tree: System_Daemon ] [ index: System_Daemon ] [ all elements ]

Class: System_Daemon_Options

Source Location: /System_Daemon-1.0.0/System/Daemon/Options.php

Class Overview


Mechanism for validating, getting and setting a predefined set of options.


Author(s):

Version:

  • SVN: Release: $Id$

Copyright:

  • 2008 Kevin van Zonneveld (http://kevin.vanzonneveld.net)

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 29]
Mechanism for validating, getting and setting a predefined set of options.


[ Top ]


Class Variables

$errors = array()

[line 57]

Holds errors
  • Access: public

Type:   array


[ Top ]

$_definitions = array()

[line 43]

Definitions for all Options
  • Access: protected

Type:   array


[ Top ]

$_isInitialized =  false

[line 50]

Wether all the options have been initialized
  • Access: protected

Type:   boolean


[ Top ]

$_options = array()

[line 36]

Keep track of active state for all Options
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 65]

System_Daemon_Options __construct( array $definitions)

Constructor
  • Access: public

Parameters:

array   $definitions     The predefined option definitions

[ Top ]

getOption   [line 81]

boolean getOption( string $name)

Retrieves any option found in $_definitions
  • Access: public

Parameters:

string   $name     Name of the Option

[ Top ]

getOptions   [line 99]

array getOptions( )

Gets an array of options found in $_definitions
  • Access: public

[ Top ]

init   [line 163]

mixed init( [boolean $premature = false])

Checks if all the required options are set & met.

Initializes, sanitizes & defaults unset variables

  • Return: integer or boolean
  • Access: public

Parameters:

boolean   $premature     Whether to do a premature option init

[ Top ]

isInitialized   [line 150]

boolean isInitialized( )

Wether options are initialized
  • Access: public

[ Top ]

replaceFuncs   [line 473]

string replaceFuncs( array $matches)

Callback function to replace function calls in defaults
  • Access: public

Parameters:

array   $matches     Matched functions

[ Top ]

replaceVars   [line 401]

string replaceVars( array $matches)

Callback function to replace variables in defaults
  • Access: public

Parameters:

array   $matches     Matched functions

[ Top ]

setOption   [line 112]

boolean setOption( string $name, mixed $value)

Sets any option found in $_definitions
  • Access: public

Parameters:

string   $name     Name of the Option
mixed   $value     Value of the Option

[ Top ]

setOptions   [line 134]

boolean setOptions( array $use_options)

Sets an array of options found in $_definitions
  • Access: public

Parameters:

array   $use_options     Array with Options

[ Top ]

strIsUnix   [line 539]

boolean strIsUnix( string $str)

Check if a string has a unix proof format (stripped spaces, special chars, etc)
  • Access: protected

Parameters:

string   $str     What string to test for unix compliance

[ Top ]

strIsUnixFile   [line 526]

boolean strIsUnixFile( string $str)

Check if a string has a unix proof file-format (stripped spaces, special chars, etc)
  • Access: protected

Parameters:

string   $str     What string to test for unix compliance

[ Top ]

strToUnix   [line 552]

string strToUnix( string $str)

Convert a string to a unix proof format (strip spaces, special chars, etc)
  • Access: protected

Parameters:

string   $str     What string to make unix compliant

[ Top ]

_allowedTypes   [line 502]

array _allowedTypes( string $str)

Compile array of allowed types
  • Access: protected

Parameters:

string   $str     String that contains allowed type information

[ Top ]

_setDefault   [line 354]

boolean _setDefault( string $name)

Sets any option found in $_definitions to its default value
  • Access: protected

Parameters:

string   $name     Name of the Option

[ Top ]

_validate   [line 207]

boolean _validate( string $name, mixed $value, [string &$reason = ""])

Validates any option found in $_definitions
  • Access: protected

Parameters:

string   $name     Name of the Option
mixed   $value     Value of the Option
string   &$reason     Why something does not validate

[ Top ]


Documentation generated on Tue, 13 Mar 2012 12:30:11 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.