Version Description
- Add composer with autoloader
- Define namespaces
Download this release
Release Info
Developer | kkopaczyktidio |
Plugin | Tidio Live Chat |
Version | 5.2.0 |
Comparing to | |
See all releases |
Code changes from version 5.1.0 to 5.2.0
- composer.json +10 -0
- composer.lock +20 -0
- readme.txt +6 -1
- src/Admin/{TidioAdminActionLink.php → AdminActionLink.php} +15 -9
- src/Admin/{TidioAdminController.php → AdminController.php} +17 -9
- src/Admin/{TidioAdminDashboard.php → AdminDashboard.php} +11 -5
- src/Admin/{TidioAdminNotice.php → AdminNotice.php} +9 -4
- src/Admin/{TidioAdminRouting.php → AdminRouting.php} +5 -3
- src/Admin/{TidioIframeSetup.php → IframeSetup.php} +15 -9
- src/{TidioLiveChatConfig.php → Config.php} +4 -2
- src/{TidioIntegrationState.php → IntegrationState.php} +7 -3
- src/Sdk/Api/Client/CurlTidioApiClient.php +9 -3
- src/Sdk/Api/Client/FileGetContentsTidioApiClient.php +9 -3
- src/Sdk/Api/Client/TidioApiClientFactory.php +5 -1
- src/Sdk/Api/Exception/TidioApiException.php +3 -1
- src/Sdk/Api/TidioApiClient.php +5 -1
- src/Sdk/Encryption/{TidioEncryptionService.php → EncryptionService.php} +7 -3
- src/Sdk/Encryption/Exception/{TidioDecryptionFailedException.php → DecryptionFailedException.php} +5 -3
- src/Sdk/Encryption/Service/{TidioEncryptionServiceFactory.php → EncryptionServiceFactory.php} +6 -4
- src/Sdk/Encryption/Service/{OpenSslTidioEncryptionService.php → OpenSslEncryptionService.php} +8 -3
- src/Sdk/Encryption/Service/{PlainTextTidioEncryptionService.php → PlainTextEncryptionService.php} +6 -2
- src/Sdk/{TidioIntegrationFacade.php → IntegrationFacade.php} +6 -1
- src/TidioLiveChat.php +27 -12
- src/Translation/{TidioErrorTranslator.php → ErrorTranslator.php} +5 -3
- src/Translation/{i18n.php → I18n.php} +6 -2
- src/Translation/{TidioTranslationLoader.php → TranslationLoader.php} +6 -2
- src/Utils/QueryParameters.php +3 -1
- src/Widget/{TidioWidgetLoader.php → WidgetLoader.php} +12 -6
- tidio-elements.php +10 -30
- vendor/autoload.php +7 -0
- vendor/composer/ClassLoader.php +477 -0
- vendor/composer/InstalledVersions.php +284 -0
- vendor/composer/LICENSE +21 -0
- vendor/composer/autoload_classmap.php +35 -0
- vendor/composer/autoload_namespaces.php +9 -0
- vendor/composer/autoload_psr4.php +10 -0
- vendor/composer/autoload_real.php +57 -0
- vendor/composer/autoload_static.php +61 -0
- vendor/composer/installed.json +5 -0
- vendor/composer/installed.php +24 -0
- vendor/composer/platform_check.php +26 -0
composer.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"require": {
|
3 |
+
"php": ">=5.6"
|
4 |
+
},
|
5 |
+
"autoload": {
|
6 |
+
"psr-4": {
|
7 |
+
"TidioLiveChat\\": "src/"
|
8 |
+
}
|
9 |
+
}
|
10 |
+
}
|
composer.lock
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_readme": [
|
3 |
+
"This file locks the dependencies of your project to a known state",
|
4 |
+
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
+
"This file is @generated automatically"
|
6 |
+
],
|
7 |
+
"content-hash": "160efcb558626824f4f30c49c7249d84",
|
8 |
+
"packages": [],
|
9 |
+
"packages-dev": [],
|
10 |
+
"aliases": [],
|
11 |
+
"minimum-stability": "stable",
|
12 |
+
"stability-flags": [],
|
13 |
+
"prefer-stable": false,
|
14 |
+
"prefer-lowest": false,
|
15 |
+
"platform": {
|
16 |
+
"php": ">=5.6"
|
17 |
+
},
|
18 |
+
"platform-dev": [],
|
19 |
+
"plugin-api-version": "2.2.0"
|
20 |
+
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: free live chat, live chat, chat, chatbot, livechat, tidio, widget, zendesk
|
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 6.0
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 5.
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -198,6 +198,11 @@ Currently, Tidio is available in English and French. Other languages are in deve
|
|
198 |
|
199 |
== Changelog ==
|
200 |
|
|
|
|
|
|
|
|
|
|
|
201 |
= 5.1.0 =
|
202 |
|
203 |
- Show Tidio chat in top bar in admin
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 6.0
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 5.2.0
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
198 |
|
199 |
== Changelog ==
|
200 |
|
201 |
+
= 5.2.0 =
|
202 |
+
|
203 |
+
- Add composer with autoloader
|
204 |
+
- Define namespaces
|
205 |
+
|
206 |
= 5.1.0 =
|
207 |
|
208 |
- Show Tidio chat in top bar in admin
|
src/Admin/{TidioAdminActionLink.php → AdminActionLink.php}
RENAMED
@@ -1,14 +1,20 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
/**
|
6 |
-
* @var
|
7 |
*/
|
8 |
private $integrationState;
|
9 |
|
10 |
/**
|
11 |
-
* @param
|
12 |
*/
|
13 |
public function __construct($integrationsState)
|
14 |
{
|
@@ -52,8 +58,8 @@ class TidioAdminActionLink
|
|
52 |
{
|
53 |
return sprintf(
|
54 |
'<a href="%s">%s</a>',
|
55 |
-
|
56 |
-
esc_html(
|
57 |
);
|
58 |
}
|
59 |
|
@@ -68,17 +74,17 @@ class TidioAdminActionLink
|
|
68 |
$toggleAsyncLabel = '✓';
|
69 |
$onclickPart = sprintf(
|
70 |
'onclick="return confirm(\'%s\');"',
|
71 |
-
|
72 |
);
|
73 |
}
|
74 |
|
75 |
return sprintf(
|
76 |
'<a href="%s" %s>%s</a>',
|
77 |
-
|
78 |
$onclickPart,
|
79 |
esc_html(
|
80 |
-
sprintf('%s %s', $toggleAsyncLabel,
|
81 |
)
|
82 |
);
|
83 |
}
|
84 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Admin;
|
4 |
+
|
5 |
+
use TidioLiveChat\IntegrationState;
|
6 |
+
use TidioLiveChat\TidioLiveChat;
|
7 |
+
use TidioLiveChat\Translation\I18n;
|
8 |
+
|
9 |
+
class AdminActionLink
|
10 |
{
|
11 |
/**
|
12 |
+
* @var IntegrationState
|
13 |
*/
|
14 |
private $integrationState;
|
15 |
|
16 |
/**
|
17 |
+
* @param IntegrationState $integrationsState
|
18 |
*/
|
19 |
public function __construct($integrationsState)
|
20 |
{
|
58 |
{
|
59 |
return sprintf(
|
60 |
'<a href="%s">%s</a>',
|
61 |
+
AdminRouting::getEndpointForClearAccountDataAction(),
|
62 |
+
esc_html(I18n::_t('Clear Account Data'))
|
63 |
);
|
64 |
}
|
65 |
|
74 |
$toggleAsyncLabel = '✓';
|
75 |
$onclickPart = sprintf(
|
76 |
'onclick="return confirm(\'%s\');"',
|
77 |
+
I18n::_t('Disabling asynchronous loading of the chat widget may affect the page loading time of your website. Are you sure you want to disable the asynchronous loading?')
|
78 |
);
|
79 |
}
|
80 |
|
81 |
return sprintf(
|
82 |
'<a href="%s" %s>%s</a>',
|
83 |
+
AdminRouting::getEndpointForToggleAsyncLoadingAction(),
|
84 |
$onclickPart,
|
85 |
esc_html(
|
86 |
+
sprintf('%s %s', $toggleAsyncLabel, I18n::_t('Asynchronous loading'))
|
87 |
)
|
88 |
);
|
89 |
}
|
90 |
+
}
|
src/Admin/{TidioAdminController.php → AdminController.php}
RENAMED
@@ -1,19 +1,27 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
/**
|
6 |
-
* @var
|
7 |
*/
|
8 |
private $integrationFacade;
|
9 |
/**
|
10 |
-
* @var
|
11 |
*/
|
12 |
private $integrationState;
|
13 |
|
14 |
/**
|
15 |
-
* @param
|
16 |
-
* @param
|
17 |
*/
|
18 |
public function __construct($integrationFacade, $integrationState)
|
19 |
{
|
@@ -23,7 +31,7 @@ class TidioAdminController
|
|
23 |
|
24 |
public function handleIntegrateProjectAction()
|
25 |
{
|
26 |
-
if (!$this->isRequestNonceValid(
|
27 |
wp_die('', 403);
|
28 |
}
|
29 |
|
@@ -46,7 +54,7 @@ class TidioAdminController
|
|
46 |
|
47 |
public function handleToggleAsyncLoadingAction()
|
48 |
{
|
49 |
-
if (!$this->isRequestNonceValid(
|
50 |
wp_die('', 403);
|
51 |
}
|
52 |
|
@@ -57,7 +65,7 @@ class TidioAdminController
|
|
57 |
|
58 |
public function handleClearAccountDataAction()
|
59 |
{
|
60 |
-
if (!$this->isRequestNonceValid(
|
61 |
wp_die('', 403);
|
62 |
}
|
63 |
|
@@ -101,4 +109,4 @@ class TidioAdminController
|
|
101 |
wp_redirect(admin_url($url));
|
102 |
die();
|
103 |
}
|
104 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Admin;
|
4 |
+
|
5 |
+
use TidioLiveChat\Sdk\Api\Exception\TidioApiException;
|
6 |
+
use TidioLiveChat\Sdk\IntegrationFacade;
|
7 |
+
use TidioLiveChat\IntegrationState;
|
8 |
+
use TidioLiveChat\TidioLiveChat;
|
9 |
+
use TidioLiveChat\Utils\QueryParameters;
|
10 |
+
|
11 |
+
class AdminController
|
12 |
{
|
13 |
/**
|
14 |
+
* @var IntegrationFacade
|
15 |
*/
|
16 |
private $integrationFacade;
|
17 |
/**
|
18 |
+
* @var IntegrationState
|
19 |
*/
|
20 |
private $integrationState;
|
21 |
|
22 |
/**
|
23 |
+
* @param IntegrationFacade $integrationFacade
|
24 |
+
* @param IntegrationState $integrationState
|
25 |
*/
|
26 |
public function __construct($integrationFacade, $integrationState)
|
27 |
{
|
31 |
|
32 |
public function handleIntegrateProjectAction()
|
33 |
{
|
34 |
+
if (!$this->isRequestNonceValid(AdminRouting::INTEGRATE_PROJECT_ACTION)) {
|
35 |
wp_die('', 403);
|
36 |
}
|
37 |
|
54 |
|
55 |
public function handleToggleAsyncLoadingAction()
|
56 |
{
|
57 |
+
if (!$this->isRequestNonceValid(AdminRouting::TOGGLE_ASYNC_LOADING_ACTION)) {
|
58 |
wp_die('', 403);
|
59 |
}
|
60 |
|
65 |
|
66 |
public function handleClearAccountDataAction()
|
67 |
{
|
68 |
+
if (!$this->isRequestNonceValid(AdminRouting::CLEAR_ACCOUNT_DATA_ACTION)) {
|
69 |
wp_die('', 403);
|
70 |
}
|
71 |
|
109 |
wp_redirect(admin_url($url));
|
110 |
die();
|
111 |
}
|
112 |
+
}
|
src/Admin/{TidioAdminDashboard.php → AdminDashboard.php}
RENAMED
@@ -1,21 +1,27 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
const TIDIO_ICON_BASE64 = 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIzLjEuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IldhcnN0d2FfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDIwIDIwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyMCAyMDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiNBMEE1QUE7fQo8L3N0eWxlPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMiwxOHYtNS45YzAtMi43LDEuNy01LDQuMy01LjdDNy4xLDMuNyw5LjQsMiwxMi4xLDJDMTUuNCwyLDE4LDQuNiwxOCw3Ljl2NS45aC00LjVsMCwwLjEKCWMtMC44LDIuNS0zLDQuMS01LjYsNC4xSDJ6IE02LjEsOC4xTDYuMSw4LjFjLTEuNiwwLjctMi42LDIuMy0yLjYsNC4xdjQuNGg0LjRjMS44LDAsMy4zLTEsNC4xLTIuNmwwLTAuMWwtMC4xLDAKCWMtMy4xLTAuMi01LjYtMi43LTUuNy01LjZsMC0wLjFMNi4xLDguMXogTTEyLjEsMy41Yy0xLjgsMC0zLjMsMS00LjEsMi42bDAsMC4xbDAuMSwwYzMuMiwwLjEsNS43LDIuNyw1LjcsNS45djAuMWwwLjEsMC4xaDIuN1Y3LjkKCUMxNi41LDUuNSwxNC41LDMuNSwxMi4xLDMuNXogTTcuNiw3LjhMNy42LDcuOGMwLDIuNSwyLDQuNSw0LjQsNC41aDAuMWwwLjEtMC4xYzAtMi41LTItNC41LTQuNC00LjVINy43TDcuNiw3Ljh6Ii8+Cjwvc3ZnPgo=';
|
6 |
|
7 |
/**
|
8 |
-
* @var
|
9 |
*/
|
10 |
private $integrationState;
|
11 |
/**
|
12 |
-
* @var
|
13 |
*/
|
14 |
private $iframeSetup;
|
15 |
|
16 |
/**
|
17 |
-
* @param
|
18 |
-
* @param
|
19 |
*/
|
20 |
public function __construct($integrationState, $iframeSetup)
|
21 |
{
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Admin;
|
4 |
+
|
5 |
+
use TidioLiveChat\IntegrationState;
|
6 |
+
use TidioLiveChat\TidioLiveChat;
|
7 |
+
use WP_Admin_Bar;
|
8 |
+
|
9 |
+
class AdminDashboard
|
10 |
{
|
11 |
const TIDIO_ICON_BASE64 = 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIzLjEuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IldhcnN0d2FfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDIwIDIwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyMCAyMDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiNBMEE1QUE7fQo8L3N0eWxlPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMiwxOHYtNS45YzAtMi43LDEuNy01LDQuMy01LjdDNy4xLDMuNyw5LjQsMiwxMi4xLDJDMTUuNCwyLDE4LDQuNiwxOCw3Ljl2NS45aC00LjVsMCwwLjEKCWMtMC44LDIuNS0zLDQuMS01LjYsNC4xSDJ6IE02LjEsOC4xTDYuMSw4LjFjLTEuNiwwLjctMi42LDIuMy0yLjYsNC4xdjQuNGg0LjRjMS44LDAsMy4zLTEsNC4xLTIuNmwwLTAuMWwtMC4xLDAKCWMtMy4xLTAuMi01LjYtMi43LTUuNy01LjZsMC0wLjFMNi4xLDguMXogTTEyLjEsMy41Yy0xLjgsMC0zLjMsMS00LjEsMi42bDAsMC4xbDAuMSwwYzMuMiwwLjEsNS43LDIuNyw1LjcsNS45djAuMWwwLjEsMC4xaDIuN1Y3LjkKCUMxNi41LDUuNSwxNC41LDMuNSwxMi4xLDMuNXogTTcuNiw3LjhMNy42LDcuOGMwLDIuNSwyLDQuNSw0LjQsNC41aDAuMWwwLjEtMC4xYzAtMi41LTItNC41LTQuNC00LjVINy43TDcuNiw3Ljh6Ii8+Cjwvc3ZnPgo=';
|
12 |
|
13 |
/**
|
14 |
+
* @var IntegrationState
|
15 |
*/
|
16 |
private $integrationState;
|
17 |
/**
|
18 |
+
* @var IframeSetup
|
19 |
*/
|
20 |
private $iframeSetup;
|
21 |
|
22 |
/**
|
23 |
+
* @param IntegrationState $integrationState
|
24 |
+
* @param IframeSetup $iframeSetup
|
25 |
*/
|
26 |
public function __construct($integrationState, $iframeSetup)
|
27 |
{
|
src/Admin/{TidioAdminNotice.php → AdminNotice.php}
RENAMED
@@ -1,14 +1,19 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
/**
|
6 |
-
* @var
|
7 |
*/
|
8 |
private $errorTranslator;
|
9 |
|
10 |
/**
|
11 |
-
* @param
|
12 |
*/
|
13 |
public function __construct($errorTranslator)
|
14 |
{
|
@@ -27,4 +32,4 @@ class TidioAdminNotice
|
|
27 |
$errorMessage = $this->errorTranslator->translate($errorCode);
|
28 |
echo sprintf('<div class="notice notice-error is-dismissible"><p>%s</p></div>', $errorMessage);
|
29 |
}
|
30 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Admin;
|
4 |
+
|
5 |
+
use TidioLiveChat\Translation\ErrorTranslator;
|
6 |
+
use TidioLiveChat\Utils\QueryParameters;
|
7 |
+
|
8 |
+
class AdminNotice
|
9 |
{
|
10 |
/**
|
11 |
+
* @var ErrorTranslator
|
12 |
*/
|
13 |
private $errorTranslator;
|
14 |
|
15 |
/**
|
16 |
+
* @param ErrorTranslator $errorTranslator
|
17 |
*/
|
18 |
public function __construct($errorTranslator)
|
19 |
{
|
32 |
$errorMessage = $this->errorTranslator->translate($errorCode);
|
33 |
echo sprintf('<div class="notice notice-error is-dismissible"><p>%s</p></div>', $errorMessage);
|
34 |
}
|
35 |
+
}
|
src/Admin/{TidioAdminRouting.php → AdminRouting.php}
RENAMED
@@ -1,13 +1,15 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
4 |
{
|
5 |
const CLEAR_ACCOUNT_DATA_ACTION = 'tidio-live-chat-clear-account-data';
|
6 |
const INTEGRATE_PROJECT_ACTION = 'tidio-live-chat-integrate-project';
|
7 |
const TOGGLE_ASYNC_LOADING_ACTION = 'tidio-live-chat-toggle-async-loading';
|
8 |
|
9 |
/**
|
10 |
-
* @param
|
11 |
*/
|
12 |
public function __construct($adminController)
|
13 |
{
|
@@ -52,4 +54,4 @@ class TidioAdminRouting
|
|
52 |
]);
|
53 |
return admin_url('admin-post.php?' . $queryString);
|
54 |
}
|
55 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Admin;
|
4 |
+
|
5 |
+
class AdminRouting
|
6 |
{
|
7 |
const CLEAR_ACCOUNT_DATA_ACTION = 'tidio-live-chat-clear-account-data';
|
8 |
const INTEGRATE_PROJECT_ACTION = 'tidio-live-chat-integrate-project';
|
9 |
const TOGGLE_ASYNC_LOADING_ACTION = 'tidio-live-chat-toggle-async-loading';
|
10 |
|
11 |
/**
|
12 |
+
* @param AdminController $adminController
|
13 |
*/
|
14 |
public function __construct($adminController)
|
15 |
{
|
54 |
]);
|
55 |
return admin_url('admin-post.php?' . $queryString);
|
56 |
}
|
57 |
+
}
|
src/Admin/{TidioIframeSetup.php → IframeSetup.php}
RENAMED
@@ -1,14 +1,20 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
/**
|
6 |
-
* @var
|
7 |
*/
|
8 |
private $integrationState;
|
9 |
|
10 |
/**
|
11 |
-
* @param
|
12 |
*/
|
13 |
public function __construct($integrationState)
|
14 |
{
|
@@ -25,14 +31,14 @@ class TidioIframeSetup
|
|
25 |
|
26 |
$queryParams = array_merge(
|
27 |
[
|
28 |
-
'pluginUrl' =>
|
29 |
'name' => $userName,
|
30 |
'refId' => $this->readRefIdFromFile()
|
31 |
],
|
32 |
$this->getDefaultIframeQueryParams()
|
33 |
);
|
34 |
|
35 |
-
$iframeBaseUrl =
|
36 |
return sprintf('%s?%s', $iframeBaseUrl, http_build_query($queryParams));
|
37 |
}
|
38 |
|
@@ -48,7 +54,7 @@ class TidioIframeSetup
|
|
48 |
$this->getDefaultIframeQueryParams()
|
49 |
);
|
50 |
|
51 |
-
$iframeBaseUrl =
|
52 |
return sprintf('%s?%s', $iframeBaseUrl, http_build_query($queryParams));
|
53 |
}
|
54 |
|
@@ -91,9 +97,9 @@ class TidioIframeSetup
|
|
91 |
];
|
92 |
if ($this->integrationState->hasProjectPrivateKey()) {
|
93 |
$queryParams['privateKey'] = $this->integrationState->getProjectPrivateKey();
|
94 |
-
return sprintf('%s/external-access?%s',
|
95 |
}
|
96 |
|
97 |
-
return sprintf('%s?%s',
|
98 |
}
|
99 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Admin;
|
4 |
+
|
5 |
+
use Exception;
|
6 |
+
use TidioLiveChat\IntegrationState;
|
7 |
+
use TidioLiveChat\Config;
|
8 |
+
|
9 |
+
class IframeSetup
|
10 |
{
|
11 |
/**
|
12 |
+
* @var IntegrationState
|
13 |
*/
|
14 |
private $integrationState;
|
15 |
|
16 |
/**
|
17 |
+
* @param IntegrationState $integrationState
|
18 |
*/
|
19 |
public function __construct($integrationState)
|
20 |
{
|
31 |
|
32 |
$queryParams = array_merge(
|
33 |
[
|
34 |
+
'pluginUrl' => AdminRouting::getEndpointForIntegrateProjectAction(),
|
35 |
'name' => $userName,
|
36 |
'refId' => $this->readRefIdFromFile()
|
37 |
],
|
38 |
$this->getDefaultIframeQueryParams()
|
39 |
);
|
40 |
|
41 |
+
$iframeBaseUrl = Config::getPanelUrl() . '/register-platforms';
|
42 |
return sprintf('%s?%s', $iframeBaseUrl, http_build_query($queryParams));
|
43 |
}
|
44 |
|
54 |
$this->getDefaultIframeQueryParams()
|
55 |
);
|
56 |
|
57 |
+
$iframeBaseUrl = Config::getPanelUrl() . '/integration-success';
|
58 |
return sprintf('%s?%s', $iframeBaseUrl, http_build_query($queryParams));
|
59 |
}
|
60 |
|
97 |
];
|
98 |
if ($this->integrationState->hasProjectPrivateKey()) {
|
99 |
$queryParams['privateKey'] = $this->integrationState->getProjectPrivateKey();
|
100 |
+
return sprintf('%s/external-access?%s', Config::getPanelUrl(), http_build_query($queryParams));
|
101 |
}
|
102 |
|
103 |
+
return sprintf('%s?%s', Config::getPanelUrl(), http_build_query($queryParams));
|
104 |
}
|
105 |
+
}
|
src/{TidioLiveChatConfig.php → Config.php}
RENAMED
@@ -1,6 +1,8 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
4 |
{
|
5 |
/**
|
6 |
* @var array|null
|
@@ -42,4 +44,4 @@ final class TidioLiveChatConfig
|
|
42 |
|
43 |
return self::$config;
|
44 |
}
|
45 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat;
|
4 |
+
|
5 |
+
final class Config
|
6 |
{
|
7 |
/**
|
8 |
* @var array|null
|
44 |
|
45 |
return self::$config;
|
46 |
}
|
47 |
+
}
|
src/{TidioIntegrationState.php → IntegrationState.php}
RENAMED
@@ -1,6 +1,10 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
const PUBLIC_KEY_OPTION = 'tidio-one-public-key';
|
6 |
const PRIVATE_KEY_OPTION = 'tidio-one-private-key';
|
@@ -9,12 +13,12 @@ class TidioIntegrationState
|
|
9 |
const TIDIO_OAUTH_REFRESH_TOKEN_KEY = 'tidio-refresh-token';
|
10 |
|
11 |
/**
|
12 |
-
* @var
|
13 |
*/
|
14 |
private $encryptionService;
|
15 |
|
16 |
/**
|
17 |
-
* @param
|
18 |
*/
|
19 |
public function __construct($encryptionService)
|
20 |
{
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat;
|
4 |
+
|
5 |
+
use TidioLiveChat\Sdk\Encryption\Service\OpenSslEncryptionService;
|
6 |
+
|
7 |
+
class IntegrationState
|
8 |
{
|
9 |
const PUBLIC_KEY_OPTION = 'tidio-one-public-key';
|
10 |
const PRIVATE_KEY_OPTION = 'tidio-one-private-key';
|
13 |
const TIDIO_OAUTH_REFRESH_TOKEN_KEY = 'tidio-refresh-token';
|
14 |
|
15 |
/**
|
16 |
+
* @var OpenSslEncryptionService
|
17 |
*/
|
18 |
private $encryptionService;
|
19 |
|
20 |
/**
|
21 |
+
* @param OpenSslEncryptionService $encryptionService
|
22 |
*/
|
23 |
public function __construct($encryptionService)
|
24 |
{
|
src/Sdk/Api/Client/CurlTidioApiClient.php
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class CurlTidioApiClient implements TidioApiClient
|
4 |
{
|
5 |
/**
|
@@ -26,7 +32,7 @@ class CurlTidioApiClient implements TidioApiClient
|
|
26 |
*/
|
27 |
public function sendPostRequest($path, $data = [])
|
28 |
{
|
29 |
-
$url =
|
30 |
$ch = curl_init();
|
31 |
|
32 |
curl_setopt($ch, CURLOPT_HEADER, 1);
|
@@ -51,7 +57,7 @@ class CurlTidioApiClient implements TidioApiClient
|
|
51 |
*/
|
52 |
public function sendGetRequest($path)
|
53 |
{
|
54 |
-
$url =
|
55 |
$ch = curl_init();
|
56 |
|
57 |
curl_setopt($ch, CURLOPT_HEADER, 1);
|
@@ -105,4 +111,4 @@ class CurlTidioApiClient implements TidioApiClient
|
|
105 |
throw TidioApiException::withUnknownErrorCode();
|
106 |
}
|
107 |
}
|
108 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Sdk\Api\Client;
|
4 |
+
|
5 |
+
use TidioLiveChat\Sdk\Api\Exception\TidioApiException;
|
6 |
+
use TidioLiveChat\Sdk\Api\TidioApiClient;
|
7 |
+
use TidioLiveChat\Config;
|
8 |
+
|
9 |
class CurlTidioApiClient implements TidioApiClient
|
10 |
{
|
11 |
/**
|
32 |
*/
|
33 |
public function sendPostRequest($path, $data = [])
|
34 |
{
|
35 |
+
$url = Config::getApiUrl() . $path;
|
36 |
$ch = curl_init();
|
37 |
|
38 |
curl_setopt($ch, CURLOPT_HEADER, 1);
|
57 |
*/
|
58 |
public function sendGetRequest($path)
|
59 |
{
|
60 |
+
$url = Config::getApiUrl() . $path;
|
61 |
$ch = curl_init();
|
62 |
|
63 |
curl_setopt($ch, CURLOPT_HEADER, 1);
|
111 |
throw TidioApiException::withUnknownErrorCode();
|
112 |
}
|
113 |
}
|
114 |
+
}
|
src/Sdk/Api/Client/FileGetContentsTidioApiClient.php
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class FileGetContentsTidioApiClient implements TidioApiClient
|
4 |
{
|
5 |
/**
|
@@ -23,7 +29,7 @@ class FileGetContentsTidioApiClient implements TidioApiClient
|
|
23 |
*/
|
24 |
public function sendPostRequest($path, $data = [])
|
25 |
{
|
26 |
-
$url =
|
27 |
$content = http_build_query($data);
|
28 |
$headers = array_merge([
|
29 |
'Content-Type: application/x-www-form-urlencoded',
|
@@ -52,7 +58,7 @@ class FileGetContentsTidioApiClient implements TidioApiClient
|
|
52 |
*/
|
53 |
public function sendGetRequest($path)
|
54 |
{
|
55 |
-
$url =
|
56 |
$options = [
|
57 |
'http' => [
|
58 |
'method' => 'GET',
|
@@ -134,4 +140,4 @@ class FileGetContentsTidioApiClient implements TidioApiClient
|
|
134 |
$statusCode = end($statusCodeResult);
|
135 |
return $statusCode ? (int) $statusCode : $statusCodeFallback;
|
136 |
}
|
137 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Sdk\Api\Client;
|
4 |
+
|
5 |
+
use TidioLiveChat\Sdk\Api\Exception\TidioApiException;
|
6 |
+
use TidioLiveChat\Sdk\Api\TidioApiClient;
|
7 |
+
use TidioLiveChat\Config;
|
8 |
+
|
9 |
class FileGetContentsTidioApiClient implements TidioApiClient
|
10 |
{
|
11 |
/**
|
29 |
*/
|
30 |
public function sendPostRequest($path, $data = [])
|
31 |
{
|
32 |
+
$url = Config::getApiUrl() . $path;
|
33 |
$content = http_build_query($data);
|
34 |
$headers = array_merge([
|
35 |
'Content-Type: application/x-www-form-urlencoded',
|
58 |
*/
|
59 |
public function sendGetRequest($path)
|
60 |
{
|
61 |
+
$url = Config::getApiUrl() . $path;
|
62 |
$options = [
|
63 |
'http' => [
|
64 |
'method' => 'GET',
|
140 |
$statusCode = end($statusCodeResult);
|
141 |
return $statusCode ? (int) $statusCode : $statusCodeFallback;
|
142 |
}
|
143 |
+
}
|
src/Sdk/Api/Client/TidioApiClientFactory.php
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
3 |
class TidioApiClientFactory
|
4 |
{
|
5 |
/**
|
@@ -27,4 +31,4 @@ class TidioApiClientFactory
|
|
27 |
|
28 |
return new FileGetContentsTidioApiClient($authorizationHeader);
|
29 |
}
|
30 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Sdk\Api\Client;
|
4 |
+
|
5 |
+
use TidioLiveChat\Sdk\Api\TidioApiClient;
|
6 |
+
|
7 |
class TidioApiClientFactory
|
8 |
{
|
9 |
/**
|
31 |
|
32 |
return new FileGetContentsTidioApiClient($authorizationHeader);
|
33 |
}
|
34 |
+
}
|
src/Sdk/Api/Exception/TidioApiException.php
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
3 |
class TidioApiException extends \Exception
|
4 |
{
|
5 |
const UNAUTHORIZED_ERROR_CODE = 'unauthorized';
|
@@ -29,4 +31,4 @@ class TidioApiException extends \Exception
|
|
29 |
{
|
30 |
return new self(self::UNKNOWN_ERROR_CODE);
|
31 |
}
|
32 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Sdk\Api\Exception;
|
4 |
+
|
5 |
class TidioApiException extends \Exception
|
6 |
{
|
7 |
const UNAUTHORIZED_ERROR_CODE = 'unauthorized';
|
31 |
{
|
32 |
return new self(self::UNKNOWN_ERROR_CODE);
|
33 |
}
|
34 |
+
}
|
src/Sdk/Api/TidioApiClient.php
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
3 |
interface TidioApiClient
|
4 |
{
|
5 |
/**
|
@@ -16,4 +20,4 @@ interface TidioApiClient
|
|
16 |
* @throws TidioApiException
|
17 |
*/
|
18 |
public function sendGetRequest($path);
|
19 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Sdk\Api;
|
4 |
+
|
5 |
+
use TidioLiveChat\Sdk\Api\Exception\TidioApiException;
|
6 |
+
|
7 |
interface TidioApiClient
|
8 |
{
|
9 |
/**
|
20 |
* @throws TidioApiException
|
21 |
*/
|
22 |
public function sendGetRequest($path);
|
23 |
+
}
|
src/Sdk/Encryption/{TidioEncryptionService.php → EncryptionService.php}
RENAMED
@@ -1,6 +1,10 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
/**
|
6 |
* @param string $value
|
@@ -11,7 +15,7 @@ interface TidioEncryptionService
|
|
11 |
/**
|
12 |
* @param string $encryptedString
|
13 |
* @return string
|
14 |
-
* @throws
|
15 |
*/
|
16 |
public function decrypt($encryptedString);
|
17 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Sdk\Encryption;
|
4 |
+
|
5 |
+
use TidioLiveChat\Sdk\Encryption\Exception\DecryptionFailedException;
|
6 |
+
|
7 |
+
interface EncryptionService
|
8 |
{
|
9 |
/**
|
10 |
* @param string $value
|
15 |
/**
|
16 |
* @param string $encryptedString
|
17 |
* @return string
|
18 |
+
* @throws DecryptionFailedException
|
19 |
*/
|
20 |
public function decrypt($encryptedString);
|
21 |
+
}
|
src/Sdk/Encryption/Exception/{TidioDecryptionFailedException.php → DecryptionFailedException.php}
RENAMED
@@ -1,14 +1,16 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
4 |
{
|
5 |
const INVALID_HASH_ERROR_CODE = 'invalid_hash';
|
6 |
|
7 |
/**
|
8 |
-
* @return
|
9 |
*/
|
10 |
public static function withInvalidHashErrorCode()
|
11 |
{
|
12 |
return new self(self::INVALID_HASH_ERROR_CODE);
|
13 |
}
|
14 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Sdk\Encryption\Exception;
|
4 |
+
|
5 |
+
class DecryptionFailedException extends \Exception
|
6 |
{
|
7 |
const INVALID_HASH_ERROR_CODE = 'invalid_hash';
|
8 |
|
9 |
/**
|
10 |
+
* @return DecryptionFailedException
|
11 |
*/
|
12 |
public static function withInvalidHashErrorCode()
|
13 |
{
|
14 |
return new self(self::INVALID_HASH_ERROR_CODE);
|
15 |
}
|
16 |
+
}
|
src/Sdk/Encryption/Service/{TidioEncryptionServiceFactory.php → EncryptionServiceFactory.php}
RENAMED
@@ -1,15 +1,17 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
4 |
{
|
5 |
public function create()
|
6 |
{
|
7 |
$encryptionKey = $this->getEncryptionKey();
|
8 |
if (empty($encryptionKey) || !extension_loaded('openssl')) {
|
9 |
-
return new
|
10 |
}
|
11 |
|
12 |
-
return new
|
13 |
}
|
14 |
|
15 |
/**
|
@@ -23,4 +25,4 @@ class TidioEncryptionServiceFactory
|
|
23 |
|
24 |
return LOGGED_IN_KEY;
|
25 |
}
|
26 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Sdk\Encryption\Service;
|
4 |
+
|
5 |
+
class EncryptionServiceFactory
|
6 |
{
|
7 |
public function create()
|
8 |
{
|
9 |
$encryptionKey = $this->getEncryptionKey();
|
10 |
if (empty($encryptionKey) || !extension_loaded('openssl')) {
|
11 |
+
return new PlainTextEncryptionService();
|
12 |
}
|
13 |
|
14 |
+
return new OpenSslEncryptionService($encryptionKey);
|
15 |
}
|
16 |
|
17 |
/**
|
25 |
|
26 |
return LOGGED_IN_KEY;
|
27 |
}
|
28 |
+
}
|
src/Sdk/Encryption/Service/{OpenSslTidioEncryptionService.php → OpenSslEncryptionService.php}
RENAMED
@@ -1,6 +1,11 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
const CIPHER_ALGORITHM = 'aes-256-ctr';
|
6 |
const HASH_ALGORITHM = 'sha256';
|
@@ -46,9 +51,9 @@ class OpenSslTidioEncryptionService implements TidioEncryptionService
|
|
46 |
|
47 |
$hashToCompare = hash_hmac(self::HASH_ALGORITHM, $encryptedValue, $this->encryptionKey, true);
|
48 |
if (!hash_equals($hmac, $hashToCompare)) {
|
49 |
-
throw
|
50 |
}
|
51 |
|
52 |
return openssl_decrypt($encryptedValue, self::CIPHER_ALGORITHM, $this->encryptionKey, 0, $iv);
|
53 |
}
|
54 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Sdk\Encryption\Service;
|
4 |
+
|
5 |
+
use TidioLiveChat\Sdk\Encryption\Exception\DecryptionFailedException;
|
6 |
+
use TidioLiveChat\Sdk\Encryption\EncryptionService;
|
7 |
+
|
8 |
+
class OpenSslEncryptionService implements EncryptionService
|
9 |
{
|
10 |
const CIPHER_ALGORITHM = 'aes-256-ctr';
|
11 |
const HASH_ALGORITHM = 'sha256';
|
51 |
|
52 |
$hashToCompare = hash_hmac(self::HASH_ALGORITHM, $encryptedValue, $this->encryptionKey, true);
|
53 |
if (!hash_equals($hmac, $hashToCompare)) {
|
54 |
+
throw DecryptionFailedException::withInvalidHashErrorCode();
|
55 |
}
|
56 |
|
57 |
return openssl_decrypt($encryptedValue, self::CIPHER_ALGORITHM, $this->encryptionKey, 0, $iv);
|
58 |
}
|
59 |
+
}
|
src/Sdk/Encryption/Service/{PlainTextTidioEncryptionService.php → PlainTextEncryptionService.php}
RENAMED
@@ -1,6 +1,10 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
/**
|
6 |
* @inerhitDoc
|
@@ -17,4 +21,4 @@ class PlainTextTidioEncryptionService implements TidioEncryptionService
|
|
17 |
{
|
18 |
return $encryptedString;
|
19 |
}
|
20 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Sdk\Encryption\Service;
|
4 |
+
|
5 |
+
use TidioLiveChat\Sdk\Encryption\EncryptionService;
|
6 |
+
|
7 |
+
class PlainTextEncryptionService implements EncryptionService
|
8 |
{
|
9 |
/**
|
10 |
* @inerhitDoc
|
21 |
{
|
22 |
return $encryptedString;
|
23 |
}
|
24 |
+
}
|
src/Sdk/{TidioIntegrationFacade.php → IntegrationFacade.php}
RENAMED
@@ -1,6 +1,11 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
const TIDIO_WORDPRESS_OAUTH_CLIENT_ID = '8ea883be-28c3-4bfd-9fe2-4091eb38fe08';
|
6 |
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Sdk;
|
4 |
+
|
5 |
+
use TidioLiveChat\Sdk\Api\Client\TidioApiClientFactory;
|
6 |
+
use TidioLiveChat\Sdk\Api\Exception\TidioApiException;
|
7 |
+
|
8 |
+
class IntegrationFacade
|
9 |
{
|
10 |
const TIDIO_WORDPRESS_OAUTH_CLIENT_ID = '8ea883be-28c3-4bfd-9fe2-4091eb38fe08';
|
11 |
|
src/TidioLiveChat.php
CHANGED
@@ -1,30 +1,45 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class TidioLiveChat
|
4 |
{
|
5 |
const TIDIO_PLUGIN_NAME = 'tidio-live-chat';
|
6 |
|
7 |
public static function load()
|
8 |
{
|
9 |
-
$encryptionService = (new
|
10 |
-
$integrationState = new
|
11 |
if (!is_admin()) {
|
12 |
-
new
|
13 |
return;
|
14 |
}
|
15 |
|
16 |
if (current_user_can('activate_plugins')) {
|
17 |
-
new
|
18 |
$apiClientFactory = new TidioApiClientFactory();
|
19 |
-
$integrationFacade = new
|
20 |
-
$adminController = new
|
21 |
-
$iframeSetup = new
|
22 |
-
$errorTranslator = new
|
23 |
|
24 |
-
new
|
25 |
-
new
|
26 |
-
new
|
27 |
-
new
|
28 |
}
|
29 |
}
|
30 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat;
|
4 |
+
|
5 |
+
use TidioLiveChat\Admin\AdminActionLink;
|
6 |
+
use TidioLiveChat\Admin\AdminController;
|
7 |
+
use TidioLiveChat\Admin\AdminDashboard;
|
8 |
+
use TidioLiveChat\Admin\AdminNotice;
|
9 |
+
use TidioLiveChat\Admin\AdminRouting;
|
10 |
+
use TidioLiveChat\Admin\IframeSetup;
|
11 |
+
use TidioLiveChat\Sdk\Api\Client\TidioApiClientFactory;
|
12 |
+
use TidioLiveChat\Sdk\Encryption\Service\EncryptionServiceFactory;
|
13 |
+
use TidioLiveChat\Sdk\IntegrationFacade;
|
14 |
+
use TidioLiveChat\Translation\ErrorTranslator;
|
15 |
+
use TidioLiveChat\Translation\TranslationLoader;
|
16 |
+
use TidioLiveChat\Widget\WidgetLoader;
|
17 |
+
|
18 |
class TidioLiveChat
|
19 |
{
|
20 |
const TIDIO_PLUGIN_NAME = 'tidio-live-chat';
|
21 |
|
22 |
public static function load()
|
23 |
{
|
24 |
+
$encryptionService = (new EncryptionServiceFactory())->create();
|
25 |
+
$integrationState = new IntegrationState($encryptionService);
|
26 |
if (!is_admin()) {
|
27 |
+
new WidgetLoader($integrationState);
|
28 |
return;
|
29 |
}
|
30 |
|
31 |
if (current_user_can('activate_plugins')) {
|
32 |
+
new TranslationLoader();
|
33 |
$apiClientFactory = new TidioApiClientFactory();
|
34 |
+
$integrationFacade = new IntegrationFacade($apiClientFactory);
|
35 |
+
$adminController = new AdminController($integrationFacade, $integrationState);
|
36 |
+
$iframeSetup = new IframeSetup($integrationState);
|
37 |
+
$errorTranslator = new ErrorTranslator();
|
38 |
|
39 |
+
new AdminRouting($adminController);
|
40 |
+
new AdminActionLink($integrationState);
|
41 |
+
new AdminDashboard($integrationState, $iframeSetup);
|
42 |
+
new AdminNotice($errorTranslator);
|
43 |
}
|
44 |
}
|
45 |
}
|
src/Translation/{TidioErrorTranslator.php → ErrorTranslator.php}
RENAMED
@@ -1,6 +1,8 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
4 |
{
|
5 |
const ERROR_CODE_FALLBACK_MESSAGE = 'The integration process has been interrupted. An error has occurred (%s). Please try again later or contact our support team.';
|
6 |
|
@@ -10,6 +12,6 @@ class TidioErrorTranslator
|
|
10 |
*/
|
11 |
public function translate($errorCode)
|
12 |
{
|
13 |
-
return sprintf(
|
14 |
}
|
15 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Translation;
|
4 |
+
|
5 |
+
class ErrorTranslator
|
6 |
{
|
7 |
const ERROR_CODE_FALLBACK_MESSAGE = 'The integration process has been interrupted. An error has occurred (%s). Please try again later or contact our support team.';
|
8 |
|
12 |
*/
|
13 |
public function translate($errorCode)
|
14 |
{
|
15 |
+
return sprintf(I18n::_t(self::ERROR_CODE_FALLBACK_MESSAGE), $errorCode);
|
16 |
}
|
17 |
+
}
|
src/Translation/{i18n.php → I18n.php}
RENAMED
@@ -1,6 +1,10 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
/**
|
6 |
* echo translation
|
@@ -17,4 +21,4 @@ class i18n
|
|
17 |
{
|
18 |
return __($message, TidioLiveChat::TIDIO_PLUGIN_NAME);
|
19 |
}
|
20 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Translation;
|
4 |
+
|
5 |
+
use TidioLiveChat\TidioLiveChat;
|
6 |
+
|
7 |
+
class I18n
|
8 |
{
|
9 |
/**
|
10 |
* echo translation
|
21 |
{
|
22 |
return __($message, TidioLiveChat::TIDIO_PLUGIN_NAME);
|
23 |
}
|
24 |
+
}
|
src/Translation/{TidioTranslationLoader.php → TranslationLoader.php}
RENAMED
@@ -1,6 +1,10 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
public function __construct()
|
6 |
{
|
@@ -25,4 +29,4 @@ class TidioTranslationLoader
|
|
25 |
|
26 |
return $mofile;
|
27 |
}
|
28 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Translation;
|
4 |
+
|
5 |
+
use TidioLiveChat\TidioLiveChat;
|
6 |
+
|
7 |
+
class TranslationLoader
|
8 |
{
|
9 |
public function __construct()
|
10 |
{
|
29 |
|
30 |
return $mofile;
|
31 |
}
|
32 |
+
}
|
src/Utils/QueryParameters.php
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
3 |
class QueryParameters
|
4 |
{
|
5 |
/**
|
@@ -23,4 +25,4 @@ class QueryParameters
|
|
23 |
|
24 |
return sanitize_text_field($_GET[$key]);
|
25 |
}
|
26 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Utils;
|
4 |
+
|
5 |
class QueryParameters
|
6 |
{
|
7 |
/**
|
25 |
|
26 |
return sanitize_text_field($_GET[$key]);
|
27 |
}
|
28 |
+
}
|
src/Widget/{TidioWidgetLoader.php → WidgetLoader.php}
RENAMED
@@ -1,14 +1,20 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
/**
|
6 |
-
* @var
|
7 |
*/
|
8 |
private $integrationState;
|
9 |
|
10 |
/**
|
11 |
-
* @param
|
12 |
*/
|
13 |
public function __construct($integrationState)
|
14 |
{
|
@@ -34,7 +40,7 @@ class TidioWidgetLoader
|
|
34 |
public function enqueueScriptsAsync()
|
35 |
{
|
36 |
$publicKey = $this->integrationState->getProjectPublicKey();
|
37 |
-
$widgetUrl = sprintf('%s/%s.js',
|
38 |
$asyncScript = <<<SRC
|
39 |
<script type='text/javascript'>
|
40 |
document.tidioChatCode = "$publicKey";
|
@@ -61,10 +67,10 @@ SRC;
|
|
61 |
{
|
62 |
$projectPublicKey = $this->integrationState->getProjectPublicKey();
|
63 |
|
64 |
-
$widgetUrl = sprintf('%s/%s.js',
|
65 |
wp_enqueue_script(TidioLiveChat::TIDIO_PLUGIN_NAME, $widgetUrl, [], TIDIOCHAT_VERSION, true);
|
66 |
|
67 |
$inlineScriptWithProjectPublicKeyVariable = sprintf('document.tidioChatCode = "%s";', $projectPublicKey);
|
68 |
wp_add_inline_script(TidioLiveChat::TIDIO_PLUGIN_NAME, $inlineScriptWithProjectPublicKeyVariable, 'before');
|
69 |
}
|
70 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace TidioLiveChat\Widget;
|
4 |
+
|
5 |
+
use TidioLiveChat\IntegrationState;
|
6 |
+
use TidioLiveChat\TidioLiveChat;
|
7 |
+
use TidioLiveChat\Config;
|
8 |
+
|
9 |
+
class WidgetLoader
|
10 |
{
|
11 |
/**
|
12 |
+
* @var IntegrationState
|
13 |
*/
|
14 |
private $integrationState;
|
15 |
|
16 |
/**
|
17 |
+
* @param IntegrationState $integrationState
|
18 |
*/
|
19 |
public function __construct($integrationState)
|
20 |
{
|
40 |
public function enqueueScriptsAsync()
|
41 |
{
|
42 |
$publicKey = $this->integrationState->getProjectPublicKey();
|
43 |
+
$widgetUrl = sprintf('%s/%s.js', Config::getWidgetUrl(), $publicKey);
|
44 |
$asyncScript = <<<SRC
|
45 |
<script type='text/javascript'>
|
46 |
document.tidioChatCode = "$publicKey";
|
67 |
{
|
68 |
$projectPublicKey = $this->integrationState->getProjectPublicKey();
|
69 |
|
70 |
+
$widgetUrl = sprintf('%s/%s.js', Config::getWidgetUrl(), $projectPublicKey);
|
71 |
wp_enqueue_script(TidioLiveChat::TIDIO_PLUGIN_NAME, $widgetUrl, [], TIDIOCHAT_VERSION, true);
|
72 |
|
73 |
$inlineScriptWithProjectPublicKeyVariable = sprintf('document.tidioChatCode = "%s";', $projectPublicKey);
|
74 |
wp_add_inline_script(TidioLiveChat::TIDIO_PLUGIN_NAME, $inlineScriptWithProjectPublicKeyVariable, 'before');
|
75 |
}
|
76 |
+
}
|
tidio-elements.php
CHANGED
@@ -4,42 +4,22 @@
|
|
4 |
* Plugin Name: Tidio Chat
|
5 |
* Plugin URI: http://www.tidio.com
|
6 |
* Description: Tidio Live Chat - live chat boosted with chatbots for your online business. Integrates with your website in less than 20 seconds.
|
7 |
-
* Version: 5.
|
8 |
* Author: Tidio Ltd.
|
9 |
* Author URI: http://www.tidio.com
|
10 |
* Text Domain: tidio-live-chat
|
11 |
* Domain Path: /languages/
|
12 |
* License: GPL2
|
13 |
*/
|
14 |
-
|
|
|
15 |
define('AFFILIATE_CONFIG_FILE_PATH', get_template_directory() . '/tidio_affiliate_ref_id.txt');
|
16 |
|
17 |
-
require_once
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
require_once __DIR__ . '/src/Admin/TidioAdminActionLink.php';
|
23 |
-
require_once __DIR__ . '/src/Admin/TidioAdminController.php';
|
24 |
-
require_once __DIR__ . '/src/Admin/TidioIframeSetup.php';
|
25 |
-
require_once __DIR__ . '/src/Admin/TidioAdminDashboard.php';
|
26 |
-
require_once __DIR__ . '/src/Admin/TidioAdminRouting.php';
|
27 |
-
require_once __DIR__ . '/src/Admin/TidioAdminNotice.php';
|
28 |
-
require_once __DIR__ . '/src/Admin/TidioIframeSetup.php';
|
29 |
-
require_once __DIR__ . '/src/Sdk/TidioIntegrationFacade.php';
|
30 |
-
require_once __DIR__ . '/src/Sdk/Encryption/TidioEncryptionService.php';
|
31 |
-
require_once __DIR__ . '/src/Sdk/Encryption/Exception/TidioDecryptionFailedException.php';
|
32 |
-
require_once __DIR__ . '/src/Sdk/Encryption/Service/PlainTextTidioEncryptionService.php';
|
33 |
-
require_once __DIR__ . '/src/Sdk/Encryption/Service/OpenSslTidioEncryptionService.php';
|
34 |
-
require_once __DIR__ . '/src/Sdk/Encryption/Service/TidioEncryptionServiceFactory.php';
|
35 |
-
require_once __DIR__ . '/src/Sdk/Api/TidioApiClient.php';
|
36 |
-
require_once __DIR__ . '/src/Sdk/Api/Client/TidioApiClientFactory.php';
|
37 |
-
require_once __DIR__ . '/src/Sdk/Api/Client/CurlTidioApiClient.php';
|
38 |
-
require_once __DIR__ . '/src/Sdk/Api/Client/FileGetContentsTidioApiClient.php';
|
39 |
-
require_once __DIR__ . '/src/Sdk/Api/Exception/TidioApiException.php';
|
40 |
-
require_once __DIR__ . '/src/Utils/QueryParameters.php';
|
41 |
-
require_once __DIR__ . '/src/TidioIntegrationState.php';
|
42 |
-
require_once __DIR__ . '/src/TidioLiveChat.php';
|
43 |
|
44 |
function initializeTidioLiveChat()
|
45 |
{
|
@@ -53,5 +33,5 @@ function initializeTidioLiveChat()
|
|
53 |
|
54 |
add_action('init', 'initializeTidioLiveChat');
|
55 |
|
56 |
-
$encryptionService = (new
|
57 |
-
register_activation_hook(__FILE__, [new
|
4 |
* Plugin Name: Tidio Chat
|
5 |
* Plugin URI: http://www.tidio.com
|
6 |
* Description: Tidio Live Chat - live chat boosted with chatbots for your online business. Integrates with your website in less than 20 seconds.
|
7 |
+
* Version: 5.2.0
|
8 |
* Author: Tidio Ltd.
|
9 |
* Author URI: http://www.tidio.com
|
10 |
* Text Domain: tidio-live-chat
|
11 |
* Domain Path: /languages/
|
12 |
* License: GPL2
|
13 |
*/
|
14 |
+
|
15 |
+
define('TIDIOCHAT_VERSION', '5.2.0');
|
16 |
define('AFFILIATE_CONFIG_FILE_PATH', get_template_directory() . '/tidio_affiliate_ref_id.txt');
|
17 |
|
18 |
+
require_once plugin_dir_path(__FILE__) . 'vendor/autoload.php';
|
19 |
+
|
20 |
+
use TidioLiveChat\Sdk\Encryption\Service\EncryptionServiceFactory;
|
21 |
+
use TidioLiveChat\IntegrationState;
|
22 |
+
use TidioLiveChat\TidioLiveChat;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
function initializeTidioLiveChat()
|
25 |
{
|
33 |
|
34 |
add_action('init', 'initializeTidioLiveChat');
|
35 |
|
36 |
+
$encryptionService = (new EncryptionServiceFactory())->create();
|
37 |
+
register_activation_hook(__FILE__, [new IntegrationState($encryptionService), 'turnOnAsyncLoading']);
|
vendor/autoload.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload.php @generated by Composer
|
4 |
+
|
5 |
+
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
+
|
7 |
+
return ComposerAutoloaderInitb9fb3e5de8a6af44b16b566fdbe3e5d5::getLoader();
|
vendor/composer/ClassLoader.php
ADDED
@@ -0,0 +1,477 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of Composer.
|
5 |
+
*
|
6 |
+
* (c) Nils Adermann <naderman@naderman.de>
|
7 |
+
* Jordi Boggiano <j.boggiano@seld.be>
|
8 |
+
*
|
9 |
+
* For the full copyright and license information, please view the LICENSE
|
10 |
+
* file that was distributed with this source code.
|
11 |
+
*/
|
12 |
+
|
13 |
+
namespace Composer\Autoload;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
17 |
+
*
|
18 |
+
* $loader = new \Composer\Autoload\ClassLoader();
|
19 |
+
*
|
20 |
+
* // register classes with namespaces
|
21 |
+
* $loader->add('Symfony\Component', __DIR__.'/component');
|
22 |
+
* $loader->add('Symfony', __DIR__.'/framework');
|
23 |
+
*
|
24 |
+
* // activate the autoloader
|
25 |
+
* $loader->register();
|
26 |
+
*
|
27 |
+
* // to enable searching the include path (eg. for PEAR packages)
|
28 |
+
* $loader->setUseIncludePath(true);
|
29 |
+
*
|
30 |
+
* In this example, if you try to use a class in the Symfony\Component
|
31 |
+
* namespace or one of its children (Symfony\Component\Console for instance),
|
32 |
+
* the autoloader will first look for the class under the component/
|
33 |
+
* directory, and it will then fallback to the framework/ directory if not
|
34 |
+
* found before giving up.
|
35 |
+
*
|
36 |
+
* This class is loosely based on the Symfony UniversalClassLoader.
|
37 |
+
*
|
38 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
39 |
+
* @author Jordi Boggiano <j.boggiano@seld.be>
|
40 |
+
* @see https://www.php-fig.org/psr/psr-0/
|
41 |
+
* @see https://www.php-fig.org/psr/psr-4/
|
42 |
+
*/
|
43 |
+
class ClassLoader
|
44 |
+
{
|
45 |
+
private $vendorDir;
|
46 |
+
|
47 |
+
// PSR-4
|
48 |
+
private $prefixLengthsPsr4 = array();
|
49 |
+
private $prefixDirsPsr4 = array();
|
50 |
+
private $fallbackDirsPsr4 = array();
|
51 |
+
|
52 |
+
// PSR-0
|
53 |
+
private $prefixesPsr0 = array();
|
54 |
+
private $fallbackDirsPsr0 = array();
|
55 |
+
|
56 |
+
private $useIncludePath = false;
|
57 |
+
private $classMap = array();
|
58 |
+
private $classMapAuthoritative = false;
|
59 |
+
private $missingClasses = array();
|
60 |
+
private $apcuPrefix;
|
61 |
+
|
62 |
+
private static $registeredLoaders = array();
|
63 |
+
|
64 |
+
public function __construct($vendorDir = null)
|
65 |
+
{
|
66 |
+
$this->vendorDir = $vendorDir;
|
67 |
+
}
|
68 |
+
|
69 |
+
public function getPrefixes()
|
70 |
+
{
|
71 |
+
if (!empty($this->prefixesPsr0)) {
|
72 |
+
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
73 |
+
}
|
74 |
+
|
75 |
+
return array();
|
76 |
+
}
|
77 |
+
|
78 |
+
public function getPrefixesPsr4()
|
79 |
+
{
|
80 |
+
return $this->prefixDirsPsr4;
|
81 |
+
}
|
82 |
+
|
83 |
+
public function getFallbackDirs()
|
84 |
+
{
|
85 |
+
return $this->fallbackDirsPsr0;
|
86 |
+
}
|
87 |
+
|
88 |
+
public function getFallbackDirsPsr4()
|
89 |
+
{
|
90 |
+
return $this->fallbackDirsPsr4;
|
91 |
+
}
|
92 |
+
|
93 |
+
public function getClassMap()
|
94 |
+
{
|
95 |
+
return $this->classMap;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* @param array $classMap Class to filename map
|
100 |
+
*/
|
101 |
+
public function addClassMap(array $classMap)
|
102 |
+
{
|
103 |
+
if ($this->classMap) {
|
104 |
+
$this->classMap = array_merge($this->classMap, $classMap);
|
105 |
+
} else {
|
106 |
+
$this->classMap = $classMap;
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Registers a set of PSR-0 directories for a given prefix, either
|
112 |
+
* appending or prepending to the ones previously set for this prefix.
|
113 |
+
*
|
114 |
+
* @param string $prefix The prefix
|
115 |
+
* @param array|string $paths The PSR-0 root directories
|
116 |
+
* @param bool $prepend Whether to prepend the directories
|
117 |
+
*/
|
118 |
+
public function add($prefix, $paths, $prepend = false)
|
119 |
+
{
|
120 |
+
if (!$prefix) {
|
121 |
+
if ($prepend) {
|
122 |
+
$this->fallbackDirsPsr0 = array_merge(
|
123 |
+
(array) $paths,
|
124 |
+
$this->fallbackDirsPsr0
|
125 |
+
);
|
126 |
+
} else {
|
127 |
+
$this->fallbackDirsPsr0 = array_merge(
|
128 |
+
$this->fallbackDirsPsr0,
|
129 |
+
(array) $paths
|
130 |
+
);
|
131 |
+
}
|
132 |
+
|
133 |
+
return;
|
134 |
+
}
|
135 |
+
|
136 |
+
$first = $prefix[0];
|
137 |
+
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
138 |
+
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
139 |
+
|
140 |
+
return;
|
141 |
+
}
|
142 |
+
if ($prepend) {
|
143 |
+
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
144 |
+
(array) $paths,
|
145 |
+
$this->prefixesPsr0[$first][$prefix]
|
146 |
+
);
|
147 |
+
} else {
|
148 |
+
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
149 |
+
$this->prefixesPsr0[$first][$prefix],
|
150 |
+
(array) $paths
|
151 |
+
);
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Registers a set of PSR-4 directories for a given namespace, either
|
157 |
+
* appending or prepending to the ones previously set for this namespace.
|
158 |
+
*
|
159 |
+
* @param string $prefix The prefix/namespace, with trailing '\\'
|
160 |
+
* @param array|string $paths The PSR-4 base directories
|
161 |
+
* @param bool $prepend Whether to prepend the directories
|
162 |
+
*
|
163 |
+
* @throws \InvalidArgumentException
|
164 |
+
*/
|
165 |
+
public function addPsr4($prefix, $paths, $prepend = false)
|
166 |
+
{
|
167 |
+
if (!$prefix) {
|
168 |
+
// Register directories for the root namespace.
|
169 |
+
if ($prepend) {
|
170 |
+
$this->fallbackDirsPsr4 = array_merge(
|
171 |
+
(array) $paths,
|
172 |
+
$this->fallbackDirsPsr4
|
173 |
+
);
|
174 |
+
} else {
|
175 |
+
$this->fallbackDirsPsr4 = array_merge(
|
176 |
+
$this->fallbackDirsPsr4,
|
177 |
+
(array) $paths
|
178 |
+
);
|
179 |
+
}
|
180 |
+
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
181 |
+
// Register directories for a new namespace.
|
182 |
+
$length = strlen($prefix);
|
183 |
+
if ('\\' !== $prefix[$length - 1]) {
|
184 |
+
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
185 |
+
}
|
186 |
+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
187 |
+
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
188 |
+
} elseif ($prepend) {
|
189 |
+
// Prepend directories for an already registered namespace.
|
190 |
+
$this->prefixDirsPsr4[$prefix] = array_merge(
|
191 |
+
(array) $paths,
|
192 |
+
$this->prefixDirsPsr4[$prefix]
|
193 |
+
);
|
194 |
+
} else {
|
195 |
+
// Append directories for an already registered namespace.
|
196 |
+
$this->prefixDirsPsr4[$prefix] = array_merge(
|
197 |
+
$this->prefixDirsPsr4[$prefix],
|
198 |
+
(array) $paths
|
199 |
+
);
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Registers a set of PSR-0 directories for a given prefix,
|
205 |
+
* replacing any others previously set for this prefix.
|
206 |
+
*
|
207 |
+
* @param string $prefix The prefix
|
208 |
+
* @param array|string $paths The PSR-0 base directories
|
209 |
+
*/
|
210 |
+
public function set($prefix, $paths)
|
211 |
+
{
|
212 |
+
if (!$prefix) {
|
213 |
+
$this->fallbackDirsPsr0 = (array) $paths;
|
214 |
+
} else {
|
215 |
+
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Registers a set of PSR-4 directories for a given namespace,
|
221 |
+
* replacing any others previously set for this namespace.
|
222 |
+
*
|
223 |
+
* @param string $prefix The prefix/namespace, with trailing '\\'
|
224 |
+
* @param array|string $paths The PSR-4 base directories
|
225 |
+
*
|
226 |
+
* @throws \InvalidArgumentException
|
227 |
+
*/
|
228 |
+
public function setPsr4($prefix, $paths)
|
229 |
+
{
|
230 |
+
if (!$prefix) {
|
231 |
+
$this->fallbackDirsPsr4 = (array) $paths;
|
232 |
+
} else {
|
233 |
+
$length = strlen($prefix);
|
234 |
+
if ('\\' !== $prefix[$length - 1]) {
|
235 |
+
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
236 |
+
}
|
237 |
+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
238 |
+
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
239 |
+
}
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Turns on searching the include path for class files.
|
244 |
+
*
|
245 |
+
* @param bool $useIncludePath
|
246 |
+
*/
|
247 |
+
public function setUseIncludePath($useIncludePath)
|
248 |
+
{
|
249 |
+
$this->useIncludePath = $useIncludePath;
|
250 |
+
}
|
251 |
+
|
252 |
+
/**
|
253 |
+
* Can be used to check if the autoloader uses the include path to check
|
254 |
+
* for classes.
|
255 |
+
*
|
256 |
+
* @return bool
|
257 |
+
*/
|
258 |
+
public function getUseIncludePath()
|
259 |
+
{
|
260 |
+
return $this->useIncludePath;
|
261 |
+
}
|
262 |
+
|
263 |
+
/**
|
264 |
+
* Turns off searching the prefix and fallback directories for classes
|
265 |
+
* that have not been registered with the class map.
|
266 |
+
*
|
267 |
+
* @param bool $classMapAuthoritative
|
268 |
+
*/
|
269 |
+
public function setClassMapAuthoritative($classMapAuthoritative)
|
270 |
+
{
|
271 |
+
$this->classMapAuthoritative = $classMapAuthoritative;
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Should class lookup fail if not found in the current class map?
|
276 |
+
*
|
277 |
+
* @return bool
|
278 |
+
*/
|
279 |
+
public function isClassMapAuthoritative()
|
280 |
+
{
|
281 |
+
return $this->classMapAuthoritative;
|
282 |
+
}
|
283 |
+
|
284 |
+
/**
|
285 |
+
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
286 |
+
*
|
287 |
+
* @param string|null $apcuPrefix
|
288 |
+
*/
|
289 |
+
public function setApcuPrefix($apcuPrefix)
|
290 |
+
{
|
291 |
+
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
292 |
+
}
|
293 |
+
|
294 |
+
/**
|
295 |
+
* The APCu prefix in use, or null if APCu caching is not enabled.
|
296 |
+
*
|
297 |
+
* @return string|null
|
298 |
+
*/
|
299 |
+
public function getApcuPrefix()
|
300 |
+
{
|
301 |
+
return $this->apcuPrefix;
|
302 |
+
}
|
303 |
+
|
304 |
+
/**
|
305 |
+
* Registers this instance as an autoloader.
|
306 |
+
*
|
307 |
+
* @param bool $prepend Whether to prepend the autoloader or not
|
308 |
+
*/
|
309 |
+
public function register($prepend = false)
|
310 |
+
{
|
311 |
+
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
312 |
+
|
313 |
+
if (null === $this->vendorDir) {
|
314 |
+
//no-op
|
315 |
+
} elseif ($prepend) {
|
316 |
+
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
317 |
+
} else {
|
318 |
+
unset(self::$registeredLoaders[$this->vendorDir]);
|
319 |
+
self::$registeredLoaders[$this->vendorDir] = $this;
|
320 |
+
}
|
321 |
+
}
|
322 |
+
|
323 |
+
/**
|
324 |
+
* Unregisters this instance as an autoloader.
|
325 |
+
*/
|
326 |
+
public function unregister()
|
327 |
+
{
|
328 |
+
spl_autoload_unregister(array($this, 'loadClass'));
|
329 |
+
|
330 |
+
if (null !== $this->vendorDir) {
|
331 |
+
unset(self::$registeredLoaders[$this->vendorDir]);
|
332 |
+
}
|
333 |
+
}
|
334 |
+
|
335 |
+
/**
|
336 |
+
* Loads the given class or interface.
|
337 |
+
*
|
338 |
+
* @param string $class The name of the class
|
339 |
+
* @return bool|null True if loaded, null otherwise
|
340 |
+
*/
|
341 |
+
public function loadClass($class)
|
342 |
+
{
|
343 |
+
if ($file = $this->findFile($class)) {
|
344 |
+
includeFile($file);
|
345 |
+
|
346 |
+
return true;
|
347 |
+
}
|
348 |
+
}
|
349 |
+
|
350 |
+
/**
|
351 |
+
* Finds the path to the file where the class is defined.
|
352 |
+
*
|
353 |
+
* @param string $class The name of the class
|
354 |
+
*
|
355 |
+
* @return string|false The path if found, false otherwise
|
356 |
+
*/
|
357 |
+
public function findFile($class)
|
358 |
+
{
|
359 |
+
// class map lookup
|
360 |
+
if (isset($this->classMap[$class])) {
|
361 |
+
return $this->classMap[$class];
|
362 |
+
}
|
363 |
+
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
364 |
+
return false;
|
365 |
+
}
|
366 |
+
if (null !== $this->apcuPrefix) {
|
367 |
+
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
368 |
+
if ($hit) {
|
369 |
+
return $file;
|
370 |
+
}
|
371 |
+
}
|
372 |
+
|
373 |
+
$file = $this->findFileWithExtension($class, '.php');
|
374 |
+
|
375 |
+
// Search for Hack files if we are running on HHVM
|
376 |
+
if (false === $file && defined('HHVM_VERSION')) {
|
377 |
+
$file = $this->findFileWithExtension($class, '.hh');
|
378 |
+
}
|
379 |
+
|
380 |
+
if (null !== $this->apcuPrefix) {
|
381 |
+
apcu_add($this->apcuPrefix.$class, $file);
|
382 |
+
}
|
383 |
+
|
384 |
+
if (false === $file) {
|
385 |
+
// Remember that this class does not exist.
|
386 |
+
$this->missingClasses[$class] = true;
|
387 |
+
}
|
388 |
+
|
389 |
+
return $file;
|
390 |
+
}
|
391 |
+
|
392 |
+
/**
|
393 |
+
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
394 |
+
*
|
395 |
+
* @return self[]
|
396 |
+
*/
|
397 |
+
public static function getRegisteredLoaders()
|
398 |
+
{
|
399 |
+
return self::$registeredLoaders;
|
400 |
+
}
|
401 |
+
|
402 |
+
private function findFileWithExtension($class, $ext)
|
403 |
+
{
|
404 |
+
// PSR-4 lookup
|
405 |
+
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
406 |
+
|
407 |
+
$first = $class[0];
|
408 |
+
if (isset($this->prefixLengthsPsr4[$first])) {
|
409 |
+
$subPath = $class;
|
410 |
+
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
411 |
+
$subPath = substr($subPath, 0, $lastPos);
|
412 |
+
$search = $subPath . '\\';
|
413 |
+
if (isset($this->prefixDirsPsr4[$search])) {
|
414 |
+
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
415 |
+
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
416 |
+
if (file_exists($file = $dir . $pathEnd)) {
|
417 |
+
return $file;
|
418 |
+
}
|
419 |
+
}
|
420 |
+
}
|
421 |
+
}
|
422 |
+
}
|
423 |
+
|
424 |
+
// PSR-4 fallback dirs
|
425 |
+
foreach ($this->fallbackDirsPsr4 as $dir) {
|
426 |
+
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
427 |
+
return $file;
|
428 |
+
}
|
429 |
+
}
|
430 |
+
|
431 |
+
// PSR-0 lookup
|
432 |
+
if (false !== $pos = strrpos($class, '\\')) {
|
433 |
+
// namespaced class name
|
434 |
+
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
435 |
+
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
436 |
+
} else {
|
437 |
+
// PEAR-like class name
|
438 |
+
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
439 |
+
}
|
440 |
+
|
441 |
+
if (isset($this->prefixesPsr0[$first])) {
|
442 |
+
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
443 |
+
if (0 === strpos($class, $prefix)) {
|
444 |
+
foreach ($dirs as $dir) {
|
445 |
+
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
446 |
+
return $file;
|
447 |
+
}
|
448 |
+
}
|
449 |
+
}
|
450 |
+
}
|
451 |
+
}
|
452 |
+
|
453 |
+
// PSR-0 fallback dirs
|
454 |
+
foreach ($this->fallbackDirsPsr0 as $dir) {
|
455 |
+
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
456 |
+
return $file;
|
457 |
+
}
|
458 |
+
}
|
459 |
+
|
460 |
+
// PSR-0 include paths.
|
461 |
+
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
462 |
+
return $file;
|
463 |
+
}
|
464 |
+
|
465 |
+
return false;
|
466 |
+
}
|
467 |
+
}
|
468 |
+
|
469 |
+
/**
|
470 |
+
* Scope isolated include.
|
471 |
+
*
|
472 |
+
* Prevents access to $this/self from included files.
|
473 |
+
*/
|
474 |
+
function includeFile($file)
|
475 |
+
{
|
476 |
+
include $file;
|
477 |
+
}
|
vendor/composer/InstalledVersions.php
ADDED
@@ -0,0 +1,284 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
namespace Composer;
|
14 |
+
|
15 |
+
use Composer\Autoload\ClassLoader;
|
16 |
+
use Composer\Semver\VersionParser;
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
+
class InstalledVersions
|
24 |
+
{
|
25 |
+
private static $installed = array (
|
26 |
+
'root' =>
|
27 |
+
array (
|
28 |
+
'pretty_version' => '5.2.0',
|
29 |
+
'version' => '5.2.0.0',
|
30 |
+
'aliases' =>
|
31 |
+
array (
|
32 |
+
),
|
33 |
+
'reference' => 'acc1e6a3c2b2dd3601991713bf3aaf61c47ae1c2',
|
34 |
+
'name' => '__root__',
|
35 |
+
),
|
36 |
+
'versions' =>
|
37 |
+
array (
|
38 |
+
'__root__' =>
|
39 |
+
array (
|
40 |
+
'pretty_version' => '5.2.0',
|
41 |
+
'version' => '5.2.0.0',
|
42 |
+
'aliases' =>
|
43 |
+
array (
|
44 |
+
),
|
45 |
+
'reference' => 'acc1e6a3c2b2dd3601991713bf3aaf61c47ae1c2',
|
46 |
+
),
|
47 |
+
),
|
48 |
+
);
|
49 |
+
private static $canGetVendors;
|
50 |
+
private static $installedByVendor = array();
|
51 |
+
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
public static function getInstalledPackages()
|
59 |
+
{
|
60 |
+
$packages = array();
|
61 |
+
foreach (self::getInstalled() as $installed) {
|
62 |
+
$packages[] = array_keys($installed['versions']);
|
63 |
+
}
|
64 |
+
|
65 |
+
|
66 |
+
if (1 === \count($packages)) {
|
67 |
+
return $packages[0];
|
68 |
+
}
|
69 |
+
|
70 |
+
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
71 |
+
}
|
72 |
+
|
73 |
+
|
74 |
+
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
|
80 |
+
|
81 |
+
public static function isInstalled($packageName)
|
82 |
+
{
|
83 |
+
foreach (self::getInstalled() as $installed) {
|
84 |
+
if (isset($installed['versions'][$packageName])) {
|
85 |
+
return true;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
return false;
|
90 |
+
}
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
+
|
98 |
+
|
99 |
+
|
100 |
+
|
101 |
+
|
102 |
+
|
103 |
+
|
104 |
+
|
105 |
+
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
106 |
+
{
|
107 |
+
$constraint = $parser->parseConstraints($constraint);
|
108 |
+
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
109 |
+
|
110 |
+
return $provided->matches($constraint);
|
111 |
+
}
|
112 |
+
|
113 |
+
|
114 |
+
|
115 |
+
|
116 |
+
|
117 |
+
|
118 |
+
|
119 |
+
|
120 |
+
|
121 |
+
|
122 |
+
public static function getVersionRanges($packageName)
|
123 |
+
{
|
124 |
+
foreach (self::getInstalled() as $installed) {
|
125 |
+
if (!isset($installed['versions'][$packageName])) {
|
126 |
+
continue;
|
127 |
+
}
|
128 |
+
|
129 |
+
$ranges = array();
|
130 |
+
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
131 |
+
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
132 |
+
}
|
133 |
+
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
134 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
135 |
+
}
|
136 |
+
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
137 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
138 |
+
}
|
139 |
+
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
140 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
141 |
+
}
|
142 |
+
|
143 |
+
return implode(' || ', $ranges);
|
144 |
+
}
|
145 |
+
|
146 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
147 |
+
}
|
148 |
+
|
149 |
+
|
150 |
+
|
151 |
+
|
152 |
+
|
153 |
+
public static function getVersion($packageName)
|
154 |
+
{
|
155 |
+
foreach (self::getInstalled() as $installed) {
|
156 |
+
if (!isset($installed['versions'][$packageName])) {
|
157 |
+
continue;
|
158 |
+
}
|
159 |
+
|
160 |
+
if (!isset($installed['versions'][$packageName]['version'])) {
|
161 |
+
return null;
|
162 |
+
}
|
163 |
+
|
164 |
+
return $installed['versions'][$packageName]['version'];
|
165 |
+
}
|
166 |
+
|
167 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
168 |
+
}
|
169 |
+
|
170 |
+
|
171 |
+
|
172 |
+
|
173 |
+
|
174 |
+
public static function getPrettyVersion($packageName)
|
175 |
+
{
|
176 |
+
foreach (self::getInstalled() as $installed) {
|
177 |
+
if (!isset($installed['versions'][$packageName])) {
|
178 |
+
continue;
|
179 |
+
}
|
180 |
+
|
181 |
+
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
182 |
+
return null;
|
183 |
+
}
|
184 |
+
|
185 |
+
return $installed['versions'][$packageName]['pretty_version'];
|
186 |
+
}
|
187 |
+
|
188 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
189 |
+
}
|
190 |
+
|
191 |
+
|
192 |
+
|
193 |
+
|
194 |
+
|
195 |
+
public static function getReference($packageName)
|
196 |
+
{
|
197 |
+
foreach (self::getInstalled() as $installed) {
|
198 |
+
if (!isset($installed['versions'][$packageName])) {
|
199 |
+
continue;
|
200 |
+
}
|
201 |
+
|
202 |
+
if (!isset($installed['versions'][$packageName]['reference'])) {
|
203 |
+
return null;
|
204 |
+
}
|
205 |
+
|
206 |
+
return $installed['versions'][$packageName]['reference'];
|
207 |
+
}
|
208 |
+
|
209 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
210 |
+
}
|
211 |
+
|
212 |
+
|
213 |
+
|
214 |
+
|
215 |
+
|
216 |
+
public static function getRootPackage()
|
217 |
+
{
|
218 |
+
$installed = self::getInstalled();
|
219 |
+
|
220 |
+
return $installed[0]['root'];
|
221 |
+
}
|
222 |
+
|
223 |
+
|
224 |
+
|
225 |
+
|
226 |
+
|
227 |
+
|
228 |
+
|
229 |
+
public static function getRawData()
|
230 |
+
{
|
231 |
+
return self::$installed;
|
232 |
+
}
|
233 |
+
|
234 |
+
|
235 |
+
|
236 |
+
|
237 |
+
|
238 |
+
|
239 |
+
|
240 |
+
|
241 |
+
|
242 |
+
|
243 |
+
|
244 |
+
|
245 |
+
|
246 |
+
|
247 |
+
|
248 |
+
|
249 |
+
|
250 |
+
|
251 |
+
|
252 |
+
public static function reload($data)
|
253 |
+
{
|
254 |
+
self::$installed = $data;
|
255 |
+
self::$installedByVendor = array();
|
256 |
+
}
|
257 |
+
|
258 |
+
|
259 |
+
|
260 |
+
|
261 |
+
private static function getInstalled()
|
262 |
+
{
|
263 |
+
if (null === self::$canGetVendors) {
|
264 |
+
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
265 |
+
}
|
266 |
+
|
267 |
+
$installed = array();
|
268 |
+
|
269 |
+
if (self::$canGetVendors) {
|
270 |
+
|
271 |
+
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
272 |
+
if (isset(self::$installedByVendor[$vendorDir])) {
|
273 |
+
$installed[] = self::$installedByVendor[$vendorDir];
|
274 |
+
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
275 |
+
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
276 |
+
}
|
277 |
+
}
|
278 |
+
}
|
279 |
+
|
280 |
+
$installed[] = self::$installed;
|
281 |
+
|
282 |
+
return $installed;
|
283 |
+
}
|
284 |
+
}
|
vendor/composer/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
Copyright (c) Nils Adermann, Jordi Boggiano
|
3 |
+
|
4 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5 |
+
of this software and associated documentation files (the "Software"), to deal
|
6 |
+
in the Software without restriction, including without limitation the rights
|
7 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8 |
+
copies of the Software, and to permit persons to whom the Software is furnished
|
9 |
+
to do so, subject to the following conditions:
|
10 |
+
|
11 |
+
The above copyright notice and this permission notice shall be included in all
|
12 |
+
copies or substantial portions of the Software.
|
13 |
+
|
14 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20 |
+
THE SOFTWARE.
|
21 |
+
|
vendor/composer/autoload_classmap.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_classmap.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
10 |
+
'TidioLiveChat\\Admin\\AdminActionLink' => $baseDir . '/src/Admin/AdminActionLink.php',
|
11 |
+
'TidioLiveChat\\Admin\\AdminController' => $baseDir . '/src/Admin/AdminController.php',
|
12 |
+
'TidioLiveChat\\Admin\\AdminDashboard' => $baseDir . '/src/Admin/AdminDashboard.php',
|
13 |
+
'TidioLiveChat\\Admin\\AdminNotice' => $baseDir . '/src/Admin/AdminNotice.php',
|
14 |
+
'TidioLiveChat\\Admin\\AdminRouting' => $baseDir . '/src/Admin/AdminRouting.php',
|
15 |
+
'TidioLiveChat\\Admin\\IframeSetup' => $baseDir . '/src/Admin/IframeSetup.php',
|
16 |
+
'TidioLiveChat\\Config' => $baseDir . '/src/Config.php',
|
17 |
+
'TidioLiveChat\\IntegrationState' => $baseDir . '/src/IntegrationState.php',
|
18 |
+
'TidioLiveChat\\Sdk\\Api\\Client\\CurlTidioApiClient' => $baseDir . '/src/Sdk/Api/Client/CurlTidioApiClient.php',
|
19 |
+
'TidioLiveChat\\Sdk\\Api\\Client\\FileGetContentsTidioApiClient' => $baseDir . '/src/Sdk/Api/Client/FileGetContentsTidioApiClient.php',
|
20 |
+
'TidioLiveChat\\Sdk\\Api\\Client\\TidioApiClientFactory' => $baseDir . '/src/Sdk/Api/Client/TidioApiClientFactory.php',
|
21 |
+
'TidioLiveChat\\Sdk\\Api\\Exception\\TidioApiException' => $baseDir . '/src/Sdk/Api/Exception/TidioApiException.php',
|
22 |
+
'TidioLiveChat\\Sdk\\Api\\TidioApiClient' => $baseDir . '/src/Sdk/Api/TidioApiClient.php',
|
23 |
+
'TidioLiveChat\\Sdk\\Encryption\\EncryptionService' => $baseDir . '/src/Sdk/Encryption/EncryptionService.php',
|
24 |
+
'TidioLiveChat\\Sdk\\Encryption\\Exception\\DecryptionFailedException' => $baseDir . '/src/Sdk/Encryption/Exception/DecryptionFailedException.php',
|
25 |
+
'TidioLiveChat\\Sdk\\Encryption\\Service\\EncryptionServiceFactory' => $baseDir . '/src/Sdk/Encryption/Service/EncryptionServiceFactory.php',
|
26 |
+
'TidioLiveChat\\Sdk\\Encryption\\Service\\OpenSslEncryptionService' => $baseDir . '/src/Sdk/Encryption/Service/OpenSslEncryptionService.php',
|
27 |
+
'TidioLiveChat\\Sdk\\Encryption\\Service\\PlainTextEncryptionService' => $baseDir . '/src/Sdk/Encryption/Service/PlainTextEncryptionService.php',
|
28 |
+
'TidioLiveChat\\Sdk\\IntegrationFacade' => $baseDir . '/src/Sdk/IntegrationFacade.php',
|
29 |
+
'TidioLiveChat\\TidioLiveChat' => $baseDir . '/src/TidioLiveChat.php',
|
30 |
+
'TidioLiveChat\\Translation\\ErrorTranslator' => $baseDir . '/src/Translation/ErrorTranslator.php',
|
31 |
+
'TidioLiveChat\\Translation\\I18n' => $baseDir . '/src/Translation/I18n.php',
|
32 |
+
'TidioLiveChat\\Translation\\TranslationLoader' => $baseDir . '/src/Translation/TranslationLoader.php',
|
33 |
+
'TidioLiveChat\\Utils\\QueryParameters' => $baseDir . '/src/Utils/QueryParameters.php',
|
34 |
+
'TidioLiveChat\\Widget\\WidgetLoader' => $baseDir . '/src/Widget/WidgetLoader.php',
|
35 |
+
);
|
vendor/composer/autoload_namespaces.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_namespaces.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
);
|
vendor/composer/autoload_psr4.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_psr4.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
'TidioLiveChat\\' => array($baseDir . '/src'),
|
10 |
+
);
|
vendor/composer/autoload_real.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_real.php @generated by Composer
|
4 |
+
|
5 |
+
class ComposerAutoloaderInitb9fb3e5de8a6af44b16b566fdbe3e5d5
|
6 |
+
{
|
7 |
+
private static $loader;
|
8 |
+
|
9 |
+
public static function loadClassLoader($class)
|
10 |
+
{
|
11 |
+
if ('Composer\Autoload\ClassLoader' === $class) {
|
12 |
+
require __DIR__ . '/ClassLoader.php';
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @return \Composer\Autoload\ClassLoader
|
18 |
+
*/
|
19 |
+
public static function getLoader()
|
20 |
+
{
|
21 |
+
if (null !== self::$loader) {
|
22 |
+
return self::$loader;
|
23 |
+
}
|
24 |
+
|
25 |
+
require __DIR__ . '/platform_check.php';
|
26 |
+
|
27 |
+
spl_autoload_register(array('ComposerAutoloaderInitb9fb3e5de8a6af44b16b566fdbe3e5d5', 'loadClassLoader'), true, true);
|
28 |
+
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
29 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitb9fb3e5de8a6af44b16b566fdbe3e5d5', 'loadClassLoader'));
|
30 |
+
|
31 |
+
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
32 |
+
if ($useStaticLoader) {
|
33 |
+
require __DIR__ . '/autoload_static.php';
|
34 |
+
|
35 |
+
call_user_func(\Composer\Autoload\ComposerStaticInitb9fb3e5de8a6af44b16b566fdbe3e5d5::getInitializer($loader));
|
36 |
+
} else {
|
37 |
+
$map = require __DIR__ . '/autoload_namespaces.php';
|
38 |
+
foreach ($map as $namespace => $path) {
|
39 |
+
$loader->set($namespace, $path);
|
40 |
+
}
|
41 |
+
|
42 |
+
$map = require __DIR__ . '/autoload_psr4.php';
|
43 |
+
foreach ($map as $namespace => $path) {
|
44 |
+
$loader->setPsr4($namespace, $path);
|
45 |
+
}
|
46 |
+
|
47 |
+
$classMap = require __DIR__ . '/autoload_classmap.php';
|
48 |
+
if ($classMap) {
|
49 |
+
$loader->addClassMap($classMap);
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
$loader->register(true);
|
54 |
+
|
55 |
+
return $loader;
|
56 |
+
}
|
57 |
+
}
|
vendor/composer/autoload_static.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_static.php @generated by Composer
|
4 |
+
|
5 |
+
namespace Composer\Autoload;
|
6 |
+
|
7 |
+
class ComposerStaticInitb9fb3e5de8a6af44b16b566fdbe3e5d5
|
8 |
+
{
|
9 |
+
public static $prefixLengthsPsr4 = array (
|
10 |
+
'T' =>
|
11 |
+
array (
|
12 |
+
'TidioLiveChat\\' => 14,
|
13 |
+
),
|
14 |
+
);
|
15 |
+
|
16 |
+
public static $prefixDirsPsr4 = array (
|
17 |
+
'TidioLiveChat\\' =>
|
18 |
+
array (
|
19 |
+
0 => __DIR__ . '/../..' . '/src',
|
20 |
+
),
|
21 |
+
);
|
22 |
+
|
23 |
+
public static $classMap = array (
|
24 |
+
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
25 |
+
'TidioLiveChat\\Admin\\AdminActionLink' => __DIR__ . '/../..' . '/src/Admin/AdminActionLink.php',
|
26 |
+
'TidioLiveChat\\Admin\\AdminController' => __DIR__ . '/../..' . '/src/Admin/AdminController.php',
|
27 |
+
'TidioLiveChat\\Admin\\AdminDashboard' => __DIR__ . '/../..' . '/src/Admin/AdminDashboard.php',
|
28 |
+
'TidioLiveChat\\Admin\\AdminNotice' => __DIR__ . '/../..' . '/src/Admin/AdminNotice.php',
|
29 |
+
'TidioLiveChat\\Admin\\AdminRouting' => __DIR__ . '/../..' . '/src/Admin/AdminRouting.php',
|
30 |
+
'TidioLiveChat\\Admin\\IframeSetup' => __DIR__ . '/../..' . '/src/Admin/IframeSetup.php',
|
31 |
+
'TidioLiveChat\\Config' => __DIR__ . '/../..' . '/src/Config.php',
|
32 |
+
'TidioLiveChat\\IntegrationState' => __DIR__ . '/../..' . '/src/IntegrationState.php',
|
33 |
+
'TidioLiveChat\\Sdk\\Api\\Client\\CurlTidioApiClient' => __DIR__ . '/../..' . '/src/Sdk/Api/Client/CurlTidioApiClient.php',
|
34 |
+
'TidioLiveChat\\Sdk\\Api\\Client\\FileGetContentsTidioApiClient' => __DIR__ . '/../..' . '/src/Sdk/Api/Client/FileGetContentsTidioApiClient.php',
|
35 |
+
'TidioLiveChat\\Sdk\\Api\\Client\\TidioApiClientFactory' => __DIR__ . '/../..' . '/src/Sdk/Api/Client/TidioApiClientFactory.php',
|
36 |
+
'TidioLiveChat\\Sdk\\Api\\Exception\\TidioApiException' => __DIR__ . '/../..' . '/src/Sdk/Api/Exception/TidioApiException.php',
|
37 |
+
'TidioLiveChat\\Sdk\\Api\\TidioApiClient' => __DIR__ . '/../..' . '/src/Sdk/Api/TidioApiClient.php',
|
38 |
+
'TidioLiveChat\\Sdk\\Encryption\\EncryptionService' => __DIR__ . '/../..' . '/src/Sdk/Encryption/EncryptionService.php',
|
39 |
+
'TidioLiveChat\\Sdk\\Encryption\\Exception\\DecryptionFailedException' => __DIR__ . '/../..' . '/src/Sdk/Encryption/Exception/DecryptionFailedException.php',
|
40 |
+
'TidioLiveChat\\Sdk\\Encryption\\Service\\EncryptionServiceFactory' => __DIR__ . '/../..' . '/src/Sdk/Encryption/Service/EncryptionServiceFactory.php',
|
41 |
+
'TidioLiveChat\\Sdk\\Encryption\\Service\\OpenSslEncryptionService' => __DIR__ . '/../..' . '/src/Sdk/Encryption/Service/OpenSslEncryptionService.php',
|
42 |
+
'TidioLiveChat\\Sdk\\Encryption\\Service\\PlainTextEncryptionService' => __DIR__ . '/../..' . '/src/Sdk/Encryption/Service/PlainTextEncryptionService.php',
|
43 |
+
'TidioLiveChat\\Sdk\\IntegrationFacade' => __DIR__ . '/../..' . '/src/Sdk/IntegrationFacade.php',
|
44 |
+
'TidioLiveChat\\TidioLiveChat' => __DIR__ . '/../..' . '/src/TidioLiveChat.php',
|
45 |
+
'TidioLiveChat\\Translation\\ErrorTranslator' => __DIR__ . '/../..' . '/src/Translation/ErrorTranslator.php',
|
46 |
+
'TidioLiveChat\\Translation\\I18n' => __DIR__ . '/../..' . '/src/Translation/I18n.php',
|
47 |
+
'TidioLiveChat\\Translation\\TranslationLoader' => __DIR__ . '/../..' . '/src/Translation/TranslationLoader.php',
|
48 |
+
'TidioLiveChat\\Utils\\QueryParameters' => __DIR__ . '/../..' . '/src/Utils/QueryParameters.php',
|
49 |
+
'TidioLiveChat\\Widget\\WidgetLoader' => __DIR__ . '/../..' . '/src/Widget/WidgetLoader.php',
|
50 |
+
);
|
51 |
+
|
52 |
+
public static function getInitializer(ClassLoader $loader)
|
53 |
+
{
|
54 |
+
return \Closure::bind(function () use ($loader) {
|
55 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInitb9fb3e5de8a6af44b16b566fdbe3e5d5::$prefixLengthsPsr4;
|
56 |
+
$loader->prefixDirsPsr4 = ComposerStaticInitb9fb3e5de8a6af44b16b566fdbe3e5d5::$prefixDirsPsr4;
|
57 |
+
$loader->classMap = ComposerStaticInitb9fb3e5de8a6af44b16b566fdbe3e5d5::$classMap;
|
58 |
+
|
59 |
+
}, null, ClassLoader::class);
|
60 |
+
}
|
61 |
+
}
|
vendor/composer/installed.json
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"packages": [],
|
3 |
+
"dev": true,
|
4 |
+
"dev-package-names": []
|
5 |
+
}
|
vendor/composer/installed.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php return array (
|
2 |
+
'root' =>
|
3 |
+
array (
|
4 |
+
'pretty_version' => '5.2.0',
|
5 |
+
'version' => '5.2.0.0',
|
6 |
+
'aliases' =>
|
7 |
+
array (
|
8 |
+
),
|
9 |
+
'reference' => 'acc1e6a3c2b2dd3601991713bf3aaf61c47ae1c2',
|
10 |
+
'name' => '__root__',
|
11 |
+
),
|
12 |
+
'versions' =>
|
13 |
+
array (
|
14 |
+
'__root__' =>
|
15 |
+
array (
|
16 |
+
'pretty_version' => '5.2.0',
|
17 |
+
'version' => '5.2.0.0',
|
18 |
+
'aliases' =>
|
19 |
+
array (
|
20 |
+
),
|
21 |
+
'reference' => 'acc1e6a3c2b2dd3601991713bf3aaf61c47ae1c2',
|
22 |
+
),
|
23 |
+
),
|
24 |
+
);
|
vendor/composer/platform_check.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// platform_check.php @generated by Composer
|
4 |
+
|
5 |
+
$issues = array();
|
6 |
+
|
7 |
+
if (!(PHP_VERSION_ID >= 50600)) {
|
8 |
+
$issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION . '.';
|
9 |
+
}
|
10 |
+
|
11 |
+
if ($issues) {
|
12 |
+
if (!headers_sent()) {
|
13 |
+
header('HTTP/1.1 500 Internal Server Error');
|
14 |
+
}
|
15 |
+
if (!ini_get('display_errors')) {
|
16 |
+
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
17 |
+
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
18 |
+
} elseif (!headers_sent()) {
|
19 |
+
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
20 |
+
}
|
21 |
+
}
|
22 |
+
trigger_error(
|
23 |
+
'Composer detected issues in your platform: ' . implode(' ', $issues),
|
24 |
+
E_USER_ERROR
|
25 |
+
);
|
26 |
+
}
|