unifact / connector
Unifact connector
Requires
- php: >=5.5.9
- camspiers/json-pretty: 1.0.*
- illuminate/support: ~5.1
- monolog/monolog: 1.22.0
- mtdowling/cron-expression: ~1.0
Requires (Dev)
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
README
Intro
Unifact Connector package for Laravel 5.2
Installation
composer require unifact/connector
-
Add
Unifact\Connector\ConnectorServiceProvider
to app providers config -
Run
php artisan vendor:publish --provider="Unifact\Connector\ConnectorServiceProvider"
to copy the assets, config and migrations. -
Run
php artisan migrate
, there are three tables the system uses. -
Configure the following .env settings:
CONNECTOR_DOMAIN
: The full domain the connector routes are available on (default: 'connector.local.dev')CONNECTOR_PREFIX
: Prefix so we don't get route collisions with app routes (default: '/cnr')CONNECTOR_USER
: Username to access the connectorCONNECTOR_PASS
: Password to access the connector (must be hashed with sha1)CONNECTOR_QUEUE_HIGH
: Name of the high priority queueCONNECTOR_QUEUE_LOW
: Name of the low priority queueCONNECTOR_QUEUE_HIGH_THRESHOLD
: The threshold needed for a job to become high priority
The connector needs (need is a big word, but it's smart to do it like this) both a subdomain and a routing prefix in order to work without conflict with your application.
-
Look at the
/config/connector.php
file and optionally turn on Hipchat logging (various other logging methods are available and configurable). -
Turn your browser to the configured url and try to log in.
How to use
- Resolve
JobProviderContract
through the service container to insert connector jobs. - Listen for the
ConnectorRegisterEvent
to register JobHandlers and/or CronHandlers.
Run php artisan connector:run
to perform the cron event and handle all connector jobs.