PluginProbe ʕ •ᴥ•ʔ
Redirection / 1.1.9
Redirection v1.1.9
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0
redirect-redirection / analyst / main.php
redirect-redirection / analyst Last commit date
assets 2 years ago src 2 years ago templates 2 years ago autoload.php 2 years ago index.php 2 years ago main.php 2 years ago sdk_resolver.php 2 years ago version.php 2 years ago
main.php
37 lines
1 <?php
2
3 require_once 'sdk_resolver.php';
4
5
6 if (!function_exists('analyst_init')) {
7 /**
8 * Initialize analyst
9 *
10 * @param array $options
11 */
12 function analyst_init ($options) {
13 // Try resolve latest supported SDK
14 // In case resolving is failed exit the execution
15 try {
16 analyst_resolve_sdk($options['base-dir']);
17 } catch (Exception $exception) {
18 // error_log('[ANALYST] Cannot resolve any supported SDK');
19 return;
20 }
21
22 try {
23 global /** @var Analyst\Analyst $analyst */
24 $analyst;
25
26 // Set global instance of analyst
27 if (!$analyst) {
28 $analyst = Analyst\Analyst::getInstance();
29 }
30
31 $analyst->registerAccount(new Account\Account($options['client-id'], $options['client-secret'], $options['base-dir']));
32 } catch (Exception $e) {
33 // error_log('Analyst SDK receive an error: [' . $e->getMessage() . '] Please contact our support at support@analyst.com');
34 }
35 }
36 }
37