basz / SlmLocale

Auto detection of locale through different strategies for Zend Framework 2
Other
67 stars 34 forks source link

Breaks console usage #94

Closed koseduhemak closed 6 years ago

koseduhemak commented 7 years ago

Got fatal error if using console commands: PHP Fatal error: Uncaught TypeError: Argument 1 passed to SlmLocale\Strategy\UriPathStrategy::__construct() must be an instance of Zend\Mvc\Router\Http\TreeRouteStack or null, instance of Zend\Mvc\Router\Console\SimpleRouteStack given, called in ..../vendor/slm/locale/src/SlmLocale/Strategy/Factory/UriPathStrategyFactory.php on line 68 and defined in ..../vendor/slm/locale/src/SlmLocale/Strategy/UriPathStrategy.php:62

Can we disable strategies depending on ConsoleRequest vs. normal HttpRequest? How to deal with it?

koseduhemak commented 6 years ago

I am on holiday till next week. Will test afterwards and report back.

svycka commented 6 years ago

I hope I fixed it in #95 but if not, please reopen