Get the config content associated to given $key
$key has to be a configurable service

@param string $key
@param mixed $value
@return null|string
350068
protected function getContent($key, $value)
    {
        if (! $value instanceof ConfigurableService) {
            return null;
        }
        $content = $value->getHeader() . PHP_EOL . "return " . common_Utils::toHumanReadablePhpString($value) . ";" . PHP_EOL;
        return $content;
    }
738250
public function get(string $key)
    {
        return isset($this->_configValues[$key])
            ? $this->_configValues[$key]
            : null;
    }
27721
static function get($key, $default = null) {
    if (isset(Config::$values[$key])) {
      return Config::$values[$key];
    } else {
      if (Config::isEmpty()) {
        throw new ConfigException("Site configuration has not been initialised for '$key'");
      } else if ($default !== null) {
        return $default;
      } else {
        throw new ConfigException("No site configuration value found for '$key'");
      }
    }
  }
1219068
public function configSet($key, $value)
    {
        $keys = explode('.', $key);
        $this->loadConfigure($keys[0]);
        $config = &$this->config;

        while (count($keys) > 1) {
            $key = array_shift($keys);
            if (!isset($config[$key]) || ! is_array($config[$key])) {
                $config[$key] = [];
            }

            $config = &$config[$key];
        }

        $config[array_shift($keys)] = $value;

        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;
        }
    }
1207612
public function find($key, $value)
    {
        foreach ($this->items as $item) {
            if ($this->extractValue($item, $key) == $value) {
                return $item;
            }
        }
        return null;
    }
37404
public static function env($key, $value = null)
    {
        if (is_string($value) || is_bool($value) || is_numeric($value)) {
            self::$configs[$key] = $value;
        } elseif ($value === null && isset(self::$configs[$key])) {
            return self::$configs[$key];
        }
    }
1162176
public static function set($key, $value){
        $oSystemSetting = SystemSettingsQuery::create()->findOneBy("key",$key);
        $oSystemSetting->setKey($key);
        $oSystemSetting->setValue($value);
        $oSystemSetting->save();
        return $value;
    }
26189
public function getConfig($key) {
        return isset($this->_config[$key]) ? $this->_config[$key] : null;
    }
790031
private function getConfigurationValue($key1, $key2 = null)
    {
        //====================================================================//
        // Load Configuration from Configurator
        $config = $this->getConfiguration();
        //====================================================================//
        // Check Configuration is Valid
        if (!is_array($config) || empty($config)) {
            return null;
        }
        //====================================================================//
        // Check Main Configuration Key Exists
        if (!isset($config[$key1])) {
            return null;
        }
        //====================================================================//
        // Check Second Configuration Key Required
        if (is_null($key2)) {
            return $config[$key1];
        }
        //====================================================================//
        // Check Second Configuration Key Exists
        return isset($config[$key1][$key2]) ? $config[$key1][$key2] : null;
    }
435643
public function setConfigVariable($key, $value)
    {

        if (!$key) {
            return false;
        }

        $this->setting->$key = $value;

        return $this;
    }
818063
public function getConfig($key = null) {
		$results = $this->_getConfig($key);
		if (empty($results)) {
			return $results;
		}

		$event = new CakeEvent('Model.afterFind', $this, [$results, true, $key]);
		$event->modParams = 0;
		$this->getEventManager()->dispatch($event);

		return $event->result;
	}
593995
public static function key($key, $value = null)
  {
    if ($value == null) return $_SESSION[$key];

    $_SESSION[$key] = $value;
  }
548230
public function set($key, $value)
    {
        $config = $this->data;
        if (!$key) {
            $config = array_merge($config, $value);
        }
        $key = is_array($key) ? $key : [$key];

        $data = &$config;
        while ($key) {
            $k = array_shift($key);
            $config[$k] = isset($config[$k]) ? $config[$k] : [];
            $config[$k] = $key
                ? $config[$k]
                : (is_array($value)
                    ? array_merge($config[$k], $value)
                    : $value);
            $config = &$config[$k];
        }
        $this->data = $data;
        return $this->save();
    }
257662
protected function getOrSetParam($key, $value = null)
    {
        if (is_null($value)) {
            return $this->params[$key];
        }

        $this->params[$key] = $value;

        return $this;
    }
1109165
public function getConfig($key = null) 
    {	
    	if($key!=null && isset($this->_config[$key])) { 
    		
    		return $this->_config[$key];
    	
    	} elseif($key == null) {
    		
            return $this->_config;
    	}

        return null;
    }
339901
public function setConfig($key, $value)
    {
        $keys = is_array($key) ? $key : [$key => $value];
        foreach ($keys as $key => $value) {
            Arr::set($this->configData, $key, $value);
        }
        return $this;
    }