ekandreas / bladerunner

WordPress plugin for Laravel Blade templating DEPRECATED
http://bladerunner.elseif.se
12 stars 1 forks source link

Namespace error #46

Closed Solinx closed 7 years ago

Solinx commented 7 years ago

Hi,

Thanks for creating this plugin! Unfortunately I ran into an issue while deploying the website to production:

PHP Fatal error: Cannot use Illuminate\Container\Container as Container because the name is already in use in .../wp-content/plugins/bladerunner/src/BladeProvider.php on line 4

Unfortunately I'm not precisely sure what caused this, as the code ran fine on my box. However, it was fixed by adding use Illuminate\Contracts\Container\Container as ContainerContract; to Container.php

And by renaming use Illuminate\Container\Container; to use Illuminate\Container\Container as BaseContainer;, including of course renaming Container to BaseContainer in the class.

I'm not certain both were required. I was unable to reproduce the error and deployment had to go through someone else, so I just passed on the changes for both suspect issues at the same time.

Cheers, Wouter

ekandreas commented 7 years ago

Yes, it's a challenge to use Laravel components if it's used somewhere else in the application/project.

Solinx commented 7 years ago

Hmm... shouldn't the Bladerunner namespace take care of that? Anyway, I'm glad it was so easily fixed. I don't want to think about having to abandon blade templating in exchange for plain WP templating!

ekandreas commented 7 years ago

We can try to fix it. Yes, Blade is awesome in WordPress development for templates.

ekandreas commented 7 years ago

Version 1.6.3 is on it's way with this merged

Solinx commented 7 years ago

Nice! Thanks!

And sorry, I can't. The error only occurred on a production server where for security reasons I only have access to the theme folder and an plain WP editor role. The error does not occur on my development box either. Unfortunately I have no idea which plugins are running on the production server.

All that I do know about it is that this error occurred, that the lack of a ContainerContract reference in Container.php was highlighted as an issue by PHPStorm, and that together with renaming the Container reference this fixed things.

ekandreas commented 7 years ago

I got an update from Stefano Vena fixing this and it is merged with version 1.6.3.

Next step now is to create controllers inside Bladerunner <3

Med vänlig hälsning, Andreas Ek, 070-3032203

On 17 Aug 2017, at 21:12, Wouter van Dam notifications@github.com wrote:

Nice! Thanks!

And sorry, I can't. The error only occurred on a production server where for security reasons I only have access to the theme folder and an plain WP editor role. The error does not occur on my development box either. Unfortunately I have no idea which plugins are running on the production server.

All that I do know about it is that this error occurred, that the lack of a ContainerContract reference in Container.php was highlighted as an issue by PHPStorm, and that together with renaming the Container reference this fixed things.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/ekandreas/bladerunner/issues/46#issuecomment-323167095, or mute the thread https://github.com/notifications/unsubscribe-auth/ABtiK3Ove4T6gbY88crmIgcSJd6Uhyu3ks5sZJClgaJpZM4O3WA5.