Get an option value either from console input, or the config files.

@param $key

@return array|mixed|string
181290
protected function getOptionOrConfig($key)
    {
        if ($option = $this->option($key)) {
            return $option;
        }

        return $this->config->get("laroute.{$key}");
    }
585230
public function getOption($key)
    {
        if (!isset($this->options[$key])) {
            throw InvalidOptionException::build([], ['option' => $key]);
        }

        return $this->options[$key];
    }
335228
public function getOption($key, $default = false)
    {
        if (!isset($this->args[$key])) {
            return $default;
        }
        $value = $this->args[$key];
        if (is_bool($value)) {
            return $value;
        }
        if (is_int($value)) {
            return (bool) $value;
        }
        if (is_string($value)) {
            $value = strtolower($value);
            if (static::booleanValue($value)) {
                return static::booleanValue($value);
            }
        }
        return $default;
    }
1094328
public static function getOption(string $key)
    {
        if (\array_key_exists($key, static::$options)) {
            return static::$options[$key];
        }

        static::validateOptions([$key => '']);
        static::$options[$key] = \ini_get('session.' . $key);

        if ($key === 'save_path' && empty(static::$options[$key])) {
            static::$options[$key] = '/tmp';
        }

        return static::$options[$key];
    }
1280700
public function getOption($key)
    {
        if (!isset($this->options[ $key ])) {
            throw new \OutOfBoundsException("Option {$key} is not set.");
        }

        return $this->options[ $key ];
    }
620958
public function get(string $key)
    {
        if (isset($this->App->Config->§options[$key])) {
            return $this->App->Config->§options[$key];
        } // Optimized. Values CAN be `null` however.

        // Else if the key does not exist at all, throw exception.
        if (!array_key_exists($key, $this->App->Config->§options)) {
            throw $this->c::issue(sprintf('Unknown option key: `%1$s`.', $key));
        }
        return null; // Default return value.
    }
1271847
public static function get($key = null)
    {
        if ($key) {
            $config = static::findBy(['key' => $key]);
            return $config ? $config->getValue() : '';
        } else {
            $config = [];
            foreach (static::all() as $c) {
                $config[$c->key] = $c->getValue();
            }
            return $config;
        }
    }
1296308
protected static function _getConfigByKey($key) {
		$dbConfig = self::_getEngine()->get($key);
		$fileConfig = Configure::read($key);
		if (!is_null($fileConfig)) {
			$dbConfig = Hash::mergeDiff((array)$dbConfig, $fileConfig);
		}

		return $dbConfig;
	}
716539
public function get($key)
    {
        $parts = explode('.', $key);
        $offset = $this->config;

        foreach($parts as $part) {
            if(!isset($offset[$part])) return null;

            $offset = $offset[$part];
        }

        return $offset;
    }
927456
public function find(string $key): Option
    {
        foreach ($this->repositories as $repository) {
            if ($repository->has($key)) {
                return $repository->find($key);
            }
        }

        throw UnknownOptionKey::fromKey($key);
    }
668617
protected function getConfigValue($key, $default = null)
    {
        if (Arr::has($this->normalizedConfig, $key)) {
            return Arr::get($this->normalizedConfig, $key);
        }

        return $this->getFallbackConfigValue($key, $default);
    }
1332200
public function get( $key, $default = null ) {
		$value = get_option( $this->option_key( $key ) );

		if ( false === $value ) {
			return $default;
		}

		return $value;
	}
1022883
public function getOption($key = null)
    {
        if (is_null($key)) {
            return $this->defaultParams;
        }

        return $this->defaultParams[$key];
    }
579964
public function getOption($key = null)
    {
        if (is_null($this->options)) {
            $this->preloadDefaults(true);
        }
        
        return $key === null ? $this->options : $this->options[$key];
    }
1056305
public function getOption($key)
    {
        if (!$this->hasOption($key)) {
            throw new InvalidException('Option '.$key.' does not exist');
        }

        return $this->_options[$key];
    }
1039487
public function getOption($key)
    {
        if (!\array_key_exists($key, $this->options)) {
            throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key));
        }

        $this->checkDeprecatedOption($key);

        return $this->options[$key];
    }
1006253
public function get($key)
    {
        $key = is_array($key) ? $key : [$key];
        $config = $this->data;
        while ($key) {
            $k = array_shift($key);
            $config = isset($config[$k]) ? $config[$k] : [];
        }
        return $config;
    }