ablaise / meteion-bundle
MeteionBundle is a Symfony integration of the Meteion library.
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.2|^8.0
- ablaise/meteion: ^0.1
- symfony/framework-bundle: ^5.3|^6.0
Requires (Dev)
README
MeteionBundle is a Symfony integration of the Meteion library.
Key features
- Auto-configuration
- Commands
- Services
- Entities
Installation
First, you need to enable the recipes (contrib) using the following command.
composer config extra.symfony.allow-contrib true
Then add MeteionBundle using the following command.
composer require ablaise/meteion-bundle
Getting Started
Environment Variable
You only need to fill in the environment variable METEION_RAWEXD_PATH
which indicates the location of the rawexd
directory extracted using SaintCoinach.
###> ablaise/meteion-bundle ###
METEION_RAWEXD_PATH="/path/to/rawexd"
###< ablaise/meteion-bundle ###
Configuration
You can leave the default settings unless you need to specify a different dbal connection.
# config/packages/meteion.yaml meteion: dbal_connection: 'default' rawexd_path: '%env(string:METEION_RAWEXD_PATH)%'
Command
Once you have defined your DATABASE_URL
connection, you can simply create the associated database and run Meteion using the following commands.
php bin/console doctrine:database:create php bin/console meteion:run
Remember to allocate enough resources to your server before running the meteion:run
command.
Meteion As A Service
The MeteionManager
service allows you to use Meteion without additional configuration using dependency injection.
public function meteion(MeteionManager $manager) { $manager->run(); // ... }
Ready to use Entities
Entities are available under the namespace MeteionBundle\Entity
.
use MeteionBundle\Entity\Quest; public function meteion(ManagerRegistry $doctrine) { $quest = $doctrine->getRepository(Quest::class)->findOneBy(['name' => 'Coming to Gridania']); // ... }
Linking subfolders metadata
Entities with the Metadata
suffix contained in the subfolders can be linked using the referenceTable
field.
use MeteionBundle\Entity\Quest; use MeteionBundle\Entity\QuestMetadata; public function meteion(ManagerRegistry $doctrine) { $quest = $doctrine->getRepository(Quest::class)->findOneBy(['name' => 'Coming to Gridania']); if (false !== $quest) { $dialogs = $doctrine->getRepository(QuestMetadata::class)->findBy(['referenceTable' => $quest->getId()], ['pk' => 'ASC']); } // ... }
What's next?
- New entity-related services
- Improved commands