1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace OCA\Files_External\Lib;
- use OCP\Files\Storage\IStorage;
- trait LegacyDependencyCheckPolyfill {
-
- abstract public function getStorageClass();
-
- public function checkDependencies() {
- $ret = [];
- $result = call_user_func([$this->getStorageClass(), 'checkDependencies']);
- if ($result !== true) {
- if (!is_array($result)) {
- $result = [$result];
- }
- foreach ($result as $key => $value) {
- if (!($value instanceof MissingDependency)) {
- $module = null;
- $message = null;
- if (is_numeric($key)) {
- $module = $value;
- } else {
- $module = $key;
- $message = $value;
- }
- $value = new MissingDependency($module);
- $value->setMessage($message);
- }
- $ret[] = $value;
- }
- }
- return $ret;
- }
- }
|