Hello,
I’m again at the end of mine knowlege and hope that someone could help me - I have a middleware and want to register it, but I’m still not able to register as I got message that it is not defined, here is the error message:
- Type: Pimple\Exception\UnknownIdentifierException
- Code: 0
- Message: Identifier “OCA\DeviceApp\Middleware\ExceptionMiddleware” is not defined.
- File: /var/www/html/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php
here is the Application PHP with registration:
namespace OCA\DeviceApp\AppInfo;
…
use \OCA\DeviceApp\Middleware\ExceptionMiddleware;
…class Application extends App {
private $server;
public function __construct(array $urlParams = ) {
parent::__construct(‘deviceapp’, $urlParams);$container = $this->getContainer(); $server = $this->getContainer()->getServer(); $this->server = $server; $container->registerMiddleWare(ExceptionMiddleware::class);
}
and here is the part of middleware file:
namespace OCA\DeviceApp\Middleware;
use \OCP\AppFramework\Middleware;
use \OCP\ILogger;
use \OCP\IConfig;class ExceptionMiddleware extends Middleware {
private $logger;
private $config;
public function __construct(ILogger $logger, IConfig $config) {
$this->logger = $logger;
$this->config = $config;
}
}
I can’t find why the file is not found on the (hope) right place
nextcloud\apps\deviceapp\lib\Middleware\ExceptionMiddleware.php
I’m using Nextcloud v.17.0.6, in v. 18 the result is the same.
Thank you in advance for any advise.
Bob