You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
153 lines
5.5 KiB
153 lines
5.5 KiB
# This file is the entry point to configure your own services. |
|
# Files in the packages/ subdirectory configure your dependencies. |
|
|
|
# Put parameters here that don't need to change on each machine where the app is deployed |
|
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration |
|
parameters: |
|
encryption_key: '%env(APP_ENCRYPTION_KEY)%' |
|
mercure_public_hub_url: '%env(MERCURE_PUBLIC_URL)%' |
|
nostr_default_relay: '%env(default::NOSTR_DEFAULT_RELAY)%' |
|
elasticsearch_enabled: '%env(ELASTICSEARCH_ENABLED)%' |
|
|
|
services: |
|
# default configuration for services in *this* file |
|
_defaults: |
|
autowire: true # Automatically injects dependencies in your services. |
|
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc. |
|
bind: |
|
$nostrDefaultRelay: '%nostr_default_relay%' |
|
$environment: '%kernel.environment%' |
|
|
|
# makes classes in src/ available to be used as services |
|
# this creates a service per class whose id is the fully-qualified class name |
|
App\: |
|
resource: '../src/' |
|
exclude: |
|
- '../src/DependencyInjection/' |
|
- '../src/Entity/' |
|
- '../src/Kernel.php' |
|
|
|
# add more service definitions when explicit configuration is needed |
|
# please note that last definitions always *replace* previous ones |
|
Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler: |
|
arguments: |
|
- '%env(DATABASE_URL)%' |
|
|
|
# |
|
FOS\ElasticaBundle\Finder\FinderInterface: |
|
alias: fos_elastica.finder.articles |
|
|
|
# Redis |
|
Symfony\Component\Cache\Adapter\RedisAdapter: |
|
arguments: |
|
- '@Redis' |
|
|
|
|
|
Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler: |
|
arguments: |
|
- '@Redis' |
|
# you can optionally pass an array of options. The only options are 'prefix' and 'ttl', |
|
# which define the prefix to use for the keys to avoid collision on the Redis server |
|
# and the expiration time for any given entry (in seconds), defaults are 'sf_s' and null: |
|
# - { 'prefix': 'my_prefix', 'ttl': 600 } |
|
|
|
Redis: |
|
# you can also use \RedisArray, \RedisCluster, \Relay\Relay or \Predis\Client classes |
|
class: Redis |
|
lazy: true |
|
calls: |
|
- connect: |
|
- '%env(REDIS_HOST)%' |
|
- auth: |
|
- '%env(REDIS_PASSWORD)%' |
|
|
|
|
|
App\Provider\ArticleProvider: |
|
tags: |
|
- { name: fos_elastica.pager_provider, index: articles, type: article } |
|
|
|
App\Provider\UserProvider: |
|
tags: |
|
- { name: fos_elastica.pager_provider, index: users, type: user } |
|
|
|
App\EventListener\PopulateListener: |
|
tags: |
|
- { name: kernel.event_listener, event: 'FOS\\ElasticaBundle\\Event\\PostIndexPopulateEvent', method: 'postIndexPopulate' } |
|
|
|
App\Command\IndexArticlesCommand: |
|
arguments: |
|
$itemPersister: '@fos_elastica.object_persister.articles' |
|
|
|
App\EventListener\UserElasticsearchIndexListener: |
|
arguments: |
|
$userPersister: '@fos_elastica.object_persister.users' |
|
$elasticsearchEnabled: '%elasticsearch_enabled%' |
|
|
|
App\Command\NostrEventFromYamlDefinitionCommand: |
|
arguments: |
|
$itemPersister: '@fos_elastica.object_persister.articles' |
|
|
|
App\Util\NostrPhp\TweakedRequest: ~ |
|
swentel\nostr\Request\Request: '@App\Util\NostrPhp\TweakedRequest' |
|
|
|
# Search services - Elasticsearch implementation |
|
App\Service\Search\ElasticsearchArticleSearch: |
|
arguments: |
|
$finder: '@fos_elastica.finder.articles' |
|
$enabled: '%elasticsearch_enabled%' |
|
|
|
# Search services - Database implementation |
|
App\Service\Search\DatabaseArticleSearch: ~ |
|
|
|
# Search service factory |
|
App\Service\Search\ArticleSearchFactory: |
|
arguments: |
|
$elasticsearchEnabled: '%elasticsearch_enabled%' |
|
|
|
# Main search service - uses Elasticsearch if enabled, otherwise database |
|
App\Service\Search\ArticleSearchInterface: |
|
factory: ['@App\Service\Search\ArticleSearchFactory', 'create'] |
|
|
|
# User Search services - Elasticsearch implementation |
|
App\Service\Search\ElasticsearchUserSearch: |
|
arguments: |
|
$finder: '@fos_elastica.finder.users' |
|
$enabled: '%elasticsearch_enabled%' |
|
|
|
# User Search services - Database implementation |
|
App\Service\Search\DatabaseUserSearch: ~ |
|
|
|
# User Search service factory |
|
App\Service\Search\UserSearchFactory: |
|
arguments: |
|
$elasticsearchEnabled: '%elasticsearch_enabled%' |
|
|
|
# Main user search service - uses Elasticsearch if enabled, otherwise database |
|
App\Service\Search\UserSearchInterface: |
|
factory: ['@App\Service\Search\UserSearchFactory', 'create'] |
|
|
|
# UnfoldBundle services |
|
App\UnfoldBundle\Config\SiteConfigLoader: |
|
arguments: |
|
$unfoldCache: '@unfold.cache' |
|
|
|
App\UnfoldBundle\Content\ContentProvider: |
|
arguments: |
|
$unfoldCache: '@unfold.cache' |
|
|
|
App\UnfoldBundle\Http\HostResolver: ~ |
|
|
|
App\UnfoldBundle\Http\RouteMatcher: ~ |
|
|
|
App\UnfoldBundle\Theme\ContextBuilder: ~ |
|
|
|
App\UnfoldBundle\Theme\HandlebarsRenderer: |
|
arguments: |
|
$projectDir: '%kernel.project_dir%' |
|
|
|
App\UnfoldBundle\Controller\SiteController: |
|
tags: ['controller.service_arguments'] |
|
|
|
App\UnfoldBundle\Controller\UnfoldAdminController: |
|
tags: ['controller.service_arguments'] |
|
|
|
|