Apply the settings.

@param string $groups
The groups option as passed in from drush_get_option().
970314
public function exec($groups = '') {
    $_groups = !empty($groups) ? explode(',', $groups) : array();

    // Print a message that the build is starting.
    $names = implode('+', array_keys($this->loadedEnvs));
    drush_print();
    drush_print($this->formatHeading(dt("--- CONFIGURING @name ENVIRONMENT ---", array('@name' => strtoupper($names))), ''));

    foreach ($this->exec as $type => $options) {
      if (!empty($options) && (empty($_groups) || in_array($type, $_groups))) {
        // Print a nice heading.
        $heading = $this->formatHeading($type);
        drush_print();
        drush_print("{$heading}");

        switch ($type) {
          case 'modules';
            $this->execModules($options);
            break;

          case 'variables':
            $this->execVariables($options);
            break;

          case 'permissions':
            $this->execPermissions($options);
            break;

          case 'commands':
            $this->execCommands($options);
            break;

          default:
            drush_set_error('INVALID_ENV_GROUP', dt("I'm not sure what to do with '!group'.", ['!group' => $type]));
            break;
        }
      }
    }

    drush_print();
    if (drush_get_error()) {
      drush_set_error('DENVER_ENV_SETUP_FAILED', dt("The environment may not have been configured the way you wanted.  Check the logs for more details."));
      drush_print(dt("Use the --groups option to run only certain sections of an environment definition."));
    }
    else {
      return drush_log(dt("Environment setup complete!"), 'success');
    }
  }
757959
public function setSettings($settings = [])
    {
        $original = $this->settings;
        $this->mergeSettings($settings, $this->settings);
        if ($this->settings != $original) {
            // @todo - Log Curl equivalent during test mode (adds overhead and risk so only do it during test)
            // if (!isset($this->settings['handler']) && class_exists(
            //         '\Namshi\Cuzzle\Middleware\CurlFormatterMiddleware'
            //     )) {
            //     $this->logger      = new Logger('guzzle.to.curl'); //initialize the logger
            //     $this->testHandler = new TestHandler(); //test logger handler
            //     $this->logger->pushHandler($this->testHandler);
            //
            //     $this->handler = HandlerStack::create();
            //     $this->handler->after('cookies', new \Namshi\Cuzzle\Middleware\CurlFormatterMiddleware($this->logger));
            //     $this->settings['handler'] = $this->handler;
            // }
            $this->client = new Client($this->settings);
        }
    }
1139110
public function addSettings(array $settings)
    {
        foreach ($settings as $key => $value) {
            $this->addSetting($key, $value);
        }
    }
1126456
public function handleGlobalOptions(string $group = 'default'): void
	{
		if(isset($this->options[$group]))
		{
			foreach($this->options[$group] as $name => $option)
			{
				$input = $this->input->getArgument($name);

				if(!empty($input))
				{
					$handler = $option['handler'];

					$this->container->call($handler, ['option' => $input]);
				}
			}
		}
	}
814315
public function setGroups(array $groups)
    {
        $this->groups = [];

        foreach ($groups as $groupIdent => $group) {
            $this->addGroup($groupIdent, $group);
        }

        return $this;
    }
1070295
public function addGroup(Group $group)
    {
        $this->hasGroupsProperty();

        if (!$this->groups->contains($group)) {
            $this->groups->add($group);
        }
    }
557050
public function addGroup($group) {
    if (!$group->inArray((array) $this->groups)) {
      $this->groups[] = $group;
      return $this->groups;
    }
    return true;
  }
715333
private function addGroup(MenuGroup $group)
    {
        if (!$this->hasGroup($group->getName())) {
            $this->groups[$group->getName()] = $group;
        }
    }
899305
public function assignTo($group): void
    {
        $group = $this->resolveGroup($group);

        $this->groups()->attach($group);
    }
1015780
private function applyOrders(array $settings): void
    {
        $data = $this->getSource();
        // Create empty column stack
        $orders = [];
        foreach ($settings as $column => $order) {
            $orders[$column] = [];
        }

        // Obtain a list of columns
        foreach ($data as $key => $row) {
            foreach ($settings as $column => $order) {
                $orders[$column][$key] = $row[$column];
            }
        }

        // Prepare array of arguments
        $funcArgs = [];
        foreach ($settings as $column => $order) {
            $funcArgs[] = $orders[$column];
            $funcArgs[] = ($order === Grid\Grid::ORDER_ASC) ? SORT_ASC : SORT_DESC;
        }
        $funcArgs[] = &$data;

        // Sort the data with volume descending, edition ascending
        // Add $data as the last parameter, to sort by the common key
        array_multisort(...$funcArgs);
        $this->setSource($data);
    }
473697
protected function getSettingsByGroup($group)
    {
        $result = array();
        foreach ($this->getKeyInfo() as $key => $keyInfo) {
            if ($keyInfo['group'] === $group) {
                $result[$key] = $this->get($key);
            }
        }
        return $result;
    }
509334
public function cacheFlushByGroup($group)
    {
        $group = StringHelper::toUnderscoreVariable(get_called_class()) . '/' . StringHelper::toUnderscoreVariable($group);
        $this->getCache()->setGroup($group)->clear();
        
        return $this;
    }
1351789
public function addSerializerGroup($group)
    {
        if (is_array($group)) {
            $this->serializerGroups = array_merge(
                $this->serializerGroups,
                $group
            );
        } else {
            $this->serializerGroups[$group] = $group;
        }
    }
997525
private function applyFilters(array $settings): void
    {
        $data = $this->getSource();
        $data = array_filter(
            $data,
            function ($row) use ($settings) {
                foreach ($settings as $column => $filters) {
                    foreach ($filters as $filter => $value) {
                        // switch statement for filter
                        switch ($filter) {
                            case Grid\Grid::FILTER_EQ:
                                if ($row[$column] != $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_NE:
                                if ($row[$column] == $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_GT:
                                if ($row[$column] <= $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_GE:
                                if ($row[$column] < $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_LT:
                                if ($row[$column] >= $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_LE:
                                if ($row[$column] > $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_LIKE:
                                if (!preg_match('/' . $value . '/', $row[$column])) {
                                    return false;
                                }
                                break;
                        }
                    }
                }
                return true;
            }
        );
        $this->setSource($data);
    }
729799
public function addParamsGrouping($fields = [])
    {
        if (is_array($fields) && !empty($fields))
        {
            $this->groupingParams = array_merge(is_array($this->groupingParams) ? $this->groupingParams : [], $fields);
        }
    }
344131
public function setGroup($group)
    {
        if (isset($this->options['group']) && $this->options['group']) {
            $group = $this->options['group'] . '/' . $group;
        }
        return $this->setOption('group', $group);
    }
937930
public function removeApplicationGroups(ApplicationGroup ...$groups)
    {
        foreach ($groups as $group) {
            $this->getApplicationGroups()->removeElement($group);
        }

        return $this;
    }