Class: Config_Container
Source Location: /Config-1.10.12/Config/Container.php
Interface for Config containers
Author(s):
|
|
|
Child classes:
|
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 123]
mixed &addItem(
&$item, [string
$where = 'bottom'], [object
$target = null], object
$item)
|
|
Adds an item to this item.
Parameters:
countChildren [line 403]
int countChildren(
[string
$type = null], [string
$name = null])
|
|
Returns how many children this container has
Parameters:
createBlank [line 182]
object reference &createBlank(
[
$where = 'bottom'], [
$target = null])
|
|
Adds a blank line to this item. This is a helper method that calls createItem
Parameters:
createComment [line 171]
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 198]
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 109]
object reference &createItem(
string
$type,
$name, string
$content, [array
$attributes = null], [string
$where = 'bottom'], [object
$target = null], mixed
$item)
|
|
Create a child for this item.
Parameters:
createSection [line 216]
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:
directiveContent [line 383]
mixed directiveContent(
mixed
$args, [int
$index = -1])
|
|
Return a child directive's content. This method can use two different search approach, depending on the parameter it is given. If the parameter is an array, it will use the Config_Container::searchPath() method. If it is a string, it will use the Config_Container::getItem() method. Example: require_once 'Config.php';
$conf =& $ini->parseConfig('/path/to/config.ini', 'inicommented');
// Will return the value found at :
// [Database]
// host=localhost
// Will return the value found at :
// date="dec-2004"
Parameters:
getAttribute [line 617]
mixed getAttribute(
string
$attribute)
|
|
Get one attribute value of this item
Parameters:
getAttributes [line 607]
Get this item's attributes.
getChild [line 516]
mixed &getChild(
[
$index = 0])
|
|
Returns the item parent object.
Parameters:
getContent [line 556]
getItem [line 242]
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 459]
Returns the item index in its parent children array.
getItemPosition [line 479]
int getItemPosition(
[bool
$byType = true])
|
|
Returns the item rank in its parent children array according to other items with same type and name.
Parameters:
getName [line 538]
getParent [line 507]
object returns &getParent(
)
|
|
Returns the item parent object.
getType [line 574]
isRoot [line 655]
Is this item root, in a config container object
removeItem [line 442]
Deletes an item (section, directive, comment...) from the current object TODO: recursive remove in sub-sections
searchPath [line 323]
mixed &searchPath(
mixed
$args)
|
|
Finds a node using XPATH like format. The search format is an array: array(item1, item2, item3, ...) Each item can be defined as the following: item = 'string' : will match the container named 'string' item = array('string', array('name' => 'xyz')) will match the container name 'string' whose attribute name is equal to "xyz" For example : <string name="xyz">
Parameters:
setAttributes [line 584]
void setAttributes(
array
$attributes)
|
|
Set this item's attributes.
Parameters:
setContent [line 547]
void setContent(
$content)
|
|
Set this item's content.
Parameters:
setDirective [line 637]
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 529]
Set this item's name.
Parameters:
setType [line 565]
Set this item's type.
Parameters:
toArray [line 692]
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 669]
mixed toString(
string
$configType, [array
$options = array()])
|
|
Call the toString methods in the container plugin
Overridden in child classes as:
- Config_Container_PHPConstants::toString()
- Returns a formatted string of the object
Parameters:
updateAttributes [line 594]
void updateAttributes(
array
$attributes)
|
|
Set this item's attributes.
Parameters:
writeDatasrc [line 745]
mixed writeDatasrc(
mixed
$datasrc, string
$configType, [array
$options = array()])
|
|
Writes the configuration to a file
Overridden in child classes as:
- Config_Container_PHPConstants::writeDatasrc()
- Writes the configuration to a file
Parameters:
Documentation generated on Mon, 11 Mar 2019 15:42:04 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|