-
Notifications
You must be signed in to change notification settings - Fork 70
Closed
Labels
Description
I'm seeing problems trying to get my application up and running again on "naked" HttpKernelAdapter:
PHP Fatal error:
Call to undefined method Volkszaehler\Util\Httpd\ReactInterface::getStaticDirectory() in /home/pi/volkszaehler.org/vendor/php-pm/httpkernel-adapter/Bridges/HttpKernel.php on line 61
This is what it comes down to:
-
BridgeInterfaceapparently relies onBootstrapInterfacebut doesn't declare this dependency in the constructor https://github.com/php-pm/php-pm/blob/master/Bridges/BridgeInterface.php#L17. This dependency should be explicit? -
HttpKernel->getStaticDirectoryrelies onBootstrapInterface->getStaticDirectorywhich isn't part of the interface (https://github.com/php-pm/php-pm-httpkernel/blob/master/Bridges/HttpKernel.php#L59). We could either addgetStaticDirectoryto theBootstrapInterfacebut it feels kind of redundant and some applications may not need it (they could return empty- I'd prefer this approach). Alternatively add a secondStaticContentInterfacethat a bridge can chose to implement or not- sounds a bit overkill? - https://github.com/php-pm/php-pm-httpkernel/blob/master/Bridges/HttpKernel.php#L149 relies on
BootstrapInterface->requestClass()which isn't part of the interface. An approach might again be forHttpKernelto use Symfony/HttpFoundation/Request as class unlessBootstrapimplementsRequestClassInterfacewhich allows to return a more specific class. We could get rid ofAbstractBootstrapthen.
May sound a bit complex but would remove the hard and non-explicit dependencies. I'd be happy to draft a patch if the direction becomes clear/ gets buy-in.