Configure's the internal Weave requirements.

@return null
512950
protected function configureContainerInternal()
	{
		$this->container->add(
			'instantiator',
			function () {
				return function ($name) {
					return $this->container->get($name);
				};
			}
		);

		$this->container->add(\Weave\Middleware\Middleware::class)
		->withArgument(\Weave\Middleware\MiddlewareAdaptorInterface::class)
		->withArgument(
			function ($pipelineName) {
				return $this->provideMiddlewarePipeline($pipelineName);
			}
		)
		->withArgument(\Weave\Resolve\ResolveAdaptorInterface::class)
		->withArgument(\Weave\Dispatch\DispatchAdaptorInterface::class)
		->withArgument(\Weave\Http\RequestFactoryInterface::class)
		->withArgument(\Weave\Http\ResponseFactoryInterface::class)
		->withArgument(\Weave\Http\ResponseEmitterInterface::class);

		$this->container->add(
			\Weave\Resolve\ResolveAdaptorInterface::class,
			\Weave\Resolve\Resolve::class
		)
		->withArgument('instantiator');

		$this->container->add(
			\Weave\Dispatch\DispatchAdaptorInterface::class,
			\Weave\Dispatch\Dispatch::class
		);

		$this->container->add(\Weave\Middleware\Dispatch::class)
		->withArgument(\Weave\Resolve\ResolveAdaptorInterface::class)
		->withArgument(\Weave\Dispatch\DispatchAdaptorInterface::class);

		$this->container->add(\Weave\Router\Router::class)
		->withArgument(\Weave\Router\RouterAdaptorInterface::class)
		->withArgument(
			function ($router) {
				return $this->provideRouteConfiguration($router);
			}
		)
		->withArgument(\Weave\Resolve\ResolveAdaptorInterface::class)
		->withArgument(\Weave\Dispatch\DispatchAdaptorInterface::class);
	}
1253356
public function initConfigs()
    {
        // Check configurations
        if (empty($this->configurations)) {
            return;
        }

        // Get available configurations
        $available = $this->getConfigurations();

        // Iterate
        foreach ($this->configurations as $component => $file) {
            // Check if configuration asked exists
            if (!array_key_exists($component, $available)) {
                continue;
            }

            $service = $this->get($component);

            // Check service integrity
            if (!$service) {
                continue;
            }

            // Initialize service
            $service->setPath($file);
            $service->init();
        }
    }
122157
public function performCheck()
    {
        $result = null;
        $configuration = $this->installerOptions->getConfiguration();
        foreach ([
            'canonical-url' => t('The canonical URL must have the http:// scheme or the https:// scheme'),
            'canonical-url-alternative' => t('The alternative canonical URL must have the http:// scheme or the https:// scheme'),
        ] as $handle => $error) {
            if (isset($configuration[$handle]) && $configuration[$handle] !== '') {
                $originalUrl = $configuration[$handle];
                $url = UrlImmutable::createFromUrl($originalUrl);
                if (!preg_match('/^https?$/i', $url->getScheme())) {
                    $result = new PreconditionResult(PreconditionResult::STATE_FAILED, $error);
                    break;
                }
                $finalUrl = (string) $url;
                if ($originalUrl !== $finalUrl) {
                    $result = new PreconditionResult(PreconditionResult::STATE_FAILED, t('The canonical url "%1$s" should be specified as "%2$s"', $originalUrl, $finalUrl));
                }
            }
        }
        if ($result === null) {
            $result = new PreconditionResult(PreconditionResult::STATE_PASSED);
        }

        return $result;
    }
1105702
protected function configureId()
    {
        $this->id = sprintf(
            $this->options['id_format'],
            $this->options['server_name'],
            $this->options['pid'],
            implode(',', $this->queues)
        );
    }
349692
public function constructAuthorize()
    {
        if (empty($this->_config['authorize'])) {
            return null;
        }
        $this->_authorizeObjects = [];
        $authorize = Hash::normalize((array)$this->_config['authorize']);
        $global = [];
        if (isset($authorize[AuthComponent::ALL])) {
            $global = $authorize[AuthComponent::ALL];
            unset($authorize[AuthComponent::ALL]);
        }
        foreach ($authorize as $alias => $config) {
            if (!empty($config['className'])) {
                $class = $config['className'];
                unset($config['className']);
            } else {
                $class = $alias;
            }
            $className = App::className($class, 'Auth', 'Authorize');
            if (!class_exists($className)) {
                throw new Exception(sprintf('Authorization adapter "%s" was not found.', $class));
            }
            if (!method_exists($className, 'authorize')) {
                throw new Exception('Authorization objects must implement an authorize() method.');
            }
            $config = (array)$config + $global;
            $this->_authorizeObjects[$alias] = new $className($this->_registry, $config);
        }

        return $this->_authorizeObjects;
    }
93997
public static function config() {
        $key = explode('\\',get_called_class());
        $key = strtolower(end($key));
        if(isset(Config::$o->$key)) {
            return Config::$o->$key;
        }
        return null;
    }
