tarioch / eveapi-fetcher-bundle
Provides automatic EVE Online Api fetching to your Symfony2 project.
Installs: 187
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 7
Forks: 1
Open Issues: 3
Type:symfony-bundle
Requires
- php: >=5.4.4
- doctrine/doctrine-bundle: >=1.2
- doctrine/doctrine-migrations-bundle: >=1.0
- doctrine/migrations: >=1.0@dev
- doctrine/orm: >=2.2.3
- jms/di-extra-bundle: >=1.4
- mmoreram/gearman-bundle: >=2.3
- symfony/framework-bundle: >=2.3
- symfony/monolog-bundle: >=2.3
- tarioch/pheal-bundle: 0.1.*
Requires (Dev)
- doctrine/doctrine-fixtures-bundle: dev-master
- liip/functional-test-bundle: ~1.0
- mockery/mockery: ~0.9
- phpmd/phpmd: ~2.0
- phpunit/phpunit: ~4.0
- squizlabs/php_codesniffer: ~2.0
This package is not auto-updated.
Last update: 2025-02-26 15:19:48 UTC
README
Copyright (C) 2013 - 2015 by Patrick Ruckstuhl All rights reserved.
Symfony bundle for automatic fetching of the EVE Online API, heavily inspired by Yapeal and makes use of PhealNG
LICENSE
EVE Api Fetcher Bundle is licensed under a MIT style license, see LICENSE.txt for further information
Dependencies
- Gearman Server + PHP Module: http://gearman.org/
- Symfony http://symfony.com
- Optional: Supervisord http://supervisord.org
INSTALLATION
First you need to add tarioch/eveapi-fetcher-bundle
to composer.json
:
{ "require": { "tarioch/eveapi-fetcher-bundle": "dev-master" } }
Bundles
You have to add the following Bundles to your AppKernel.php
:
// app/AppKernel.php //... class AppKernel extends Kernel { //... public function registerBundles() { $bundles = array( ... new JMS\DiExtraBundle\JMSDiExtraBundle($this), new JMS\AopBundle\JMSAopBundle(), new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(), new Mmoreram\GearmanBundle\GearmanBundle(), new Tarioch\PhealBundle\TariochPhealBundle(), new Tarioch\EveapiFetcherBundle\TariochEveapiFetcherBundle(), ); //... return $bundles; } //... }
Configuration
You have to add the following things to your config
- Annotation parsing
- Entity manager
- Doctrine migrations
- Gearman
// app/config/config.yml // ... jms_di_extra: locations: all_bundles: false bundles: [TariochPhealBundle, TariochEveapiFetcherBundle] doctrine: dbal: connections: eveapi: driver: "%database_driver%" host: "%database_host%" port: "%database_port%" dbname: "%database_eveapi_name%" user: "%database_user%" password: "%database_password%" charset: UTF8 mapping_types: enum: string orm: entity_managers: eveapi: connection: eveapi mappings: TariochEveapiFetcherBundle: ~ doctrine_migrations: # workaround, see http://stackoverflow.com/questions/17066670/symfony2-change-migration-directory dir_name: '%kernel.root_dir%/../vendor/tarioch/eveapi-fetcher-bundle/Tarioch/EveapiFetcherBundle/DoctrineMigrations' doctrine_cache: providers: gearman_cache: type: file_system namespace: doctrine_cache.ns.gearman gearman: bundles: TariochEveapiFetcherBundle: name: TariochEveapiFetcherBundle active: true include: - Component/Worker defaults: method: doNormal iterations: 50 callbacks: false job_prefix: null generate_unique_key: true workers_name_prepend_namespace: false servers: localhost: host: 127.0.0.1 port: 4730 tarioch_pheal: user_agent: yourname@example.tld
Database
For getting the correct database schema, run
php app/console doctrine:migrations:migrate --em=eveapi
Running
The best way to run this is to have a minutely cron job that schedules missing api calls and use supervisord for actually running the workers.
Cronjob
* * * * * su www-data -c '/usr/bin/php /path/to/app/console eve:api:schedule --env=prod'
Supervisord
[program:evetool]
process_name=evetool%(process_num)s
command=/usr/bin/php /path/to/app/console gearman:worker:execute TariochEveapiFetcherEveWorker --env=prod --no-interaction
numprocs=10
autostart=true
autorestart=true
user=www-data
Getting started
Simply insert a key into the table apiKey and all available and implemented api data will be fetched.
Help
Feel free to open an issue if you have an issues or questions.