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],
];
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:
load_users.yml) in data/fixtures/.php bin/console doctrine:fixtures:load --append
README.md or description.md for specific Alice syntax (if documented).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).Define Fixtures
Use Alice’s YAML format (e.g., data/fixtures/users.yml):
App\Entity\User:
user{1..10}:
email: <email()>
roles: [ROLE_USER]
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');
Services.yml (if exists) for the exact service ID.Integration with Doctrine
doctrine:fixtures:load is configured in config/packages/doctrine.yaml:
doctrine:
fixtures:
paths: ['%kernel.project_dir%/data/fixtures']
Event-Driven Fixtures
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');
});
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)%'
users.yml before posts.yml) by leveraging Alice’s extends or CLI --order flag.Archived Package Risks
nelmio/alice-data-fixtures.Doctrine Fixture Loader Conflicts
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,
Missing Documentation
README.md and description.md are empty or minimal. Assume:
Resources/config/ for defaults.Service Autowiring Issues
config/services.yaml:
services:
AvOssus\OssusBundle\Loader\FixtureLoader: ~
Enable Debug Mode
Add this to config/packages/dev/av_ossus.yaml (if it exists):
av_ossus:
debug: true
var/log/dev.log).Verify Fixture Loading
Use Doctrine’s fixtures:load with --debug:
php bin/console doctrine:fixtures:load --debug --append
Fallback to Alice Directly If the bundle fails, use Alice standalone:
composer require nelmio/alice
php bin/console alice:load
Custom Fixture Loaders
Extend the bundle’s loader class (likely Loader/FixtureLoader.php) to add:
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',
];
}
}
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
How can I help you explore Laravel packages today?