Get initialization script.

@param bool $defaultValues
@return string
4154
public function getScriptInitialization($defaultValues = false)
    {
        $scriptContent = '';
        foreach ($this->variables as $variable) {
            $scriptContent .= $variable->getScriptDeclaration()."\n";
            if ($defaultValues) {
                $scriptContent .= $variable->getScriptValueSet()."\n";
            }
        }

        $scriptContent .= $this->checkVariable->getScriptDeclaration()."\n";
        $scriptContent .= $this->checkOldVariable->getScriptDeclaration()."\n";
        $scriptContent .= $this->checkWindow->getScriptDeclaration()."\n";
        $scriptContent .= "declare check_original = ".$this->checkWindow->getInitialValue().";\n";

        if ($defaultValues) {
            $scriptContent .= $this->checkVariable->getScriptValueSet()."\n";
            $scriptContent .= $this->checkOldVariable->getScriptValueSet()."\n";
            $scriptContent .= $this->checkWindow->getScriptValueSet()."\n";
        }

        return $scriptContent;
    }
877864
public static function getDefault()
    {
        if ((self::$compatibilityMode === true) or (func_num_args() > 0)) {
            if (!self::$_breakChain) {
                self::$_breakChain = true;
                trigger_error('You are running Zend_Locale in compatibility mode... please migrate your scripts', E_USER_NOTICE);
                $params = func_get_args();
                $param = null;
                if (isset($params[0])) {
                    $param = $params[0];
                }
                return self::getOrder($param);
            }

            self::$_breakChain = false;
        }

        return self::$_default;
    }
752014
public function createFakeRow(array $fieldConfiguration, array $defaultValues = array()) {
        // TODO For now, filter primary keys, assuming they will be auto-generated by the database.
        $exclude = f\either(f\prop('primary'), f\prop_equals('origin', 'relation'));
        $configWithoutPks = f\filter(f\not($exclude), $fieldConfiguration);
        $self = $this;
        return f\reduce(
            function ($out, $field) use ($self) {
                $fieldName = $field['name'];
                if (array_key_exists($fieldName, $out)) {
                    return $out;
                }
                $out[$fieldName] = $self->getFakeValueForField($field);
                return $out;
            },
            $defaultValues,
            $configWithoutPks
        );
    }
116182
public function setInitFormValues(array $values) {

		$this->initFormValues = $values;

		foreach($values as $name => $value) {
			if(isset($this->elements[$name]) && is_object($this->elements[$name])) {

				if($this->elements[$name] instanceof CheckboxElement) {
					if(empty($this->requestValues)) {
						$this->elements[$name]->setChecked($this->elements[$name]->getValue() == $value);
					}
					else {
						$this->elements[$name]->setChecked(!is_null($this->requestValues->get($name)));
					}
				}

				else if(is_null($this->elements[$name]->getValue())) {
					$this->elements[$name]->setValue($value);
				}
			}
		}

		return $this;

	}
1063379
function $$getDefaultValue() {
      if (!injector) throw new Error("Injectable functions cannot be called at configuration time");
      var defaultValue = injector.invoke(config.$$fn);
      if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))
        throw new Error("Default value (" + defaultValue + ") for parameter '" + self.id + "' is not an instance of Type (" + self.type.name + ")");
      return defaultValue;
    }
1126628
public function getDefault(string $type)
    {
        switch ($type) {
            case self::TYPE_NULL:
                return null;
            case self::TYPE_BOOLEAN:
                return false;
            case self::TYPE_INTEGER:
            case self::TYPE_FLOAT:
                return 0;
            case self::TYPE_STRING:
            case self::TYPE_BINARY:
                return '';
            case self::TYPE_ARRAY:
            case self::TYPE_OBJECT:
                return [];
        }

        throw new InvalidValueException("Invalid value type: $type");
    }
429070
protected function _getDefaultValues()
    {
        $teamComponent = $this->_data->parent->parent->parent;
        if (Kwc_Abstract::hasSetting($teamComponent->componentClass, 'defaultVcardValues')) {
            $setting = Kwc_Abstract::getSetting($teamComponent->componentClass, 'defaultVcardValues');
        }

        if (isset($setting)) {
            return $setting;
        } else {
            return Kwc_Abstract::getSetting($this->_data->componentClass, 'defaultVcardValues');
        }
    }
794222
public function getDefaultValuesForProperties()
    {
        $this->initialize();
        if (!isset($this->fullConfiguration['properties'])) {
            return [];
        }

        $defaultValues = [];
        foreach ($this->fullConfiguration['properties'] as $propertyName => $propertyConfiguration) {
            if (isset($propertyConfiguration['defaultValue'])) {
                $type = isset($propertyConfiguration['type']) ? $propertyConfiguration['type'] : '';
                switch ($type) {
                    case 'DateTime':
                        $defaultValues[$propertyName] = new \DateTime($propertyConfiguration['defaultValue']);
                    break;
                    default:
                        $defaultValues[$propertyName] = $propertyConfiguration['defaultValue'];
                }
            }
        }

        return $defaultValues;
    }
