| @@ 130-139 (lines=10) @@ | ||
| 127 | $info = $this->appManager->getAppInfo($appId); |
|
| 128 | if (isset($info['two-factor-providers'])) { |
|
| 129 | $providerClasses = $info['two-factor-providers']; |
|
| 130 | foreach ($providerClasses as $class) { |
|
| 131 | try { |
|
| 132 | $this->loadTwoFactorApp($appId); |
|
| 133 | $provider = OC::$server->query($class); |
|
| 134 | $providers[$provider->getId()] = $provider; |
|
| 135 | } catch (QueryException $exc) { |
|
| 136 | // Provider class can not be resolved |
|
| 137 | throw new Exception("Could not load two-factor auth provider $class"); |
|
| 138 | } |
|
| 139 | } |
|
| 140 | } |
|
| 141 | } |
|
| 142 | ||
| @@ 164-176 (lines=13) @@ | ||
| 161 | } |
|
| 162 | ||
| 163 | private function loadCommandsFromInfoXml($commands) { |
|
| 164 | foreach ($commands as $command) { |
|
| 165 | try { |
|
| 166 | $c = \OC::$server->query($command); |
|
| 167 | } catch (QueryException $e) { |
|
| 168 | if (class_exists($command)) { |
|
| 169 | $c = new $command(); |
|
| 170 | } else { |
|
| 171 | throw new \Exception("Console command '$command' is unknown and could not be loaded"); |
|
| 172 | } |
|
| 173 | } |
|
| 174 | ||
| 175 | $this->application->add($c); |
|
| 176 | } |
|
| 177 | } |
|
| 178 | } |
|
| 179 | ||