Add version update reminders#212
Conversation
|
I kind of want this data to also reflect on the extension's pages, but that proves to be a bit more difficult, as it's not supplied by $blueprint. That said, we could probably also turn this into a $blueprint method. |
|
|
||
| // get version info | ||
| $context = stream_context_create(['http' => ['method' => 'GET', 'header' => 'User-Agent: BlueprintFramework']]); | ||
| $remoteVersions = @file_get_contents( |
There was a problem hiding this comment.
maybe use a proper http client instead
There was a problem hiding this comment.
I took the file_get_contents shenanigans directly from a few other Artisan commands of ours, but I'll migrate it over to use Illuminate\Support\Facades\Http.
| $installedExtensions = $this->blueprint->extensions(); | ||
|
|
||
| // get version info | ||
| $context = stream_context_create(['http' => ['method' => 'GET', 'header' => 'User-Agent: BlueprintFramework']]); |
There was a problem hiding this comment.
version in the user agent could be useful
There was a problem hiding this comment.
I somewhat agree, but would that kind of conflict with users disabling telemetry?
| } | ||
|
|
||
| // atomic swap | ||
| DB::statement("RENAME TABLE {$table} TO {$table}_bak, {$temp} TO {$table}"); |
There was a problem hiding this comment.
this is the worst code ive seen in a long time, please use a real atomic swap, e.g. using model upsert or a transaction where you remove all rows and add them back

Tip
To test this PR on your own Blueprint instance, run the following command:
blueprint -upgrade remote blueprintframework/framework remote-metadata. You can refetch the update data by setting theremote_metadataflag to false, saving, and turning it back to true.uses data from blueprint.zip/browse, another reason to submit your extension :)