/**
  * read encryption module needed to read/write the file located at $path
  *
  * @param string $path
  * @return null|\OCP\Encryption\IEncryptionModule
  * @throws ModuleDoesNotExistsException
  * @throws \Exception
  */
 protected function getEncryptionModule($path)
 {
     $encryptionModule = null;
     $header = $this->getHeader($path);
     $encryptionModuleId = $this->util->getEncryptionModuleId($header);
     if (!empty($encryptionModuleId)) {
         try {
             $encryptionModule = $this->encryptionManager->getEncryptionModule($encryptionModuleId);
         } catch (ModuleDoesNotExistsException $e) {
             $this->logger->critical('Encryption module defined in "' . $path . '" not loaded!');
             throw $e;
         }
     }
     return $encryptionModule;
 }
Exemple #2
0
 public static function onException($exception)
 {
     $msg = $exception->getMessage() . ' at ' . $exception->getFile() . '#' . $exception->getLine();
     self::$logger->critical(self::removePassword($msg), array('app' => 'PHP'));
 }