Adds a new class constant

@param string $name
@param string $value

@return void
@throws \Exception
420904
public function addConstant($name, $value) {
        $constants = $this->getConstants();
        if(array_key_exists($name, $constants)) {
            throw new \Exception('Constant Already Exists: ' . $name);
        }
        $constants[$name] = $value;
        asort($constants);
        $this->setConstants($constants);
    }
560257
public function setParam($name, $value) {
        if (in_array($name, $this->_textParamNames)) {
            $this->_setTextParam($name, $value);
        } else if (in_array($name, $this->_rawParamNames)) {
            $this->_setRawParam($name, $value);
        } else {
            throw new CPS_Exception(array(array('long_message' => 'Invalid request parameter', 'code' => ERROR_CODE_INVALID_PARAMETER, 'level' => 'REJECTED', 'source' => 'CPS_API')));
        }
    }
535152
public function addToClass($name, $value)
    {
        if ($value instanceof ContributorInterface) {
            $value->contributeToClass($name, $this);
        } else {
            $this->_nonModelfields[$name] = $value;
        }
    }
286511
public function addAttr($name, $value)
    {
        if (!in_array($name, $this->attributes)) {
            $this->attributes[$name] = $value;
        }
        return $this;
    }
510329
public function offsetSet($name, $value)
    {
        if (is_int($name)) {
            parent::offsetSet($name, $value);
            // @codeCoverageIgnoreStart
            // This will never be reached, because an exception is always
            // thrown.
            return;
            // @codeCoverageIgnoreEnd
        }

        $param = new Parameter($this->root, $name, $value);
        $this->parameters[$param->name] = $param;
    }
52998
public function addAttribute($name, $value) {
        $this->setVariable(self::ATTRIBUTES, $this->addValue($this->getVariable(self::ATTRIBUTES), $this->assembleAssignmentString($name, $value)));
    }
174465
public function addAttribute($name, $value)
    {
        if ($name === 'class') {
            $this->addAttributeClass($value);
        } elseif ($name === 'style') {
            $value = rtrim($value, ';') . ';';
            $value = explode(';', $value);
            $value = array_filter($value);

            foreach ($value as $style) {
                if (preg_match_all("/(.*)(: )(.*)/", $style, $match)) {
                    $this->addAttributeStyle($match[ 1 ][ 0 ], $match[ 3 ][ 0 ]);
                } elseif (preg_match_all("/(.*)(:)(.*)/", $style, $match)) {
                    $this->addAttributeStyle($match[ 1 ][ 0 ], $match[ 3 ][ 0 ]);
                }
            }
        } elseif (is_string($value)) {
            $this->storage[ $name ] = trim($value);
        } else {
            $this->storage[ $name ] = $value;
        }

        return $this;
    }
491937
public function set($name, $value)
    {
        if (is_array($value)) {
            $value = new ObjectConfig($value);
        }

        parent::set($name, $value);
    }
533716
public function addScriptConstant($name, $value = null)
    {
        if ($name instanceof ScriptConstant) {
            $scriptConstant = $name;
        } else {
            $scriptConstant = new ScriptConstant($name, $value);
        }
        if (!in_array($scriptConstant, $this->constants)) {
            array_push($this->constants, $scriptConstant);
        }
        return $this;
    }
648026
public static function set($name, $value) {
		
		// instance of the singleton
		$self = static::getInstance();
		
		// populate all the options by reading db once
		$self->checkPopulated();
		
		// check if named option exists
		try {
			
			if (!array_key_exists($name, $self->list)) {
				throw new \Exception('Cannot write the value of option “'. $name .'” as it doesn’t exist.');
			}
				
			switch ($self->list[$name]->type) {
				
				case 'bool';
					$value = $value ? 1 : 0;
					break;
					
				case 'password':
					if ($self->isCryptAvailable()) {
						$value = openssl_encrypt($value, 'AES128', OPTIONS_CRYPT_KEY); 
					} else {
						throw new \Exception('OPTIONS_CRYPT_KEY constant must be defined into config.php file.');
					}
					break;
					
			}

			// update the value into db
			Database::run('UPDATE `options` SET `value` = ? WHERE `name` = ?', [$value, $name]);
			
			// update value into the singleton object
			$self->list[$name]->value = $value;
			
		} catch(\Exception $e) {
			
			$app = Application::getInstance();
			$app->logWarning($e->getMessage());
			
		}
		
	}
961253
public function addParam($name, $value)
    {
        if (!empty($name) && !empty($value)) {
            $this->params[stripslashes(trim($name))] = stripslashes(trim($value));
        }
    }
367228
public static function SetClassVar ($name, $value, $const_flag = false) {
		$name_key = implode('=>', (array) $name);
		if ($const_flag && isset(static::$_ClassVariableTrait_ConstList[$name_key])) {
			throw CoreException::RaiseSystemError('%s is constant', [$name_key]);
		}
		if (is_array($name)) {
			static::$_ClassVariableTrait_Data = Arrays::SetLowest(static::$_ClassVariableTrait_Data, $name, $value);
		} else {
			static::$_ClassVariableTrait_Data[$name] = $value;
		}

		static::$_ClassVariableTrait_ConstList[$name_key] = $const_flag;
	}
921305
public function addExtraConfiguration($name, $value)
    {
        $name = $this->resolveString($name, __METHOD__);
        $this->extraConfiguration[$name] = $value;

        return $this;
    }
176694
protected function setAttribute(string $name, $value) : void
    {
        // Convert values
        switch ($name) {
            case 'name':
                // no break here
            case 'value':
                $value = (string) $value;
                break;
            case 'prefixed':
                $value = (boolean) $value;
                break;
        }

        $this->$name = $value;
    }
868465
public function addConfigurationSetting($name, $value)
    {
        $this->checkConnectionUp("Cannot set configuration once a connection is made with the server.")
            ->configurator->set($name, $value);

        return $this;
    }
1252561
protected function addResponseHeader(string $name, string $value = '') : void
    {
        $this->response = $this->response->withAddedHeader($name, $value);
    }
1334546
public function addConstant($name, $value)
    {
        if (is_numeric($value)) {
            $value = (float)$value;
        }
        $this->_constants[$name] = $value;
        return $this;
    }