Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 5 support breaking Laravel 4 support #79

Closed
ghost opened this issue Feb 1, 2015 · 0 comments
Closed

Laravel 5 support breaking Laravel 4 support #79

ghost opened this issue Feb 1, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Feb 1, 2015

Just reporting feedback for commit #3696417

While you updated the support to Laravel 5 and tried to not break the Laravel 4 support, you unfortunately did it, explaining what you did :

if (starts_with($this->app->version(), '5'))
{
    $this->loadTranslationsFrom($this->app->basePath() . '/vendor/jenssegers/date/src/lang', 'date');
}
// Laravel 4 package registration
else
{
    $this->package('jenssegers/date');
}

But in Laravel 4 $this->app->version() method doesn't exist at all and will throw a beautiful Call to undefined method Illuminate\Foundation\Application::version(), so how we fix it, just checking if the method exists before calling it for version check :

if (method_exists($this->app, 'version') && starts_with($this->app->version(), '5'))
{
    $this->loadTranslationsFrom($this->app->basePath() . '/vendor/jenssegers/date/src/lang', 'date');
}

Please review this PR #78, tested on L5 and L4 as working, also with Travis CI.

@ghost ghost mentioned this issue Feb 1, 2015
@ghost ghost closed this as completed Feb 1, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants