-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProvider.php
More file actions
31 lines (24 loc) · 1.12 KB
/
Copy pathProvider.php
File metadata and controls
31 lines (24 loc) · 1.12 KB
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
<?php
/**
* Provides everything needed for the Extension
*/
$config = file_get_contents(__DIR__.'/gp247.json');
$config = json_decode($config, true);
$extensionPath = $config['configGroup'].'/'.$config['configKey'];
$this->loadTranslationsFrom(__DIR__.'/Lang', $extensionPath);
if (gp247_extension_check_active($config['configGroup'], $config['configKey'])) {
// WHY: declare this plugin's admin config screen as store-scoped so the MultiStore
// Pro StoreFence lets a store-admin reach the config of their own store (registry
// idiom, ADR plugin-manager_per-store-plugin-config). No-op without the Pro fence.
config(['gp247-config.admin.store_scoped_segments' => array_values(array_unique(array_merge(
(array) config('gp247-config.admin.store_scoped_segments', []),
['shippingstandard']
)))]);
$this->loadViewsFrom(__DIR__.'/Views', $extensionPath);
if (file_exists(__DIR__.'/config.php')) {
$this->mergeConfigFrom(__DIR__.'/config.php', $extensionPath);
}
if (file_exists(__DIR__.'/function.php')) {
require_once __DIR__.'/function.php';
}
}