105 public function __construct(array $array, $allowModifications =
false)
107 $this->_allowModifications = (boolean) $allowModifications;
108 $this->_loadedSection =
null;
110 $this->_data = array();
111 foreach ($array as $key =>
$value) {
115 $this->_data[$key] =
$value;
118 $this->_count =
count($this->_data);
128 public function get(
$name, $default =
null)
131 if (array_key_exists(
$name, $this->_data)) {
145 return $this->
get(
$name);
159 if ($this->_allowModifications) {
165 $this->_count =
count($this->_data);
168 #require_once 'Zend/Config/Exception.php'; 182 foreach ($this->_data as $key =>
$value) {
184 $array[$key] = clone
$value;
189 $this->_data = $array;
203 $array[$key] =
$value->toArray();
219 return isset($this->_data[
$name]);
231 if ($this->_allowModifications) {
232 unset($this->_data[
$name]);
233 $this->_count =
count($this->_data);
234 $this->_skipNextIteration =
true;
237 #require_once 'Zend/Config/Exception.php'; 260 $this->_skipNextIteration =
false;
271 return key($this->_data);
280 if ($this->_skipNextIteration) {
281 $this->_skipNextIteration =
false;
294 $this->_skipNextIteration =
false;
316 if(is_array($this->_loadedSection) &&
count($this->_loadedSection) == 1) {
317 $this->_loadedSection = $this->_loadedSection[0];
329 return $this->_loadedSection ===
null;
343 foreach($merge as $key =>
$item) {
344 if(array_key_exists($key, $this->_data)) {
370 $this->_allowModifications =
false;
371 foreach ($this->_data as $key =>
$value) {
405 public function setExtend($extendingSection, $extendedSection =
null)
407 if ($extendedSection ===
null && isset($this->_extends[$extendingSection])) {
408 unset($this->_extends[$extendingSection]);
409 }
else if ($extendedSection !==
null) {
410 $this->_extends[$extendingSection] = $extendedSection;
426 $extendedSectionCurrent = $extendedSection;
427 while (array_key_exists($extendedSectionCurrent, $this->_extends)) {
428 if ($this->_extends[$extendedSectionCurrent] == $extendingSection) {
430 #require_once 'Zend/Config/Exception.php'; 433 $extendedSectionCurrent = $this->_extends[$extendedSectionCurrent];
436 $this->_extends[$extendingSection] = $extendedSection;
449 if ($this->_loadFileErrorStr ===
null) {
450 $this->_loadFileErrorStr = $errstr;
452 $this->_loadFileErrorStr .= (PHP_EOL . $errstr);
466 if (is_array($firstArray) && is_array($secondArray)) {
467 foreach ($secondArray as $key =>
$value) {
468 if (isset($firstArray[$key])) {
474 $firstArray[$key] =
$value;
479 $firstArray = $secondArray;
setExtend($extendingSection, $extendedSection=null)
merge(Zend_Config $merge)
_loadFileErrorHandler($errno, $errstr, $errfile, $errline)
_assertValidExtend($extendingSection, $extendedSection)
__construct(array $array, $allowModifications=false)
_arrayMergeRecursive($firstArray, $secondArray)
if(!isset($_GET['name'])) $name