PluginProbe
PhastPress / 1.78
PhastPress v1.78
3.12 3.11 1.75 1.76 1.77 1.78 1.79 1.80 1.81 1.82 1.83 1.84 1.85 1.86 1.87 1.88 1.89 1.90 1.91 1.92 1.93 1.94 1.95 1.96 1.97 All 119 releases
← All changes | classes/ServiceSDKImplementation.php +3 -30 3.121.78 View file →
@@ -1,47 +1,20 @@
1 1 <?php
2 2 namespace Kibo\PhastPlugins\PhastPress;
3 3
4 -use Kibo\Phast\HTTP\Request;
4 +use Kibo\PhastPlugins\SDK\Common\ServiceHostTrait;
5 5 use Kibo\PhastPlugins\SDK\ServiceHost;
6 6
7 7 class ServiceSDKImplementation implements ServiceHost {
8 +
8 9 public function getCacheRootCandidatesProvider() {
9 10 return new CacheRootCandidatesProviderImplementation();
10 11 }
11 12
12 13 public function onServiceConfigurationLoad(array $config) {
13 - if (class_exists(\WpOrg\Requests\Requests::class)) {
14 + if (class_exists(\Requests::class)) {
14 15 $config['httpClient'] = RequestsHTTPClient::class;
15 16 }
16 -
17 - if ($map = $this->getRetrieverMap()) {
18 - $config['retrieverMap'] = $map;
19 - }
20 -
21 17 return $config;
22 18 }
23 19
24 - private function getRetrieverMap() {
25 - if (!defined('MULTISITE')
26 - || !MULTISITE
27 - || !defined('SUBDOMAIN_INSTALL')
28 - || SUBDOMAIN_INSTALL
29 - ) {
30 - return null;
31 - }
32 -
33 - $request = Request::fromGlobals();
34 -
35 - $map = [
36 - '/' => $request->getDocumentRoot(),
37 - ];
38 -
39 - foreach (['wp-content', 'wp-admin', 'wp-includes'] as $dir) {
40 - $map["/[_0-9a-zA-Z-]+/$dir/"] = "{$request->getDocumentRoot()}/$dir";
41 - }
42 -
43 - return [
44 - $request->getHost() => $map,
45 - ];
46 - }
47 20 }