-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmodule.config.php
116 lines (107 loc) · 4.1 KB
/
module.config.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
declare(strict_types=1);
namespace TypesenseSearch;
use Laminas\Router\Http\Literal;
return [
'view_manager' => [
'template_path_stack' => [
dirname(__DIR__) . '/view',
],
'strategies' => [
# makes it possible to return json in api response.
'ViewJsonStrategy',
],
],
'form_elements' => [
'invokables' => [
# module configuration form
Form\ConfigForm::class => Form\ConfigForm::class,
],
],
'router' => [
'routes' => [
'admin' => [
'child_routes' => [
'drop-index' => [
'type' => Literal::class,
'options' => [
'route' => '/search-index/drop',
'defaults' => [
'__NAMESPACE__' => 'TypesenseSearch\Controller',
'controller' => Controller\SearchController::class,
'action' => 'dropIndex',
],
],
],
'recreate-index' => [
'type' => Literal::class,
'options' => [
'route' => '/search-index/recreate',
'defaults' => [
'__NAMESPACE__' => 'TypesenseSearch\Controller',
'controller' => Controller\SearchController::class,
'action' => 'recreateIndex',
],
],
],
],
],
'site' => [
'type' => \Laminas\Router\Http\Segment::class,
'options' => [
'route' => '/:site-slug',
'constraints' => [
'site-slug' => '[a-zA-Z0-9_-]+',
],
'defaults' => [
'__NAMESPACE__' => 'Omeka\Controller\Site',
'__SITE__' => true,
'controller' => 'Index',
'action' => 'index',
],
],
'may_terminate' => true,
'child_routes' => [
'search' => [
'type' => Literal::class,
'options' => [
'route' => '/search',
'defaults' => [
'__NAMESPACE__' => 'TypesenseSearch\Controller',
# attach SearchController to /search route with default action as `search`
'controller' => Controller\SearchController::class,
'action' => 'search',
],
],
],
'results' => [
'type' => Literal::class,
'options' => [
'route' => '/search-results',
'defaults' => [
'__NAMESPACE__' => 'TypesenseSearch\Controller',
'controller' => Controller\SearchController::class,
'action' => 'results',
],
],
]
]
],
],
],
'controllers' => [
'factories' => [
# Since settings cannot be accessed in a regular AbstractActionController, we create this instance using a factory class.
Controller\SearchController::class => Service\Controller\SearchControllerFactory::class,
]
],
'typesensesearch' => [
'config' => [
'typesense_url' => null,
'typesense_api_key' => null,
'typesense_search_index' => null,
'typesense_index_properties' => [],
'typesense_search_result_format' => '',
],
],
];