28
28
exit ;
29
29
}
30
30
31
- require_once __DIR__ . '/model/defaults .php ' ;
32
- require_once __DIR__ . '/model/hooks .php ' ;
33
- require_once __DIR__ . '/model/builder .php ' ;
34
- require_once __DIR__ . '/model/connection .php ' ;
31
+ require_once __DIR__ . '/model/apisearch_defaults .php ' ;
32
+ require_once __DIR__ . '/model/apisearch_hooks .php ' ;
33
+ require_once __DIR__ . '/model/apisearch_builder .php ' ;
34
+ require_once __DIR__ . '/model/apisearch_connection .php ' ;
35
35
36
36
class Apisearch extends Module
37
37
{
@@ -41,35 +41,35 @@ class Apisearch extends Module
41
41
42
42
public function __construct ()
43
43
{
44
- $ this ->name = Defaults ::PLUGIN_NAME ;
44
+ $ this ->name = ApisearchDefaults ::PLUGIN_NAME ;
45
45
$ this ->tab = 'search_filter ' ;
46
- $ this ->version = Defaults ::PLUGIN_VERSION ;
46
+ $ this ->version = ApisearchDefaults ::PLUGIN_VERSION ;
47
47
$ this ->author = 'Apisearch Team ' ;
48
48
$ this ->need_instance = 0 ;
49
49
$ this ->bootstrap = true ;
50
50
parent ::__construct ();
51
51
$ this ->displayName = $ this ->l ('Apisearch ' );
52
52
$ this ->description = $ this ->l ('Search over your products, and give to your users unique, amazing and unforgettable experiences. ' );
53
53
$ this ->ps_versions_compliancy = array ('min ' => '1.5 ' , 'max ' => _PS_VERSION_ );
54
- $ this ->connection = new Connection ();
55
- $ this ->hooks = new Hooks (
56
- new Builder (),
54
+ $ this ->connection = new ApisearchConnection ();
55
+ $ this ->hooks = new ApisearchHooks (
56
+ new ApisearchBuilder (),
57
57
$ this ->connection
58
58
);
59
59
}
60
60
61
61
public function install ()
62
62
{
63
63
Configuration::updateValue ('AS_CLUSTER_URL ' , '' );
64
- Configuration::updateValue ('AS_ADMIN_URL ' , Defaults ::DEFAULT_AS_ADMIN_URL );
65
- Configuration::updateValue ('AS_API_VERSION ' , Defaults ::DEFAULT_AS_API_VERSION );
64
+ Configuration::updateValue ('AS_ADMIN_URL ' , ApisearchDefaults ::DEFAULT_AS_ADMIN_URL );
65
+ Configuration::updateValue ('AS_API_VERSION ' , ApisearchDefaults ::DEFAULT_AS_API_VERSION );
66
66
Configuration::updateValue ('AS_APP ' , '' );
67
67
Configuration::updateValue ('AS_INDEX ' , '' );
68
68
Configuration::updateValue ('AS_TOKEN ' , '' );
69
69
Configuration::updateValue ('AS_SHOP ' , '' );
70
- Configuration::updateValue ('AS_INDEX_PRODUCTS_WITHOUT_IMAGE ' , Defaults ::DEFAULT_INDEX_PRODUCTS_WITHOUT_IMAGE );
71
- Configuration::updateValue ('AS_REAL_TIME_INDEXATION ' , Defaults ::DEFAULT_REAL_TIME_INDEXATION );
72
- Configuration::updateValue ('AS_INDEX_PRODUCT_PURCHASE_COUNT ' , Defaults ::DEFAULT_REAL_TIME_INDEXATION );
70
+ Configuration::updateValue ('AS_INDEX_PRODUCTS_WITHOUT_IMAGE ' , ApisearchDefaults ::DEFAULT_INDEX_PRODUCTS_WITHOUT_IMAGE );
71
+ Configuration::updateValue ('AS_REAL_TIME_INDEXATION ' , ApisearchDefaults ::DEFAULT_REAL_TIME_INDEXATION );
72
+ Configuration::updateValue ('AS_INDEX_PRODUCT_PURCHASE_COUNT ' , ApisearchDefaults ::DEFAULT_REAL_TIME_INDEXATION );
73
73
74
74
$ meta_as = new Meta ();
75
75
$ meta_as ->page = 'module-apisearch-as_search ' ;
@@ -164,21 +164,21 @@ protected function getConfigForm()
164
164
'col ' => 3 ,
165
165
'type ' => 'text ' ,
166
166
'label ' => $ this ->l ('Apisearch Cluster Url ' ),
167
- 'placeholder ' => Defaults ::DEFAULT_AS_CLUSTER_URL ,
167
+ 'placeholder ' => ApisearchDefaults ::DEFAULT_AS_CLUSTER_URL ,
168
168
'name ' => 'AS_CLUSTER_URL ' ,
169
169
),
170
170
array (
171
171
'col ' => 3 ,
172
172
'type ' => 'text ' ,
173
173
'label ' => $ this ->l ('Apisearch Admin Url ' ),
174
- 'placeholder ' => Defaults ::DEFAULT_AS_ADMIN_URL ,
174
+ 'placeholder ' => ApisearchDefaults ::DEFAULT_AS_ADMIN_URL ,
175
175
'name ' => 'AS_ADMIN_URL ' ,
176
176
),
177
177
array (
178
178
'col ' => 3 ,
179
179
'type ' => 'text ' ,
180
180
'label ' => $ this ->l ('Apisearch Api Version ' ),
181
- 'placeholder ' => Defaults ::DEFAULT_AS_API_VERSION ,
181
+ 'placeholder ' => ApisearchDefaults ::DEFAULT_AS_API_VERSION ,
182
182
'name ' => 'AS_API_VERSION ' ,
183
183
),
184
184
array (
@@ -326,7 +326,7 @@ public function hookHeader()
326
326
if ($ this ->connection ->isProperlyConfigured ()) {
327
327
$ admin_url = Configuration::get ('AS_ADMIN_URL ' );
328
328
$ admin_url = $ admin_url == ""
329
- ? Defaults ::DEFAULT_AS_ADMIN_URL
329
+ ? ApisearchDefaults ::DEFAULT_AS_ADMIN_URL
330
330
: $ admin_url ;
331
331
332
332
Media::addJsDef (array (
0 commit comments