Load the AuthenticationTypeController into the AuthenticationType.
197870
protected function loadController()
    {
        $env = Environment::get();
        $r = $env->getRecord(DIRNAME_AUTHENTICATION . '/' . $this->authTypeHandle . '/' . FILENAME_CONTROLLER);
        $prefix = $r->override ? true : $this->getPackageHandle();
        $authTypeHandle = Core::make('helper/text')->camelcase($this->authTypeHandle);
        $class = core_class('Authentication\\' . $authTypeHandle . '\\Controller', $prefix);
        $this->controller = Core::make($class, [$this]);
    }
465924
public function boot()
    {
        $isCaching = true === $this->getIsCaching();
        $hasCache = null;

        if ($isCaching) {
            $hasCache = Cache::has('metadataControllers');
            if ($hasCache) {
                $meta = Cache::get('metadataControllers');
                App::instance('metadataControllers', $meta);
                return;
            }
        }

        $meta = App::make('metadataControllers');

        $classes = $this->getClassMap();
        $ends = $this->getCandidateControllers($classes);

        // now process each class that uses the metadata controller trait and stick results in $metamix
        $metamix = [];
        foreach ($ends as $end) {
            $map = $end->getMappings();
            // verify uniqueness - must be exactly one mapping for model-verb combo - different verb mappings for
            // a model can glom onto different controllers
            foreach ($map as $key => $lock) {
                if (!array_key_exists($key, $metamix)) {
                    // if we haven't yet got a mapping for this model, grab it holus-bolus
                    $metamix[$key] = $lock;
                    continue;
                }
                // if we do, make sure we aren't re-adding mappings for any of the CRUD verbs
                foreach ($lock as $barrel => $roll) {
                    $isOptional = in_array($barrel, $this->optionalVerbs);
                    $alreadyKey = array_key_exists($barrel, $metamix[$key]);
                    if ($isOptional) {
                        // if we've picked up a default mapping for an optional verb, then we can overwrite it
                        $alreadyKey = null === $metamix[$key][$barrel] ? false : $alreadyKey;
                    }
                    if ($alreadyKey) {
                        $msg = 'Mapping already defined for model ' . $key . ' and CRUD verb ' . $barrel;
                        throw new InvalidOperationException($msg);
                    }
                    $metamix[$key][$barrel] = $roll;
                }
            }
        }

        $meta->setMetadata($metamix);

        $key = 'metadataControllers';
        $this->handlePostBoot($isCaching, $hasCache, $key, $meta);
    }
807721
public void registerDatatype(Class<? extends GVRHybridObject> textureClass,
            AsyncLoaderFactory<? extends GVRHybridObject, ?> asyncLoaderFactory) {
        mFactories.put(textureClass, asyncLoaderFactory);
    }
809600
public function authenticate($type = '')
    {
        $valt = $this->app->make('token');
        if (!$valt->validate('login_' . $type)) {
            $this->error->add($valt->getErrorMessage());
        } else {
            try {
                $at = AuthenticationType::getByHandle($type);
                $user = $at->controller->authenticate();
                if ($user && $user->isRegistered()) {
                    return $this->finishAuthentication($at, $user);
                }
            } catch (Exception $e) {
                $this->error->add($e->getMessage());
            }
        }

        if (isset($at)) {
            $this->set('lastAuthType', $at);
        }

        $this->view();
    }
923941
private function initTypes()
    {
        $this->types = array();

        foreach ($this->loadTypes() as $type) {
            if (!$type instanceof JobTypeInterface) {
                throw new \InvalidArgumentException(sprintf('Type %s should implements JobTypeInterface', get_class($type)));
            }

            $this->types[$type->getName()] = $type;
        }
    }
796189
private function registerControllers()
    {
        $this->_controller = new Controller();
        $this->_controller->load($this->_router,
        $this->_config->get('basepath'));
    }
1205424
protected function loadExternalType()
    {
        parent::loadExternalType();

        $this->formTypeClassName = TimeModelFormItem::class;
        $this->viewItemClassName = TimeModelItem::class;
        $this->tableItemClassName = TimeModelItem::class;

    }
644970
protected function loadExternalType()
    {

        $this->formTypeClassName = DateModelFormItem::class;
        $this->tableItemClassName = DateModelItem::class;
        $this->viewItemClassName = DateModelItem::class;

    }
