Sentry-laravel: Version comparison fails in 0.7.0

Created on 31 Jul 2017  路  3Comments  路  Source: getsentry/sentry-laravel

src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php

// Laravel 4.x compatibility
if (version_compare($app::VERSION, '5.0') < 0) {
     $this->package('sentry/sentry-laravel', static::$abstract);
     ...
}

The VERSION Constant does not exist in my lumen application. The correct way to request the Version value would be: $app->version()

But this returns in my case "Lumen (5.4.6) (Laravel Components 5.4.*)" which is not in the correct format to be compared using the listed method. Therefore it triggers the laravel 4.x compatibility case, which is not necessary here.

Do I have to add the VERSION Constant to my application? Should it already be there?
Am I missing something here?

PS: The current 0.7.0 build also breaks because this commit is not yet included in a newer release efdeeb1d4095ae9e277d39808e27277d7c7e3708

Most helpful comment

Understandably, will try to see if we can add a extra thingy that mentions Lumen on that page :)

All 3 comments

@Dalabad we have a SentryLumenServiceProvider for Lumen. You are not supposed to run the SentryLaravelServiceProvider in your Lumen app 馃槃

@stayallive oh wow. thanks a lot for pointing that out! I totally missed the small difference.

I was following the install guide on https://sentry.io/for/laravel/ and somehow expected the package to work for both laravel and lumen the same way.

Understandably, will try to see if we can add a extra thingy that mentions Lumen on that page :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JorgenSolli picture JorgenSolli  路  3Comments

AidasK picture AidasK  路  5Comments

andrey-helldar picture andrey-helldar  路  6Comments

yoyosan picture yoyosan  路  5Comments

masoudjahromi picture masoudjahromi  路  4Comments