$conf
$conf : \Phabstractic\Features\Zend\Config\Config
The objects configuration object
Should be an instance of Zend/Config
Stack Class - Defines a Stack (heap) Data Structure
A stack is a basic Last In First Out structure. The The last thing you put in it, is the first thing you get from it.
This implementation takes inspiration from the PostScript stack and includes a couple of member functions that implement common PostScript stack behavior.
configure(array|string|\Phabstractic\Features\Zend\Config\Config $configuration, string $format = null, mixed $context = null) : boolean
Configure An Object
Expects an array for configuration however, you can also pass it a filepath where it will read the information from a file automatically detecting the format using the file extension. You can also pass a Zend/Config object already made.
You can also pass a format specifier (forced format) for use in a if $configuration is a string formatted with such information. E.G. to load from a string in the format ini:
$this->configure($configString, 'ini');
The $context argument is used for any additional reader constructor information, such as the constructor for the 'yaml' format.
NOTE: You can override/extend the classes used for reading formats by identifying an additional array in the property $this->configReaders. This will merge with the standard formats array.
array|string|\Phabstractic\Features\Zend\Config\Config | $configuration | The objects configuration information. |
string | $format | The forced format, or format for configuration string |
mixed | $context | Any additional information for a reader constructor, such as needed for the YAML format. |
True if instantiated
saveSettings(string $file, \Phabstractic\Features\Zend\Config\Writer\WriterInterface $writer = null, boolean $exclusive = true, mixed $context = null)
Save an Object's Configuration to a File
Takes an objects $conf property and writes the information contained therein to a file with a format automatically specified by the filename.
It is possible to retrieve a string of a particular format from this method by specifying the filename '#string' with an extension indicating the desired format, such as '#string.json'.
The $context argument is used for any additional reader constructor information, such as the constructor for the 'yaml' format.
NOTE: You can override/extend the classes used for writing formats by identifying an additional array in the property $this->configWriters. This will merge with the standard formats array.
string | $file | The file path to write to, or '#string.ext' |
\Phabstractic\Features\Zend\Config\Writer\WriterInterface | $writer | The optional writer object supplied to use (such as a MySQL writer) |
boolean | $exclusive | Argument provided to toFile(), file exclusive lock when writing |
mixed | $context | Any additionla writer constructor information (YAML) |
getSettings(string $format, $context = null) : string|boolean
Retrieve an Object's Configuration Information As String
This is a shortcut to ::saveSettings() which specifies a format and forces the return of a string, using the #string.ext filename -see documentation for ::saveSettings()-
string | $format | The format to return, must be supported by ::saveSettings(), use $this->configWriters to support additional formats. |
$context |
The formatted string, or false otherwise
processSettings(\Phabstractic\Features\Zend\Config\Processor\ProcessorInterface $processor)
Process an Object's Configuration
This uses a Zend\Config\Processor implementation to process the configuration information, such as constants. The processor must be supplied and implement ProcessorInterface
NOTE: Edits the $conf object in place.
\Phabstractic\Features\Zend\Config\Processor\ProcessorInterface | $processor | The given processor object |
top() : mixed|\Phabstractic\Data\Types\Phabstractic\Data\Types\None
Retrieve the 'top' of the list
Returns a None object if the list is empty and strict is false
Note: Does not 'pop' the value off the list
if no top exists
'Top' Value of List
topReference() : mixed|\Phabstractic\Data\Types\Phabstractic\Data\Types\None
Return the 'top' of the list as a reference
Returns a None object if the list is empty and strict is false
Note: Does not 'pop' the value off the list
when called on empty stack
'Top' Values as Reference of List
index(integer $i) : mixed|\Phabstractic\Data\Types\Phabstractic\Data\Types\None
Return the $i'th element of the list
NOTE: With a stack we start counting at the 'top' of the stack 0 is the top of the stack, 1, the next, and so on
integer | $i | The numerical index into the list |
If index is out of well... range.
The value found at index of list: list[index]
indexReference(integer $i) : mixed
Return the $i'th element of the list as a reference
NOTE: With a stack we start counting at the 'top' of the stack 0 is the top of the stack, 1, the next, and so on
integer | $i | The numerical index into the list |
If index is out of well... range.
The value at the list's numerical index as a reference
remove(mixed $value) : \Phabstractic\Data\Types\Resource\Phabstractic\Data\Types\Resource\AbstractList
Remove a value out of the list
This is just in case we want to remove something out of order.
Only removes the first occurance of value
mixed | $value | The value to remove |
For chaining
roll( $c)
'Rolls' the list like one might 'roll' a wheel.
Negative values roll the list the opposite direction positive values roll the list.
Note: Edits the list in place, does not return copy of list
EX:
12345 might become 34512
$c |
if argument isn't integer
offsetSet(integer $key, mixed $value) : \Phabstractic\Data\Types\intNew
Set the offset in the list to the provided value
integer | $key | The index to the list item |
mixed | $value | The value to set to |
if the value is not a stack index
number of list elements
offsetGet(integer $key) : mixed
Retrieve the value in the list at the provided index
integer | $key | The index to the list item |
if the value is not a stack index
The value at the list index
bottom() : mixed|\Phabstractic\Data\Types\Phabstractic\Data\Types\None
Retrieve the 'bottom' of the list
Note: Does not 'shift' the value off the list
if no top exists
'Top' Value of List otherwise
bottomReference() : mixed|\Phabstractic\Data\Types\Phabstractic\Data\Types\None
Return the 'bottom' of the list as a reference
Note: Does not 'pop' the value off the list
if no top exists
'Top' Values as Reference of List