tethys/app/Providers/SolariumServiceProvider.php

48 lines
1.2 KiB
PHP
Raw Permalink Normal View History

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(
'endpoint' => array(
'localhost' => array(
'host' => 'repository.geologie.ac.at',
'port' => '8983',
'path' => '/solr/',
'core' => 'rdr_data'
2018-08-06 12:30:51 +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-08-06 12:30:51 +00:00
}
public function provides()
{
return [Client::class];
}
}