Parses the language key.

@param  string $key Language key
@return array
550128
protected function parseKey(string $key): array
	{
		return (strpos($key, '.') === false) ? [$key, null] : explode('.', $key, 2);
	}
1188336
protected function parseData(string $key) : array
    {
        if (file_exists($this->getPath($key))) {
            $rawData = json_decode(file_get_contents($this->getPath($key)), true);
            $parsedData = ['d' => unserialize($rawData['d']), 't' => $rawData['t']];
        } else {
            $parsedData = ['d' => null, 't' => 0];
        }

        if (time() > $parsedData['t']) {
            $this->delete($key);

            return ['d' => null, 't' => 0];
        }

        return $parsedData;
    }
293618
protected function extractKeyValues($key) {
        $formattedKey = substr(str_replace("L_", "", $key), 0, -preg_match_all( "/[0-9]/", $key ));
        return array(
            substr($key, -preg_match_all( "/[0-9]/", $key )),
            $this->getMappedKeyName($formattedKey),
            $formattedKey
        );
    }
549351
protected function parseKey($key)
    {
        if (0 === strpos($key, '__TABLE__.')) {
            list($collection, $key) = explode('.', $key, 2);
        }

        if ('id' == $key && $this->connection->getConfig('pk_convert_id')) {
            $key = '_id';
        }

        return trim($key);
    }
990720
public function parseKey($key)
    {
        $keys = explode('.', $key);

        $keys = [implode(".", array_slice($keys, 0, -1)), $keys[count($keys) - 1]];

        $key = (new Collection($keys))->map(function ($part) {
            return '`'.$part.'`';
        })->implode('.');

        return DB::raw($key);
    }
273501
protected function getParentChildKeys($key)
    {
        $parts = explode('.', $key);
        $child = array_pop($parts);
        return [implode('.', $parts), $child];
    }
1035115
protected function _convertKeyNames($key)
    {
        if (array_key_exists($key, self::$_cacheKeys)) {
            return self::$_cacheKeys[$key];
        }

        $convertedKey = strtolower(
            preg_replace('/(.)([A-Z0-9])/', "$1_$2", $key)
        );
        self::$_cacheKeys[$key] = $convertedKey;
        return $convertedKey;
    }
826501
function getTranslation(string $key, array $replacements = array()) {
        if(isset($this->translations[$key])) {
            $lang = $this->translations[$key];
            
            if(!empty($replacements)) {
                foreach($replacements as $key => $val) {
                    $lang = \str_replace($key, $val, $lang);
                }
            }
            
            return $lang;
        }
        
        return $key;
    }
966184
protected function lang($key)
    {
        if (count($this->language) < 1) {
            $this->setLanguage('en'); // set the default language
        }

        if (isset($this->language[$key])) {
            return $this->language[$key];
        } else {
            return 'Language string failed to load: ' . $key;
        }
    }
505027
protected function parseNamespacedSegments($key)
    {
        list($namespace, $item) = explode('::', $key);

        // If the namespace is registered as a package, we will just assume the group
        // is equal to the namespace since all packages cascade in this way having
        // a single file per package, otherwise we'll just parse them as normal.
        if (in_array($namespace, $this->packages)) {
            return $this->parsePackageSegments($key, $namespace, $item);
        }

        // Next 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);
    }
94254
protected function parseSubkeys($key) {
        $k          = $key;
        $subkeys    = [];
        $quoteChars = ["'", '"'];                       // single and double quotes

        while (true) {
            $k = trim($k);

            foreach ($quoteChars as $char) {
                if (strpos($k, $char) === 0) {          // subkey starts with a quote char
                    $pos = strpos($k, $char, 1);        // find the ending quote char
                    if ($pos === false) throw new InvalidArgumentException('Invalid argument $key: '.$key);
                    $subkeys[] = substr($k, 1, $pos-1);
                    $k         = trim(substr($k, $pos+1));
                    if (!strlen($k))                    // last subkey or next char is a key separator
                        break 2;
                    if (strpos($k, '.') !== 0) throw new InvalidArgumentException('Invalid argument $key: '.$key);
                    $k = substr($k, 1);
                    continue 2;
                }
            }

            // key is not quoted
            $pos = strpos($k, '.');                     // find next key separator
            if ($pos === false) {
                $subkeys[] = $k;                        // last subkey
                break;
            }
            $subkeys[] = trim(substr($k, 0, $pos));
            $k         = substr($k, $pos+1);            // next subkey
        }
        return $subkeys;
    }
837610
public function getNameByKey($key)
    {
        return (array_key_exists($key, $this->_languages)) ? $this->_languages[$key] : null;
    }
286078
public function getAbsoluteConfigKey($key) {
        $prefix = null;
        $parser = $this->getConfigParser();
        $steps = explode('.', $key);
        $config = $this->config;

        foreach ($steps as $step) {
            if ( ! is_array($config)) {
                break;
            }

            array_shift($steps);
            $config = array_get($config, $step);

            if ($parser->isReference($config)) {
                array_unshift($steps, $parser->parseReferencePath($config));
                $config = implode('.', $steps);

                return $this->getAbsoluteConfigKey($config);
            }
        }

        return $key;
    }
149765
protected function parseNamespacedSegments($key)
    {
        list($namespace, $item) = explode('::', $key);

        // If the namespace is registered as a package, we will just assume the group
        // is equal to the namespace since all packages cascade in this way having
        // a single file per package, otherwise we'll just parse them as normal.
        if (array_key_exists($namespace, $this->packages)) {
            return $this->parsePackageSegments($key, $namespace, $item);
        }

        return parent::parseNamespacedSegments($key);
    }