1058665
def loadTargetState(targetStateConfig, existingTargetState=None):
    
    from analyser.common.targetstatecontroller import TargetState
    targetState = TargetState() if existingTargetState is None else existingTargetState
    # FIXFIX validate
    if targetStateConfig is not None:
        val = targetStateConfig.get('fs')
        if val is not None:
            targetState.fs = val
        val = targetStateConfig.get('samplesPerBatch')
        if val is not None:
            targetState.samplesPerBatch = val
        val = targetStateConfig.get('gyroEnabled')
        if val is not None:
            targetState.gyroEnabled = val
        val = targetStateConfig.get('gyroSens')
        if val is not None:
            targetState.gyroSens = val
        val = targetStateConfig.get('accelerometerEnabled')
        if val is not None:
            targetState.accelerometerEnabled = val
        val = targetStateConfig.get('accelerometerSens')
        if val is not None:
            targetState.accelerometerSens = val
    return targetState
401932
private function loadCustomTypes()
    {
        $customFields = (array) $this->getConfig('custom_fields');

        if (!empty($customFields)) {
            foreach ($customFields as $fieldName => $fieldClass) {
                $this->addCustomField($fieldName, $fieldClass);
            }
        }
    }
714670
def add_authentication(self, public_key, authentication_type=None):
        
        authentication = {}
        if public_key:
            authentication = {'type': authentication_type, 'publicKey': public_key}
        logger.debug(f'Adding authentication {authentication}')
        self._authentications.append(authentication)
1068090
protected void checkSupported(AuthType authType) {
    switch (authType) {
      case NOSASL:
      case SIMPLE:
      case CUSTOM:
        return;
      default:
        throw new RuntimeException("Authentication type not supported:" + authType.name());
    }
  }
277956
@XmlElement(name = "authentication-mechanism-type", required = true)
    public void setAuthenticationMechanismType(String authMech) {
        AuthenticationMechanismType type = AuthenticationMechanismType.valueOf(authMech);
        authenticationMechanismType = type.name();
    }
936081
def _load_types(root):
    """"""
    def text(t):
        if t.tag == 'name':
            return '{name}'
        elif t.tag == 'apientry':
            return '{apientry}'
        out = []
        if t.text:
            out.append(_escape_tpl_str(t.text))
        for x in t:
            out.append(text(x))
            if x.tail:
                out.append(_escape_tpl_str(x.tail))
        return ''.join(out)
    out_dict = collections.OrderedDict()
    for elem in root.findall('types/type'):
        name = elem.get('name') or elem.find('name').text
        template = text(elem)
        api = elem.get('api')
        if 'requires' in elem.attrib:
            required_types = set((elem.attrib['requires'],))
        else:
            required_types = set()
        comment = elem.get('comment')
        if api:
            k = (name, api)
        else:
            k = (name, None)
        out_dict[k] = Type(name, template, required_types, api, comment)
    return out_dict
391710
function loadController(controllersDirectory, controller, development) {
    const filePath = path.resolve(controllersDirectory, controller);
    try {
        return require(filePath);
    } catch (e) {
        if (e.code === 'MODULE_NOT_FOUND' && e.message.indexOf("Cannot find module '" + filePath + "'") === 0 && development) {
            console.error('Cannot find controller: ' + filePath);
            return null;
        } else {
            throw e;
        }
    }
}
464164
protected function loadController() {
		//try to load the controller
		$config = $this->getConfig();
		$controller = null;
		if (!empty($config['controllerConfig']['name'])) {
			$className = $this->getSite()->getControllerClass($config['controllerConfig']['name']);
			if (class_exists($className)) {
				$controller = new $className($this->getSite(),$config['controllerConfig']);
				$controller->evaluate();
			}
		}
		if (!$controller) {
			$this->logger->warn("Did not find Controller Class");
			$this->getSite()->setRedirectUrl($config['PATH_HTTP']);
		}
	}
358384
public function loadConfiguration(): void
	{
		$builder = $this->getContainerBuilder();
		$config = $this->validateConfig($this->defaults);

		Validators::assertField($config, 'enabled', 'bool');
		Validators::assertField($config, 'users', 'array');

		// Skip if its disabled
		if ($config['enabled'] !== true) return;

		// Throws if there's no user
		if ($config['users'] === []) throw new LogicException('You have to define any user or disable extension');

		$def = $builder->addDefinition($this->prefix('authenticator'))
			->setType(BasicAuthenticator::class)
			->setArguments([$config['title']]);

		foreach ($config['users'] as $user => $values) {
			if (is_string($values)) {
				trigger_error('Usage of `$username => $password` is deprecated, use `$username => ["password" => $password]` instead', E_USER_DEPRECATED);
				$password = $values;
				$unsecured = true;
			} else {
				$password = $values['password'];
				$unsecured = $values['unsecured'] ?? false;
			}
			$def->addSetup('addUser', [$user, $password, $unsecured]);
		}
	}