2018-08-06 12:30:51 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
use Solarium\Client;
|
2021-05-25 12:15:02 +00:00
|
|
|
use Solarium\Core\Client\Adapter\Curl;
|
|
|
|
use Symfony\Component\EventDispatcher\EventDispatcher;
|
2018-08-06 12:30:51 +00:00
|
|
|
|
|
|
|
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) {
|
2021-05-25 12:15:02 +00:00
|
|
|
|
|
|
|
$adapter = new Curl();
|
|
|
|
$dispatcher = new EventDispatcher();
|
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);
|
2021-05-25 12:15:02 +00:00
|
|
|
return new Client($adapter, $dispatcher, $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];
|
|
|
|
}
|
|
|
|
}
|