-
Notifications
You must be signed in to change notification settings - Fork 7
/
Plugin.php
48 lines (42 loc) · 1.62 KB
/
Plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php namespace Shohabbos\Elasticsearch;
use App;
use Backend;
use Elasticsearch\Client;
use Elasticsearch\ClientBuilder;
use System\Classes\PluginBase;
use Shohabbos\Elasticsearch\Classes\ElasticsearchclientServiceProvider;
class Plugin extends PluginBase
{
public function registerComponents()
{
}
public function registerSettings()
{
return [
'settings' => [
'label' => 'Elasticsearch settings',
'description' => 'Manage hosts and other settings of the plugin.',
'category' => 'Elasticsearch',
'icon' => 'icon-cog',
'class' => 'Shohabbos\Elasticsearch\Models\Settings',
'order' => 500,
'keywords' => 'elasticsearch search',
'permissions' => ['shohabbos.elasticsearch.manage_settings']
],
'settings-indexes' => [
'label' => 'Elasticsearch indexes',
'description' => 'Manage available indexes, create new indexex, reindex avaiable data.',
'category' => 'Elasticsearch',
'icon' => 'icon-search',
'url' => Backend::url('shohabbos/elasticsearch/indexes'),
'order' => 500,
'keywords' => 'elasticsearch index add index create new index'
]
];
}
public function register()
{
$this->registerConsoleCommand('shohabbos.reindex', 'Shohabbos\Elasticsearch\Console\ReindexCommand');
App::register(ElasticsearchclientServiceProvider::class);
}
}