As pointed on discussion jordanjay29
We should upgrade all extensions manually fallowing this guide:
https://discuss.flarum.org/d/9225-the-most-unsettling-end-user-guide-to-composer-for-flarum
If you have multiple of them it will be a lot of manual work, so what about get it automated?
Example fast scripting:
[me@myhost flarum]$ which composer
/usr/local/bin/composer
[me@myhost flarum]$ which php
/usr/local/bin/php
[me@myhost flarum]$ ls
CHANGELOG.md LICENSE README.md composer.json composer.lock config.php extend.php flarum nohup.out public storage vendor update.sh
Version if you have limited memory and want to update one by one:
[me@myhost flarum]$ cat update.sh
#!/bin/bash
extensions=$(cat composer.json | awk '/}/ {found=0} {if(found) print} /require/ {found=1}' | awk -F : '{print $1}' | sed 's/"//g')
echo 'Updating extensions:'
for i in $extensions
do
echo -n 'Updating: '; echo $i;
/usr/local/bin/composer update $i --prefer-dist --no-dev -o --no-suggest
done
echo 'Migrate:'
/usr/local/bin/php flarum migrate
echo 'Clear cache:'
/usr/local/bin/php flarum cache:clear
echo 'Update completed!'
echo
Version if you want to update them all at once:
[me@myhost flarum]$ cat update.sh
#!/bin/bash
extensions=$(cat composer.json | awk '/}/ {found=0} {if(found) print} /require/ {found=1}' | awk -F : '{print $1}' | sed 's/"//g')
echo -n 'Updating extensions: '; echo $extensions
echo
/usr/local/bin/composer update $extensions --prefer-dist --no-dev -o --no-suggest
echo 'Migrate:'
/usr/local/bin/php flarum migrate
echo 'Clear cache:'
/usr/local/bin/php flarum cache:clear
echo 'Update completed!'
echo
How to run it?
[me@myhost flarum]$ chmod +x update.sh
[me@myhost flarum]$ ./update.sh
In theory we can also add it into cron to get autopatch everyday at midnight? 🙂
Did I get it right?