1229041
public function getMessageForAllLanguages($key, $lang = null) {
		
		if (!$this->messages) {
			$this->loadAllMessages();
		}
		
		$messageArray = array();
		foreach ($this->messages as $language=>$messageLanguage) {
			if(is_null($lang) || $lang == "")
				$messageArray[$language] = $messageLanguage->getMessage($key);
			elseif($lang == $language)
				$messageArray[$language] = $messageLanguage->getMessage($key);
		}
		return $messageArray;
	}
1104076
function parse($key = '') {
    global $messageStack;

    if (isset($_FILES[$this->file])) {
      if (zen_not_null($key)) {
        $file = array('name' => $_FILES[$this->file]['name'][$key],
        'type' => $_FILES[$this->file]['type'][$key],
        'size' => $_FILES[$this->file]['size'][$key],
        'tmp_name' => $_FILES[$this->file]['tmp_name'][$key]);
      } else {
        $file = array('name' => $_FILES[$this->file]['name'],
        'type' => $_FILES[$this->file]['type'],
        'size' => $_FILES[$this->file]['size'],
        'tmp_name' => $_FILES[$this->file]['tmp_name']);
      }
    } elseif (isset($GLOBALS['HTTP_POST_FILES'][$this->file])) {
      global $HTTP_POST_FILES;

      $file = array('name' => $HTTP_POST_FILES[$this->file]['name'],
      'type' => $HTTP_POST_FILES[$this->file]['type'],
      'size' => $HTTP_POST_FILES[$this->file]['size'],
      'tmp_name' => $HTTP_POST_FILES[$this->file]['tmp_name']);
    } else {
      $file = array('name' => (isset($GLOBALS[$this->file . '_name']) ? $GLOBALS[$this->file . '_name'] : ''),
      'type' => (isset($GLOBALS[$this->file . '_type']) ? $GLOBALS[$this->file . '_type'] : ''),
      'size' => (isset($GLOBALS[$this->file . '_size']) ? $GLOBALS[$this->file . '_size'] : ''),
      'tmp_name' => (isset($GLOBALS[$this->file]) ? $GLOBALS[$this->file] : ''));
    }
    //if (!zen_not_null($file['tmp_name'])) return false;
    //if ($file['tmp_name'] == 'none') return false;
    //if (!is_uploaded_file($file['tmp_name'])) return false;

// not working at this time to test for server limit error
    if (!is_uploaded_file($file['tmp_name'])) {
      if ($this->message_location == 'direct') {
        $messageStack->add_session('header', WARNING_NO_FILE_UPLOADED, 'warning');
      } else {
        $messageStack->add_session('upload', WARNING_NO_FILE_UPLOADED, 'warning');
      }
      return false;
    }

    if ( zen_not_null($file['tmp_name']) && ($file['tmp_name'] != 'none') && is_uploaded_file($file['tmp_name']) ) {
      if (zen_not_null($file['size']) and ($file['size'] > MAX_FILE_UPLOAD_SIZE)) {
        if ($this->message_location == 'direct') {
          $messageStack->add_session('header', ERROR_FILE_TOO_BIG, 'error');
        } else {
          $messageStack->add_session('upload', ERROR_FILE_TOO_BIG, 'error');
        }
        return false;
      }
      if (substr($file['name'], -9) == '.htaccess' || (sizeof($this->extensions) > 0 && !in_array(strtolower(substr($file['name'], strrpos($file['name'], '.')+1)), $this->extensions))) {
          if ($this->message_location == 'direct') {
            $messageStack->add_session('header', ERROR_FILETYPE_NOT_ALLOWED . ' ' . UPLOAD_FILENAME_EXTENSIONS, 'error');
          } else {
            $messageStack->add_session('upload', ERROR_FILETYPE_NOT_ALLOWED . ' - ' . UPLOAD_FILENAME_EXTENSIONS, 'error');
          }
          return false;
      }

      $this->set_file($file);
      $this->set_filename($file['name']);
      $this->set_tmp_filename($file['tmp_name']);

      return $this->check_destination();
    } else {
      if ($this->message_location == 'direct') {
        $messageStack->add_session('header', WARNING_NO_FILE_UPLOADED, 'warning');
      } else {
        $messageStack->add_session('upload', WARNING_NO_FILE_UPLOADED, 'warning');
      }
      return false;
    }
  }
223610
protected function parse_key($key)
    {
        $ekey = new enigma_key();

        foreach ($key->getUserIds() as $idx => $user) {
            $id = new enigma_userid();
            $id->name    = $user->getName();
            $id->comment = $user->getComment();
            $id->email   = $user->getEmail();
            $id->valid   = $user->isValid();
            $id->revoked = $user->isRevoked();

            $ekey->users[$idx] = $id;
        }

        $ekey->name = trim($ekey->users[0]->name . ' <' . $ekey->users[0]->email . '>');

        // keep reference to Crypt_GPG's key for performance reasons
        $ekey->reference = $key;

        foreach ($key->getSubKeys() as $idx => $subkey) {
            $skey = new enigma_subkey();
            $skey->id          = $subkey->getId();
            $skey->revoked     = $subkey->isRevoked();
            $skey->created     = $subkey->getCreationDate();
            $skey->expires     = $subkey->getExpirationDate();
            $skey->fingerprint = $subkey->getFingerprint();
            $skey->has_private = $subkey->hasPrivate();
            $skey->algorithm   = $subkey->getAlgorithm();
            $skey->length      = $subkey->getLength();
            $skey->usage       = $subkey->usage();

            $ekey->subkeys[$idx] = $skey;
        };

        $ekey->id = $ekey->subkeys[0]->id;

        return $ekey;
    }