/** * {@inheritDoc} */ public function integrate(Aurex $aurex) { $aurex->register(new FormServiceProvider()); $aurex->register(new SessionServiceProvider()); $aurex->register(new TranslationServiceProvider(), ['locale' => 'en']); $aurex['form.extensions'] = $aurex->extend('form.extensions', function ($extensions, $app) { $managerRegistry = new FormManagerRegistry(null, [], ['default'], null, null, '\\Doctrine\\ORM\\Proxy\\Proxy'); $managerRegistry->setContainer($app); unset($extensions); return [new DoctrineOrmExtension($managerRegistry)]; }); $aurex->getInjector()->share($aurex['form.factory']); }
/** * {@inheritDoc} */ public function integrate(Aurex $aurex) { $aurex->register(new TwigServiceProvider(), ['cache' => __DIR__ . '/../../../Application/Cache/Twig', 'twig.path' => __DIR__ . '/../../../../../web/templates', 'twig.options' => ['debug' => (string) ($aurex->getEnvironment() === "dev") ? true : false]]); $this->addAssetFunction($aurex); $aurex->getInjector()->share($aurex['twig']); $aurex->getInjector()->share($aurex['url_generator']); }
/** * {@inheritDoc} */ public function integrate(Aurex $aurex) { $config = $aurex->getConfiguration(self::CONFIG_KEY); $logName = $config['log_name'] === null ? self::DEFAULT_LOG_NAME : $config['log_name']; $logFile = $config['log_file'] === null ? self::DEFAULT_LOG_FILE : $config['log_file']; $aurex->register(new MonologServiceProvider(), ['monolog.name' => $logName, 'monolog.logfile' => $logFile]); }
/** * {@inheritDoc} */ public function integrate(Aurex $aurex) { $config = $aurex->getConfiguration(self::CONFIG_KEY); $aurex->register(new DoctrineServiceProvider(), ['db.options' => $config]); $configType = 'annotation'; $entityDirectory = __DIR__ . '/../../../Application/Model/Entity'; $entityNamespace = 'Aurex\\Application\\Model\\Entity'; $cacheObject = !$aurex['debug'] && extension_loaded('apc') ? new ApcCache() : new ArrayCache(); $cacheDirectory = __DIR__ . '/../../../Application/Cache/Doctrine'; $cacheNamespace = 'Aurex\\Application\\Cache\\Doctrine'; $mappings = ['mappings' => [['type' => $configType, 'path' => $entityDirectory, 'namespace' => $entityNamespace]]]; $aurex->register(new DoctrineOrmServiceProvider(), ['orm.proxies_dir' => $cacheDirectory, 'orm.proxies_namespace' => $cacheNamespace, 'orm.cache' => $cacheObject, 'orm.auto_generate_proxies' => true, 'orm.em.options' => $mappings]); /** @var Connection $orm */ $orm = $aurex['orm.em']; /** @var Configuration $ormConfig */ $ormConfig = $orm->getConfiguration(); $ormConfig->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader(), [$entityDirectory])); $aurex->getInjector()->share($aurex['orm.em']); $aurex->getInjector()->share($aurex['db']); }
/** * {@inheritDoc} */ public function integrate(Aurex $aurex) { $config = $aurex->getConfiguration(self::CONFIG_KEY); $firewalls = $config['firewalls']; $hierarchy = $config['hierarchy']; $accessRules = $config['access_rules']; $firewalls['default']['users'] = function ($aurex) { /** @var EntityManager $orm */ $orm = $aurex['orm.em']; return new UserRepository($orm, new ClassMetadata('Aurex\\Application\\Model\\Entity\\User')); }; $aurex->register(new SecurityServiceProvider(), ['security.firewalls' => $firewalls, 'security.role_hierarchy' => $hierarchy, 'security.access_rules' => $accessRules]); $aurex['security.encoder.digest'] = function () { return new BCryptPasswordEncoder(10); }; }