mirror of
				https://github.com/mail-in-a-box/mailinabox.git
				synced 2025-11-03 19:30:54 +00:00 
			
		
		
		
	zpush: add the latest z-push hack for php 8.0
This commit is contained in:
		
							parent
							
								
									29b1c29a35
								
							
						
					
					
						commit
						c743ebe606
					
				@ -55,12 +55,20 @@ if [ $needs_update == 1 ]; then
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# HACK z-push for php 8.0
 | 
					# HACK z-push for php 8.0
 | 
				
			||||||
# see: https://github.com/mail-in-a-box/mailinabox/pull/2083#issuecomment-1237232402
 | 
					# see: https://github.com/mail-in-a-box/mailinabox/issues/2177#issuecomment-1294430425
 | 
				
			||||||
if [ "$PHP_VER" = "8.0" ]; then
 | 
					if [ "$PHP_VER" = "8.0" ]; then
 | 
				
			||||||
    # change a z-push source code logging line so it doesn't print the mutexid or memid, which cause an exception ("Uncaught Error: Object of class SysvSemaphore could not be converted to string in /usr/local/lib/z-push/backend/ipcsharedmemory/ipcsharedmemoryprovider.php:45"
 | 
					    # change a z-push source code logging line so it doesn't print the mutexid or memid, which cause an exception ("Uncaught Error: Object of class SysvSemaphore could not be converted to string in /usr/local/lib/z-push/backend/ipcsharedmemory/ipcsharedmemoryprovider.php:45"
 | 
				
			||||||
    sed -i 's/\(Initialized mutexid\) %s\( and memid\) %s/\1\2/' /usr/local/lib/z-push/backend/ipcsharedmemory/ipcsharedmemoryprovider.php
 | 
					    sed -i 's/\(Initialized mutexid\) %s\( and memid\) %s/\1\2/' /usr/local/lib/z-push/backend/ipcsharedmemory/ipcsharedmemoryprovider.php
 | 
				
			||||||
    # change the default value of maxattsize from '' to -1 in policies.ini
 | 
					    # change the default value of maxattsize from '' to -1 in policies.ini
 | 
				
			||||||
    tools/editconf.py /usr/local/lib/z-push/policies.ini -ini-section default -c ';' maxattsize=-1
 | 
					    tools/editconf.py /usr/local/lib/z-push/policies.ini -ini-section default -c ';' maxattsize=-1
 | 
				
			||||||
 | 
					    # change interval->format("%a") to interval->format("%d") in caldav.php
 | 
				
			||||||
 | 
					    xt=$(mktemp)
 | 
				
			||||||
 | 
					    awk 'BEGIN {prev=""} /format\("%a"\)/ && prev ~ /DateInterval/ { gsub(/%a/,"%d") } { prev=$0; print }' /usr/local/lib/z-push/backend/caldav/caldav.php >>$xt
 | 
				
			||||||
 | 
					    if [ $(diff -y --suppress-common-lines "$xt" /usr/local/lib/z-push/backend/caldav/caldav.php | wc -l) -eq 1 ]; then
 | 
				
			||||||
 | 
					        # verified: only 1 line was changed
 | 
				
			||||||
 | 
					        cp "$xt" /usr/local/lib/z-push/backend/caldav/caldav.php
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    rm "$xt"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Configure default config.
 | 
					# Configure default config.
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user