597020
protected function configure(): void
    {
        $this->setName('dependency-guard');
        $this->setDescription(
            'Check Composer dependencies for a --no-dev install.'
        );

        $this->addOption(
            'format',
            'f',
            InputOption::VALUE_REQUIRED,
            'The output format. '
                . implode(
                    ', ',
                    array_map(
                        function (string $format) : string {
                            return sprintf('<comment>%s</comment>', $format);
                        },
                        $this->exporterFactory->getOutputFormats()
                    )
                ),
            ViolationExporterFactoryInterface::DEFAULT_FORMAT
        );
    }
329309
public function getRequiredModules()
    {
        if ($this->_aRequiredModules == null) {
            $aRequiredPHPExtensions = [
                'php_xml',
                'j_son',
                'i_conv',
                'tokenizer',
                'mysql_connect',
                'gd_info',
                'mb_string',
                'curl',
                'bc_math',
                'open_ssl',
                'soap',
            ];

            $aRequiredPHPConfigs = [
                'allow_url_fopen',
                'request_uri',
                'ini_set',
                'memory_limit',
                'unicode_support',
                'file_uploads',
                'session_autostart',
            ];

            $aRequiredServerConfigs = [
                'php_version',
                'mod_rewrite',
                'server_permissions'
            ];

            if ($this->isAdmin()) {
                $aRequiredServerConfigs[] = 'mysql_version';
            }
            $this->_aRequiredModules = array_fill_keys($aRequiredServerConfigs, 'server_config') +
                                       array_fill_keys($aRequiredPHPConfigs, 'php_config') +
                                       array_fill_keys($aRequiredPHPExtensions, 'php_extennsions')
                                       ;
        }

        return $this->_aRequiredModules;
    }
957974
public function requiredComponents() {
    $components = parent::requiredComponents();

    foreach ($this->component_data['injected_services'] as $service_id) {
      $components['service_' . $service_id] = array(
        'component_type' => 'InjectedService',
        'containing_component' => '%requester',
        'service_id' => $service_id,
      );
    }

    if (!empty($this->component_data['plugin_type_data']['config_schema_prefix'])) {
      $schema_id = $this->component_data['plugin_type_data']['config_schema_prefix']
        . $this->component_data['plugin_name'];

      $components["config/schema/%module.schema.yml"] = [
        'component_type' => 'ConfigSchema',
        'yaml_data' => [
           $schema_id => [
            'type' => 'mapping',
            'label' => $this->component_data['plugin_name'],
            'mapping' => [

            ],
          ],
        ],
      ];
    }

    if (!empty($this->component_data['replace_parent_plugin'])) {
      if (!empty($this->component_data['plugin_type_data']['alter_hook_name'])) {
        $alter_hook_name = 'hook_' . $this->component_data['plugin_type_data']['alter_hook_name'];

        $components['hooks'] = [
          'component_type' => 'Hooks',
          'hooks' => [
            $alter_hook_name => TRUE,
          ],
          'hook_bodies' => [
            $alter_hook_name => [
              "// Override the class for the '{$this->component_data['parent_plugin_id']}' plugin.",
              "if (isset(£info['{$this->component_data['parent_plugin_id']}'])) {",
              "  £info['{$this->component_data['parent_plugin_id']}']['class'] = \\{$this->component_data['qualified_class_name']}::class;",
              "}",
            ],
          ],
        ];
      }
    }

    return $components;
  }
580363
public function configure()
    {
        $docs = []; //$this->configuration->getTransformer()->getExternalClassDocumentation();
        foreach ($docs as $external) {
            $prefix = (string) $external->getPrefix();
            $uri = (string) $external->getUri();

            $this[] = new Rule(
                function ($node) use ($prefix) {
                    return is_string($node) && (strpos(ltrim($node, '\\'), $prefix) === 0);
                },
                function ($node) use ($uri) {
                    return str_replace('{CLASS}', ltrim($node, '\\'), $uri);
                }
            );
        }
    }
516020
protected static function configure()
    {
        $config = [];
        if (!count(self::scheme())) {
            self::initScheme($config);
        }
        $diff = array_diff_key(self::scheme(), self::$agentsConfig);
        self::initAgentsConfig(array_keys($diff), $config);
        if (!count(self::scheme())) {
            throw new PhpSmsException('Expected at least one agent in scheme.');
        }
    }
818653
public function setup()
    {
        $this->di->set('config', $this->config);

        $this->initEnvironment($this->config);
        $this->initErrorHandler($this->config);
        $this->initLoader($this->config);
        $this->initModules($this->config);
        $this->initRoutes($this->config);
        $this->initServices($this->config);
        $this->initDispatcher();

        $this->application->setDI($this->di);
        DI::setDefault($this->di);

        return $this;
    }
