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

Ossus Bundle Laravel Package

appventus/ossus-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the bundle via Composer (though note the package is archived and outdated):

    composer require appventus/ossus-bundle
    

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

    return [
        // ...
        AppVentus\OssusBundle\AvOssusBundle::class => ['all' => true],
    ];
    
  2. First Use Case: Fixture Loading The bundle appears to integrate with Alice (a fixture loader) via the alice keyword in composer.json. To load fixtures:

    • Place fixture files (e.g., load_users.yml) in data/fixtures/.
    • Load them via CLI:
      php bin/console doctrine:fixtures:load --append
      
    • Verify in README.md or description.md for specific Alice syntax (if documented).
  3. Key Files to Inspect

    • config/av_ossus.yml (if generated; check for default configs).
    • src/AppVentus/OssusBundle/ (core logic, likely extends Symfony’s Bundle base class).

Implementation Patterns

Workflow: Fixture Management

  1. Define Fixtures Use Alice’s YAML format (e.g., data/fixtures/users.yml):

    App\Entity\User:
      user{1..10}:
        email: <email()>
        roles: [ROLE_USER]
    
  2. Load Fixtures Programmatically Inject the Alice\Fixtures service (if exposed) or use the CLI command:

    $this->container->get('av_ossus.fixture_loader')->load('data/fixtures/users.yml');
    
    • Check Services.yml (if exists) for the exact service ID.
  3. Integration with Doctrine

    • Ensure doctrine:fixtures:load is configured in config/packages/doctrine.yaml:
      doctrine:
        fixtures:
          paths: ['%kernel.project_dir%/data/fixtures']
      
  4. Event-Driven Fixtures

    • Listen to kernel.request or console.command events to load fixtures dynamically:
      $eventDispatcher->addListener('kernel.request', function () {
          $this->get('av_ossus.fixture_loader')->load('dynamic_fixtures.yml');
      });
      

Common Patterns

  • Environment-Specific Fixtures Use separate fixture files (e.g., dev_users.yml, prod_users.yml) and load them conditionally:
    # config/packages/av_ossus.yaml
    av_ossus:
        fixture_paths:
            - '%kernel.project_dir%/data/fixtures/%env(APP_ENV)%'
    
  • Fixture Dependencies Load fixtures in order (e.g., users.yml before posts.yml) by leveraging Alice’s extends or CLI --order flag.

Gotchas and Tips

Pitfalls

  1. Archived Package Risks

    • The package is unmaintained (last release: 2016). Expect:
      • Compatibility issues with modern Symfony (tested on Symfony 2.x).
      • Missing features (e.g., no PHP 8 support, no Symfony Flex integration).
    • Mitigation: Fork the repo or use alternatives like nelmio/alice-data-fixtures.
  2. Doctrine Fixture Loader Conflicts

    • The bundle may conflict with Symfony’s built-in doctrine/doctrine-fixtures-bundle. Ensure only one fixture loader is active:
      # config/bundles.php
      // Disable the default fixture bundle if using AvOssusBundle
      Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => false,
      
  3. Missing Documentation

    • The README.md and description.md are empty or minimal. Assume:
      • Configuration is undocumented; inspect Resources/config/ for defaults.
      • Alice integration is the primary feature (no custom logic).
  4. Service Autowiring Issues

    • The bundle may not support Symfony’s autowiring. Manually define services in config/services.yaml:
      services:
          AvOssus\OssusBundle\Loader\FixtureLoader: ~
      

Debugging Tips

  1. Enable Debug Mode Add this to config/packages/dev/av_ossus.yaml (if it exists):

    av_ossus:
        debug: true
    
    • Check logs for fixture loading errors (var/log/dev.log).
  2. Verify Fixture Loading Use Doctrine’s fixtures:load with --debug:

    php bin/console doctrine:fixtures:load --debug --append
    
  3. Fallback to Alice Directly If the bundle fails, use Alice standalone:

    composer require nelmio/alice
    php bin/console alice:load
    

Extension Points

  1. Custom Fixture Loaders Extend the bundle’s loader class (likely Loader/FixtureLoader.php) to add:

    • Pre/post-load hooks.
    • Custom data transformers.
  2. Event Listeners Dispatch custom events (e.g., av_ossus.fixture.loaded) to react to fixture loads:

    // src/EventListener/FixtureListener.php
    class FixtureListener implements EventSubscriberInterface {
        public static function getSubscribedEvents() {
            return [
                'av_ossus.fixture.loaded' => 'onFixtureLoaded',
            ];
        }
    }
    
  3. Configuration Overrides Override default configs in config/packages/av_ossus.yaml:

    av_ossus:
        namespace: 'App\Entity'  # Custom entity namespace
        purge_before_load: true   # Clear DB before loading
    
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.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware