Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
application.php
1<?php
2namespace Bitrix\Rest;
3
4
6
8{
9 protected static $initialized = false;
10
14 protected static $authProvider = null;
15
19 public static function getAuthProvider()
20 {
21 static::initialize();
22
23 if(static::$authProvider === null)
24 {
25 static::$authProvider = static::getDefaultAuthProvider();
26 }
27
28 return static::$authProvider;
29 }
30
34 public static function setAuthProvider(AuthProviderInterface $authProvider)
35 {
36 static::$authProvider = $authProvider;
37 }
38
42 protected static function getDefaultAuthProvider()
43 {
44 return OAuth\Provider::instance();
45 }
46
47 protected static function initialize()
48 {
49 if(!static::$initialized)
50 {
51 static::$initialized = true;
52
53 $event = new Event('rest', 'onApplicationManagerInitialize');
54 $event->send();
55 }
56 }
57}
static setAuthProvider(AuthProviderInterface $authProvider)