1234944
public function requireConfig()
    {
        global $CFG;

        if (!defined('CLI_SCRIPT')) {
            define('CLI_SCRIPT', true);
        }
        if (!defined('IGNORE_COMPONENT_CACHE')) {
            define('IGNORE_COMPONENT_CACHE', true);
        }
        if (!defined('CACHE_DISABLE_ALL')) {
            define('CACHE_DISABLE_ALL', true);
        }
        if (!defined('ABORT_AFTER_CONFIG')) {
            // Need this since Moodle will not be fully installed.
            define('ABORT_AFTER_CONFIG', true);
        }
        $path = $this->directory.'/config.php';

        if (!is_file($path)) {
            throw new \RuntimeException('Failed to find Moodle config file');
        }

        /** @noinspection PhpIncludeInspection */
        require_once $path;

        // Save a local reference to Moodle's config.
        if (empty($this->cfg)) {
            $this->cfg = $CFG;
        }
    }
360532
protected function configure()
    {
        $this->bind(ResourceInterface::class)->to(Resource::class)->in(Scope::SINGLETON);
        $this->bind(InvokerInterface::class)->to(Invoker::class);
        $this->bind(LinkerInterface::class)->to(Linker::class);
        $this->bind(FactoryInterface::class)->to(Factory::class);
        $this->bind(SchemeCollectionInterface::class)->toProvider(SchemeCollectionProvider::class);
        $this->bind(AnchorInterface::class)->to(Anchor::class);
        $this->bind(NamedParameterInterface::class)->to(NamedParameter::class);
        $this->bind(RenderInterface::class)->to(PrettyJsonRenderer::class)->in(Scope::SINGLETON);
        $this->bind(Cache::class)->to(ArrayCache::class);
        $this->bind(RenderInterface::class)->annotatedWith('options')->to(OptionsRenderer::class);
        $this->bind(OptionsMethods::class);
        $this->bind(NamedParamMetasInterface::class)->to(NamedParamMetas::class);
    }
1069676
protected function validateRequirementsInstall()
    {
        if ($this->isExcluded('requirements')) {
            return null;
        }

        if ($this->config->isInitialized()) {
            $error = $this->translation->text('System already installed');
            $this->setError('installed', $error);
            return false;
        }

        $requirements = $this->install->getRequirements();
        $errors = $this->install->getRequirementErrors($requirements);

        if (empty($errors['danger'])) {
            return true;
        }

        $messages = array();
        $messages[] = $this->translation->text('Please fix all critical errors in your environment');

        foreach ($requirements as $items) {
            foreach ($items as $name => $info) {
                if (in_array($name, $errors['danger'])) {
                    $status = empty($info['status']) ? $this->translation->text('No') : $this->translation->text('Yes');
                    $messages[] = " {$info['message']} - $status";
                }
            }
        }

        $this->setError('requirements', implode(PHP_EOL, $messages));
        return false;
    }
1175048
@Override
  protected void configure() {
    try {
      InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
      File appRoot = new File(System.getProperty(CadmiumListener.BASE_PATH_ENV), "maven");
      FileUtils.forceMkdir(appRoot);
      String remoteMavenRepo = System.getProperty(MAVEN_REPOSITORY);
      ArtifactResolver resolver = new ArtifactResolver(remoteMavenRepo, appRoot.getAbsolutePath());
      bind(ArtifactResolver.class).toInstance(resolver);
      bind(JBossAdminApi.class);
      Multibinder<ConfigurationListener> listenerBinder = Multibinder.newSetBinder(binder(), ConfigurationListener.class);
      listenerBinder.addBinding().to(JBossAdminApi.class);
      bind(IJBossUtil.class).to(JBossDelegator.class);
    } catch(Exception e) {
      logger.error("Failed to initialize maven artifact resolver.", e);
    }
  }
156934
public function configure()
    {
        $name = $this->current();
        $config = $this->config;

        $this->loadConfiguration($name, $config);

        /** @var UniformResourceLocator $locator */
        $locator = $this->grav['locator'];

        $registered = stream_get_wrappers();

        $schemes = $config->get("themes.{$name}.streams.schemes", []);
        $schemes += [
            'theme' => [
                'type' => 'ReadOnlyStream',
                'paths' => $locator->findResources("themes://{$name}", false)
            ]
        ];

        foreach ($schemes as $scheme => $config) {
            if (isset($config['paths'])) {
                $locator->addPath($scheme, '', $config['paths']);
            }
            if (isset($config['prefixes'])) {
                foreach ($config['prefixes'] as $prefix => $paths) {
                    $locator->addPath($scheme, $prefix, $paths);
                }
            }

            if (\in_array($scheme, $registered, true)) {
                stream_wrapper_unregister($scheme);
            }
            $type = !empty($config['type']) ? $config['type'] : 'ReadOnlyStream';
            if ($type[0] !== '\\') {
                $type = '\\RocketTheme\\Toolbox\\StreamWrapper\\' . $type;
            }

            if (!stream_wrapper_register($scheme, $type)) {
                throw new \InvalidArgumentException("Stream '{$type}' could not be initialized.");
            }
        }

        // Load languages after streams has been properly initialized
        $this->loadLanguages($this->config);
    }