芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/cepali/lib/horde/framework/Horde/Support/CaseInsensitiveArray.php
* @category Horde * @copyright 2013-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD * @package Support */ class Horde_Support_CaseInsensitiveArray extends ArrayIterator { /** */ public function offsetGet($offset) { return (is_null($offset = $this->_getRealOffset($offset))) ? null : parent::offsetGet($offset); } /** */ public function offsetSet($offset, $value) { if (is_null($roffset = $this->_getRealOffset($offset))) { parent::offsetSet($offset, $value); } else { parent::offsetSet($roffset, $value); } } /** */ public function offsetExists($offset) { return !is_null($offset = $this->_getRealOffset($offset)); } /** */ public function offsetUnset($offset) { if (!is_null($offset = $this->_getRealOffset($offset))) { parent::offsetUnset($offset); } } /** * Determines the actual array offset given the input offset. * * @param string $offset Input offset. * * @return string Real offset or null. */ protected function _getRealOffset($offset) { /* Optimize: check for base $offset in array first. */ if (parent::offsetExists($offset)) { return $offset; } foreach (array_keys($this->getArrayCopy()) as $key) { if (strcasecmp($key, $offset) === 0) { return $key; } } return null; } }