Closed aschweigert closed 10 months ago
I think the problem is that the second parameter needs to be a file path and you're passing in a URL. Try using the full path to the main plugin file instead.
Ah great, that worked beautifully. Thank you!
Sorry, one more question. I have this working now, but the plugins I'm trying to update use composer to generate the builds so the stable branch in github ("release") doesn't have the vendor folder included. When they tag releases the zip file for the tagged release is already built and has the vendor folder included. Is there a way to use your library to grab that zip file instead of using a branch?
PUC should already prioritize GitHub releases if you don't explicitly set a branch, and I don't see any setBranch()
calls in that code. Are you sure it's using the "release" branch?
If the build that you want to use is added as a release asset, you'll need to call enableReleaseAssets()
to make PUC choose that instead of the source code ZIP.
Hm, looking at the debug info, the download URL I see is: https://api.github.com/repos/Automattic/newspack-plugin/zipball/v2.9.0
and what I would want is this one: https://github.com/Automattic/newspack-plugin/releases/download/v2.9.0/newspack-plugin.zip
Which is basically the zip file in the tagged release (https://github.com/Automattic/newspack-plugin/releases/tag/v2.9.0).
is that what I need enableReleaseAssets()
for?
Yes, that's what it's for.
Ah gotcha, ok. Sorry for all the questions, this has been super helpful!
Hi There -
I'm trying to use this library in a plugin to update a couple of other plugins. I have the library in a subfolder called "vendor" within my plugin and then this code in the main plugin file:
require_once( 'vendor/plugin-update-checker/plugin-update-checker.php' ); use YahnisElsts\PluginUpdateChecker\v5\PucFactory;
When I run this, I get a fatal error:
From reading other tickets here I gathered that the second parameter passed to buildUpdateChecker() needs to be the full path to the main plugin file in these other plugins and the path looks correct in the error here so I'm wondering why it's failing...do you have any thoughts?
Thanks for your help!