1 | <?php |
||
14 | class Forge implements ArrayAccess, Iterator |
||
15 | { |
||
16 | use AbstractCollection, LazyIterator, LazyArrayAccess; |
||
17 | |||
18 | /** |
||
19 | * API provider. |
||
20 | * |
||
21 | * @var \Laravel\Forge\ApiProvider |
||
22 | */ |
||
23 | protected $api; |
||
24 | |||
25 | /** |
||
26 | * Servers [id => name] map. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $serversMap = []; |
||
31 | |||
32 | /** |
||
33 | * Single servers cache. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $serversCache = []; |
||
38 | |||
39 | /** |
||
40 | * Create new Servers manager instance. |
||
41 | * |
||
42 | * @param \Laravel\Forge\ApiProvider $api |
||
43 | */ |
||
44 | public function __construct(ApiProvider $api) |
||
48 | |||
49 | /** |
||
50 | * @{inheritdocs} |
||
51 | */ |
||
52 | public function lazyLoad() |
||
71 | |||
72 | /** |
||
73 | * Generate items keys. |
||
74 | */ |
||
75 | public function generateKeys() |
||
79 | |||
80 | /** |
||
81 | * Initialize servers factory. |
||
82 | * |
||
83 | * @return \Laravel\Forge\Servers\Factory |
||
84 | */ |
||
85 | public function create() |
||
89 | |||
90 | /** |
||
91 | * Returns single server. |
||
92 | * |
||
93 | * @param int $serverId |
||
94 | * |
||
95 | * @return \Laravel\Forge\Server |
||
96 | */ |
||
97 | public function get(int $serverId) |
||
107 | |||
108 | /** |
||
109 | * Load single server from API and save it to memory cache. |
||
110 | * |
||
111 | * @param int $serverId |
||
112 | * |
||
113 | * @throws \Laravel\Forge\Exceptions\Servers\ServerWasNotFoundException |
||
114 | * |
||
115 | * @return \Laravel\Forge\Server |
||
116 | */ |
||
117 | protected function loadSingleServer(int $serverId) |
||
131 | } |
||
132 |