Apply assignment permissions.
@param array $config
@return void
332129
protected function applyPermissions(array $config) : void
    {
        $this->stdout("Init permissions: " . count($config) . "\n", Console::FG_YELLOW);
        foreach ($config as $item) {
            if ($permission = $this->applyPermission($item)) {
                $this->stdout("\t- success: " . $permission->name . "\n", Console::FG_GREEN);
            } else {
                $this->stdout("\t- error config permission: " . Json::encode($item) . "\n", Console::FG_RED);
            }
        }
    }
950520
protected function setConfig($config)
    {
        //
        // Parameter check -- probably should raise an error here if config
        // is not an array.
        //
        if (! is_array($config)) {
            return;
        }

        foreach ($config as $k => $v) {
            if (isset($this->_config[$k])) {
                $this->_config[$k] = $v;
            } else {
                // map old (Net_LDAP2) parms to new ones
                switch($k) {
                case "dn":
                    $this->_config["binddn"] = $v;
                    break;
                case "password":
                    $this->_config["bindpw"] = $v;
                    break;
                case "tls":
                    $this->_config["starttls"] = $v;
                    break;
                case "base":
                    $this->_config["basedn"] = $v;
                    break;
                }
            }
        }

        //
        // Ensure the host list is an array.
        //
        if (is_array($this->_config['host'])) {
            $this->_host_list = $this->_config['host'];
        } else {
            if (strlen($this->_config['host']) > 0) {
                $this->_host_list = array($this->_config['host']);
            } else {
                $this->_host_list = array();
                // ^ this will cause an error in performConnect(),
                // so the user is notified about the failure
            }
        }

        //
        // Reset the down host list, which seems like a sensible thing to do
        // if the config is being reset for some reason.
        //
        $this->_down_host_list = array();
    }
318705
public function setPermissionsAttribute(array $permissions = [])
    {
        foreach ($permissions as $key => $value) {
            $permissions[$key] = (bool) $value;
        }
        $this->attributes['permissions'] = json_encode($permissions ?? []);
    }
878392
protected function initializeConfig(array $config = null)
    {
        $default = $this->defaultConfigurations();

        $this->config = $config ? array_replace_recursive($default, $config) : $default;
    }
88198
public function apply_grip_config($config)
    {
        if (!is_array(reset($config))) {
            $config = array($config);
        }
        foreach ($config as $entry) {
            if (!array_key_exists('control_uri', $entry)) {
                continue;
            }
            $pub = new \PubControl\PubControlClient($entry['control_uri']);
            if (array_key_exists('control_iss', $entry)) {
                $pub->set_auth_jwt(array('iss' => $entry['control_iss']), $entry['key']);
            }
            $this->clients[] = $pub;
        }
    }
399369
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->table('users');
        $this->displayField('username');
        $this->primaryKey('id');

        $this->addBehavior('Timestamp');
        $this->addBehavior('Muffin/Trash.Trash');
        $this->addBehavior('Muffin/Tokenize.Tokenize');

        if (Plugin::loaded('Search')) {
            $this->addBehavior('Search.Search');
        }
    }
1031210
public function setConfig( array $config )
	{
		if ( $config == $this->getConfig() ) { return; }

		$this->_values['config'] = $config;
		$this->setModified();
	}
469376
public function configure(array $config = []) {
        $this->_config = [
            'request_path' => filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_STRING),
            'request_queries' => filter_input(INPUT_SERVER, 'QUERY_STRINGS', FILTER_SANITIZE_STRING),
            'request_controller' => FALSE,
            'request_action' => FALSE,
            'root_dir' => NULL,
            'default_controller' => 'index',
            'default_action' => 'index'
        ] + $config;
        
        if ( $this->_config['request_controller'] === FALSE || $this->_config['request_action'] === FALSE) {
            $url = explode('/', $this->_config['request_path']);
            $this->_config['request_controller'] = array_shift($url);
            $this->_config['request_action'] = array_shift($url);
        }
    }
1117690
private function configure($config = [])
    {
        $this->config = $config;

        $this->configureVariable('ssl');
        $this->configureVariable('ssl_method');
        $this->configureVariable('ssl_name');
        $this->configureVariable('ssl_verify_sign');
        $this->configureVariable('ssl_verify_peer');
        $this->configureVariable('ssl_verify_depth');
    }
267238
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->Controller = $this->_registry->getController();

        $this->_addFromConfigure();

        // set up the default helper
        $this->Controller->helpers['Utils.Menu'] = [];
    }
1053531
public function assignTo($parent, array $config = []) {
		foreach ($config as $key => $val) {
			$this->{'_' . $key} = $val;
		}
		$this->_parent =& $parent;
	}
905735
public function setConfig(array $config)
    {
        foreach ($config as $name => $value) {
            $setter = 'set' . ucfirst($name);

            call_user_func_array(array($this, $setter), array($value));
        }
    }
982815
private function applyConfig(array $config): void
    {
        // override
        if ($this->config != null) {
            $config = Config::merge($config, $this->config->getData());
        }
        $this->config = new Config($config);

        // set/reset logger options
        $loggerOptions = $this->config->get('logger');
        if ($loggerOptions != null) {
            isset($loggerOptions['level']) && $this->logger->setLevel($loggerOptions['level']);
            isset($loggerOptions['directory']) && $this->logger->setDirectory($loggerOptions['directory']);
        }
    }
1124414
protected function setModes(array $config)
	{
		if(isset($config['modes']))
		{
			$this->setCustomModes($config);
		}
		else if(isset($config['strict']))
		{
			if($config['strict'])
			{
				$this->pdo->prepare($this->strictMode())->execute();
			}
			else
			{
				$this->pdo->prepare("set session sql_mode='NO_ENGINE_SUBSTITUTION'")->execute();
			}
		}
	}
237295
public function configure($config)
    {
        foreach ((array)$config as $key => $value) {
            $this->setConfig($key, $value);
        }
    }
636320
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->_action = $this->_controller->request->getParam('action');
        $this->_request = $this->_controller->request;

        if (!isset($this->_controller->dispatchComponents)) {
            $this->_controller->dispatchComponents = [];
        }

        $this->_controller->dispatchComponents['Crud'] = true;
    }
434524
protected function checkConfig(array $config): void
    {
        foreach (['host', 'username', 'password', 'database', 'persistent'] as $key) {
            if (!isset($config[$key])) {
                $class = get_class($this);
                throw new ConfigException("Missing configuration key={$key} in {$class}");
            }
        }
    }