Creates new instance from Realm object.

@param StaticRealmDto $realm
@param array          $customSettings
336187
public static function initByRealmObject( StaticRealmDto $realm, array $customSettings = [] )
	{
		self::setSettings([
			self::SET_ENDPOINT => $realm->cdn . "/",
			self::SET_VERSION  => $realm->dd,
		]);

		if (!empty($customSettings))
			self::setSettings($customSettings);

		self::$initialized = true;
	}
1335127
protected function loadConfigDefaults($userSettings)
    {
        $parser = $this['config-parser'];
        $defaults = $parser->parseFile(__DIR__ . '/slender.yml');
        $userSettings = array_merge_recursive($defaults, $userSettings);
        $this['settings']->setArray($userSettings);
    }
1066405
public static JedisPool create(final PippoSettings settings) {
        String host = settings.getString(HOST, Protocol.DEFAULT_HOST).trim();
        int minIdle = settings.getInteger(MIN_IDLE, GenericObjectPoolConfig.DEFAULT_MIN_IDLE);
        int maxIdle = settings.getInteger(MAX_IDLE, GenericObjectPoolConfig.DEFAULT_MAX_IDLE);
        int maxTotal = settings.getInteger(MAX_TOTAL, GenericObjectPoolConfig.DEFAULT_MAX_TOTAL);
        JedisPoolConfig config = new JedisPoolConfig();
        config.setMinIdle(minIdle);
        config.setMaxIdle(maxIdle);
        config.setMaxTotal(maxTotal);

        try {
            return new JedisPool(config, new URI(host));
        } catch (URISyntaxException e) {
            throw new PippoRuntimeException("Malformed redis URI", e);
        }
    }
1300690
public function fillMissingParams($module, $moduleSettings)
    {
        // Set class properties if needed
        if (empty($module->slug)) {
            foreach ($moduleSettings as $key => $value) {
                $module->$key = $value;
            }

            $module->isLegacy = true;
        }

        return $module;
    }
1184869
private function createInstanceSettingsProvider(array $applicationData): InstanceSettingsProvider
    {
        // Load all settings from path specified
        $provider = (new FileSettingsProvider($applicationData))->load($this->getSettingsPath());

        // Application settings have a list of providers which might have additional settings to load
        $providerClasses = $applicationData[A::KEY_PROVIDER_CLASSES];
        $selectedClasses = $this->selectClassImplements($providerClasses, ProvidesSettingsInterface::class);
        foreach ($selectedClasses as $providerClass) {
            /** @var ProvidesSettingsInterface $providerClass */
            foreach ($providerClass::getSettings() as $setting) {
                $provider->register($setting);
            }
        }

        return $provider;
    }
1299509
function(newSettings) {
      var s = '';

      if (typeof newSettings !== 'object') {
        throw new Error('ss.http.set() takes an object e.g. {static: {maxAge: 60000}}');
      }

      for (s in newSettings) {
        if (newSettings.hasOwnProperty(s)) {
          settings[s] = newSettings[s]
        }
      }
    }
698154
@Override
  public Collection<Realm> getRealms() {
    ArrayList<Realm> rss = new ArrayList<Realm>();

    Set<String> keys = new HashSet<String>(this.realmNameToRealmSet.keySet());
    for (String key : keys) {
      RealmSet rs = this.realmNameToRealmSet.get(key);
      rss.addAll(rs.values());
    }
    return rss;
  }
881492
public UserRealm addRealm(UserRealm realm)
    {
        return (UserRealm)_realmMap.put(realm.getName(),realm);
    }
466685
private void addCustomAttributesToSSOToken() {
        SingleSignonToken ssoToken = getSSOToken(subject);
        if (ssoToken != null) {
            if (customRealm != null) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Add custom realm into SSOToken");
                }
                ssoToken.addAttribute(AttributeNameConstants.WSCREDENTIAL_REALM, customRealm);
            }
            if (authProvider != null && !authProvider.endsWith("Form")) {
                ssoToken.addAttribute(AuthenticationConstants.INTERNAL_AUTH_PROVIDER, authProvider);
            }
        }
    }
948397
public static function getInstance(array $userSettings = array())
    {
        if (!self::$instance) {
            self::$instance = new self($userSettings);
        }
        
        return self::$instance;
    }
