Pushs a value into the registry.

@param string $key      The registry key to store the value in
@param mixed  $data     The data to store
@param bool   $override (optional) Whether to override existing keys

@return mixed
778788
public function push(string $key, $data, bool $override = false)
    {
        if (!array_key_exists($key, $this->data) || $override) {
            $this->data[$key] = $data;

            return $this->data[$key];
        }

        return false;
    }
430471
public function copy($source, $overrides = [])
    {
        $this->sourceId = $source;
        return $this->sync($overrides) ? $this : null;
    }
27776
public function post($key)
    {
        if ($this->has('post') && isset($this->data['post'][$key]) === true) {
            return $this->data['post'][$key];
        }
        return $key;
    }
904545
public function encrypt($data, $key) {
        if ($data === '') {
            return $data;
        }

        $cipher = $this->createCipher($key);

        $encrypted = mcrypt_generic($cipher, $data);

        $this->clearCipher($cipher);

        return $encrypted;
    }
70315
public function put($key, $data)
    {
        $filename = $this->getKeyCode($key);
        $data = json_encode($data);
        $this->write($data, $filename);
    }
490596
private static function recursiveGetFromKey($data, $key, $default)
    {
        if (empty($key)) {
            return $data;
        } else {
            $currentKey = array_shift($key);
            return isset($data[$currentKey]) ? self::recursiveGetFromKey($data[$currentKey], $key, $default) : $default;
        }
    }
732390
public function setSubmitted($key, $data)
    {
        if (isset($key)) {
            gplcart_array_set($this->submitted, $key, $data);
            return $this->submitted;
        }

        return $this->submitted = (array) $data;
    }
1035294
public function save( $data, $key ) {
		$data->license_status = true;

		// We can update the available status transient since we know the server was reached.
		// @todo move this into the Call class since it's the earliest point of access.
		set_site_transient( 'boldgrid_available', 1, 2 * MINUTE_IN_SECONDS );

		// We update transient with the response of the API check version call.
		set_site_transient( 'boldgrid_api_data', $data, 8 * HOUR_IN_SECONDS );

		// Update the key option in case key is being overridden by something else so we have the new one next time.
		update_site_option( 'boldgrid_api_key', $key );

		// Updates the site hash identifier being stored.
		update_site_option( 'boldgrid_site_hash', $data->result->data->site_hash );

		// This looks for any reseller entries that exist and saves the wp option.
		$this->saveReseller( $data->result->data );


		// Returns back the transient data object.
		return $data;
	}
1058815
protected function overrideConfig(array $override, Repository $config, Settings $settings, Dispatcher $dispatcher)
    {
        foreach ($override as $key => $settingKey) {
            $configKey = is_string($key) ? $key : $settingKey;

            $dispatcher->fire("settings.overriding: {$configKey}", [$configKey, $settingKey]);

            $settingValue = $settings->get($settingKey);
            $configValue = $config->get($configKey);

            $config->set($configKey, $settingValue);

            $dispatcher->fire("settings.override: {$configKey}", [
                $configKey, $configValue, $settingKey, $settingValue
            ]);
        }
    }
1026508
public static function moveKeyToEnd(array $data, $key)
    {
        if (array_key_exists($key, $data)) {
            $data += array_splice($data, array_search($key, array_keys($data)), 1);
        }

        return $data;
    }
311958
public function overwrite($key, $value=null)
    {
        if (!is_array($key)) {
            $this->overwrittenData[$key] = $value;
            return $this;
        }

        foreach ($key as $k=>$v) {
            $this->overwrite($k, $v);
        }

        return $this;
    }
1298463
public function setParameter(String $key, $value, Bool $override=false)
	{
		if ($this->getParameter($key)) {
			$defValue = $this->getParameter($key);
			$this->parameters[$key] = [$defValue];
			$this->parameters[$key][] = $value;
			return;
		}

		$this->parameters[$key] = $value;
	}
478317
public static function getValueByKey($data, $key = null, $default = null)
    {
        if (!isset($key) || empty($key)) {
            return $data;
        }

        if (is_array($key)) {
            $keys = $key;
        } else {
            $keys = explode('.', $key);
        }

        $item = $data;
        foreach ($keys as $keyName) {
            if (is_array($item)) {
                if (isset($item[$keyName])) {
                    $item = $item[$keyName];
                } else {
                    return $default;
                }
            } else if (is_object($item)) {
                if (isset($item->$keyName)) {
                    $item = $item->$keyName;
                } else {
                    return $default;
                }
            }

        }

        return $item;
    }
571826
public function modifyCacheKey($cacheKey, $override = false)
    {
        if ($override) {
            $this->_sCacheKey = $cacheKey . "|i18n";
        } else {
            $this->_sCacheKey .= $cacheKey;
        }

        if (!$cacheKey) {
            $this->_sCacheKey = null;
        }
    }
186848
public function update($data, $override = null)
    {
        if (func_num_args() == 2) {
            $override['id'] = $data;
            $data = $override;
        }

        $response = $this->ontraport->put(
            $this->getNamespace(), $this->toArray($data)
        );

        return $this->ontraport->item($this, $response);
    }
64665
protected function setTemplateData(array $overrides = [])
    {
        if (empty($overrides['template_data'])) {
            $this->templateData = [];
        } else {
            $this->templateData = $overrides['template_data'];
            $overrides = array_diff_key($overrides, ['template_data' => []]);
        }

        return $overrides;
    }
200944
public function set( $key, $value, $overwrite = true )
    {
        Option::set( $this->_map, $this->_hashKey( $key ), $value, $overwrite );

        return $this;
    }