Class: Config_Container
Source Location: /Config-1.10.2/Config/Container.php
Interface for Config containers
Author(s):
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
Config_Container (Constructor) [line 85]
Config_Container Config_Container(
[string
$type = 'section'], [string
$name = ''], [string
$content = ''], [array
$attributes = null])
|
|
Constructor
Parameters:
addItem [line 119]
mixed &addItem(
object
&$item, [string
$where = 'bottom'], [object
$target = null])
|
|
Adds an item to this item.
Parameters:
countChildren [line 347]
int countChildren(
[string
$type = null], [string
$name = null])
|
|
Returns how many children this container has
Parameters:
createBlank [line 178]
object reference &createBlank(
[mixed
$where = 'bottom'], [mixed
$target = null])
|
|
Adds a blank line to this item. This is a helper method that calls createItem
createComment [line 167]
object reference &createComment(
[string
$content = ''], [string
$where = 'bottom'], [object
$target = null])
|
|
Adds a comment to this item. This is a helper method that calls createItem
Parameters:
createDirective [line 194]
object reference &createDirective(
string
$name, string
$content, [mixed
$attributes = null], [string
$where = 'bottom'], [object
$target = null])
|
|
Adds a directive to this item. This is a helper method that calls createItem
Parameters:
createItem [line 105]
object reference &createItem(
string
$type, mixed
$name, string
$content, [array
$attributes = null], [string
$where = 'bottom'], [object
$target = null], mixed
$item)
|
|
Create a child for this item.
Parameters:
createSection [line 212]
object reference &createSection(
string
$name, [array
$attributes = null], [string
$where = 'bottom'], [object
$target = null])
|
|
Adds a section to this item. This is a helper method that calls createItem If the section already exists, it won't create a new one. It will return reference to existing item.
Parameters:
getAttribute [line 558]
mixed getAttribute(
string
$attribute)
|
|
Get one attribute value of this item
Parameters:
getAttributes [line 548]
Get this item's attributes.
getChild [line 457]
mixed &getChild(
[mixed
$index = 0])
|
|
Returns the item parent object.
getContent [line 497]
getItem [line 238]
mixed &getItem(
[string
$type = null], [mixed
$name = null], [mixed
$content = null], [array
$attributes = null], [int
$index = -1])
|
|
Tries to find the specified item(s) and returns the objects. Examples: $directives =& $obj->getItem('directive'); $directive_bar_4 =& $obj->getItem('directive', 'bar', null, 4); $section_foo =& $obj->getItem('section', 'foo'); This method can only be called on an object of type 'section'. Note that root is a section. This method is not recursive and tries to keep the current structure. For a deeper search, use searchPath()
Parameters:
getItemIndex [line 406]
Returns the item index in its parent children array.
getItemPosition [line 425]
Returns the item rank in its parent children array according to other items with same type and name.
getName [line 479]
getParent [line 448]
object returns &getParent(
)
|
|
Returns the item parent object.
getType [line 515]
isRoot [line 596]
Is this item root, in a config container object
removeItem [line 389]
Deletes an item (section, directive, comment...) from the current object TODO: recursive remove in sub-sections
searchPath [line 313]
mixed &searchPath(
mixed
$args)
|
|
Finds a node using XPATH like format: search format = array ( item,item,item,item) item = 'string' .. will match the <string of the xml element item = array('string',array('name'=>'xyz')) .. will match <string name="xyz">
Parameters:
setAttributes [line 525]
void setAttributes(
array
$attributes)
|
|
Set this item's attributes.
Parameters:
setContent [line 488]
void setContent(
mixed
$content)
|
|
Set this item's content.
setDirective [line 578]
object newly &setDirective(
string
$name, mixed
$content, [int
$index = -1])
|
|
Set a children directive content. This is an helper method calling getItem and addItem or setContent for you. If the directive does not exist, it will be created at the bottom.
Parameters:
setName [line 470]
void setName(
mixed
$name)
|
|
Set this item's name.
setType [line 506]
void setType(
mixed
$type)
|
|
Set this item's type.
toArray [line 633]
array toArray(
[bool
$useAttr = true])
|
|
Returns a key/value pair array of the container and its children. Format : section[directive][index] = value If the container has attributes, it will use '@' and '#' index is here because multiple directives can have the same name.
Parameters:
toString [line 610]
mixed toString(
string
$configType, [array
$options = array()])
|
|
Call the toString methods in the container plugin
Parameters:
updateAttributes [line 535]
void updateAttributes(
array
$attributes)
|
|
Set this item's attributes.
Parameters:
writeDatasrc [line 686]
mixed writeDatasrc(
mixed
$datasrc, string
$configType, [array
$options = array()])
|
|
Writes the configuration to a file
Parameters:
Documentation generated on Tue, 15 Jun 2004 05:40:09 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.
|
|