227398
private DefaultServiceDefaultsContext resolveServiceDefaults(ServiceDefaultsType serviceDefaults, RealmsContext realmsContext) {

        if (serviceDefaults == null) {
            return null;
        }

        DefaultAcceptOptionsContext acceptOptions = null;

        ServiceAcceptOptionsType serviceAcceptOptions = serviceDefaults.getAcceptOptions();
        if (serviceAcceptOptions != null) {
            acceptOptions = new DefaultAcceptOptionsContext(null, serviceAcceptOptions);
        }

        DefaultConnectOptionsContext connectOptions = null;
        ServiceConnectOptionsType serviceConnectOptions = serviceDefaults.getConnectOptions();
        if (serviceConnectOptions != null) {
            connectOptions = new DefaultConnectOptionsContext(null, serviceConnectOptions);
        }

        Map<String, String> mimeMappings = null;

        MimeMappingType[] mimeMappingTypes = serviceDefaults.getMimeMappingArray();
        if (mimeMappingTypes != null) {
            mimeMappings = new HashMap<>();
            for (MimeMappingType mmt : mimeMappingTypes) {
                mimeMappings.put(mmt.getExtension(), mmt.getMimeType());
            }
        }

        return new DefaultServiceDefaultsContext(acceptOptions, connectOptions, mimeMappings);
    }
717302
function (customSettings) {
      if(Utils.isObject(customSettings)){
        this.settings = Utils.extend(this.settings, customSettings);
      }else{
        throw new TypeError('Setup should be called with an options object.');
      }
      return this.settings;
    }
1330535
public function setRealmId( $realm_id )
	{
		$this->realm_id = (is_numeric($realm_id)) ? abs(round($realm_id)) : NULL;

		return $this;
	}
77470
public static function create(
        array $customHeaders = [],
        ApiContext $apiContext = null
    ): BunqResponseSandboxUser {
        if (is_null($apiContext)) {
            throw new BunqException(self::ERROR_API_CONTEXT_IS_NULL);
        }

        $apiClient = new ApiClient($apiContext);
        $responseRaw = $apiClient->post(
            vsprintf(
                self::ENDPOINT_URL_CREATE,
                []
            ),
            [],
            $customHeaders
        );

        return BunqResponseSandboxUser::castFromBunqResponse(
            static::fromJson($responseRaw, self::OBJECT_TYPE_POST)
        );
    }
22712
protected function applyDqlSettingsToConfiguration(array $configuredSettings, Configuration $doctrineConfiguration)
    {
        if (isset($configuredSettings['customStringFunctions'])) {
            $doctrineConfiguration->setCustomStringFunctions($configuredSettings['customStringFunctions']);
        }
        if (isset($configuredSettings['customNumericFunctions'])) {
            $doctrineConfiguration->setCustomNumericFunctions($configuredSettings['customNumericFunctions']);
        }
        if (isset($configuredSettings['customDatetimeFunctions'])) {
            $doctrineConfiguration->setCustomDatetimeFunctions($configuredSettings['customDatetimeFunctions']);
        }
    }
303937
private function composeWebController(
        SettingsProviderInterface $settingsProvider,
        FileSystemInterface $fileSystem,
        string $singular,
        string $plural
    ): TemplateOutput {
        $folder = $settingsProvider
                      ->get(FluteSettingsInterface::class)[FluteSettingsInterface::KEY_WEB_CONTROLLERS_FOLDER];

        $outputRootFolder = $this->filterOutFolderMask($folder);
        $outputFileName   = $plural . 'Controller.php';
        $outputContent    = $this->composeTemplateContent(
            $fileSystem,
            $this->getTemplatePath('WebController.txt'),
            [
                '{%SINGULAR_CC%}' => $singular,
                '{%PLURAL_CC%}'   => $plural,
                '{%PLURAL_LC%}'   => strtolower($plural),
                '{%PLURAL_UC%}'   => strtoupper($plural),
            ]
        );

        return new TemplateOutput($outputRootFolder, $outputFileName, $outputContent);
    }
120400
public function getStaticRealm(): StaticData\StaticRealmDto
    {
	    $result = false;
	    try
	    {
		    // Fetch StaticData from JSON files
		    $result = DataDragonAPI::getStaticRealms($this->getSetting(self::SET_REGION));
		    if (!$result) throw new ServerException("StaticData failed to be loaded.");

		    $this->result_data = $result;
	    }
	    catch (DataDragonExceptions\ArgumentException $ex)
	    {
		    throw new RequestException($ex->getMessage(), $ex->getCode());
	    }
	    finally
	    {
		    // Parse array and create instances
		    return new StaticData\StaticRealmDto($result, $this);
	    }
    }