Registers aspects written within source files which we might encounter

@param \AppserverIo\Psr\Application\ApplicationInterface $application The application instance

@return void
420940
protected function registerAspectClasses(ApplicationInterface $application)
    {

        // check directory for PHP files with classes we want to register
        /** @var \AppserverIo\Appserver\Core\Api\DeploymentService $service */
        $service = $application->newService('AppserverIo\Appserver\Core\Api\DeploymentService');

        // iterate over the directories and try to find aspects
        $aspectDirectories = $service->globDir($this->getWebappPath() . DIRECTORY_SEPARATOR . '{WEB-INF,META-INF,common}' .
            DIRECTORY_SEPARATOR . 'classes', GLOB_BRACE);
        foreach ($aspectDirectories as $aspectDirectory) {
            // iterate all PHP files found in the directory
            foreach ($service->globDir($aspectDirectory . DIRECTORY_SEPARATOR . '*.php') as $phpFile) {
                try {
                    // cut off the META-INF directory and replace OS specific directory separators
                    $relativePathToPhpFile = str_replace(DIRECTORY_SEPARATOR, '\\', str_replace($aspectDirectory, '', $phpFile));

                    // now cut off the .php extension
                    $className = substr($relativePathToPhpFile, 0, -4);

                    // we need a reflection class to read the annotations
                    $reflectionClass = $this->getReflectionClass($className);

                    // if we found an aspect we have to register it using our aspect register class
                    if ($reflectionClass->hasAnnotation(AspectAnnotation::ANNOTATION)) {
                        $parser = new AspectParser($phpFile, new Config());
                        $this->aspectRegister->register(
                            $parser->getDefinition($reflectionClass->getShortName(), false)
                        );
                    }

                // if class can not be reflected continue with next class
                } catch (\Exception $e) {
                    // log an error message
                    $application->getInitialContext()->getSystemLogger()->error($e->__toString());

                    // proceed with the next class
                    continue;
                }
            }
        }
    }
1226493
public function onPeridotConfigure(CoreConfiguration $configuration, Application $application)
    {
        $this->configuration = new Configuration($configuration);
        $this->application = $application;
    }
474039
protected function registerConfigs(Application $app)
    {
        $base = $app['path.base'];

        if (file_exists("$base/.env")) {
            $dotenv = \Dotenv::load($base);
        }

        $preloadedVars = [
            'env.DEBUG'              => $app['debug'],
            'env.AUTO_REBUILD'       => $app['auto_rebuild'],
            'env.DOMAIN'             => isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'skimpy.dev',
            'path.base'              => $base,
        ];

        $envVars = $_ENV;
        foreach ($envVars as $k => $v) {
            $preloadedVars["env.$k"] = $v;
        }

        $app->register(new \Igorw\Silex\ConfigServiceProvider("$base/config/site.php"));
    }
787212
public function register(Application $app)
	{
		$assets = $this;
		$app['assets'] = $app->share(function() use($app, $assets){
			
			return $assets;
		});
	}
238753
public function updateResponse(ApplicationInterface $application, RequestInterface $request, ResponseInterface $response): void
    {
        parent::updateResponse($application, $request, $response);

        $locationUrl = Url::parseRelative($this->location, $request->getUrl());
        $response->setHeader('Location', $locationUrl->__toString());
    }
745453
public function register(Application $app)
    {
        $this->registerTranslationMessages($app);
        $this->registerWriters($app);
        $this->registerDependenciesOnXsltExtension($app);

        $app->register(new \phpDocumentor\Plugin\Graphs\ServiceProvider());
        $app->register(new \phpDocumentor\Plugin\Twig\ServiceProvider());
    }
864523
public function registerAspect(Aspect $aspect): void
    {
        $refAspect = new ReflectionClass($aspect);
        $this->set("aspect.{$refAspect->name}", $aspect, ['aspect']);
        $this->addResource($refAspect->getFileName());
    }
