/** * Uncaught exception handler * * @param \Exception $exception */ public static function onException($exception) { $class = get_class($exception); $msg = $exception->getMessage(); $msg = "{$class}: {$msg} at " . $exception->getFile() . '#' . $exception->getLine(); self::$logger->critical(self::removePassword($msg), ['app' => 'PHP']); }
/** * 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; }
/** * @inheritdoc */ public function critical($message, array $context = []) { $this->logger->critical($message, array_merge($this->context, $context)); }
/** * @inheritdoc */ public function critical($message, array $context = array()) { $this->logger->critical($message, $this->context); }