564484
public function getPhpDefaultValue()
    {
        if (null === $this->defaultValue) {
            return null;
        }

        if ($this->defaultValue->isExpression()) {
            throw new EngineException('Cannot get PHP version of default value for default value EXPRESSION.');
        }

        if (in_array($this->mappingType, [ PropelTypes::BOOLEAN, PropelTypes::BOOLEAN_EMU ])) {
            return $this->booleanValue($this->defaultValue->getValue());
        }

        if (PropelTypes::PHP_ARRAY === $this->mappingType) {
            return $this->getDefaultValueForArray($this->defaultValue->getValue());
        }
        if (PropelTypes::SET === $this->mappingType) {
            return $this->getDefaultValueForSet($this->defaultValue->getValue());
        }

        return $this->defaultValue->getValue();
    }
711589
protected function getConfig($key, $defaultValue = null)
    {
        $config = $this->readConfig();
        
        return isset($config[$key]) ? $config[$key] : $defaultValue;
    }
332724
public function getVariable($variableName, $defaultValue = null)
    {
        return isset($this->variables[$variableName]) ?
            $this->variables[$variableName] : $defaultValue;
    }
1341040
public function postProcessFormValues(array $formValues)
    {
        $settings = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS,
            'Lightwerk.SurfCaptain');
        $driver = $settings['sources']['default']['driver'];
        $repositories = Arrays::trimExplode(',', $formValues['repositories']);
        // reset
        $this->distributionSettings['Lightwerk']['SurfCaptain']['sources']['default']['repositories'] = [];
        for ($i = 0; $i < count($repositories); $i++) {
            $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings,
                'Lightwerk.SurfCaptain.sources.default.repositories.' . $i, $repositories[$i]);
        }
        $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings,
            'Lightwerk.SurfCaptain.sources.default.privateToken', $formValues['privateToken']);
        switch ($driver) {
            case 'GitHub':
                $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings,
                    'Lightwerk.SurfCaptain.sources.default.accountName', 'git@github.com');
                $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings,
                    'Lightwerk.SurfCaptain.sources.default.apiUrl', 'https://api.github.com/');
                break;
            case 'GitLab':
                $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings,
                    'Lightwerk.SurfCaptain.sources.default.accountName', $formValues['accountName']);
                $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings,
                    'Lightwerk.SurfCaptain.sources.default.apiUrl', $formValues['apiUrl']);
                break;
            case 'BitBucket':
                $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings,
                    'Lightwerk.SurfCaptain.sources.default.accountName', $formValues['accountName']);
                $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings,
                    'Lightwerk.SurfCaptain.sources.default.apiUrl', 'https://api.bitbucket.org/2.0/');
                $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings,
                    'Lightwerk.SurfCaptain.sources.default.fallbackApiUrl', 'https://api.bitbucket.org/1.0/');
                $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings,
                    'Lightwerk.SurfCaptain.sources.default.privateSecret', $formValues['privateSecret']);
                $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings,
                    'Lightwerk.SurfCaptain.sources.default.accessToken', $formValues['accessToken']);
                $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings,
                    'Lightwerk.SurfCaptain.sources.default.accessSecret', $formValues['accessSecret']);
                break;
            default:
                throw new SetupException('Unknown driver ' . $driver, 1427623122);
        }
        $this->configurationSource->save(FLOW_PATH_CONFIGURATION . ConfigurationManager::CONFIGURATION_TYPE_SETTINGS,
            $this->distributionSettings);
    }
1261088
public function getSession($name = null, $defaultValue = null)
    {
        if ($name === null) {
            return $_SESSION;
        }
        return (isset($_SESSION[$name])) ? $_SESSION[$name] : $defaultValue;
    }
14183
public static function getVar(string $name, $defaultValue = null)
    {
        $value = getenv($name);
        return $value !== false ? $value : $defaultValue;
    }
1369785
protected function extractDefault($defaultValue)
	{
		if(strncmp($this->dbType,'bit',3)===0)
			$this->defaultValue=bindec(trim($defaultValue,'b\''));
		elseif(($this->dbType==='timestamp' || $this->dbType==='datetime')  && ($defaultValue==='CURRENT_TIMESTAMP' || $defaultValue==='current_timestamp()'))
			$this->defaultValue=null;
		else
			parent::extractDefault($defaultValue);
	}
331083
public function getSetting($key, $defaultValue = null)
    {
        return $this->hasSetting($key) ? $this->settings[$key] : $defaultValue;
    }
101095
public function getDefaultValue()
    {
        if ($this->isArray() || $this->isList()) {
            return [];
        }
        return Utils::getValueWithinItsType($this->getMetaValueFirstSet([
            'default',
            'Default',
            'DefaultValue',
            'defaultValue',
            'defaultvalue',
        ]), $this->getType(true));
    }