MeteionBundle is a Symfony integration of the Meteion library.
- Auto-configuration
- Commands
- Services
- Entities
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
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 ###
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)%'
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.
The MeteionManager
service allows you to use Meteion without additional configuration using dependency injection.
public function meteion(MeteionManager $manager)
{
$manager->run();
// ...
}
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']);
// ...
}
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']);
}
// ...
}
- New entity-related services
- Improved commands