-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37d721f
commit 3c4ae74
Showing
3 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), | ||
|
||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] | ||
); | ||
}); | ||
} | ||
} |