Skip to content

Commit

Permalink
Laravel 5.x integration
Browse files Browse the repository at this point in the history
  • Loading branch information
robgridley committed May 31, 2016
1 parent 37d721f commit 3c4ae74
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 0 deletions.
42 changes: 42 additions & 0 deletions config/pace.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Pace Server Address
|--------------------------------------------------------------------------
|
| The Pace server host name or IP address (port is optional in both cases).
|
| Format: epace.printcompany.com:8443 or 10.10.10.10
|
*/

'host' => env('PACE_HOST'),

/*
|--------------------------------------------------------------------------
| Pace System User
|--------------------------------------------------------------------------
|
| The provided system user must have "Allow remote API usage" enabled.
|
*/

'login' => env('PACE_LOGIN'),

'password' => env('PACE_PASSWORD'),

/*
|--------------------------------------------------------------------------
| URL Scheme
|--------------------------------------------------------------------------
|
| Supported: "https", "http"
|
*/

'scheme' => env('PACE_SCHEME', 'https'),

];
19 changes: 19 additions & 0 deletions src/Facades/Pace.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Pace\Facades;

use Pace\Client;
use Illuminate\Support\Facades\Facade;

class Pace extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return Client::class;
}
}
41 changes: 41 additions & 0 deletions src/PaceServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace Pace;

use Pace\Soap\Factory as SoapFactory;
use Illuminate\Support\ServiceProvider;

class PaceServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
$this->publishes([
__DIR__.'/../config/pace.php' => config_path('pace.php'),
]);
}

/**
* Register the application services.
*
* @return void
*/
public function register()
{
$this->app->singleton(Client::class, function ($app) {
$config = $app['config']['pace'];

return new Client(
new SoapFactory(),
$config['host'],
$config['login'],
$config['password'],
$config['scheme']
);
});
}
}

0 comments on commit 3c4ae74

Please sign in to comment.