/** * Get soap clients for all good storages * * @return array RESTClient for all good storages */ protected function getClients() { $clients = array(); $user = User::getInstance(); $uid = $user->getId(); $mac = $user->getMac(); if ($mac) { RESTClient::$from = $mac; } elseif ($uid) { RESTClient::$from = $uid; } else { RESTClient::$from = $this->stb->mac; } RESTClient::setAccessToken($this->createAccessToken()); foreach ($this->storages as $name => $storage) { $clients[$name] = new RESTClient('http://' . $storage['storage_ip'] . '/stalker_portal/storage/rest.php?q='); } return $clients; }