| @@ 113-122 (lines=10) @@ | ||
| 110 | $info = $this->appManager->getAppInfo($appId); |
|
| 111 | if (isset($info['two-factor-providers'])) { |
|
| 112 | $providerClasses = $info['two-factor-providers']; |
|
| 113 | foreach ($providerClasses as $class) { |
|
| 114 | try { |
|
| 115 | $this->loadTwoFactorApp($appId); |
|
| 116 | $provider = OC::$server->query($class); |
|
| 117 | $providers[$provider->getId()] = $provider; |
|
| 118 | } catch (QueryException $exc) { |
|
| 119 | // Provider class can not be resolved |
|
| 120 | throw new Exception("Could not load two-factor auth provider $class"); |
|
| 121 | } |
|
| 122 | } |
|
| 123 | } |
|
| 124 | } |
|
| 125 | ||
| @@ 157-169 (lines=13) @@ | ||
| 154 | } |
|
| 155 | ||
| 156 | private function loadCommandsFromInfoXml($commands) { |
|
| 157 | foreach ($commands as $command) { |
|
| 158 | try { |
|
| 159 | $c = \OC::$server->query($command); |
|
| 160 | } catch (QueryException $e) { |
|
| 161 | if (class_exists($command)) { |
|
| 162 | $c = new $command(); |
|
| 163 | } else { |
|
| 164 | throw new \Exception("Console command '$command' is unknown and could not be loaded"); |
|
| 165 | } |
|
| 166 | } |
|
| 167 | ||
| 168 | $this->application->add($c); |
|
| 169 | } |
|
| 170 | } |
|
| 171 | } |
|
| 172 | ||