antonioribeiro / support

Support Classes
BSD 3-Clause "New" or "Revised" License
59 stars 49 forks source link

v0.6.14 breaks artisan optimize --force #13

Open RobertBoes opened 7 years ago

RobertBoes commented 7 years ago

I'm currently using v0.6.11, but updating to v0.6.14 breaks php artisan optimize --force (the versions in between are also broken).

The error I get is the following;

Fatal error: Cannot declare interface Illuminate\Contracts\Container\Container, because the name is already in use in {...}\bootstrap\cache\compiled.php on line 4

I think it has something to do with 98da8d4 or 7376acd

fgreinus commented 7 years ago

Same here... but i don't think this comes from the support package, but from the firewall package.

RobertBoes commented 7 years ago

Maybe it has something to do with the firewall package, but I've updated all my packages except this one. When I do update this one I get the error mentioned above

fgreinus commented 7 years ago

Do you only use this package or is this package only installed within your application because of the requirement in the firewall application?

RobertBoes commented 7 years ago

It's a required in antonioribeiro/firewall, but I don't get the error when I force to use v0.6.11

antonioribeiro commented 7 years ago

I'll address this later today, sorry guys.

antonioribeiro commented 7 years ago

How do I reproduce this? I have both Tracker and Firewall installed on a 5.4 app and I don't get this message.

antonioribeiro commented 7 years ago

image

RobertBoes commented 7 years ago

I am on Laravel 5.2, the optimized class loader generated correctly, but it's actually broken when I executed another artisan command (like php artisan config:cache). It doesn't give you the fatal error? Maybe it has something to do with <5.4 then. Edit: Tested on a clean 5.4 install and seems to work fine, maybe it's only 5.2 (and possibly 5.3)

antonioribeiro commented 7 years ago

I always setup those packages on something I'm developing, to make sure things will not break during a related package update, so no, It's running smoothly here. I will set it up on a 5.2 branch to see what happens. Thank you for reporting and sorry for the delay.

antonioribeiro commented 7 years ago

Not there yet...

image

RobertBoes commented 7 years ago

Seems like you didn't use php artisan optimize --force, the force is important here, because it compiles the common classes (bootstrap\cache\compiled.php).

I did the following to reproduce;

composer create-project laravel/laravel=5.2.* Laravel52
cd Laravel52
composer require pragmarx/firewall
#Add the provider and alias in config/app.php
php artisan optimize --force
php artisan

Then I get the error mentioned above and the error is gone when I delete bootstrap\cache\compiled.php. This is the same for Laravel 5.3, but on 5.4 it's working correctly.

@antonioribeiro Did you manage to reproduce the error?