Deconstructs an authentication ini section key into a named array with authentication parts.

@param string $key INI section key as found in authentication.ini
@return array Array with named keys for controller, plugin and prefix
761724
public static function deconstructIniKey($key) {
		$res = [
			'plugin' => null,
			'prefix' => null
		];

		if (strpos($key, '.') !== false) {
			list($res['plugin'], $key) = explode('.', $key);
		}
		if (strpos($key, '/') !== false) {
			list($res['prefix'], $key) = explode('/', $key);
		}
		$res['controller'] = $key;
		return $res;
	}
26964
public function configHierarchical($key = null)
    {
        $config = [];
        $all = $this->config($key);
        if (! is_array($all)) $all = array($key => $all);
        foreach ($all as $_key => $_val) {
            $keys = explode('.', $_key);
            $value = &$config;
            while ($key = array_shift($keys)) {
                if ($keys) {
                    if (! isset($value[$key])) $value[$key] = [];
                    $value = &$value[$key];
                } else {
                    $value[$key] = $_val;
                }
            }
        }
        return $config;
    }
46296
protected function getOneByCompoundKey($key)
	{
		$sanitizedKey = [];

		// We can can potentially accept an associaitve or standard array.
		if($this->isAssociativeArray($key))
		{
			if(array_key_exists('entity_type', $key) &&  array_key_exists('entity_id', $key))
			{
				$sanitizedKey['entity_type'] = $key['entity_type'];
				$sanitizedKey['entity_id']   = $key['entity_id'];
			}
			else
			{
				return new Payload(null, 'insufficient_entity_key');
			}
		}
		else
		{
			$sanitizedKey['entity_type'] = $key[0];
			$sanitizedKey['entity_id']   = $key[1];
		}

		return $this->aggregate[$this->formatEntityType($sanitizedKey['entity_type'])]->get([['field' => 'id', 'value' => $sanitizedKey['entity_id'], 'operator' => '=', 'or' => false]]);
	}
380584
protected function removeTableFromKey(string $key): string
    {
        if (strpos($key, '.') === false) {
            return $key;
        }
        $keyParts = explode('.', $key);
        return array_pop($keyParts);
    }
959240
protected function _getCipherOb($key)
    {
        if (!is_string($key)) {
            throw new Horde_Secret_Exception('Key must be a string', Horde_Secret_Exception::KEY_NOT_STRING);
        }

        if (!strlen($key)) {
            throw new Horde_Secret_Exception('Key must be non-zero.', Horde_Secret_Exception::KEY_ZERO_LENGTH);
        }

        $key = substr($key, 0, 56);

        $idx = hash('md5', $key);
        if (!isset($this->_cipherCache[$idx])) {
            $this->_cipherCache[$idx] = new Horde_Crypt_Blowfish($key);
        }

        return $this->_cipherCache[$idx];
    }
1232438
public function delete($key, $section = null)
    {
        if (is_null($section)) {
            $pieces = explode('.', $key);
            $section = $pieces[0];
            $key = $pieces[1];
        }
        return $this->model->deleteSetting($section, $key);
    }
964284
protected function parseKey(&$key) {
        $key   =  trim($key);
        if(!is_numeric($key) && !preg_match('/[,\'\"\*\(\)\[.\s]/',$key)) {
           $key = '['.$key.']';
        }
        return $key;   
    }
475436
protected function parseArrayKey($key)
    {
        preg_match(static::ARRAY_KEY_PATTERN, $key, $matches);
        return (isset($matches['array_key']) ? $matches['array_key'] : null);
    }
771278
protected function parseNamespacedSegments($key)
    {
        [$namespace, $item] = explode('::', $key);

        // First we'll just explode the first segment to get the namespace and group
        // since the item should be in the remaining segments. Once we have these
        // two pieces of data we can proceed with parsing out the item's value.
        $itemSegments = explode('.', $item);

        $groupAndItem = array_slice(
            $this->parseBasicSegments($itemSegments), 1
        );

        return array_merge([$namespace], $groupAndItem);
    }
1229373
private function keyToName($key)
    {
        $parts = explode('_', $key);
        $name = '';

        foreach ($parts as $part) {
            $name .= ucfirst($part);
        }

        return $name;
    }
1207761
static function internalKey( $key )
    {
        $ini = eZINI::instance();
        $debug = $ini->variable( 'TemplateSettings', 'Debug' ) == 'enabled';
        if ( $debug )
            $key = $key . '-debug';
        else
            $key = $key . '-clean';
        return $key;
    }
910205
function clear($key) {
		if (!$this->dsn)
			return;
		$ndx=$this->prefix.'.'.$key;
		$parts=explode('=',$this->dsn,2);
		switch ($parts[0]) {
			case 'apc':
			case 'apcu':
				return call_user_func($parts[0].'_delete',$ndx);
			case 'redis':
				return $this->ref->del($ndx);
			case 'memcache':
				return memcache_delete($this->ref,$ndx);
			case 'memcached':
				return $this->ref->delete($ndx);
			case 'wincache':
				return wincache_ucache_delete($ndx);
			case 'xcache':
				return xcache_unset($ndx);
			case 'folder':
				return @unlink($parts[1].$ndx);
		}
		return FALSE;
	}
966597
public function remove($key) {
        $key = $this->secureKey($key);
        
        if (isset($_SESSION[$key])) unset($_SESSION[$key]);
        
        return $key;
    }
565663
public function remove($key)
    {
        $key = is_array($key) ? $key : [$key];
        $config = $this->data;
        $data = &$config;
        while ($key) {
            $k = array_shift($key);
            if (!$key) {
                unset($config[$k]);
                break;
            }
            $config[$k] = isset($config[$k]) ? $config[$k] : [];
            $config = &$config[$k];
        }
        $this->data = $data;
        return $this->save();
    }
1135656
private function tokenizeKey($key)
    {
        $containerName = $this->containerName;
        if (false === $this->multiContainerMode) {
            return [$containerName, $key];
        }

        if (false === ($index = strpos($key, '/'))) {
            throw new \InvalidArgumentException(sprintf(
                'Failed to establish container name from key "%s", container name is required in multi-container mode',
                $key
            ));
        }
        $containerName = substr($key, 0, $index);
        $key = substr($key, $index + 1);

        return [$containerName, $key];
    }
903007
protected function normalizeKey($key)
    {
        if ($this->normalization & static::NORMALIZE_TRIM) {
            $key = trim($key);
        }

        if ($this->normalization & static::NORMALIZE_DELIMITERS) {
            $key = static::normalizeKeyDelimiters($key);
        }

        if ($this->normalization & static::NORMALIZE_CASE) {
            $key = strtolower($key);
        }

        if ($this->normalization & static::NORMALIZE_CANONICAL) {
            $key = static::canonicalizeKey($key);
        }

        return $key;
    }
1094579
public function remove( $key )
	{
		$uri	= $this->getUriForKey( $key );
		unset( $this->data[$key] );
		return @unlink( $uri );
	}