/** * Load item from configs * * Warn: Recursive function * * @param \Directory $parentDirectory * The parent directory */ protected function load($parentDirectory) { while (false !== ($entry = $parentDirectory->read())) { if ($entry !== '.' && $entry !== '..') { if (is_dir($entry)) { $tmpD = dir($entry); $this->load($tmpD); $tmpD->close(); } else { if (substr($entry, -strlen('.php')) === '.php') { $this[substr($entry, 0, -strlen('.php'))] = (include $this->getPath() . $entry); } } } } }