applyConfigHandlers($input, $userId); } /** * Test connecting using the given backend configuration * * @param string $class backend class name * @param array $options backend configuration options * @param boolean $isPersonal * @return int see self::STATUS_* * @throws \Exception * @deprecated 34.0.0 use BackendService instead */ public static function getBackendStatus($class, $options) { return Server::get(BackendService::class)->getBackendStatus($class, $options); } /** * Encrypt passwords in the given config options * * @param array $options mount options * @return array updated options * @deprecated 34.0.0 use EncryptionService instead */ public static function encryptPasswords($options) { return Server::get(EncryptionService::class)->encryptPasswords($options); } /** * Decrypt passwords in the given config options * * @param array $options mount options * @return array updated options * @deprecated 34.0.0 use EncryptionService instead */ public static function decryptPasswords($options) { return Server::get(EncryptionService::class)->decryptPasswords($options); } /** * Computes a hash based on the given configuration. * This is mostly used to find out whether configurations * are the same. * @throws \JsonException */ public static function makeConfigHash(array $config): string { $data = json_encode( [ 'c' => $config['backend'], 'a' => $config['authMechanism'], 'm' => $config['mountpoint'], 'o' => $config['options'], 'p' => $config['priority'] ?? -1, 'mo' => $config['mountOptions'] ?? [], ], JSON_THROW_ON_ERROR ); return hash('md5', $data); } }