@@ -55,6 +55,19 @@ If you are sure that no update or backup is currently running, you can fix this
55
55
exit 1
56
56
fi
57
57
58
+ # Change from APCu to Redis for local cache
59
+ # https://github.com/nextcloud/vm/pull/2040
60
+ if pecl list | grep apcu > /dev/null 2>&1
61
+ then
62
+ sed -i " /memcache.local/d" " $NCPATH " /config/config.php
63
+ if pecl list | grep redis > /dev/null 2>&1
64
+ then
65
+ nextcloud_occ config:system:set memcache.local --value=' \OC\Memcache\Redis'
66
+ else
67
+ nextcloud_occ config:system:delete memcache.local
68
+ fi
69
+ fi
70
+
58
71
# Create a snapshot before doing anything else
59
72
check_free_space
60
73
if ! [ -f " $SCRIPTS /nextcloud-startup-script.sh" ] && (does_snapshot_exist " NcVM-startup" \
@@ -324,13 +337,33 @@ then
324
337
check_command phpenmod -v ALL redis
325
338
fi
326
339
327
- # Upgrade APCu and igbinary
328
- # if [ "${CURRENTVERSION%%.*}" -ge "17" ]
329
- if [ " ${CURRENTVERSION%% .* } " -ge " 23" ]
340
+ # Remove APCu https://github.com/nextcloud/vm/issues/2039
341
+ if is_this_installed " php$PHPVER " -dev
342
+ then
343
+ # Delete PECL APCu
344
+ if pecl list | grep -q apcu
345
+ then
346
+ if ! yes no | pecl uninstall apcu
347
+ then
348
+ msg_box " APCu PHP module removal failed! Please report this to $ISSUES "
349
+ else
350
+ print_text_in_color " $IGreen " " APCu PHP module removal OK!"
351
+ fi
352
+ # Delete everything else
353
+ check_command phpdismod -v ALL apcu
354
+ rm -f $PHP_MODS_DIR /apcu.ini
355
+ sed -i " /extension=apcu.so/d" " $PHP_INI "
356
+ sed -i " /APCu/d" " $PHP_INI "
357
+ sed -i " /apc./d" " $PHP_INI "
358
+ fi
359
+ fi
360
+
361
+ # Upgrade other PECL dependencies
362
+ if [ " ${CURRENTVERSION%% .* } " -ge " 17" ]
330
363
then
331
364
if [ -f " $PHP_INI " ]
332
365
then
333
- print_text_in_color " $ICyan " " Trying to upgrade igbinary, smbclient, and APCu ..."
366
+ print_text_in_color " $ICyan " " Trying to upgrade igbinary, and smbclient ..."
334
367
if pecl list | grep igbinary > /dev/null 2>&1
335
368
then
336
369
yes no | pecl upgrade igbinary
@@ -373,35 +406,8 @@ then
373
406
sed -i " /extension=smbclient.so/d" " $PHP_INI "
374
407
fi
375
408
fi
376
- if pecl list | grep -q apcu
377
- then
378
- yes no | pecl upgrade apcu
379
- # Remove old igbinary
380
- if grep -qFx extension=apcu.so " $PHP_INI "
381
- then
382
- sed -i " /extension=apcu.so/d" " $PHP_INI "
383
- fi
384
- # Check if apcu is enabled and create the file if not
385
- if [ ! -f $PHP_MODS_DIR /apcu.ini ]
386
- then
387
- touch $PHP_MODS_DIR /apcu.ini
388
- fi
389
- # Enable new apcu
390
- if ! grep -qFx extension=apcu.so $PHP_MODS_DIR /apcu.ini
391
- then
392
- echo " # PECL apcu" > $PHP_MODS_DIR /apcu.ini
393
- echo " extension=apcu.so" >> $PHP_MODS_DIR /apcu.ini
394
- check_command phpenmod -v ALL apcu
395
- fi
396
- # Fix https://help.nextcloud.com/t/nc-21-manual-update-issues/108693/4?$
397
- if ! grep -qFx apc.enable_cli=1 $PHP_MODS_DIR /apcu.ini
398
- then
399
- echo " apc.enable_cli=1" >> $PHP_MODS_DIR /apcu.ini
400
- check_command phpenmod -v ALL apcu
401
- fi
402
- fi
403
409
if pecl list | grep -q inotify
404
- then
410
+ then
405
411
# Remove old inotify
406
412
if grep -qFx extension=inotify.so " $PHP_INI "
407
413
then
0 commit comments