fei / bid-package
Bid client package integration for Objective PHP applications
Installs: 99
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 16
Forks: 0
Open Issues: 0
Type:project
Requires
- fei/bid-client: ~2.0.0
- objective-php/application: ~1.1.0
Requires (Dev)
- jakub-onderka/php-parallel-lint: ^0.9.2
- phpmd/phpmd: ^2.6
- phpro/grumphp: ^0.11.1
- sebastian/phpcpd: ^2.0
- squizlabs/php_codesniffer: ^2.7
README
This package provide Bidder Client integration for Objective PHP applications.
Installation
Bid Package needs PHP 7.0 or up to run correctly.
You will have to integrate it to your Objective PHP project with composer require fei/bid-package
.
Integration
As shown below, the Bid Package must be plugged in the application initialization method.
The Bid Package create a Bidder Client service that will be consumed by the application's middlewares.
<?php use ObjectivePHP\Application\AbstractApplication; use Fei\Service\Bid\Package\BidPackage; class Application extends AbstractApplication { public function init() { /** @var AbstractApplication $this */ // Define some application steps $this->addSteps('bootstrap', 'init', 'auth', 'route', 'rendering'); // Initializations... // Plugging the Bid Package in the bootstrap step $this->getStep('bootstrap') ->plug(BidPackage::class); // Another initializations... } }
Application configuration
Create a file in your configuration directory and put your Bidder configuration as below:
<?php use Fei\Service\Bid\Package\Config\BidBaseUrl; use Fei\Service\Bid\Package\Config\BidAuthorization; return [ (new BidBaseUrl())->setBaseUrl('http://bid.dev:8181'), (new BidAuthorization())->setAuthorization('authorizationKey') ];
In the previous example you need to set this configuration:
BidBaseUrl
: represent the URL where the API can be contacted in order to send the bidsBidAuthorization
: represent the Authorization Key to access on Bid Api server
Please check out bid-client
documentation for more information about how to use this client.