Closed tombroucke closed 2 years ago
Yeah, same here. Total crash of the site.
Shit, thanks for reporting.
It's because I'm trying to move it towards a WordPress plugin/wpackagist, so I need to compile third party code into vendor/
. I imagine Composer is over-riding the prebuilt vendor
file I have with the namespaced third party classes. I will try see how I can get this working in the meanwhile before the transfer to wpackagist. For now you can pull in version 2.0.0-rc.4
and it should work.
Sorry about this!
@tombroucke @BSBjorn I just ran composer require soberwp/intervention:dev-main
and it seemed to keep the distributed vendor folder on my side.
On your side, could you check for me, under intervention/vendor/illuminate/collections/Collection.php
is the namespace Jacoby\Intervention\Illuminate\Support
?
@tombroucke @BSBjorn I just ran
composer require soberwp/intervention:dev-main
and it seemed to keep the distributed vendor folder on my side.On your side, could you check for me, under
intervention/vendor/illuminate/collections/Collection.php
is the namespaceJacoby\Intervention\Illuminate\Support
?
The vendor folder is present & namespace is correct. I will also try to debug the problem.
Hmm, maybe something to do with the autoloader? Does it work if you just clone from GitHub?
@tombroucke @BSBjorn I just ran
composer require soberwp/intervention:dev-main
and it seemed to keep the distributed vendor folder on my side.On your side, could you check for me, under
intervention/vendor/illuminate/collections/Collection.php
is the namespaceJacoby\Intervention\Illuminate\Support
?
just dit
Same her. Namespace is correct.
@tombroucke @BSBjorn what if you remove this in the root file intervention.php
?
/**
* Support for Bedrock/Composer
*/
if (!class_exists('Jacoby\Intervention\Intervention')) {
if (is_file(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
}
// include file_exists($composer = __DIR__ . '/vendor/autoload.php') ? $composer : __DIR__ . '/build/vendor/autoload.php';
}
If you remove if (!class_exists('Jacoby\Intervention\Intervention')) {
?
Does the code run inside if (is_file(__DIR__ . '/vendor/autoload.php')) {
?
I think it may be Bedrock specific.
Just tried cloning from github, same issue.
I tried removing the IF. Different error...
I assume the autoloader is looking for the Collection class in src/illuminate/support/Collection.php
, which doesn't exist. The Collection class is located in vendor/illuminate/collections/Collection.php
, in the Illuminate\Support
namespace. You have prefixed the namespace with Jacoby\Intervention\
, which makes the autoloader search for the class in src/Illuminate/Support/Collection.php
.
@tombroucke Hm, any ideas on the best solution with php-scoper? Change the namespace of scoper so it's something different and doesn't conflict with PSR-4 loading? I'm a little stumped on the best solution.
"autoload": {
"psr-4": {
"Jacoby\\Intervention\\": "src/"
}
},
Is there a way for me to get this working for now?
@BSBjorn falling back to 2.0.0-rc.4
should work.
OK, sorry for my incompetence, but can you quickly explain how I do that with composer?
@BSBjorn try composer require soberwp/intervention:2.0.0-rc.4
THANKS! :D learned something usefull right away. :) Just let me know if you need to test, I'm happy to help!
@tombroucke @BSBjorn what if you remove this in the root file
intervention.php
?/** * Support for Bedrock/Composer */ if (!class_exists('Jacoby\Intervention\Intervention')) { if (is_file(__DIR__ . '/vendor/autoload.php')) { require_once __DIR__ . '/vendor/autoload.php'; } // include file_exists($composer = __DIR__ . '/vendor/autoload.php') ? $composer : __DIR__ . '/build/vendor/autoload.php'; }
If you remove if
(!class_exists('Jacoby\Intervention\Intervention')) {
?Does the code run inside
if (is_file(__DIR__ . '/vendor/autoload.php')) {
?I think it may be Bedrock specific.
Hi @darrenjacoby so I have the same problem with the dev-main version, and if I downgrade to 2.0.0-rc.4
all my params not working well like 'application.discussion' => false
not removed from admin panel menu. So I tried to remove (!class_exists('Jacoby\Intervention\Intervention')) {
and now it is working well. So yes I think it comes from a problem of autoloader and your new folder vendor/ with src/ Hope you will find the solution and if you need I try other things, doesn't hesitate !
@jeremydumaye committed that change to dev-main. Could you give me more insight into your setup? Sage 9/10? Bedrock? Standard WP installation?
Thanks!
@darrenjacoby Perfect I update dev-main version and all working good thanks ! For my setup, I use Sage 9 and Bedrock
@jeremydumaye and you installed the plugin now with composer require soberwp/intervention:dev-main
correct?
@darrenjacoby yes 👍
Closing for now!
just did update as well to dev-main and is working as expected. Thanks
Hi,
Automated updates on several website are failing since februari 20th because a fatal error:
All websites are running Bedrock & Sage 9 & latest tagged version of intervention (7377e42)