Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Pomm Symfony Bridge Laravel Package

conserto/pomm-symfony-bridge

Symfony bridge for Pomm, providing a profiler integration for the full-stack framework. Fork of the original pomm-symfony-bridge and typically installed via conserto/pomm-bundle rather than directly.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the package via Composer (now requires Symfony 8+):

    composer require conserto/pomm-symfony-bridge:^6.0
    

    Register the bundle in config/bundles.php (Symfony 8+):

    return [
        // ...
        Conserto\PommSymfonyBridge\PommSymfonyBridgeBundle::class => ['all' => true],
    ];
    
  2. Enable Profiling Add the profiler to Symfony 8's profiler toolbar:

    # config/packages/dev/profiler.yaml
    framework:
        profiler:
            collectors:
                pomm: true
    
  3. First Use Case Inject the Pomm\Client into a service and use it as usual. The profiler will automatically capture:

    • Query execution time
    • Parameter binding
    • Resultset metadata Access via /_profiler/pomm in dev mode.

Implementation Patterns

Common Workflows

  1. Symfony 8 Dependency Injection Bind Pomm\Client using Symfony 8's autowiring or explicit configuration:

    # config/services.yaml
    services:
        App\Services\DatabaseService:
            arguments:
                $pommClient: '@pomm.client'
    
  2. Query Logging Middleware (Symfony 8) Extend the profiler to log queries using Symfony 8's event system:

    use Conserto\PommSymfonyBridge\EventListener\PommProfilerListener;
    use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
    
    class CustomPommListener {
        #[AsEventListener(event: 'pomm.query.executed')]
        public function onQueryExecuted(PommQueryEvent $event) {
            // Custom logic (e.g., log to Sentry)
        }
    }
    
  3. Performance Comparison with Symfony 8 Use the profiler to compare query performance across environments:

    $profiler = $this->container->get('profiler');
    $data = $profiler->loadProfile('pomm')->getData();
    

Integration Tips

  • Symfony 8 Compatibility: Ensure your Symfony 8 app uses symfony/dependency-injection and symfony/http-kernel v6.x.
  • Async Queries: Profile asynchronous queries by wrapping Pomm\Client calls in Symfony 8's MessengerComponent.
  • Custom Data Collectors: Extend PommDataCollector to add domain-specific metrics (Symfony 8's DataCollector interface):
    use Symfony\Component\HttpFoundation\Request;
    use Symfony\Component\HttpFoundation\Response;
    
    class CustomPommDataCollector extends PommDataCollector {
        public function collect(Request $request, Response $response, \Throwable $exception = null) {
            // Custom logic for Symfony 8
        }
    }
    

Gotchas and Tips

Pitfalls

  1. Symfony 8 Dependency The package requires Symfony 8+. Ensure your project is upgraded:

    composer require symfony/*:^6.0
    
  2. Dev-Only Feature The profiler is disabled in production by default. Avoid relying on profiler data in non-dev environments.

  3. Memory Overhead Complex queries with large resultsets may increase memory usage. Disable profiling for bulk operations:

    $client->getProfiler()->disable();
    

Debugging

  • Missing Data: Ensure pomm.client is properly configured in Symfony 8's DI container and the profiler is enabled.
  • Slow Queries: Use the profiler’s "slowest queries" tab to identify bottlenecks.
  • Event Listeners: Debug listener issues by checking Symfony 8's event dispatcher logs.

Extension Points

  1. Custom Profiler Data Override PommDataCollector::collect() to add custom metrics (Symfony 8 compatible):

    public function collect(Request $request, Response $response, \Throwable $exception = null) {
        $profiler = $this->getPommProfiler();
        $profiler->addCustomData('app_metric', $this->calculateCustomMetric());
    }
    
  2. Query Filtering Filter profiled queries by type or namespace (Symfony 8 event system):

    $profiler->setQueryFilter(function ($query) {
        return strpos($query->getSql(), 'SELECT') !== false;
    });
    
  3. Profiler Storage Persist profiler data to a database for historical analysis (Symfony 8 compatible):

    $profiler->setStorage(new DoctrinePommProfilerStorage($entityManager));
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity