src/PHPDish/Bundle/CoreBundle/DependencyInjection/Compiler/AlgoliaPass.php
public function process(ContainerBuilder $container)
    {
        if ($algoliaClient = $container->findDefinition('algolia_client')) {
            $algoliaClient->setArguments([
                '%algolia.application_id%',
                '%algolia.api_key%',
            ]);
        }
        //没有设置账号的不开启
        if (!$container->hasParameter('algolia.application_id') ||
            ($container->getParameter('algolia.application_id') === 'phpdish'
            && $container->getParameter('algolia.api_key') === 'phpdish')
        ) {
            $container->setAlias('search.engine', 'search.engine.null');
            $container->findDefinition('search.search_indexer_subscriber')
                ->replaceArgument(1, [])
                ->clearTags();
        }
    }
public function process(ContainerBuilder $container)
    {
        if ($algoliaClient = $container->findDefinition('algolia_client')) {
            $algoliaClient->setArguments([
                '%algolia.application_id%',
                '%algolia.api_key%',
            ]);
        }
        //没有设置账号的不开启
        if (!$container->hasParameter('algolia.application_id') ||
            ($container->getParameter('algolia.application_id') === 'phpdish'
            && $container->getParameter('algolia.api_key') === 'phpdish')
        ) {
            $container->setAlias('search.engine', 'search.engine.null');
            $container->findDefinition('search.search_indexer_subscriber')
                ->replaceArgument(1, [])
                ->clearTags();
        }
    }
{@inheritdoc}