433368
public function register(Application $app)
    {
        $app['parser.example.finder'] = new Example\Finder();

        $this->addCache($app);
        $this->addAssemblers($app);
        $this->addFilters($app);
        $this->addValidators($app);
        $this->addBuilder($app);

        // I would prefer to extend it but due to a circular reference will pimple fatal
        $this->attachFiltersToManager($app['descriptor.filter'], $app);

        $app['descriptor.analyzer'] = function () {
            return new ProjectAnalyzer();
        };
    }
589509
public function registerExtension(ExtensionInterface $extension)
    {
        $extension->setEngine($this);

        foreach ($extension->functions() as $func) {
            $this->registerFunction($func);
        }
    }
284762
public function register(Application $app)
    {
        parent::register($app);

        $app->register(
            new \Silex\Provider\DoctrineServiceProvider(),
            ['db.options' => $app['config']['db.options']]
        );
        $app->register(
            new DoctrineOrmServiceProvider(),
            $app['config']['orm.options']
        );

        if (getenv('MIGRATION_COMMANDS')) {
            $app->register(new MigrationServiceProvider(), [
                'db.migrations.path' =>$app['config']['migrations.directory'],
            ]);
        }

        $app['orm.em'] = $app->extend('orm.em', function(EntityManagerInterface $em) use($app) {
            if (file_exists(APP_PATH.'/vendor/apitude/apitude/src/Annotations/APIAnnotations.php')) {
                AnnotationRegistry::registerFile(APP_PATH.'/vendor/apitude/apitude/src/Annotations/APIAnnotations.php');
            }
            /** @var Configuration $config */
            $config = $em->getConfiguration();
            $config->setMetadataCacheImpl($app['cache']);
            $config->addCustomHydrationMode('simple', SimpleHydrator::class);

            /** @var MappingDriverChain $driver */
            $driver = $config->getMetadataDriverImpl();

            // gedmo initialization
            $reader = new AnnotationReader();
            $cache = new CachedReader($reader, $app['cache']);
            DoctrineExtensions::registerAbstractMappingIntoDriverChainORM(
                $driver,
                $cache
            );

            return $em;
        });
    }
529854
final protected function resolveApplicationBindings($app): void
    {
        foreach ($this->overrideApplicationBindings($app) as $original => $replacement) {
            $app->bind($original, $replacement);
        }
    }
444357
public static void register(Application application, ApptentiveConfiguration configuration) {
		if (application == null) {
			throw new IllegalArgumentException("Application is null");
		}

		if (configuration == null) {
			throw new IllegalArgumentException("Apptentive configuration is null");
		}

		try {
			ApptentiveInternal.createInstance(application, configuration);
		} catch (Exception e) {
			ApptentiveLog.e(e, "Exception while registering Apptentive SDK");
			logException(e);
		}
	}
557517
public function setApplication(ApplicationInterface $application, $status = null)
    {
        $this->application = $application;
        $this->setTo(
            $application->getJob()->getUser()->getInfo()->getEmail(),
            $application->getJob()->getUser()->getInfo()->getDisplayName(false)
        );
        $this->setVariablesFromApplication($application);
        return $this;
    }
1268430
private function showRegisteredAspectsInfo(SymfonyStyle $io, array $aspects): void
    {
        foreach ($aspects as $aspect) {
            $this->showAspectInfo($io, $aspect);
        }
    }
466791
public function register(Application $app)
    {
        $prefix = $this->prefix;

        foreach(array('.server', '.options', '.attributes') as $key) {
            if (!(isset($app[$prefix . $key]))) {
                $app[$prefix. $key] = array();
            }
        }

        $app[$prefix] = $this->getPdo($app, $prefix);
    }
782605
public function register(Application $application)
    {
        $provider = $this->getProvider();
        $config   = $this->getConfig();

        return $application->register(new $provider(), $config->process());
    }
221377
public function setApplication($application) {
        $this->application = $application;
        foreach($this->translations as $locale => $translations) {
            foreach($translations as $translation) {
                $translation->translation_key = $this;
            }
        }
    }