Open nnnikolay opened 9 years ago
@nnnikolay currently we aren't using Lumen for any projects, but I'm not against it. Happy to review a PR if it doesn't create any BC breaks.
@pleckey I would love to do that. But there are few issue so far...
NewrelicServiceProvider
can be solved with implementing LumenNewrelicServiceProvider
.LumenNewrelicMIddleware
. And needs to be added into bootstrap/app.php
like that$app->middleware([
App\Http\Middleware\LumenNewrelicMiddleware::class
]);
...
class_alias('Illuminate\Support\Facades\Cache', 'Cache');
class_alias('Illuminate\Support\Facades\Cookie', 'Cookie');
...
it means we need to add similar line into the bootstrap/app.php
class_alias('Intouch\LaravelNewrelic\Facades\Newrelic', 'Newrelic');
Seems now it should work :)
In the LumenNewRelicMiddleWare (around line 95), could you please rewrite
foreach (\App::getRoutes() as $routeName => $route) {
$regex = $routeToRegex($routeName);
$method = $routeToMethod($routeName);
$routes[$method.$regex] = compact('route', 'method', 'regex');
}
to
foreach (app()->getRoutes() as $routeName => $route) {
$regex = $routeToRegex($routeName);
$method = $routeToMethod($routeName);
$routes[$method.$regex] = compact('route', 'method', 'regex');
}
so it also works without the Facades being enabled
bests & thanks wirtsi
I got another problem with Lumen when running
vagrant@server:~/feed-api$ php artisan vendor:publish --provider="Intouch\LaravelNewrelic\NewrelicServiceProvider"
PHP Fatal error: Call to undefined function Intouch\LaravelNewrelic\config_path() in /home/vagrant/feed-api/vendor/intouch/laravel-newrelic/src/Intouch/LaravelNewrelic/NewrelicServiceProvider.php on line 41
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined function Intouch\LaravelNewrelic\config_path()
Is this related to Lumen - Laravel differences?
app()->getRoutes()
isn't working anymore
Do you have plan to support Lumen ?
Currently it does not work because of NewrelicServiceProvider and
$app['router']
usage.