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

Core Bundle Laravel Package

bean-project/core-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the bundle via Composer (if still available in packagist or via private repo):

    composer require bean-project/core-bundle
    

    Register in config/bundles.php:

    return [
        // ...
        Bean\Bundle\CoreBundle\BeanCoreBundle::class => ['all' => true],
    ];
    
  2. First Use Case The bundle appears to abstract Symfony core functionality (likely beans/dependency injection). Start by checking:

    • src/Bean/Bundle/CoreBundle/DependencyInjection/ for configuration schemas.
    • Resources/config/services.xml for default service definitions.
    • Test with a simple service:
      # config/services.yaml
      services:
          _defaults:
              autowire: true
              autoconfigure: true
              public: false
          App\Service\TestService:
              tags: ['bean.core.tag']  # Hypothetical tag (verify in docs)
      
  3. Key Entry Points

    • Configuration: Check BeanCoreBundleExtension for supported parameters.
    • Commands: Look for BeanCoreBundle console commands (if any).
    • Events: Scan for BeanCoreEvents (e.g., bean.core.event).

Implementation Patterns

Core Workflows

  1. Service Registration Extend Symfony’s DI with bean-specific configurations:

    # Override a service with bean-specific logic
    services:
        App\Service\MyService:
            factory: ['@bean.core.factory', 'createBean']
            arguments:
                - '%bean.core.param%'
    
  2. Bean Lifecycle Hooks If the bundle supports lifecycle callbacks (common in bean frameworks):

    use Bean\CoreBundle\Annotation\BeanLifecycle;
    
    class MyBean {
        /**
         * @BeanLifecycle("postConstruct")
         */
        public function init() {
            // Post-construction logic
        }
    }
    
  3. Configuration-Driven Beans Use YAML/XML to define beans (if supported):

    <!-- Resources/config/beans.xml -->
    <bean id="app.myBean" class="App\Bean\MyBean">
        <property name="dependency" ref="app.dependencyBean"/>
    </bean>
    
  4. Integration with Symfony Components

    • Event Dispatcher: Attach listeners to bean.core.* events.
    • Validator: Use BeanCoreBundle validators via constraints:
      use Bean\CoreBundle\Validator\Constraints\BeanValid;
      
      class MyEntity {
          /**
           * @BeanValid()
           */
          public $field;
      }
      
  5. Command-Line Tools If the bundle includes CLI tools (e.g., bean inspection):

    php bin/console bean:list  # Hypothetical command
    

Gotchas and Tips

Common Pitfalls

  1. Deprecated/Stale Code

    • Last release in 2018 suggests potential compatibility issues with modern Symfony (5.4+/6.x).
    • Tip: Test with symfony/flex recipes or check for forks (e.g., bean-project/core-bundle on GitHub may be abandoned).
  2. Lack of Documentation

    • Workaround: Reverse-engineer from:
      • DependencyInjection/BeanCoreExtension.php (configuration logic).
      • Resources/config/ (default service definitions).
      • Tests/ (usage examples).
    • Tip: Use php bin/console debug:container to inspect registered beans.
  3. Namespace Collisions

    • The bundle may use Bean\ namespace, which could conflict with other libraries.
    • Fix: Alias services in services.yaml:
      services:
          bean.core.service:
              alias: App\Service\BeanService
      
  4. Event System Quirks

    • If events exist (e.g., BeanCoreEvents), ensure they’re dispatched in the correct order:
      $dispatcher->dispatch(new BeanCoreEvent($bean), BeanCoreEvents::POST_LOAD);
      
  5. Configuration Overrides

    • The bundle may not support modern Symfony’s autoconfigure/autowire fully.
    • Tip: Manually define services in config/packages/bean_core.yaml:
      bean_core:
            enabled: true
            debug: '%kernel.debug%'
      

Debugging Tips

  1. Service Dumping

    php bin/console debug:container Bean\  # List all BeanCoreBundle services
    
  2. Event Listeners Dump dispatched events:

    $dispatcher->addListener(BeanCoreEvents::PRE_LOAD, function ($event) {
        error_log("Bean loaded: " . $event->getBean());
    });
    
  3. Logging Enable debug mode and check var/log/dev.log for BeanCoreBundle entries.

Extension Points

  1. Custom Bean Factories Implement Bean\CoreBundle\Factory\BeanFactoryInterface for custom bean creation.

  2. Annotations If annotations are supported (e.g., @Bean), extend:

    use Doctrine\Common\Annotations\Annotation;
    class CustomBeanAnnotation extends Annotation {}
    
  3. Compiler Passes Add custom logic during kernel compilation:

    use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
    class MyBeanPass implements CompilerPassInterface {
        public function process(ContainerBuilder $container) {
            // Modify BeanCoreBundle services
        }
    }
    
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.
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed