Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
extensionfacade.php
1<?php
2
4
6
7final class ExtensionFacade
8{
9
11 private $config;
12
14 private $setup;
15
17 private $installs;
18
20 private $adapter;
21
23 private $isExceptionHandled = false;
24
25 public static function getInstance() : self
26 {
27 static $instance;
28 if(!$instance)
29 {
30 $instance = new self();
31 }
32 return $instance;
33 }
34
35 private function __construct()
36 {
37 try
38 {
39 $this->adapter = ServiceAdapter::loadFacebookService();
40 $this->config = Configuration\Facebook\Config::load();
41 $this->setup = Configuration\Facebook\Setup::load();
42 $this->installs = Configuration\Facebook\Installs::load();
43 }
44 catch (\Throwable $exception)
45 {
46 $this->isExceptionHandled = true;
47 }
48 }
49
53 public function isInstalled() : bool
54 {
55 return (!$this->isExceptionHandled) && $this->setup && $this->installs && $this->config && $this->adapter;
56 }
57
61 public function getCurrentConfig() : ?Configuration\Facebook\Config
62 {
63 return $this->config;
64 }
65
69 public function getCurrentSetup() : ?Configuration\Facebook\Setup
70 {
71 return $this->setup;
72 }
73
77 public function getCurrentInstalls() : ?Configuration\Facebook\Installs
78 {
79 return $this->installs;
80 }
81
82 public function getServiceAdapter() : ?ServiceAdapter
83 {
84 return $this->adapter;
85 }
86}