2018-08-06 12:30:51 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
use Solarium\Client;
|
|
|
|
|
|
|
|
class SolariumServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
protected $defer = true;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register the application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
2018-11-08 16:47:27 +00:00
|
|
|
$this->app->bind(Client::class, function ($app) {
|
2018-08-06 12:30:51 +00:00
|
|
|
// $config = config('solarium');
|
|
|
|
$config = array(
|
2018-11-27 11:21:42 +00:00
|
|
|
'endpoint' => array(
|
|
|
|
'localhost' => array(
|
2019-09-20 17:00:57 +00:00
|
|
|
'host' => 'repository.geologie.ac.at',
|
2018-11-27 11:21:42 +00:00
|
|
|
'port' => '8983',
|
|
|
|
'path' => '/solr/',
|
2019-09-20 17:00:57 +00:00
|
|
|
'core' => 'rdr_data'
|
2018-08-06 12:30:51 +00:00
|
|
|
)
|
2018-11-27 11:21:42 +00:00
|
|
|
)
|
|
|
|
);
|
2018-08-06 12:30:51 +00:00
|
|
|
//return new Client($config);
|
2018-11-27 11:21:42 +00:00
|
|
|
return new Client($config);
|
2018-08-06 12:30:51 +00:00
|
|
|
//return new Client($app['config']['solarium']);
|
2018-11-27 11:21:42 +00:00
|
|
|
});
|
2018-08-06 12:30:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function provides()
|
|
|
|
{
|
|
|
|
return [Client::class];
|
|
|
|
}
|
|
|
|
}
|